From e57ab1b1aefd15fe5ccb771ce3d4d08fde2e4bad Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Sat, 31 Oct 2015 20:13:00 +0530 Subject: [PATCH] [0.3.2] Update builds. --- CONTRIBUTING.md | 2 +- dist/cta.js | 21 +++++++++++---------- dist/cta.min.js | 4 ++-- package.json | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34faffa..b11c498 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ #Setup 1. [Fork **cta.js**](https://help.github.com/articles/fork-a-repo) and clone it on your system. -2. Create a new branch out off `dev` for your fix/feature. `git checkout new-feature dev` +2. Create a new branch out off `master` for your fix/feature. `git checkout new-feature master` #Things to remember diff --git a/dist/cta.js b/dist/cta.js index 9f7aef9..8f60965 100644 --- a/dist/cta.js +++ b/dist/cta.js @@ -1,4 +1,4 @@ -/*! cta.js - v0.3.1 - 2015-05-02 +/*! cta.js - v0.3.2 - 2015-10-31 * http://kushagragour.in/lab/ctajs/ * Copyright (c) 2015 Kushagra Gour; Licensed MIT */ @@ -90,6 +90,12 @@ }; function cta(trigger, target, options, callback) { + // Support optional arguments + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (!isSupportedBrowser) { if (callback) { callback(target); @@ -101,18 +107,13 @@ triggerBackground, targetBounds, triggerBounds, - dummy, - extraTransitionDuration = 1; + dummy; - // Support optional arguments - if (typeof options === 'function') { - callback = options; - options = {}; - } options = options || {}; options.duration = options.duration || defaults.duration; options.targetShowDuration = options.targetShowDuration || getAnimationTime(target) || defaults.targetShowDuration; options.relativeToWindow = options.relativeToWindow || defaults.relativeToWindow; + options.extraTransitionDuration = options.extraTransitionDuration || defaults.extraTransitionDuration; // Set some properties to make the target visible so we can get its dimensions. // Set `display` to `block` only when its already hidden. Otherwise changing an already visible @@ -172,11 +173,11 @@ callback(target); } // Animate the dummy element to zero opacity while the target is getting rendered. - dummy.style.transitionDuration = (options.targetShowDuration + extraTransitionDuration) + 's'; + dummy.style.transitionDuration = (options.targetShowDuration + options.extraTransitionDuration) + 's'; dummy.style.opacity = 0; setTimeout(function () { dummy.parentNode.removeChild(dummy); - }, (options.targetShowDuration + extraTransitionDuration) * 1000); + }, (options.targetShowDuration + options.extraTransitionDuration) * 1000); }); // Return a reverse animation function for the called animation. diff --git a/dist/cta.min.js b/dist/cta.min.js index 23598cb..07ce4d3 100644 --- a/dist/cta.min.js +++ b/dist/cta.min.js @@ -1,5 +1,5 @@ -/*! cta.js - v0.3.1 - 2015-05-02 +/*! cta.js - v0.3.2 - 2015-10-31 * http://kushagragour.in/lab/ctajs/ * Copyright (c) 2015 Kushagra Gour; Licensed MIT */ -!function(){function a(a){for(var b,c=0,d="string"==typeof a?a.split(/\s*,\s*/):[],e=d.length;e--;)b=d[e],c=Math.max(parseFloat(b)||0,c);return c}function b(b){var c=0,d=0,g=0,k=0,l=window.getComputedStyle(b)||{},m=l[e+h];c=Math.max(a(m),c);var n=l[e+i];d=Math.max(a(n),d);l[f+i];k=Math.max(a(l[f+i]),k);var o=a(l[f+h]);return o>0&&(o*=parseInt(l[f+j],10)||1),g=Math.max(o,g),g||c}function c(a){var b=window.getComputedStyle(a);return b.background||b.backgroundColor}function d(a,e,f,h){if(!g)return void(h&&h(e));var i,j,l,m,n,o=1;"function"==typeof f&&(h=f,f={}),f=f||{},f.duration=f.duration||k.duration,f.targetShowDuration=f.targetShowDuration||b(e)||k.targetShowDuration,f.relativeToWindow=f.relativeToWindow||k.relativeToWindow,"none"===window.getComputedStyle(e).display&&e.style.setProperty("display","block","important"),i=c(e),j=c(a),l=e.getBoundingClientRect(),m=a.getBoundingClientRect(),scaleXRatio=m.width/l.width,scaleYRatio=m.height/l.height,diffX=m.left-l.left,diffY=m.top-l.top,e.style.removeProperty("display"),n=document.createElement("div"),n.style.setProperty("pointer-events","none","important"),n.style.setProperty("position",f.relativeToWindow?"fixed":"absolute","important"),n.style.setProperty("-webkit-transform-origin","top left","important"),n.style.setProperty("transform-origin","top left","important"),n.style.setProperty("transition",f.duration+"s ease"),n.style.setProperty("width",l.width+"px","important"),n.style.setProperty("height",l.height+"px","important"),n.style.setProperty("left",l.left+(f.relativeToWindow?0:window.pageXOffset)+"px","important"),n.style.setProperty("top",l.top+(f.relativeToWindow?0:window.pageYOffset)+"px","important"),n.style.setProperty("background",j,"important"),n.style.setProperty("-webkit-transform","translate("+diffX+"px, "+diffY+"px) scale("+scaleXRatio+", "+scaleYRatio+")","important"),n.style.setProperty("transform","translate("+diffX+"px, "+diffY+"px) scale("+scaleXRatio+", "+scaleYRatio+")","important"),document.body.appendChild(n);n.offsetTop;return n.style.setProperty("background",i,"important"),n.style.removeProperty("-webkit-transform"),n.style.removeProperty("transform"),n.addEventListener("transitionend",function p(){n.removeEventListener("transitionend",p),h&&h(e),n.style.transitionDuration=f.targetShowDuration+o+"s",n.style.opacity=0,setTimeout(function(){n.parentNode.removeChild(n)},1e3*(f.targetShowDuration+o))}),function(b,c){d(e,a,b,c)}}var e,f,g=function(){return void 0!==window.ontransitionend||void 0!==document.documentElement.style.transition}(),h="Duration",i="Delay",j="IterationCount";e=void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend?"WebkitTransition":"transition",f=void 0===window.onanimationend&&void 0!==window.onwebkitanimationend?"WebkitAnimation":"animation";var k={duration:.3,targetShowDuration:0,extraTransitionDuration:1,relativeToWindow:!1};d.isSupported=g,"object"==typeof exports?module.exports=d:"function"==typeof define&&define.amd?define(function(){return d}):window.cta=d}(); \ No newline at end of file +!function(){function a(a){for(var b,c=0,d="string"==typeof a?a.split(/\s*,\s*/):[],e=d.length;e--;)b=d[e],c=Math.max(parseFloat(b)||0,c);return c}function b(b){var c=0,d=0,g=0,k=0,l=window.getComputedStyle(b)||{},m=l[e+h];c=Math.max(a(m),c);var n=l[e+i];d=Math.max(a(n),d);l[f+i];k=Math.max(a(l[f+i]),k);var o=a(l[f+h]);return o>0&&(o*=parseInt(l[f+j],10)||1),g=Math.max(o,g),g||c}function c(a){var b=window.getComputedStyle(a);return b.background||b.backgroundColor}function d(a,e,f,h){if("function"==typeof f&&(h=f,f={}),!g)return void(h&&h(e));var i,j,l,m,n;f=f||{},f.duration=f.duration||k.duration,f.targetShowDuration=f.targetShowDuration||b(e)||k.targetShowDuration,f.relativeToWindow=f.relativeToWindow||k.relativeToWindow,f.extraTransitionDuration=f.extraTransitionDuration||k.extraTransitionDuration,"none"===window.getComputedStyle(e).display&&e.style.setProperty("display","block","important"),i=c(e),j=c(a),l=e.getBoundingClientRect(),m=a.getBoundingClientRect(),scaleXRatio=m.width/l.width,scaleYRatio=m.height/l.height,diffX=m.left-l.left,diffY=m.top-l.top,e.style.removeProperty("display"),n=document.createElement("div"),n.style.setProperty("pointer-events","none","important"),n.style.setProperty("position",f.relativeToWindow?"fixed":"absolute","important"),n.style.setProperty("-webkit-transform-origin","top left","important"),n.style.setProperty("transform-origin","top left","important"),n.style.setProperty("transition",f.duration+"s ease"),n.style.setProperty("width",l.width+"px","important"),n.style.setProperty("height",l.height+"px","important"),n.style.setProperty("left",l.left+(f.relativeToWindow?0:window.pageXOffset)+"px","important"),n.style.setProperty("top",l.top+(f.relativeToWindow?0:window.pageYOffset)+"px","important"),n.style.setProperty("background",j,"important"),n.style.setProperty("-webkit-transform","translate("+diffX+"px, "+diffY+"px) scale("+scaleXRatio+", "+scaleYRatio+")","important"),n.style.setProperty("transform","translate("+diffX+"px, "+diffY+"px) scale("+scaleXRatio+", "+scaleYRatio+")","important"),document.body.appendChild(n);n.offsetTop;return n.style.setProperty("background",i,"important"),n.style.removeProperty("-webkit-transform"),n.style.removeProperty("transform"),n.addEventListener("transitionend",function o(){n.removeEventListener("transitionend",o),h&&h(e),n.style.transitionDuration=f.targetShowDuration+f.extraTransitionDuration+"s",n.style.opacity=0,setTimeout(function(){n.parentNode.removeChild(n)},1e3*(f.targetShowDuration+f.extraTransitionDuration))}),function(b,c){d(e,a,b,c)}}var e,f,g=function(){return void 0!==window.ontransitionend||void 0!==document.documentElement.style.transition}(),h="Duration",i="Delay",j="IterationCount";e=void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend?"WebkitTransition":"transition",f=void 0===window.onanimationend&&void 0!==window.onwebkitanimationend?"WebkitAnimation":"animation";var k={duration:.3,targetShowDuration:0,extraTransitionDuration:1,relativeToWindow:!1};d.isSupported=g,"object"==typeof exports?module.exports=d:"function"==typeof define&&define.amd?define(function(){return d}):window.cta=d}(); \ No newline at end of file diff --git a/package.json b/package.json index 34bcb8a..4bc7fec 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "cta", "title": "cta.js", "description": "A light-weight performant library to animate your 'action-to-effect' paths", - "version": "0.3.1", + "version": "0.3.2", "homepage": "http://kushagragour.in/lab/ctajs/", "author": { "name": "Kushagra Gour",