PageSourceSearch

https://fdnyheart.com/plugins/system/easyslider/assets/js/lib/easing.js

js fdnyheart.com collected 2026-10-08 08:11:28 UTC 1,307 bytes, 53 lines download raw bytes

1/**
2 * Created by phong on 8/28/15.
3 */
4
5void function ( exports, $, _, Backbone) {
6
7	var easings = exports.ES_Easings = {
8		linear: function( p ) {
9			return p;
10		}
11	};
12	var baseEasings = {};
13
14	_.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( name, i ) {
15		baseEasings[ name ] = function( p ) {
16			return Math.pow( p, i + 2 );
17		};
18	} );
19	_.extend( baseEasings, {
20		Sine: function( p ) {
21			return 1 - Math.cos( p * Math.PI / 2 );
22		},
23		Circ: function( p ) {
24			return 1 - Math.sqrt( 1 - p * p );
25		},
26		Elastic: function( p ) {
27			return p === 0 || p === 1 ? p :
28			-Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
29		},
30		Back: function( p ) {
31			return p * p * ( 3 * p - 2 );
32		},
33		Bounce: function( p ) {
34			var pow2,
35				bounce = 4;
36			while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {
37			}
38			return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
39		}
40	} );
41	_.each( baseEasings, function( easeIn, name ) {
42		easings[ "easeIn" + name ] = easeIn;
43		easings[ "easeOut" + name ] = function( p ) {
44			return 1 - easeIn( 1 - p );
45		};
46		easings[ "easeInOut" + name ] = function( p ) {
47			return p < 0.5 ?
48			easeIn( p * 2 ) / 2 :
49			1 - easeIn( p * -2 + 2 ) / 2;
50		};
51	} );
52
53} ( this, jQuery, _, Backbone );

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.