diff options
| -rw-r--r-- | css/sally.css | 4 | ||||
| -rw-r--r-- | js/util.js | 29 |
2 files changed, 30 insertions, 3 deletions
diff --git a/css/sally.css b/css/sally.css index f3356df..515442a 100644 --- a/css/sally.css +++ b/css/sally.css @@ -73,6 +73,4 @@ textarea { font-size:12pt; width: 45%; height: 300px; background: #333; color: # .selector_el.creating div { display: none; } -@media screen and (-webkit-min-device-pixel-ratio:0) { - #nvgovy{white-space:pre;} -} + @@ -115,6 +115,34 @@ function weave(a){ return b } +// easing functions +function circular (t) { return Math.sqrt( 1 - ( --t * t ) ) } +function quadratic (t) { return t * ( 2 - t ) } +function back (t) { + var b = 4; + return ( t = t - 1 ) * t * ( ( b + 1 ) * t + b ) + 1; +} +function bounce (t) { + if (t >= 1) return 1; + if ( ( t /= 1 ) < ( 1 / 2.75 ) ) { + return 7.5625 * t * t; + } else if ( t < ( 2 / 2.75 ) ) { + return 7.5625 * ( t -= ( 1.5 / 2.75 ) ) * t + 0.75; + } else if ( t < ( 2.5 / 2.75 ) ) { + return 7.5625 * ( t -= ( 2.25 / 2.75 ) ) * t + 0.9375; + } else { + return 7.5625 * ( t -= ( 2.625 / 2.75 ) ) * t + 0.984375; + } +} +function elastic (t) { + var f = 0.22, + e = 0.4; + + if ( t === 0 ) { return 0; } + if ( t == 1 ) { return 1; } + + return ( e * Math.pow( 2, - 10 * t ) * Math.sin( ( t - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 ); +} Model=function a(b,c,d,e){function f(){var a=this,f={};a.on=function(a,b){(f[a]|| (f[a]=[])).push(b)},a.trigger=function(a,b){for(var c=f[a],d=0;c&&d<c.length;)c [d++](b)},a.off=function(a,b){for(d=f[a]||[];b&&(c=d.indexOf(b))>-1;)d.splice(c @@ -123,3 +151,4 @@ d=this.apply(a,arguments))===e?a:d}.bind(d):d;a.init&&a.init.apply(a,arguments) }return f.extend=function(f){d={};for(c in b)d[c]=b[c];for(c in f)d[c]=f[c],b[c ]!==e&&(d["__"+c]=b[c]);return a(d)},f},typeof module=="object"&&(module.exports =Model); // c-{{{-< + |
