]> _ Git - fluidbook-html5.git/commitdiff
wip #5116 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 21 Feb 2022 18:41:25 +0000 (19:41 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 21 Feb 2022 18:41:25 +0000 (19:41 +0100)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.links.js

index b86e341f203d6e3a448298253f02ef140719eb3f..d63d7171f5760ee29d48f99c94819f21802c9d24 100644 (file)
@@ -750,12 +750,11 @@ Fluidbook.prototype = {
     },
 
     hideMenuItems: function () {
-        $('#menuList > ul > li, #shareLinks,footer#mobile-credits').fadeOut(100);
-
+        gsap.to($('#menuList > ul > li, #shareLinks,footer#mobile-credits'),{duration:0.1, autoAlpha: 0});
     },
 
     showMenuItems: function () {
-        $('#menuList > ul > li, #shareLinks,footer#mobile-credits').fadeIn(300);
+        gsap.to($('#menuList > ul > li, #shareLinks,footer#mobile-credits'),{duration:0.3,autoAlpha:1});
     },
 
     print: function (button) {
index ebf99e6a713d2478a4e0df45df1ee26c0ceb6f49..1110d2f2111aea111d3a0e734a59e1bbb24c5a0a 100644 (file)
@@ -669,17 +669,13 @@ FluidbookLinks.prototype = {
             var left = 0;
 
             var rectinit = 'rect(0px,' + w + 'px,' + h + 'px,0px)';
-            if ((animation.direction === 'left' && animation.type === 'unmask') ||
-                (animation.direction === 'right' && animation.type === 'reveal')) {
+            if ((animation.direction === 'left' && animation.type === 'unmask') || (animation.direction === 'right' && animation.type === 'reveal')) {
                 right = 0;
-            } else if ((animation.direction === 'right' && animation.type === 'unmask') ||
-                (animation.direction === 'left' && animation.type === 'reveal')) {
+            } else if ((animation.direction === 'right' && animation.type === 'unmask') || (animation.direction === 'left' && animation.type === 'reveal')) {
                 left = w;
-            } else if ((animation.direction === 'up' && animation.type === 'unmask') ||
-                (animation.direction === 'down' && animation.type === 'reveal')) {
+            } else if ((animation.direction === 'up' && animation.type === 'unmask') || (animation.direction === 'down' && animation.type === 'reveal')) {
                 bottom = 0;
-            } else if ((animation.direction === 'down' && animation.type === 'unmask') ||
-                (animation.direction === 'up' && animation.type === 'reveal')) {
+            } else if ((animation.direction === 'down' && animation.type === 'unmask') || (animation.direction === 'up' && animation.type === 'reveal')) {
                 top = h;
             }
             var rect = 'rect(' + top + 'px,' + right + 'px,' + bottom + 'px,' + left + 'px);';
@@ -719,18 +715,13 @@ FluidbookLinks.prototype = {
                 // init radian
                 var rad = Math.PI / 180;
                 // first circle (bigger)
-                var x1 = cx + r * Math.cos(-startAngle * rad),
-                    x2 = cx + r * Math.cos(-endAngle * rad),
-                    y1 = cy + r * Math.sin(-startAngle * rad),
-                    y2 = cy + r * Math.sin(-endAngle * rad);
+                var x1 = cx + r * Math.cos(-startAngle * rad), x2 = cx + r * Math.cos(-endAngle * rad),
+                    y1 = cy + r * Math.sin(-startAngle * rad), y2 = cy + r * Math.sin(-endAngle * rad);
 
                 // second circle / donut section
                 var r1 = r * pct;
-                var
-                    x3 = cx + r1 * Math.cos(-endAngle * rad),
-                    y3 = cy + r1 * Math.sin(-endAngle * rad),
-                    x4 = cx + r1 * Math.cos(-startAngle * rad),
-                    y4 = cy + r1 * Math.sin(-startAngle * rad);
+                var x3 = cx + r1 * Math.cos(-endAngle * rad), y3 = cy + r1 * Math.sin(-endAngle * rad),
+                    x4 = cx + r1 * Math.cos(-startAngle * rad), y4 = cy + r1 * Math.sin(-startAngle * rad);
 
                 var long = +(endAngle - startAngle > 180);
                 return paper.path(["M", x4, y4, "L", x1, y1, "A", r, r, 0, long, 0, x2, y2, "L", x3, y3, "A", r1, r1, 0, long, 1, x4, y4, "z"]).attr(params);
@@ -745,8 +736,7 @@ FluidbookLinks.prototype = {
             to.onUpdate = function () {
                 paper.clear();
                 sector(paper, cx, cy, radius, animation.innerradius, linkElement.angle, to.angle, {
-                    fill: bgc,
-                    stroke: 'none'
+                    fill: bgc, stroke: 'none'
                 });
             };
         } else if (animation.type === 'number') {
@@ -801,8 +791,7 @@ FluidbookLinks.prototype = {
         } else if (animation.type === 'draggable') {
             $(link).css('pointer-events', 'auto');
             var draggable = new Draggable(link, {
-                type: 'x',
-                onRelease: function () {
+                type: 'x', onRelease: function () {
                     var d = this;
                     if (animation.drop === 'click') {
                         $('#links .link a').each(function () {
@@ -812,7 +801,7 @@ FluidbookLinks.prototype = {
                                     $(e).click();
                                 }, 500);
 
-                                TweenLite.to($(link), 0.5, {x: 0, y: 0});
+                                gsap.to($(link), {duration: 0.5, x: 0, y: 0});
                                 return true;
                             }
                         });
@@ -906,10 +895,7 @@ FluidbookLinks.prototype = {
         if (repetitions > 0) {
             el.css('opacity', 0);
             timeline.add(gsap.to(el, {
-                duration: this.fluidbook.settings.linkBlinkTime * speed,
-                delay: 0.1,
-                opacity: 1,
-                ease: 'none'
+                duration: this.fluidbook.settings.linkBlinkTime * speed, delay: 0.1, opacity: 1, ease: 'none'
             }));
             d = 0;
         } else {
@@ -917,21 +903,14 @@ FluidbookLinks.prototype = {
         }
         for (var i = 0; i < repetitions; i++) {
             timeline.add(gsap.to(el, {
-                duration: this.fluidbook.settings.linkBlinkTime * speed,
-                opacity: 0.5,
-                ease: 'none'
+                duration: this.fluidbook.settings.linkBlinkTime * speed, opacity: 0.5, ease: 'none'
             }));
             timeline.add(gsap.to(el, {
-                duration: this.fluidbook.settings.linkBlinkTime * speed,
-                opacity: 1,
-                ease: 'none'
+                duration: this.fluidbook.settings.linkBlinkTime * speed, opacity: 1, ease: 'none'
             }));
         }
         timeline.add(gsap.to(el, {
-            duration: this.fluidbook.settings.linkBlinkTime,
-            delay: d,
-            opacity: 0,
-            onComplete: _complete
+            duration: this.fluidbook.settings.linkBlinkTime, delay: d, opacity: 0, onComplete: _complete
         }));
         timeline.play();
     },