From: Vincent Vanwaelscappel Date: Tue, 4 May 2021 12:57:14 +0000 (+0200) Subject: wait #4451 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8a373159e62fb33145a152e70ce268f8b61ad464;p=fluidbook-html5.git wait #4451 @0.25 --- diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index ec21e7d7..383cecff 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -519,7 +519,7 @@ FluidbookLinks.prototype = { animation.type = 'none'; } var defaultParams = {}; - var globalDefault = {x: 0, y: 0}; + var globalDefault = {x: 0, y: 0, yoyo: 0, repeat: 0}; var w = parseFloat(link.css('width')); var cx = w / 2; var h = parseFloat(link.css('height')); @@ -529,11 +529,14 @@ FluidbookLinks.prototype = { var duration = 0.5; var tweenmax = true; + animation = $.extend({}, globalDefault, defaultParams, animation); if (animation.duration !== undefined) { duration = parseFloat(animation.duration); } + to.yoyo = animation.yoyo === true || animation.yoyo === 1 || animation.yoyo === '1' || animation.yoyo === 'true'; + to.repeat = parseInt(animation.repeat); var css = {}; if (animation.ease === undefined) { @@ -566,8 +569,8 @@ FluidbookLinks.prototype = { from.backgroundPosition = to.backgroudPosition = '50% 50%'; from.backgroundSize = animation.type === 'zoomin' ? '100% 100%' : s + ' ' + s; to.backgroundSize = animation.type === 'zoomout' ? '100% 100%' : s + ' ' + s; - if(Modernizr.firefox) { - to.force3D=true; + if (Modernizr.firefox) { + to.force3D = true; to.rotation = 0.01; from.rotation = 0.01; } @@ -732,6 +735,7 @@ FluidbookLinks.prototype = { link.hide(); } if (tweenmax) { + console.log(from, to); TweenMax.fromTo(linkElement, duration, from, to); } this.fluidbook.networkControl.pause((to.delay + duration + 0.5) * 1000);