From 086b9591e2a76b438d01eeb5408f5e304d025225 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 23 Apr 2018 16:36:23 +0200 Subject: [PATCH] wip #2027 @0:50 --- js/libs/fluidbook/fluidbook.links.js | 39 +++++++++++++++++++++++++--- style/fluidbook.less | 24 +++++++++++++++++ 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index 09eea178..64a751e9 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -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('
' + getSpriteIcon('interface-close') + '
'); - $(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 = '
'; + $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)); + }); + }, } diff --git a/style/fluidbook.less b/style/fluidbook.less index df38fb9d..9084a00d 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -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); -- 2.39.5