1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-fx.Easing'>/**
2 </span> * @class Ext.fx.Easing
4 This class contains a series of function definitions used to modify values during an animation.
5 They describe how the intermediate values used during a transition will be calculated. It allows for a transition to change
6 speed over its duration. The following options are available:
8 - linear The default easing type
19 - cubic-bezier(x1, y1, x2, y2)
21 Note that cubic-bezier will create a custom easing curve following the CSS3 transition-timing-function specification `{@link http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag}`. The four values specify points P1 and P2 of the curve
22 as (x1, y1, x2, y2). All values must be in the range [0, 1] or the definition is invalid.
28 Ext.require('Ext.fx.CubicBezier', function() {
37 // ease: Ext.fx.CubicBezier.cubicBezier(0.25, 0.1, 0.25, 1),
38 // linear: Ext.fx.CubicBezier.cubicBezier(0, 0, 1, 1),
39 // 'ease-in': Ext.fx.CubicBezier.cubicBezier(0.42, 0, 1, 1),
40 // 'ease-out': Ext.fx.CubicBezier.cubicBezier(0, 0.58, 1, 1),
41 // 'ease-in-out': Ext.fx.CubicBezier.cubicBezier(0.42, 0, 0.58, 1),
42 // 'easeIn': Ext.fx.CubicBezier.cubicBezier(0.42, 0, 1, 1),
43 // 'easeOut': Ext.fx.CubicBezier.cubicBezier(0, 0.58, 1, 1),
44 // 'easeInOut': Ext.fx.CubicBezier.cubicBezier(0.42, 0, 0.58, 1)
47 Ext.apply(Ext.fx.Easing, {
52 var q = 0.07813 - n / 2,
54 Q = sqrt(0.0066 + q * q),
56 X = pow(abs(x), 1/3) * (x < 0 ? -1 : 1),
58 Y = pow(abs(y), 1/3) * (y < 0 ? -1 : 1),
60 return pow(1 - t, 2) * 3 * t * 0.1 + (1 - t) * 3 * t * t + t * t * t;
62 easeIn: function (n) {
65 easeOut: function (n) {
68 easeInOut: function(n) {
69 var q = 0.48 - n / 1.04,
70 Q = sqrt(0.1734 + q * q),
72 X = pow(abs(x), 1/3) * (x < 0 ? -1 : 1),
74 Y = pow(abs(y), 1/3) * (y < 0 ? -1 : 1),
76 return (1 - t) * 3 * t * t + t * t * t;
78 backIn: function (n) {
79 return n * n * ((backInSeed + 1) * n - backInSeed);
81 backOut: function (n) {
83 return n * n * ((backInSeed + 1) * n + backInSeed) + 1;
85 elasticIn: function (n) {
86 if (n === 0 || n === 1) {
91 return pow(2, -10 * n) * sin((n - s) * (2 * pi) / p) + 1;
93 elasticOut: function (n) {
94 return 1 - Ext.fx.Easing.elasticIn(1 - n);
96 bounceIn: function (n) {
97 return 1 - Ext.fx.Easing.bounceOut(1 - n);
99 bounceOut: function (n) {
103 if (n < (1 / p)) {
106 if (n < (2 / p)) {
108 l = s * n * n + 0.75;
110 if (n < (2.5 / p)) {
112 l = s * n * n + 0.9375;
115 l = s * n * n + 0.984375;
122 Ext.apply(Ext.fx.Easing, {
123 'back-in': Ext.fx.Easing.backIn,
124 'back-out': Ext.fx.Easing.backOut,
125 'ease-in': Ext.fx.Easing.easeIn,
126 'ease-out': Ext.fx.Easing.easeOut,
127 'elastic-in': Ext.fx.Easing.elasticIn,
128 'elastic-out': Ext.fx.Easing.elasticIn,
129 'bounce-in': Ext.fx.Easing.bounceIn,
130 'bounce-out': Ext.fx.Easing.bounceOut,
131 'ease-in-out': Ext.fx.Easing.easeInOut
133 });</pre></pre></body></html>