]> _ Git - fluidbook-html5.git/commitdiff
wait #6518 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 Nov 2023 18:50:48 +0000 (19:50 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 Nov 2023 18:50:48 +0000 (19:50 +0100)
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.video.js
style/fluidbook.less

index c3a8d1dc343eeab3bfc484c4371f1fcfbf261f36..570657187f7db58ebbec82927bd315b32f7f3d3d 100644 (file)
@@ -383,7 +383,7 @@ FluidbookLinks.prototype = {
                         if ($(this).is('[data-zindex]')) {
                             $(this).css('z-index', $(this).data('zindex'));
                         }
-                        console.log('hide ',id);
+                        console.log('hide ', id);
                         $this.hidePlacedLink(this, timeout);
                     }
                 });
@@ -571,7 +571,6 @@ FluidbookLinks.prototype = {
             }
         }
         return href;
-
     },
 
     appendParamsToURL: function (url, params) {
@@ -679,6 +678,13 @@ FluidbookLinks.prototype = {
         this.fluidbook.resize.resizeLinks();
         var $this = this;
 
+        $("#links .link[data-delay]").each(function () {
+            let $link = $(this);
+            setTimeout(function () {
+                $this.initDelayedLink($link);
+            }, $(this).data('delay') * 1000);
+        });
+
         this.animateLinks();
         $this.initAnimatedContentsLinks();
 
@@ -696,6 +702,10 @@ FluidbookLinks.prototype = {
         this.resize();
     },
 
+    initDelayedLink: function (link) {
+        $(link).addClass('revealed');
+        this.fluidbook.video.initVideos();
+    },
 
     replaceVariableInTextLinks: function () {
         $('.textLink').each(function () {
index 963548a3cc8b3c75a5167404eeb1bfb7b8fe0ed1..eaf16dd5286cc386225f87b5b05b644a9e850dbf 100644 (file)
@@ -82,6 +82,9 @@ FluidbookVideo.prototype = {
         var $this = this;
 
         $(".videoContainer").each(function () {
+            if ($(this).closest('[data-delay]:not(.revealed)').length > 0) {
+                return;
+            }
             if ($(this).closest('.rightclone').length > 0 && $(this).is(':hidden')) {
                 return;
             }
index f8b13ce8bb6dbfbd49e6ca6123ad0aeacd031e43..ac026629a58163ce8a1b53019ac5771437ef0ca5 100644 (file)
@@ -296,6 +296,17 @@ body, html {
     pointer-events: none;
   }
 
+  &[data-delay] {
+    visibility: hidden;
+    opacity: 0;
+    transition: opacity 250ms;
+
+    &.revealed {
+      visibility: visible;
+      opacity: 1;
+    }
+  }
+
   &.rightclone {
     display: none;