From eac242afa3ac98c6c9a34ab6b3882d103cb2ca8f Mon Sep 17 00:00:00 2001 From: Geoff Montel Date: Fri, 20 Sep 2019 00:16:23 +0200 Subject: [PATCH] full working project. Awaiting review. --- assets/js/custom.js | 6 ------ assets/js/generator.js | 42 +++++++++++++++++++++++++++++++++++++++ assets/js/owl-carousel.js | 6 +++--- index.html | 32 +++++------------------------ lessons.json | 19 +++++++++++------- 5 files changed, 62 insertions(+), 43 deletions(-) create mode 100644 assets/js/generator.js diff --git a/assets/js/custom.js b/assets/js/custom.js index 5911b9e..3c8021b 100644 --- a/assets/js/custom.js +++ b/assets/js/custom.js @@ -1,9 +1,3 @@ -$(document).ready(function(){ - $(".clickSay").click(function( event ){ - var textToSay = $(this).text(); - responsiveVoice.speak(textToSay); - }); -}); (function($) { $('.owl-carousel').owlCarousel({ diff --git a/assets/js/generator.js b/assets/js/generator.js new file mode 100644 index 0000000..f869df2 --- /dev/null +++ b/assets/js/generator.js @@ -0,0 +1,42 @@ +// Generator, by Geoff +$(document).ready(function(){ + $(".clickSay").click(function( event ){ + var textToSay = $(this).text(); + responsiveVoice.speak(textToSay); + }); + $.getJSON("lessons.json", function(data) { + var wordsHtml = ''; + var sidebarHtml = ''; + var lessonIndex = 0; + $.each(data, function(lesson, wordList){ + lessonIndex++; + $.each(wordList, function(key, word){ + wordsHtml += ' '; + }); + sidebarHtml += '
  • '+ lesson +'
  • '; + + }); + $('#words').html(wordsHtml); + $('#lessonIndex').html(sidebarHtml); + swapView(1) + }); +}); + +function swapView(newView){ + $(".lesson").hide(1000); + $(".lesson-" + newView).show(1000); +} diff --git a/assets/js/owl-carousel.js b/assets/js/owl-carousel.js index c327c23..56f1d01 100644 --- a/assets/js/owl-carousel.js +++ b/assets/js/owl-carousel.js @@ -1917,7 +1917,7 @@ i = ((settings.center && n * -1) || 0), position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i, clones = this._core.clones().length, - load = $.proxy(function(i, v) { this.load(v) }, this); + load = $.proxy(function(i, v) { this.on('load',v) }, this); //TODO: Need documentation for this new option if (settings.lazyLoadEager > 0) { n += settings.lazyLoadEager; @@ -1929,7 +1929,7 @@ } while (i++ < n) { - this.load(clones / 2 + this._core.relative(position)); + this.on('load',clones / 2 + this._core.relative(position)); clones && $.each(this._core.clones(this._core.relative(position)), load); position++; } @@ -3445,4 +3445,4 @@ $.support.transform3d = tests.csstransforms3d(); } -})(window.Zepto || window.jQuery, window, document); \ No newline at end of file +})(window.Zepto || window.jQuery, window, document); diff --git a/index.html b/index.html index 7461e40..24d734f 100644 --- a/index.html +++ b/index.html @@ -45,28 +45,7 @@ https://templatemo.com/tm-529-ramayana
    -
    -
    -
    -
    -

    Cat

    -

    The brown cat jumps over the lazy dog.

    -
    -
    -
    -
    -
    -

    Dog

    -

    The brown dog jumps over the lazy dog.

    -
    -
    -
    -
    -
    -

    Extravasation

    -

    At least this apple doesn't suffer from synovial extravasations.

    -
    -
    +
    @@ -91,9 +70,7 @@ https://templatemo.com/tm-529-ramayana
  • Page d'accueil
  • Leçons -