]> _ Git - fluidbook-html5.git/commitdiff
wait #2718 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 16 May 2019 17:38:20 +0000 (19:38 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 16 May 2019 17:38:20 +0000 (19:38 +0200)
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.mobilefirst.js
style/mobilefirst.less

index 89c1ee03a3a32ae3768a8e6382146a284e364eac..891deee7256618039b0fea2ec2facdb546395c66 100644 (file)
@@ -434,24 +434,11 @@ FluidbookLinks.prototype = {
         var $this = this;
         var links = $(container).find(".link a.displayArea");
 
-        $(links).each(function () {
-            var delay = $(this).data('blinkdelay');
-            if (delay === undefined || delay === null) {
-                delay = 0;
-            } else {
-                delay = parseInt(delay);
-            }
-            var e = this;
-
-            setTimeout(function () {
-                $(e).addClass('animating').css('opacity', 1);
-                TweenMax.to(e, $this.fluidbook.datas.linkBlinkTime, {
-                    opacity: 0, delay: .1, onComplete: function () {
-                        $(e).removeClass('animating').css('opacity', 1)
-                    }
-                });
-            }, delay + additionalDelay);
-        });
+        if (!this.fluidbook.mobilefirst.enabled) {
+            $(links).each(function () {
+                $this.animateLink(this, additionalDelay);
+            });
+        }
 
 
         if (animateBookmarks) {
@@ -465,6 +452,31 @@ FluidbookLinks.prototype = {
         }
     },
 
+    animateLink: function (link, additionalDelay) {
+        var $this = this;
+        if (!$(link).is('.displayArea')) {
+            link = $(link).find('.displayArea');
+        }
+        if (additionalDelay === undefined) {
+            additionalDelay = 0;
+        }
+        var delay = $(link).data('blinkdelay');
+        if (delay === undefined || delay === null) {
+            delay = 0;
+        } else {
+            delay = parseInt(delay);
+        }
+
+        setTimeout(function () {
+            $(link).addClass('animating').css('opacity', 1);
+            TweenMax.to(link, $this.fluidbook.datas.linkBlinkTime, {
+                opacity: 0, delay: .1, onComplete: function () {
+                    $(link).removeClass('animating').css('opacity', 1)
+                }
+            });
+        }, delay + additionalDelay);
+    },
+
     zoomLink: function (link) {
 
         var $this = this,
index d2d82c1c934b983907d8a26d2146a78a9358da57..21f9ed916f67514df32aea6eb66ba9990ef6376f 100644 (file)
@@ -27,10 +27,19 @@ FluidbookMobileFirst.prototype = {
             $("#pages .mf-nav").removeClass('hiddenzoom');
         });
 
+        $(this.fluidbook).on('fluidbook.page.change.end', function () {
+            $this.checkScroll();
+        });
+
         this.fluidbook.datas.soundTheme = '';
     },
 
-    checkScroll: function (top) {
+    checkScroll: function () {
+        this.checkFooterNavReveal();
+        this.checkLinksReveal();
+    },
+
+    checkFooterNavReveal: function () {
         if (!this.fluidbook.pagetransitions.canChangePage()) {
             return;
         }
@@ -42,6 +51,26 @@ FluidbookMobileFirst.prototype = {
         }
     },
 
+    checkLinksReveal: function () {
+        var $this = this;
+        $("#links .link:not(.revealed):visible").each(function () {
+            var rect = $(this).get(0).getBoundingClientRect();
+            if (rect.top < $this.fluidbook.resize.hh) {
+                $(this).addClass('revealed');
+                if ($(this).find('a.displayArea').length > 0) {
+                    $this.fluidbook.links.animateLink(this, 800);
+                } else if ($(this).is('.multimedia.notinteractive')) {
+                    var url = $(this).find('iframe').attr('src');
+                    var iframe = $(this).find('iframe');
+                    iframe.attr('src', null);
+                    setTimeout(function () {
+                        $(iframe).attr('src', url);
+                    }, 10);
+                }
+            }
+        });
+    },
+
     beforeTransition: function (page) {
         $('#pages .mf-nav').css({opacity: 0});
         var $this = this;
index 3ee9f4e0412e4ac9ba7415785580d70da649ca05..da648f984fe9163b88eaac0ff1f81abf01105f65 100644 (file)
         }
       }
     }
+
+    .link.multimedia.notinteractive {
+      visibility: hidden;
+      opacity: 0;
+
+      &.revealed {
+        visibility: visible;
+        opacity: 1;
+      }
+    }
   }
 
   .mview.fs .fonctions {
 
       .pageholder {
         height: 100%;
+
         &.cut {
           overflow: hidden;
           position: relative;