]> _ Git - fluidbook-html5.git/commitdiff
wait #4451 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 4 May 2021 12:57:14 +0000 (14:57 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 4 May 2021 12:57:14 +0000 (14:57 +0200)
js/libs/fluidbook/fluidbook.links.js

index ec21e7d756bd9ac20a2ece9ff8a0715dadebb129..383cecffe0bfdc9567767f14b87d0b8c59c91b8e 100644 (file)
@@ -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);