to.repeat = parseInt(animation.repeat);
var css = {};
- if (animation.ease === undefined) {
- animation.ease = "power1.out";
- }
+ animation.ease = this.fixEase();
if (animation.rotate !== undefined) {
animation.rotation = animation.rotate;
}
} 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);';
+ var rect = 'rect(' + top + 'px,' + right + 'px,' + bottom + 'px,' + left + 'px)';
if (animation.type === 'unmask') {
to.clip = rect;
animation.decimaldigitnumber = parseInt(animation.decimaldigitnumber);
animation.letterspacing = parseFloat(animation.letterspacing);
- var ea = to.ease.split('.');
- var ease = window[ea[0]][ea[1]];
-
+ var ease = gsap.parseEase(to.ease);
var options = {
duration: duration,
useEasing: true,
decimal: animation.decimalseparator,
prefix: animation.prefix,
suffix: animation.suffix,
- //easingFn: function (t, b, c, d) {
- // return b + ease.getRatio(Math.min(1, Math.max(0, t / d))) * c;
- //}
+ easingFn: function (t, b, c, d) {
+ return b + ease(Math.min(1, Math.max(0, t / d))) * c;
+ }
};
css = {
} else if (animation.type === 'draggable') {
$(link).css('pointer-events', 'auto');
var draggable = new Draggable(link, {
- inertia: true,
- type: 'x', onRelease: function () {
+ inertia: true, type: 'x', onRelease: function () {
var d = this;
if (animation.drop === 'clickhide') {
$('#links .link a').each(function () {
}
if (usegsap) {
to.duration = duration;
+ console.log(from,to);
gsap.fromTo(linkElement, from, to);
}
this.fluidbook.networkControl.pause((to.delay + duration + 0.5) * 1000);
},
+ fixEase: function (ease) {
+ if (ease === undefined) {
+ ease = "power1.out";
+ }
+ ease = ease.toLowerCase();
+ if (ease.indexOf('linear') === 0 || ease.indexOf('power0') === 0) {
+ ease = 'none';
+ }
+ ease = ease.replace('.ease', '.');
+ return ease;
+ },
+
getLinkDataById: function (uid) {
return this.fluidbook.settings.linksData[uid];
},