vendor: 5,024 bytes, lines 1-194
1// -------------------------------------------------- 2// easing.js v0.5.4 3// Generic set of easing functions with AMD support 4// https://github.com/danro/easing-js 5// This code may be freely distributed under the MIT license 6// http://danro.mit-license.org/ 7// -------------------------------------------------- 8// All functions adapted from Thomas Fuchs & Jeremy Kahn 9// Easing Equations (c) 2003 Robert Penner, BSD license 10// https://raw.github.com/danro/easing-js/master/LICENSE 11// -------------------------------------------------- 12(function (name, definition) { 13 /*global define module*/ 14 if (typeof define == 'function') define(definition); 15 else if (typeof module != 'undefined') module.exports = definition; 16 else this[name] = definition; 17}('easing', { 18 easeInQuad: function(pos) { 19 return Math.pow(pos, 2); 20 }, 21 22 easeOutQuad: function(pos) { 23 return -(Math.pow((pos-1), 2) -1); 24 }, 25 26 easeInOutQuad: function(pos) { 27 if ((pos/=0.5) < 1) return 0.5*Math.pow(pos,2); 28 return -0.5 * ((pos-=2)*pos - 2); 29 }, 30 31 easeInCubic: function(pos) { 32 return Math.pow(pos, 3); 33 }, 34 35 easeOutCubic: function(pos) { 36 return (Math.pow((pos-1), 3) +1); 37 }, 38 39 easeInOutCubic: function(pos) { 40 if ((pos/=0.5) < 1) return 0.5*Math.pow(pos,3); 41 return 0.5 * (Math.pow((pos-2),3) + 2); 42 }, 43 44 easeInQuart: function(pos) { 45 return Math.pow(pos, 4); 46 }, 47 48 easeOutQuart: function(pos) { 49 return -(Math.pow((pos-1), 4) -1); 50 }, 51 52 easeInOutQuart: function(pos) { 53 if ((pos/=0.5) < 1) return 0.5*Math.pow(pos,4); 54 return -0.5 * ((pos-=2)*Math.pow(pos,3) - 2); 55 }, 56 57 easeInQuint: function(pos) { 58 return Math.pow(pos, 5); 59 }, 60 61 easeOutQuint: function(pos) { 62 return (Math.pow((pos-1), 5) +1); 63 }, 64 65 easeInOutQuint: function(pos) { 66 if ((pos/=0.5) < 1) return 0.5*Math.pow(pos,5); 67 return 0.5 * (Math.pow((pos-2),5) + 2); 68 }, 69 70 easeInSine: function(pos) { 71 return -Math.cos(pos * (Math.PI/2)) + 1; 72 }, 73 74 easeOutSine: function(pos) { 75 return Math.sin(pos * (Math.PI/2)); 76 }, 77 78 easeInOutSine: function(pos) { 79 return (-0.5 * (Math.cos(Math.PI*pos) -1)); 80 }, 81 82 easeInExpo: function(pos) { 83 return (pos===0) ? 0 : Math.pow(2, 10 * (pos - 1)); 84 }, 85 86 easeOutExpo: function(pos) { 87 return (pos===1) ? 1 : -Math.pow(2, -10 * pos) + 1; 88 }, 89 90 easeInOutExpo: function(pos) { 91 if(pos===0) return 0; 92 if(pos===1) return 1; 93 if((pos/=0.5) < 1) return 0.5 * Math.pow(2,10 * (pos-1)); 94 return 0.5 * (-Math.pow(2, -10 * --pos) + 2); 95 }, 96 97 easeInCirc: function(pos) { 98 return -(Math.sqrt(1 - (pos*pos)) - 1); 99 }, 100 101 easeOutCirc: function(pos) { 102 return Math.sqrt(1 - Math.pow((pos-1), 2)); 103 }, 104 105 easeInOutCirc: function(pos) { 106 if((pos/=0.5) < 1) return -0.5 * (Math.sqrt(1 - pos*pos) - 1); 107 return 0.5 * (Math.sqrt(1 - (pos-=2)*pos) + 1); 108 }, 109 110 easeOutBounce: function(pos) { 111 if ((pos) < (1/2.75)) { 112 return (7.5625*pos*pos); 113 } else if (pos < (2/2.75)) { 114 return (7.5625*(pos-=(1.5/2.75))*pos + 0.75); 115 } else if (pos < (2.5/2.75)) { 116 return (7.5625*(pos-=(2.25/2.75))*pos + 0.9375); 117 } else { 118 return (7.5625*(pos-=(2.625/2.75))*pos + 0.984375); 119 } 120 }, 121 122 easeInBack: function(pos) { 123 var s = 1.70158; 124 return (pos)*pos*((s+1)*pos - s); 125 }, 126 127 easeOutBack: function(pos) { 128 var s = 1.70158; 129 return (pos=pos-1)*pos*((s+1)*pos + s) + 1; 130 }, 131 132 easeInOutBack: function(pos) { 133 var s = 1.70158; 134 if((pos/=0.5) < 1) return 0.5*(pos*pos*(((s*=(1.525))+1)*pos -s)); 135 return 0.5*((pos-=2)*pos*(((s*=(1.525))+1)*pos +s) +2); 136 }, 137 138 elastic: function(pos) { 139 return -1 * Math.pow(4,-8*pos) * Math.sin((pos*6-1)*(2*Math.PI)/2) + 1; 140 }, 141 142 swingFromTo: function(pos) { 143 var s = 1.70158; 144 return ((pos/=0.5) < 1) ? 0.5*(pos*pos*(((s*=(1.525))+1)*pos - s)) : 145 0.5*((pos-=2)*pos*(((s*=(1.525))+1)*pos + s) + 2); 146 }, 147 148 swingFrom: function(pos) { 149 var s = 1.70158; 150 return pos*pos*((s+1)*pos - s); 151 }, 152 153 swingTo: function(pos) { 154 var s = 1.70158; 155 return (pos-=1)*pos*((s+1)*pos + s) + 1; 156 }, 157 158 bounce: function(pos) { 159 if (pos < (1/2.75)) { 160 return (7.5625*pos*pos); 161 } else if (pos < (2/2.75)) { 162 return (7.5625*(pos-=(1.5/2.75))*pos + 0.75); 163 } else if (pos < (2.5/2.75)) { 164 return (7.5625*(pos-=(2.25/2.75))*pos + 0.9375); 165 } else { 166 return (7.5625*(pos-=(2.625/2.75))*pos + 0.984375); 167 } 168 }, 169 170 bouncePast: function(pos) { 171 if (pos < (1/2.75)) { 172 return (7.5625*pos*pos); 173 } else if (pos < (2/2.75)) { 174 return 2 - (7.5625*(pos-=(1.5/2.75))*pos + 0.75); 175 } else if (pos < (2.5/2.75)) { 176 return 2 - (7.5625*(pos-=(2.25/2.75))*pos + 0.9375); 177 } else { 178 return 2 - (7.5625*(pos-=(2.625/2.75))*pos + 0.984375); 179 } 180 }, 181 182 easeFromTo: function(pos) { 183 if ((pos/=0.5) < 1) return 0.5*Math.pow(pos,4); 184 return -0.5 * ((pos-=2)*Math.pow(pos,3) - 2); 185 }, 186 187 easeFrom: function(pos) { 188 return Math.pow(pos,4); 189 }, 190 191 easeTo: function(pos) { 192 return Math.pow(pos,0.25); 193 } 194}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.