Issue #2: added Minification

This commit is contained in:
Ramon Gebben
2015-01-16 14:01:31 +01:00
parent e86218e8e1
commit f823507f3f
6 changed files with 15 additions and 16 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
# Ignore modules
/node_modules

View File

@@ -185,4 +185,3 @@ var renderloop = function(){
// // launch the animation // // launch the animation
// renderloop(); // renderloop();

7
Gulpfile.js Normal file
View File

@@ -0,0 +1,7 @@
var gulp=require("gulp"),
uglify = require("gulp-uglify");
gulp.task("compress", function(){
gulp.src("Cquence.js").pipe( uglify() ).pipe( gulp.dest("minified") )
});

1
cquence.min.js vendored
View File

@@ -1 +0,0 @@
function getInternetExplorerVersion(){var e=-1;if(navigator.appName=="Microsoft Internet Explorer"){var t=navigator.userAgent;var n=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(n.exec(t)!=null)e=parseFloat(RegExp.$1)}return e}var raf=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)};var elem=function(e){return document.getElementById(e)};var style=function(e,t,n){if(t==="opacity"){if(IE8){e.style["-ms-filter"]="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.floor(n*100)+")";e.style["filter"]="alpha(opacity="+Math.floor(n*100)+")"}else{e.style[t]=n}}else{e.style[t]=n+"px"}};var combine=function(){var e=Array.prototype.slice.call(arguments,0);var t=0;for(var n=0;n<e.length;n++){t=Math.max(e[n].d,t)}return{d:t,f:function(t){for(var n=0;n<e.length;n++){var r=e[n];if(r.d>t){r.f(t)}else{if(!r.done){r.f(r.d);r.done=true}}}}}};var sequence=function(){var e=Array.prototype.slice.call(arguments,0);var t=0;for(var n=0;n<e.length;n++){t=t+e[n].d}return{d:t,f:function(t){var n=null;var r=0;for(var i=0;i<e.length;i++){var n=e[i];if(r+n.d>t){n.f(t-r);return}if(!n.done){n.f(n.d);n.done=true}r=r+n.d}}}};var animate=function(e){return function(t,n,r,i){return{d:n,f:function(s){var o=elem(t);for(var u in r){var a=r[u];var f=i[u];var l=f-a;var c=e(Math.max(s/n,0));var h=a+c*l;style(o,u,h)}}}}};var linear=animate(function(e){return e});var easeIn=animate(function(e){return Math.pow(e,5)});var easeOut=animate(function(e){return 1-Math.pow(1-e,5)});var sleep=function(e){return{d:e,f:function(e){}}};var IEVERSION=getInternetExplorerVersion();var IE8=IEVERSION===8;var IEWTF=IEVERSION<8&&IEVERSION>-1;var timeline=[];var start=+(new Date);var second=1e3;var stop=15*second;var render=null;var renderloop=function(){var e=+(new Date)-start;if(e<stop)raf(renderloop);if(render)render.f(e)}

1
minified/Cquence.js Normal file
View File

@@ -0,0 +1 @@
function getInternetExplorerVersion(){var e=-1;if("Microsoft Internet Explorer"==navigator.appName){var n=navigator.userAgent,t=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=t.exec(n)&&(e=parseFloat(RegExp.$1))}return e}var raf=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},elem=function(e){return document.getElementById(e)},style=function(e,n,t){"opacity"===n?IE8?(e.style["-ms-filter"]="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.floor(100*t)+")",e.style.filter="alpha(opacity="+Math.floor(100*t)+")"):e.style[n]=t:e.style[n]=t+"px"},combine=function(){for(var e=Array.prototype.slice.call(arguments,0),n=0,t=0;t<e.length;t++)n=Math.max(e[t].d,n);return{d:n,f:function(n){for(var t=0;t<e.length;t++){var r=e[t];r.d>n?r.f(n):r.done||(r.f(r.d),r.done=!0)}}}},sequence=function(){for(var e=Array.prototype.slice.call(arguments,0),n=0,t=0;t<e.length;t++)n+=e[t].d;return{d:n,f:function(n){for(var t=null,r=0,o=0;o<e.length;o++){var t=e[o];if(r+t.d>n)return void t.f(n-r);t.done||(t.f(t.d),t.done=!0),r+=t.d}}}},animate=function(e){return function(n,t,r,o){return{d:t,f:function(a){var i=elem(n);for(var f in r){var u=r[f],l=o[f],s=l-u,c=e(Math.max(a/t,0)),d=u+c*s;style(i,f,d)}}}}},linear=animate(function(e){return e}),easeIn=animate(function(e){return Math.pow(e,5)}),easeOut=animate(function(e){return 1-Math.pow(1-e,5)}),sleep=function(e){return{d:e,f:function(){}}},IEVERSION=getInternetExplorerVersion(),IE8=8===IEVERSION,IEWTF=8>IEVERSION&&IEVERSION>-1,timeline=[],start=+new Date,second=1e3,stop=15*second,render=null,renderloop=function(){var e=+new Date-start;stop>e&&raf(renderloop),render&&render.f(e)};

View File

@@ -1,19 +1,10 @@
{ {
"name": "Qemulatoriuminator", "name": "Cquence",
"description": "A very tiny Javascript animation library",
"author": "Ramon Gebben <cquence@ra-ge.net>",
"version": "0.1.0", "version": "0.1.0",
"devDependencies": { "devDependencies": {
"body-parser": "^1.9.2", "gulp": "^3.8.10",
"express": "^4.10.2", "gulp-uglify": "^1.0.2"
"finalhandler": "^0.3.2",
"grunt": "~0.4.5",
"grunt-browserify": "^3.2.0",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-uglify": "~0.5.0",
"s3": "^4.3.1",
"serve-static": "^1.7.1"
},
"dependencies": {
"gm": "^1.17.0"
} }
} }