]> _ Git - fluidbook-html5.git/commitdiff
wip #2027 @0:50
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 23 Apr 2018 14:36:23 +0000 (16:36 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 23 Apr 2018 15:07:23 +0000 (17:07 +0200)
js/libs/fluidbook/fluidbook.links.js
style/fluidbook.less

index 09eea1781a9f26f8d5ad69e3236486484fe8a16f..64a751e92662d3d2e7256f1351a2da1a5fe8ec46 100644 (file)
@@ -1,22 +1,20 @@
 function FluidbookLinks(fluidbook) {
     this.fluidbook = fluidbook;
+    this.initInlineSlideshowsIntervals = [];
     this.init();
 }
 
 FluidbookLinks.prototype = {
     init: function () {
-
         var $this = this;
 
         $(document).on('click', '[data-wescosales-ref]', function () {
 
         });
 
-
         // ToDo: consider re-using existing popinOverlay div?
         $('body').append('<div id="zoomPopupOverlay"></div><div id="zoomPopupWrapper"><a href="#" class="zoomPopupClose">' + getSpriteIcon('interface-close') + '</a></div>');
 
-
         $(document).on('click', '.zoomPopup', function (e) {
             e.preventDefault();
             $this.zoomLink(this);
@@ -73,7 +71,6 @@ FluidbookLinks.prototype = {
             }
             fluidbook.wopen($(this).attr('href'), target);
             return false;
-
         });
 
 
@@ -140,8 +137,10 @@ FluidbookLinks.prototype = {
         }
         setTimeout(function () {
             $this.fluidbook.initVideos();
+            $this.initInlineSlideshows();
         }, 200);
         $(fluidbook).trigger('fluidbooklinksready');
+        $(fluidbook).trigger('fluidbook.links.ready');
     },
     animateLinks: function () {
         var animateBookmarks = (this.fluidbook.datas.bookmarkBlinkOnPageChange == true);
@@ -335,5 +334,37 @@ FluidbookLinks.prototype = {
         var a = $('.link[data-id="' + id + '"] a:eq(0)');
         a.get(0).click();
     },
+    initInlineSlideshows: function () {
+        var $__this = this;
+
+        $.each(this.initInlineSlideshowsInterval, function (k, interval) {
+            clearInterval(interval);
+        });
+        $(".inlineslideshow").each(function () {
+            var $this = $(this);
+            var dir = 'data/links/' + $(this).data('dir') + '/';
+            $.each($(this).data('images'), function (k, i) {
+                var h = '<div class="slide" style="background-image: url(\'' + dir + i + '\');"></div>';
+                $this.append(h);
+            });
+
+            setTimeout(function () {
+                $this.find('.slide:eq(0)').addClass('show');
+            }, 1000);
+
+            $__this.initInlineSlideshowsIntervals.push(setInterval(function () {
+                var current = $this.find('.slide.show');
+                var next = $(current).nextAll('.slide:not(.show):eq(0)');
+                if ($(next).length == 0) {
+                    next = $this.find('.slide:eq(0)');
+                }
+                console.log(current);
+                console.log(next);
+
+                $(next).addClass('show');
+                $(current).removeClass('show');
+            }, parseFloat($__this.fluidbook.datas.inlineSlideshowDuration) * 1000));
+        });
+    },
 
 }
index df38fb9d6af19e8b00fce4181397252ac3889e4b..9084a00df0f25bb62ca1ab750592dbff783c6f3a 100644 (file)
@@ -2339,6 +2339,30 @@ body > input {
        }
 }
 
+.inlineslideshow {
+       width: 100%;
+       height: 100%;
+       max-width: 100%;
+       max-height: 100%;
+       overflow: hidden;
+
+       .slide {
+               width: 100%;
+               height: 100%;
+               background-size: cover;
+               background-position: 50% 50%;
+               opacity: 0;
+               transition: opacity @inlineslideshow-transition-time;
+               position: absolute;
+               top: 0;
+               left: 0;
+
+               &.show {
+                       opacity: 1;
+               }
+       }
+}
+
 #links .fb_iframe_widget {
        transform-origin: 0 0 0;
        transform: scale(2.5);