From 2e8b7b6e0968c1021114ea868bf4e48779bd67f8 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Fri, 2 Jan 2015 15:23:02 +0100 Subject: [PATCH 001/160] Improved(?) grammar in docs/index --- docs/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.html b/docs/index.html index 0887517..643dbd7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -84,11 +84,11 @@

Introduction

snabbt.js is built to be fast. It will only animate things that modern browsers can animate cheaply: transforms and opacity. The goal is to make a library that will let the user make smooth animations without needing to know too much about browser rendering.

-

Note: For convienience, width and height are animatable to, but be aware of those. They may cause page reflows and slow down your animations.

+

Note: For convenience, width and height are animatable too, but beware since they may cause page reflows and slow down your animations.

Limitations

From 657ff97dd96ec7ca0a342a3f0d3d3fec4b96d00b Mon Sep 17 00:00:00 2001 From: daniel-lundin Date: Fri, 2 Jan 2015 23:58:38 +0100 Subject: [PATCH 002/160] Update readme, prepare for intial release --- Gruntfile.js | 2 +- README.md | 30 +++++++++++++++++++++++++----- dist/snabbt.min.js | 2 +- docs/index.html | 2 +- package.json | 12 ++++++------ 5 files changed, 34 insertions(+), 14 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 772e18c..ecf71bc 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,7 +5,7 @@ module.exports = function(grunt) { pkg: grunt.file.readJSON('package.json'), uglify: { options: { - banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' + banner: '/*! <%= pkg.name %> v<%= pkg.version %> built: <%= grunt.template.today("yyyy-mm-dd") %> */\n' }, dist: { src: 'src/*.js', diff --git a/README.md b/README.md index dbc5879..2aef9d5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,27 @@ -snabbt.js -========= +# snabbt.js + Fast animations with Javascript and CSS transforms(Work in progress) -- [Docs](http://daniel-lundin.github.io/snabbt.js/) -- [Demo cards](http://daniel-lundin.github.io/snabbt.js/cards.html) -- [Demo sticks](http://daniel-lundin.github.io/snabbt.js/sticks.html) +**Docs** + +[Documentation](http://daniel-lundin.github.io/snabbt.js/) + +**Demos** + +- [Card formations](http://daniel-lundin.github.io/snabbt.js/cards.html) +- [Crazy sticks](http://daniel-lundin.github.io/snabbt.js/sticks.html) + +## Relases +The initial release is out. Would love some feedback on things that can be improved. The release(and future ones) can be found in the release section + +- **0.1.0** - Initial beta release + +## TODOS + + - Improve documentation + - bower/npm package + - require.js support + - Optimize memory usage by reusing matrix + +[MIT License](LICENSE.md) © Daniel Lundin (http://twitter.com/danielundin). + diff --git a/dist/snabbt.min.js b/dist/snabbt.min.js index 5ca3fca..50ccb0f 100644 --- a/dist/snabbt.min.js +++ b/dist/snabbt.min.js @@ -1,2 +1,2 @@ -/*! snabbt.js 2015-01-01 */ +/*! snabbt.js v0.1.0 built: 2015-01-02 */ function snabbt(a,b,c){function d(a){return j.tick(a),j.update_element(e),j.stopped()?void 0:j.completed()?void(f.loop>1&&!j.stopped()?(f.loop-=1,j=snabbtjs.create_animation(i),snabbtjs.requestAnimationFrame(d)):(f.callback&&f.callback(),l.length&&(f=l.pop(),g=snabbtjs.state_from_options(h,f,"from_"),h=snabbtjs.state_from_options(new snabbtjs.State({}),f,""),snabbtjs.setup_animation_options(g,h,f),j=new snabbtjs.Animation(f),snabbtjs.running_animations.push([e,j]),j.tick(a),snabbtjs.requestAnimationFrame(d)))):snabbtjs.requestAnimationFrame(d)}if("scroll"===a)return snabbtjs.setup_scroll_animation(b);if("attention"===b)return snabbtjs.setup_attention_animation(a,c);if("stop"===b)return snabbtjs.stop_animation(a);var e=a,f=b,g=snabbtjs.current_animation_transform(e);g||(g=snabbtjs.state_from_options(g,f,"from_"));var h=new snabbtjs.State({});h=snabbtjs.state_from_options(h,f,"");var i=snabbtjs.setup_animation_options(g,h,f),j=snabbtjs.create_animation(i);if(e.hasOwnProperty("length"))for(var k=0;kthis.delay&&(this.current_time=a-this.delay);var b=Math.min(Math.max(0,this.current_time-this.start_time),this.duration),c=this.duration;this.easing.tick(b/c),this.update_current_transform()}},snabbtjs.Animation.prototype.current_state=function(){return this._current_state},snabbtjs.Animation.prototype.update_current_transform=function(){var a=this.easing.value();snabbtjs.TweenStates(this._start_state,this._end_state,this._current_state,a)},snabbtjs.Animation.prototype.completed=function(){return this._stopped?!0:0===this.start_time?!1:this.easing.completed()},snabbtjs.Animation.prototype.update_element=function(a){var b=this._current_state.as_matrix(),c=this._current_state.properties();snabbtjs.update_element_transform(a,b,this.perspective),snabbtjs.update_element_properties(a,c)},snabbtjs.ValueFeededAnimation=function(a){this.value_feeder=a.value_feeder,this.duration=a.duration||500,this.delay=a.delay||0,this.perspective=a.perspective,this.easing=snabbtjs.create_easer("linear"),a.easing&&(this.easing=snabbtjs.create_easer(a.easing,a)),this._current_state=new snabbtjs.State({}),this.current_matrix=this.value_feeder(0),this.start_time=0,this.current_time=0,this._stopped=!1},snabbtjs.ValueFeededAnimation.prototype.stop=function(){this._stopped=!0},snabbtjs.ValueFeededAnimation.prototype.stopped=function(){return this._stopped},snabbtjs.ValueFeededAnimation.prototype.tick=function(a){if(!this._stopped){this.start_time||(this.start_time=a),a-this.start_time>this.delay&&(this.current_time=a-this.delay);var b=Math.min(Math.max(.001,this.current_time-this.start_time),this.duration),c=this.duration;this.easing.tick(b/c),this.update_current_transform()}},snabbtjs.ValueFeededAnimation.prototype.current_state=function(){return this._current_state},snabbtjs.ValueFeededAnimation.prototype.update_current_transform=function(){var a=this.easing.value();this.current_matrix=this.value_feeder(a)},snabbtjs.ValueFeededAnimation.prototype.completed=function(){return this._stopped?!0:this.easing.completed()},snabbtjs.ValueFeededAnimation.prototype.update_element=function(a){snabbtjs.update_element_transform(a,this.current_matrix,this.perspective)},snabbtjs.ScrollAnimation=function(a){this.start_scroll=window.scrollY,this.end_scroll=a.scroll_pos,this.duration=a.duration||500,this.delay=a.delay||0,this.easing=a.easing||snabbtjs.cos_easing,this.start_time=0,this.current_time=0},snabbtjs.ScrollAnimation.prototype.tick=function(a){this.start_time||(this.start_time=a),a-this.start_time>this.delay&&(this.current_time=a-this.delay),this.update_scrolling()},snabbtjs.ScrollAnimation.prototype.update_scrolling=function(){var a=Math.min(Math.max(.001,this.current_time-this.start_time),this.duration),b=this.duration,c=this.easing(a,b),d=this.end_scroll-this.start_scroll,e=this.start_scroll+c*d;window.scrollTo(0,e)},snabbtjs.ScrollAnimation.prototype.completed=function(){return 0===this.start_time?!1:this.current_time-this.start_time>this.duration},snabbtjs.AttentionAnimation=function(a){this.movement=a.movement,this.current_movement=new snabbtjs.State({}),a.initial_velocity=.1,a.equilibrium_position=0,this.spring=new snabbtjs.SpringEasing(a),this._stopped=!1},snabbtjs.AttentionAnimation.prototype.stop=function(){this._stopped=!0},snabbtjs.AttentionAnimation.prototype.stopped=function(){return this._stopped},snabbtjs.AttentionAnimation.prototype.tick=function(){this._stopped||this.spring.equilibrium||(this.spring.tick(),this.update_movement())},snabbtjs.AttentionAnimation.prototype.update_movement=function(){this.current_movement.x=this.movement.x*this.spring.position,this.current_movement.y=this.movement.y*this.spring.position,this.current_movement.z=this.movement.z*this.spring.position,this.current_movement.ax=this.movement.ax*this.spring.position,this.current_movement.ay=this.movement.ay*this.spring.position,this.current_movement.az=this.movement.az*this.spring.position,this.current_movement.bx=this.movement.bx*this.spring.position,this.current_movement.by=this.movement.by*this.spring.position,this.current_movement.bz=this.movement.bz*this.spring.position},snabbtjs.AttentionAnimation.prototype.update_element=function(a){var b=this.current_movement.as_matrix(),c=this.current_movement.properties();snabbtjs.update_element_transform(a,b),snabbtjs.update_element_properties(a,c)},snabbtjs.AttentionAnimation.prototype.current_state=function(){return this.current_movement},snabbtjs.AttentionAnimation.prototype.completed=function(){return this.spring.equilibrium||this._stopped},snabbtjs.create_animation=function(a){return a.value_feeder?new snabbtjs.ValueFeededAnimation(a):new snabbtjs.Animation(a)};var snabbtjs=snabbtjs||{};snabbtjs.linear_easing=function(a){return a},snabbtjs.ease=function(a){return(Math.cos(a*Math.PI+Math.PI)+1)/2},snabbtjs.ease_in=function(a){return-Math.pow(a-1,2)+1},snabbtjs.ease_out=function(a){return a*a},snabbtjs.SpringEasing=function(a){this.position=snabbtjs.option_or_default(a.start_position,0),this.equilibrium_position=snabbtjs.option_or_default(a.equilibrium_position,1),this.velocity=snabbtjs.option_or_default(a.initial_velocity,0),this.spring_constant=snabbtjs.option_or_default(a.spring_constant,.8),this.deacceleration=snabbtjs.option_or_default(a.spring_deacceleration,.9),this.mass=snabbtjs.option_or_default(a.spring_mass,10),this.equilibrium=!1},snabbtjs.SpringEasing.prototype.tick=function(a){if(0!==a&&!this.equilibrium){var b=-(this.position-this.equilibrium_position)*this.spring_constant,c=b/this.mass;this.velocity+=c,this.position+=this.velocity,this.velocity*=this.deacceleration,Math.abs(this.position-this.equilibrium_position)<.001&&Math.abs(this.velocity)<.001&&(this.equilibrium=!0)}},snabbtjs.SpringEasing.prototype.value=function(){return this.position},snabbtjs.SpringEasing.prototype.completed=function(){return this.equilibrium},snabbtjs.EASING_FUNCS={linear:snabbtjs.linear_easing,ease:snabbtjs.ease,"ease-in":snabbtjs.ease_in,"ease-out":snabbtjs.ease_out},snabbtjs.Easer=function(a){this.easer=a,this._value=0},snabbtjs.Easer.prototype.tick=function(a){this._value=this.easer(a),this.last_value=a},snabbtjs.Easer.prototype.value=function(){return this._value},snabbtjs.Easer.prototype.completed=function(){return this.last_value>=1},snabbtjs.create_easer=function(a,b){if("spring"==a)return new snabbtjs.SpringEasing(b);var c;return c=snabbtjs.is_function(a)?a:snabbtjs.EASING_FUNCS[a],new snabbtjs.Easer(c)},window.jQuery&&!function(a){a.fn.snabbt=function(a,b){return snabbt(this.get(),a,b)}}(jQuery);var snabbtjs=snabbtjs||{};snabbtjs.setup_scroll_animation=function(a){function b(a){c.tick(a),c.completed()||snabbtjs.requestAnimationFrame(b)}var c=new snabbtjs.ScrollAnimation(a);snabbtjs.running_animations.push([void 0,c]),snabbtjs.requestAnimationFrame(b)},snabbtjs.setup_attention_animation=function(a,b){function c(b){e.tick(b),e.update_element(a),e.completed()||snabbtjs.requestAnimationFrame(c)}var d=snabbtjs.state_from_options(new snabbtjs.State({}),b,"");b.movement=d;var e=new snabbtjs.AttentionAnimation(b);snabbtjs.running_animations.push([a,e]),snabbtjs.requestAnimationFrame(c)},snabbtjs.stop_animation=function(a){for(var b=0;bc;++c)snabbtjs.tick_requests[c](a);snabbtjs.tick_requests.splice(0,b),window.requestAnimationFrame(snabbtjs.tick_animations),snabbtjs.running_animations=snabbtjs.running_animations.filter(function(a){return!a[1].completed()})},window.requestAnimationFrame(snabbtjs.tick_animations);var snabbtjs=snabbtjs||{};snabbtjs.assigned_matrix_multiplication=function(a,b,c){return c[0]=a[0]*b[0]+a[1]*b[4]+a[2]*b[8]+a[3]*b[12],c[1]=a[0]*b[1]+a[1]*b[5]+a[2]*b[9]+a[3]*b[13],c[2]=a[0]*b[2]+a[1]*b[6]+a[2]*b[10]+a[3]*b[14],c[3]=a[0]*b[3]+a[1]*b[7]+a[2]*b[11]+a[3]*b[15],c[4]=a[4]*b[0]+a[5]*b[4]+a[6]*b[8]+a[7]*b[12],c[5]=a[4]*b[1]+a[5]*b[5]+a[6]*b[9]+a[7]*b[13],c[6]=a[4]*b[2]+a[5]*b[6]+a[6]*b[10]+a[7]*b[14],c[7]=a[4]*b[3]+a[5]*b[7]+a[6]*b[11]+a[7]*b[15],c[8]=a[8]*b[0]+a[9]*b[4]+a[10]*b[8]+a[11]*b[12],c[9]=a[8]*b[1]+a[9]*b[5]+a[10]*b[9]+a[11]*b[13],c[10]=a[8]*b[2]+a[9]*b[6]+a[10]*b[10]+a[11]*b[14],c[11]=a[8]*b[3]+a[9]*b[7]+a[10]*b[11]+a[11]*b[15],c[12]=a[12]*b[0]+a[13]*b[4]+a[14]*b[8]+a[15]*b[12],c[13]=a[12]*b[1]+a[13]*b[5]+a[14]*b[9]+a[15]*b[13],c[14]=a[12]*b[2]+a[13]*b[6]+a[14]*b[10]+a[15]*b[14],c[15]=a[12]*b[3]+a[13]*b[7]+a[14]*b[11]+a[15]*b[15],c},snabbtjs.mat_to_css=function(a){for(var b="matrix3d(",c=0;cIntroduction

Limitations

  • All transforms work on pixels or radians. Any unit conversion has to be done beforehand.
  • -
  • No abritrary propery animations, e.g. colors, padding, margin or line height animations.
  • +
  • No abritrary property animations, e.g. colors, padding, margin or line height animations.
  • For performance reasons, snabbt.js never queries the DOM. This means that in some cases you need to store end transforms yourself.
diff --git a/package.json b/package.json index b022b14..be7fdf3 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,17 @@ { "name": "snabbt.js", - "version": "0.0.0", - "description": "Move things fast", - "main": "main.js", + "version": "0.1.0", + "description": "Fast animations with javascript and CSS-transforms", + "main": "snabbt.min.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", - "url": "git@bitbucket.org:diggidanne/snabbt.js.git" + "url": "git@github.com:daniel-lundin/snabbt.js.git" }, - "author": "", - "license": "ISC", + "author": "Daniel Lundin", + "license": "MIT", "devDependencies": { "grunt-contrib-uglify": "^0.4.0", "grunt-contrib-concat": "^0.5.0" From 897c51fcf6145cb53e01a1a51b0b2cbda5c97921 Mon Sep 17 00:00:00 2001 From: daniel-lundin Date: Fri, 2 Jan 2015 23:59:22 +0100 Subject: [PATCH 003/160] Fix typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2aef9d5..65c6f8c 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The initial release is out. Would love some feedback on things that can be impro - Improve documentation - bower/npm package - require.js support - - Optimize memory usage by reusing matrix + - Optimize memory usage by reusing matrices [MIT License](LICENSE.md) © Daniel Lundin (http://twitter.com/danielundin). From 63510847a423eb92bec0dd3771ead10c1a24199f Mon Sep 17 00:00:00 2001 From: daniel-lundin Date: Sat, 3 Jan 2015 00:06:16 +0100 Subject: [PATCH 004/160] Fix license link in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 65c6f8c..cba327d 100644 --- a/README.md +++ b/README.md @@ -23,5 +23,5 @@ The initial release is out. Would love some feedback on things that can be impro - require.js support - Optimize memory usage by reusing matrices -[MIT License](LICENSE.md) © Daniel Lundin (http://twitter.com/danielundin). +[MIT License](LICENSE.txt) © Daniel Lundin (http://twitter.com/danielundin). From 2615e7113c71215f11ffae0016ec9d6a53c4de37 Mon Sep 17 00:00:00 2001 From: daniel-lundin Date: Sat, 3 Jan 2015 16:48:13 +0100 Subject: [PATCH 005/160] Update copyright year --- README.md | 3 +-- docs/index.html | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cba327d..2f255ce 100644 --- a/README.md +++ b/README.md @@ -23,5 +23,4 @@ The initial release is out. Would love some feedback on things that can be impro - require.js support - Optimize memory usage by reusing matrices -[MIT License](LICENSE.txt) © Daniel Lundin (http://twitter.com/danielundin). - +[MIT License](LICENSE.txt) © 2015 Daniel Lundin (http://twitter.com/danielundin). diff --git a/docs/index.html b/docs/index.html index bcdd082..3183a93 100644 --- a/docs/index.html +++ b/docs/index.html @@ -448,7 +448,7 @@

Animation configuration

From 31ac4405fa4c6fdfda06461ea6e7b4c077a7e7dc Mon Sep 17 00:00:00 2001 From: daniel-lundin Date: Sun, 4 Jan 2015 00:27:17 +0100 Subject: [PATCH 006/160] Fix iOS7 bugs in documentation --- docs/cards.html | 2 ++ docs/cards.js | 13 +++++++------ docs/css/custom.css | 8 +++----- docs/docs.js | 3 +++ docs/index.html | 1 + 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/docs/cards.html b/docs/cards.html index 2f20104..9c15c99 100644 --- a/docs/cards.html +++ b/docs/cards.html @@ -47,6 +47,8 @@ .card { position: absolute; border-radius: 10%; + /* Fix jagged edges in firefox */ + outline: 1px solid transparent; } #toolbar { text-align: center; diff --git a/docs/cards.js b/docs/cards.js index 308535e..a285e13 100644 --- a/docs/cards.js +++ b/docs/cards.js @@ -13,7 +13,8 @@ var PYTH_ANGLE = Math.PI/2 - TILT; var TILTED_CARD_HEIGHT = Math.sin(PYTH_ANGLE) * CARD_HEIGHT + 2; var TILTED_CARD_WIDTH = Math.cos(PYTH_ANGLE) * CARD_HEIGHT; -var PYRAMID_WIDTH = TILTED_CARD_WIDTH * 2 + 4; +var CARD_SPACING = 2; +var PYRAMID_WIDTH = TILTED_CARD_WIDTH * 2 + CARD_SPACING * 2; function update_sizes() { var c = document.getElementById('container'); @@ -23,7 +24,7 @@ function update_sizes() { CARD_HEIGHT = HEIGHT * 0.15; TILTED_CARD_HEIGHT = Math.sin(PYTH_ANGLE) * CARD_HEIGHT + 2; TILTED_CARD_WIDTH = Math.cos(PYTH_ANGLE) * CARD_HEIGHT; - PYRAMID_WIDTH = TILTED_CARD_WIDTH * 2 + 4; + PYRAMID_WIDTH = TILTED_CARD_WIDTH * 2 + CARD_SPACING * 2; for(var i=0;iAnimation configuration + From 72b2bb79dda0a51eddcaa7dc4bdde856c191a266 Mon Sep 17 00:00:00 2001 From: daniel-lundin Date: Sun, 4 Jan 2015 00:35:38 +0100 Subject: [PATCH 007/160] Add outline to sticks-demo to fix firefox anti-aliasing problems --- docs/sticks.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/sticks.html b/docs/sticks.html index cb30cdb..aa87e61 100644 --- a/docs/sticks.html +++ b/docs/sticks.html @@ -33,6 +33,8 @@ width: 50px; height: 5px; border-radius: 5px; + /* Fix jagged edges in firefox */ + outline: 1px solid transparent; } From 402c844c742cbaf76a3c78bd5c3b9a7f631d51d9 Mon Sep 17 00:00:00 2001 From: chico Date: Sun, 4 Jan 2015 19:23:43 +0300 Subject: [PATCH 008/160] add .gitignore and .npmignore --- .gitignore | 1 + .npmignore | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 .gitignore create mode 100644 .npmignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..ed2be9a --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +docs +src +Gruntfile.js \ No newline at end of file From 88e117d65de7ecbfa7aa3597206e6e5b66d7b7a7 Mon Sep 17 00:00:00 2001 From: Madan Date: Sun, 4 Jan 2015 22:07:38 +0530 Subject: [PATCH 009/160] String concatenation are slow, using array for string concatenation --- src/mat.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mat.js b/src/mat.js index 5f7281a..0f64776 100644 --- a/src/mat.js +++ b/src/mat.js @@ -26,15 +26,15 @@ snabbtjs.assigned_matrix_multiplication = function(a, b, res) { }; snabbtjs.mat_to_css = function(matrix) { - var css = 'matrix3d('; + var css = ['matrix3d(']; for(var i=0;i Date: Sun, 4 Jan 2015 18:55:25 +0100 Subject: [PATCH 010/160] Add UMD boilder plate to add support for require.js and browserify --- Gruntfile.js | 28 +- dist/jquery.snabbt.min.js | 2 - dist/snabbt.min.js | 2 - docs/docs.js | 2 - docs/index.html | 2 +- docs/snabbt.min.js | 4 +- snabbt.js | 934 ++++++++++++++++++++++++++++++++++++++ snabbt.min.js | 2 + src/main.js | 4 +- src/module_post.js | 4 + src/module_pre.js | 19 + 11 files changed, 985 insertions(+), 18 deletions(-) delete mode 100644 dist/jquery.snabbt.min.js delete mode 100644 dist/snabbt.min.js create mode 100644 snabbt.js create mode 100644 snabbt.min.js create mode 100644 src/module_post.js create mode 100644 src/module_pre.js diff --git a/Gruntfile.js b/Gruntfile.js index ecf71bc..7de067f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,8 +8,9 @@ module.exports = function(grunt) { banner: '/*! <%= pkg.name %> v<%= pkg.version %> built: <%= grunt.template.today("yyyy-mm-dd") %> */\n' }, dist: { - src: 'src/*.js', - dest: 'dist/snabbt.min.js' + files: { + 'snabbt.min.js': ['snabbt.js'] + } }, }, concat: { @@ -17,16 +18,29 @@ module.exports = function(grunt) { separator: ';', }, dist: { - src: 'src/*.js', - dest: 'dist/snabbt.js', + src: ['src/module_pre.js', 'src/animations.js', 'src/easing.js', 'src/jquery.snabbt.js', 'src/main.js', 'src/mat.js', 'src/state.js', 'src/tween.js', 'src/utils.js', 'src/module_post.js'], + dest: 'snabbt.js', }, - }, + } + //, + //umd: { + // all: { + // options: { + // src: 'concat.snabbt.js', + // dest: 'snabbt.js', // optional, if missing the src will be used + // objectToExport: 'snabbtjs', // optional, internal object that will be exported + // amdModuleId: 'snabbt-js', // optional, if missing the AMD module will be anonymous + // } + // } + //} }); - // Load the plugin that provides the "uglify" task. grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-concat'); + //grunt.loadNpmTasks('grunt-umd'); + // Default task(s). - grunt.registerTask('default', ['uglify', 'concat']); + //grunt.registerTask('default', ['concat', 'umd', 'uglify']); + grunt.registerTask('default', ['concat', 'uglify']); }; diff --git a/dist/jquery.snabbt.min.js b/dist/jquery.snabbt.min.js deleted file mode 100644 index df457a5..0000000 --- a/dist/jquery.snabbt.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! snabbt.js 2014-12-17 */ -function snabbt(a,b,c){function d(a){return j.tick(a),j.update_element(e),j.stopped()?void 0:j.completed()?void(f.loop>1&&!j.stopped()?(f.loop-=1,j=snabbtjs.create_animation(i),snabbtjs.requestAnimationFrame(d)):(f.callback&&f.callback(),l.length&&(f=l.pop(),g=snabbtjs.state_from_options(h,f,"from_"),h=snabbtjs.state_from_options(new snabbtjs.State({}),f,""),snabbtjs.setup_animation_options(g,h,f),j=new snabbtjs.Animation(f),snabbtjs.running_animations.push([e,j]),j.tick(a),snabbtjs.requestAnimationFrame(d)))):snabbtjs.requestAnimationFrame(d)}if("scroll"==a)return snabbtjs.setup_scroll_animation(b);if("attention"==b)return snabbtjs.setup_attention_animation(a,c);if("stop"==b)return snabbtjs.stop_animation(a);var e=a,f=b,g=snabbtjs.current_animation_transform(e);g||(g=snabbtjs.state_from_options(g,f,"from_"));var h=new snabbtjs.State({});h=snabbtjs.state_from_options(h,f,"");var i=snabbtjs.setup_animation_options(g,h,f),j=snabbtjs.create_animation(i);if(e.hasOwnProperty("length"))for(var k=0;kthis.delay&&(this.current_time=a-this.delay);var b=Math.min(Math.max(0,this.current_time-this.start_time),this.duration),c=this.duration;this.easing.tick(b,c),this.update_current_transform()}},snabbtjs.Animation.prototype.current_state=function(){return this._current_state},snabbtjs.Animation.prototype.update_current_transform=function(){var a=this.easing.value();snabbtjs.TweenStates(this._start_state,this._end_state,this._current_state,a)},snabbtjs.Animation.prototype.completed=function(){return this._stopped?!0:0===this.start_time?!1:this.easing.completed()},snabbtjs.Animation.prototype.update_element=function(a){var b=this._current_state.as_matrix(),c=this._current_state.properties();snabbtjs.update_element_transform(a,b,this.perspective),snabbtjs.update_element_properties(a,c)},snabbtjs.ValueFeededAnimation=function(a){this.value_feeder=a.value_feeder,this.duration=a.duration||500,this.delay=a.delay||0,this.perspective=a.perspective,this.easing=snabbtjs.create_easer("linear"),a.easing&&(this.easing=snabbtjs.create_easer(a.easing,a)),this._current_state=new snabbtjs.State({}),this.current_matrix=this.value_feeder(0),this.start_time=0,this.current_time=0,this._stopped=!1},snabbtjs.ValueFeededAnimation.prototype.stop=function(){this._stopped=!0},snabbtjs.ValueFeededAnimation.prototype.stopped=function(){return this._stopped},snabbtjs.ValueFeededAnimation.prototype.tick=function(a){if(!this._stopped){this.start_time||(this.start_time=a),a-this.start_time>this.delay&&(this.current_time=a-this.delay);var b=Math.min(Math.max(.001,this.current_time-this.start_time),this.duration),c=this.duration;this.easing.tick(b,c),this.update_current_transform()}},snabbtjs.ValueFeededAnimation.prototype.current_state=function(){return this._current_state},snabbtjs.ValueFeededAnimation.prototype.update_current_transform=function(){var a=this.easing.value();this.current_matrix=this.value_feeder(a)},snabbtjs.ValueFeededAnimation.prototype.completed=function(){return this._stopped?!0:this.easing.completed()},snabbtjs.ValueFeededAnimation.prototype.update_element=function(a){snabbtjs.update_element_transform(a,this.current_matrix,this.perspective)},snabbtjs.ScrollAnimation=function(a){this.start_scroll=window.scrollY,this.end_scroll=a.scroll_pos,this.duration=a.duration||500,this.delay=a.delay||0,this.easing=a.easing||snabbtjs.cos_easing,this.start_time=0,this.current_time=0},snabbtjs.ScrollAnimation.prototype.tick=function(a){this.start_time||(this.start_time=a),a-this.start_time>this.delay&&(this.current_time=a-this.delay),this.update_scrolling()},snabbtjs.ScrollAnimation.prototype.update_scrolling=function(){var a=Math.min(Math.max(.001,this.current_time-this.start_time),this.duration),b=this.duration,c=this.easing(a,b),d=this.end_scroll-this.start_scroll,e=this.start_scroll+c*d;window.scrollTo(0,e)},snabbtjs.ScrollAnimation.prototype.completed=function(){return 0===this.start_time?!1:this.current_time-this.start_time>this.duration},snabbtjs.AttentionAnimation=function(a){this.movement=a.movement,this.current_movement=new snabbtjs.State({}),a.initial_velocity=.1,a.equilibrium_position=0,this.spring=new snabbtjs.SpringEasing(a),this._stopped=!1},snabbtjs.AttentionAnimation.prototype.stop=function(){this._stopped=!0},snabbtjs.AttentionAnimation.prototype.stopped=function(){return this._stopped},snabbtjs.AttentionAnimation.prototype.tick=function(){this._stopped||this.spring.equilibrium||(this.spring.tick(),this.update_movement())},snabbtjs.AttentionAnimation.prototype.update_movement=function(){this.current_movement.x=this.movement.x*this.spring.position,this.current_movement.y=this.movement.y*this.spring.position,this.current_movement.z=this.movement.z*this.spring.position,this.current_movement.ax=this.movement.ax*this.spring.position,this.current_movement.ay=this.movement.ay*this.spring.position,this.current_movement.az=this.movement.az*this.spring.position,this.current_movement.bx=this.movement.bx*this.spring.position,this.current_movement.by=this.movement.by*this.spring.position,this.current_movement.bz=this.movement.bz*this.spring.position},snabbtjs.AttentionAnimation.prototype.update_element=function(a){var b=this.current_movement.as_matrix(),c=this.current_movement.properties();snabbtjs.update_element_transform(a,b),snabbtjs.update_element_properties(a,c)},snabbtjs.AttentionAnimation.prototype.current_state=function(){return this.current_movement},snabbtjs.AttentionAnimation.prototype.completed=function(){return this.spring.equilibrium||this._stopped},snabbtjs.create_animation=function(a){return a.value_feeder?new snabbtjs.ValueFeededAnimation(a):new snabbtjs.Animation(a)};var snabbtjs=snabbtjs||{};snabbtjs.pow2_easing=function(a,b){var c=a/b;return c*c},snabbtjs.linear_easing=function(a,b){return a/b},snabbtjs.cos_easing=function(a,b){return(Math.cos(a/b*Math.PI+Math.PI)+1)/2},snabbtjs.sqrt_easing=function(a,b){var c=a/b;return Math.pow(c,.5)},snabbtjs.sinc_wobbler_easing=function(a,b){var c=a/b,d=5;return(-Math.sin(d*Math.PI*c)/(d*c)+Math.PI)/Math.PI},snabbtjs.sinc2=function(a,b){var c=a/b;return 1-Math.sin(20*Math.PI*c)/(20*Math.PI*c)},snabbtjs.exp_cos=function(a,b){var c=a/b;return 1+Math.exp(-5*c)*Math.cos(4*Math.PI*c)},snabbtjs.exp_cos_bounce=function(a,b){var c=a/b;return 1-Math.abs(Math.exp(-5*c)*Math.cos(4*Math.PI*c))},snabbtjs.SpringEasing=function(a){this.position=snabbtjs.option_or_default(a.start_position,0),this.equilibrium_position=snabbtjs.option_or_default(a.equilibrium_position,1),this.velocity=snabbtjs.option_or_default(a.initial_velocity,0),this.spring_constant=snabbtjs.option_or_default(a.spring_constant,.8),this.deacceleration=snabbtjs.option_or_default(a.deacceleration,.9),this.mass=snabbtjs.option_or_default(a.spring_mass,10),this.equilibrium=!1},snabbtjs.SpringEasing.prototype.tick=function(a){if(0!==a&&!this.equilibrium){var b=-(this.position-this.equilibrium_position)*this.spring_constant,c=b/this.mass;this.velocity+=c,this.position+=this.velocity,this.velocity*=this.deacceleration,Math.abs(this.position-this.equilibrium_position)<.001&&Math.abs(this.velocity)<.001&&(this.equilibrium=!0)}},snabbtjs.SpringEasing.prototype.value=function(){return this.position},snabbtjs.SpringEasing.prototype.completed=function(){return this.equilibrium},snabbtjs.EASING_FUNCS={linear:snabbtjs.linear_easing,square:snabbtjs.pow2_easing,sqrt:snabbtjs.sqrt_easing,cos:snabbtjs.cos_easing,exp_cos_bounce:snabbtjs.exp_cos_bounce,exp_cos:snabbtjs.exp_cos,sinc_wobbler:snabbtjs.sinc_wobbler_easing},snabbtjs.Easer=function(a){this.easer=a,this._value=0},snabbtjs.Easer.prototype.tick=function(a,b){this._value=this.easer(a,b),this.last_value=a/b},snabbtjs.Easer.prototype.value=function(){return this._value},snabbtjs.Easer.prototype.completed=function(){return this.last_value>=1},snabbtjs.create_easer=function(a,b){if("spring"==a)return new snabbtjs.SpringEasing(b);var c=snabbtjs.EASING_FUNCS[a];return new snabbtjs.Easer(c)},window.jQuery&&!function(a){a.fn.snabbt=function(a,b){return snabbt(this.get(),a,b)}}(jQuery);var snabbtjs=snabbtjs||{};snabbtjs.setup_scroll_animation=function(a){function b(a){c.tick(a),c.completed()||snabbtjs.requestAnimationFrame(b)}var c=new snabbtjs.ScrollAnimation(a);snabbtjs.running_animations.push([void 0,c]),snabbtjs.requestAnimationFrame(b)},snabbtjs.setup_attention_animation=function(a,b){function c(b){e.tick(b),e.update_element(a),e.completed()||snabbtjs.requestAnimationFrame(c)}var d=snabbtjs.state_from_options(new snabbtjs.State({}),b,""),e=new snabbtjs.AttentionAnimation({movement:d,spring_constant:b.spring_constant,deacceleration:b.deacceleration,initial_velocity:b.initial_velocity});snabbtjs.running_animations.push([a,e]),snabbtjs.requestAnimationFrame(c)},snabbtjs.stop_animation=function(a){for(var b=0;bc;++c)snabbtjs.tick_requests[c](a);snabbtjs.tick_requests.splice(0,b),window.requestAnimationFrame(snabbtjs.tick_animations),snabbtjs.running_animations=snabbtjs.running_animations.filter(function(a){return!a[1].completed()})},window.requestAnimationFrame(snabbtjs.tick_animations);var snabbtjs=snabbtjs||{};snabbtjs.assigned_matrix_multiplication=function(a,b,c){return c[0]=a[0]*b[0]+a[1]*b[4]+a[2]*b[8]+a[3]*b[12],c[1]=a[0]*b[1]+a[1]*b[5]+a[2]*b[9]+a[3]*b[13],c[2]=a[0]*b[2]+a[1]*b[6]+a[2]*b[10]+a[3]*b[14],c[3]=a[0]*b[3]+a[1]*b[7]+a[2]*b[11]+a[3]*b[15],c[4]=a[4]*b[0]+a[5]*b[4]+a[6]*b[8]+a[7]*b[12],c[5]=a[4]*b[1]+a[5]*b[5]+a[6]*b[9]+a[7]*b[13],c[6]=a[4]*b[2]+a[5]*b[6]+a[6]*b[10]+a[7]*b[14],c[7]=a[4]*b[3]+a[5]*b[7]+a[6]*b[11]+a[7]*b[15],c[8]=a[8]*b[0]+a[9]*b[4]+a[10]*b[8]+a[11]*b[12],c[9]=a[8]*b[1]+a[9]*b[5]+a[10]*b[9]+a[11]*b[13],c[10]=a[8]*b[2]+a[9]*b[6]+a[10]*b[10]+a[11]*b[14],c[11]=a[8]*b[3]+a[9]*b[7]+a[10]*b[11]+a[11]*b[15],c[12]=a[12]*b[0]+a[13]*b[4]+a[14]*b[8]+a[15]*b[12],c[13]=a[12]*b[1]+a[13]*b[5]+a[14]*b[9]+a[15]*b[13],c[14]=a[12]*b[2]+a[13]*b[6]+a[14]*b[10]+a[15]*b[14],c[15]=a[12]*b[3]+a[13]*b[7]+a[14]*b[11]+a[15]*b[15],c},snabbtjs.mat_to_css=function(a){for(var b="matrix3d(",c=0;c1&&!j.stopped()?(f.loop-=1,j=snabbtjs.create_animation(i),snabbtjs.requestAnimationFrame(d)):(f.callback&&f.callback(),l.length&&(f=l.pop(),g=snabbtjs.state_from_options(h,f,"from_"),h=snabbtjs.state_from_options(new snabbtjs.State({}),f,""),snabbtjs.setup_animation_options(g,h,f),j=new snabbtjs.Animation(f),snabbtjs.running_animations.push([e,j]),j.tick(a),snabbtjs.requestAnimationFrame(d)))):snabbtjs.requestAnimationFrame(d)}if("scroll"===a)return snabbtjs.setup_scroll_animation(b);if("attention"===b)return snabbtjs.setup_attention_animation(a,c);if("stop"===b)return snabbtjs.stop_animation(a);var e=a,f=b,g=snabbtjs.current_animation_transform(e);g||(g=snabbtjs.state_from_options(g,f,"from_"));var h=new snabbtjs.State({});h=snabbtjs.state_from_options(h,f,"");var i=snabbtjs.setup_animation_options(g,h,f),j=snabbtjs.create_animation(i);if(e.hasOwnProperty("length"))for(var k=0;kthis.delay&&(this.current_time=a-this.delay);var b=Math.min(Math.max(0,this.current_time-this.start_time),this.duration),c=this.duration;this.easing.tick(b/c),this.update_current_transform()}},snabbtjs.Animation.prototype.current_state=function(){return this._current_state},snabbtjs.Animation.prototype.update_current_transform=function(){var a=this.easing.value();snabbtjs.TweenStates(this._start_state,this._end_state,this._current_state,a)},snabbtjs.Animation.prototype.completed=function(){return this._stopped?!0:0===this.start_time?!1:this.easing.completed()},snabbtjs.Animation.prototype.update_element=function(a){var b=this._current_state.as_matrix(),c=this._current_state.properties();snabbtjs.update_element_transform(a,b,this.perspective),snabbtjs.update_element_properties(a,c)},snabbtjs.ValueFeededAnimation=function(a){this.value_feeder=a.value_feeder,this.duration=a.duration||500,this.delay=a.delay||0,this.perspective=a.perspective,this.easing=snabbtjs.create_easer("linear"),a.easing&&(this.easing=snabbtjs.create_easer(a.easing,a)),this._current_state=new snabbtjs.State({}),this.current_matrix=this.value_feeder(0),this.start_time=0,this.current_time=0,this._stopped=!1},snabbtjs.ValueFeededAnimation.prototype.stop=function(){this._stopped=!0},snabbtjs.ValueFeededAnimation.prototype.stopped=function(){return this._stopped},snabbtjs.ValueFeededAnimation.prototype.tick=function(a){if(!this._stopped){this.start_time||(this.start_time=a),a-this.start_time>this.delay&&(this.current_time=a-this.delay);var b=Math.min(Math.max(.001,this.current_time-this.start_time),this.duration),c=this.duration;this.easing.tick(b/c),this.update_current_transform()}},snabbtjs.ValueFeededAnimation.prototype.current_state=function(){return this._current_state},snabbtjs.ValueFeededAnimation.prototype.update_current_transform=function(){var a=this.easing.value();this.current_matrix=this.value_feeder(a)},snabbtjs.ValueFeededAnimation.prototype.completed=function(){return this._stopped?!0:this.easing.completed()},snabbtjs.ValueFeededAnimation.prototype.update_element=function(a){snabbtjs.update_element_transform(a,this.current_matrix,this.perspective)},snabbtjs.ScrollAnimation=function(a){this.start_scroll=window.scrollY,this.end_scroll=a.scroll_pos,this.duration=a.duration||500,this.delay=a.delay||0,this.easing=a.easing||snabbtjs.cos_easing,this.start_time=0,this.current_time=0},snabbtjs.ScrollAnimation.prototype.tick=function(a){this.start_time||(this.start_time=a),a-this.start_time>this.delay&&(this.current_time=a-this.delay),this.update_scrolling()},snabbtjs.ScrollAnimation.prototype.update_scrolling=function(){var a=Math.min(Math.max(.001,this.current_time-this.start_time),this.duration),b=this.duration,c=this.easing(a,b),d=this.end_scroll-this.start_scroll,e=this.start_scroll+c*d;window.scrollTo(0,e)},snabbtjs.ScrollAnimation.prototype.completed=function(){return 0===this.start_time?!1:this.current_time-this.start_time>this.duration},snabbtjs.AttentionAnimation=function(a){this.movement=a.movement,this.current_movement=new snabbtjs.State({}),a.initial_velocity=.1,a.equilibrium_position=0,this.spring=new snabbtjs.SpringEasing(a),this._stopped=!1},snabbtjs.AttentionAnimation.prototype.stop=function(){this._stopped=!0},snabbtjs.AttentionAnimation.prototype.stopped=function(){return this._stopped},snabbtjs.AttentionAnimation.prototype.tick=function(){this._stopped||this.spring.equilibrium||(this.spring.tick(),this.update_movement())},snabbtjs.AttentionAnimation.prototype.update_movement=function(){this.current_movement.x=this.movement.x*this.spring.position,this.current_movement.y=this.movement.y*this.spring.position,this.current_movement.z=this.movement.z*this.spring.position,this.current_movement.ax=this.movement.ax*this.spring.position,this.current_movement.ay=this.movement.ay*this.spring.position,this.current_movement.az=this.movement.az*this.spring.position,this.current_movement.bx=this.movement.bx*this.spring.position,this.current_movement.by=this.movement.by*this.spring.position,this.current_movement.bz=this.movement.bz*this.spring.position},snabbtjs.AttentionAnimation.prototype.update_element=function(a){var b=this.current_movement.as_matrix(),c=this.current_movement.properties();snabbtjs.update_element_transform(a,b),snabbtjs.update_element_properties(a,c)},snabbtjs.AttentionAnimation.prototype.current_state=function(){return this.current_movement},snabbtjs.AttentionAnimation.prototype.completed=function(){return this.spring.equilibrium||this._stopped},snabbtjs.create_animation=function(a){return a.value_feeder?new snabbtjs.ValueFeededAnimation(a):new snabbtjs.Animation(a)};var snabbtjs=snabbtjs||{};snabbtjs.linear_easing=function(a){return a},snabbtjs.ease=function(a){return(Math.cos(a*Math.PI+Math.PI)+1)/2},snabbtjs.ease_in=function(a){return-Math.pow(a-1,2)+1},snabbtjs.ease_out=function(a){return a*a},snabbtjs.SpringEasing=function(a){this.position=snabbtjs.option_or_default(a.start_position,0),this.equilibrium_position=snabbtjs.option_or_default(a.equilibrium_position,1),this.velocity=snabbtjs.option_or_default(a.initial_velocity,0),this.spring_constant=snabbtjs.option_or_default(a.spring_constant,.8),this.deacceleration=snabbtjs.option_or_default(a.spring_deacceleration,.9),this.mass=snabbtjs.option_or_default(a.spring_mass,10),this.equilibrium=!1},snabbtjs.SpringEasing.prototype.tick=function(a){if(0!==a&&!this.equilibrium){var b=-(this.position-this.equilibrium_position)*this.spring_constant,c=b/this.mass;this.velocity+=c,this.position+=this.velocity,this.velocity*=this.deacceleration,Math.abs(this.position-this.equilibrium_position)<.001&&Math.abs(this.velocity)<.001&&(this.equilibrium=!0)}},snabbtjs.SpringEasing.prototype.value=function(){return this.position},snabbtjs.SpringEasing.prototype.completed=function(){return this.equilibrium},snabbtjs.EASING_FUNCS={linear:snabbtjs.linear_easing,ease:snabbtjs.ease,"ease-in":snabbtjs.ease_in,"ease-out":snabbtjs.ease_out},snabbtjs.Easer=function(a){this.easer=a,this._value=0},snabbtjs.Easer.prototype.tick=function(a){this._value=this.easer(a),this.last_value=a},snabbtjs.Easer.prototype.value=function(){return this._value},snabbtjs.Easer.prototype.completed=function(){return this.last_value>=1},snabbtjs.create_easer=function(a,b){if("spring"==a)return new snabbtjs.SpringEasing(b);var c;return c=snabbtjs.is_function(a)?a:snabbtjs.EASING_FUNCS[a],new snabbtjs.Easer(c)},window.jQuery&&!function(a){a.fn.snabbt=function(a,b){return snabbt(this.get(),a,b)}}(jQuery);var snabbtjs=snabbtjs||{};snabbtjs.setup_scroll_animation=function(a){function b(a){c.tick(a),c.completed()||snabbtjs.requestAnimationFrame(b)}var c=new snabbtjs.ScrollAnimation(a);snabbtjs.running_animations.push([void 0,c]),snabbtjs.requestAnimationFrame(b)},snabbtjs.setup_attention_animation=function(a,b){function c(b){e.tick(b),e.update_element(a),e.completed()||snabbtjs.requestAnimationFrame(c)}var d=snabbtjs.state_from_options(new snabbtjs.State({}),b,"");b.movement=d;var e=new snabbtjs.AttentionAnimation(b);snabbtjs.running_animations.push([a,e]),snabbtjs.requestAnimationFrame(c)},snabbtjs.stop_animation=function(a){for(var b=0;bc;++c)snabbtjs.tick_requests[c](a);snabbtjs.tick_requests.splice(0,b),window.requestAnimationFrame(snabbtjs.tick_animations),snabbtjs.running_animations=snabbtjs.running_animations.filter(function(a){return!a[1].completed()})},window.requestAnimationFrame(snabbtjs.tick_animations);var snabbtjs=snabbtjs||{};snabbtjs.assigned_matrix_multiplication=function(a,b,c){return c[0]=a[0]*b[0]+a[1]*b[4]+a[2]*b[8]+a[3]*b[12],c[1]=a[0]*b[1]+a[1]*b[5]+a[2]*b[9]+a[3]*b[13],c[2]=a[0]*b[2]+a[1]*b[6]+a[2]*b[10]+a[3]*b[14],c[3]=a[0]*b[3]+a[1]*b[7]+a[2]*b[11]+a[3]*b[15],c[4]=a[4]*b[0]+a[5]*b[4]+a[6]*b[8]+a[7]*b[12],c[5]=a[4]*b[1]+a[5]*b[5]+a[6]*b[9]+a[7]*b[13],c[6]=a[4]*b[2]+a[5]*b[6]+a[6]*b[10]+a[7]*b[14],c[7]=a[4]*b[3]+a[5]*b[7]+a[6]*b[11]+a[7]*b[15],c[8]=a[8]*b[0]+a[9]*b[4]+a[10]*b[8]+a[11]*b[12],c[9]=a[8]*b[1]+a[9]*b[5]+a[10]*b[9]+a[11]*b[13],c[10]=a[8]*b[2]+a[9]*b[6]+a[10]*b[10]+a[11]*b[14],c[11]=a[8]*b[3]+a[9]*b[7]+a[10]*b[11]+a[11]*b[15],c[12]=a[12]*b[0]+a[13]*b[4]+a[14]*b[8]+a[15]*b[12],c[13]=a[12]*b[1]+a[13]*b[5]+a[14]*b[9]+a[15]*b[13],c[14]=a[12]*b[2]+a[13]*b[6]+a[14]*b[10]+a[15]*b[14],c[15]=a[12]*b[3]+a[13]*b[7]+a[14]*b[11]+a[15]*b[15],c},snabbtjs.mat_to_css=function(a){for(var b="matrix3d(",c=0;cSimple

Write less, animate more

- Download + Download

Warning: snabbt.js is under development, breaking changes could occur. This document should be seen as a draft.