transition-timer.js revision 959c053d56a076109993a2f14094d20b1f8c0c17
/**
* The Transition Utility provides an API for creating advanced transitions.
* @module node
*/
/**
* Provides the base Transition class, for animating numeric properties.
*
* @module node
* @submodule transition
*/
/**
* A class for constructing animation instances.
* @class Transition
* @for Transition
* @constructor
*/
var START = 'transition:start',
END = 'transition:end',
PROPERTY_END = 'transition:propertyEnd',
Transition = Y.Transition;
_start: function() {
if (Transition.useNative) {
this._runNative();
} else {
this._runTimer();
}
},
_runTimer: function() {
var anim = this;
anim._initAttrs();
anim._startTime = new Date();
},
if (finish) { // jump to last frame
}
this._running = false;
this._startTime = null;
},
_runFrame: function() {
var t = new Date() - this._startTime;
this._runAttrs(t);
},
var anim = this,
done = false,
allDone = false,
d,
t,
i;
for (i in attr) {
t = time;
done = (t >= d);
if (t > d) {
t = d;
}
if (done) {
allDone = true;
});
}
}
}
}
}
}
},
_initAttrs: function() {
var from = {},
to = {},
attr = {},
val,
name,
if (!runtimeAttrs) {
}
}
if (typeof val === 'function') {
}
}
return;
}
if (typeof easing === 'string') {
}
}
runtimeAttrs[name] = {
};
if (duration > this._totalDuration) {
this._totalDuration = duration;
}
this._count++;
}
}
this._skip = {};
},
destroy: function() {
this.detachAll();
this._node = null;
}
}, true);
Y.mix(Y.Transition, {
_runtimeAttrs: {},
/**
* Regex of properties that should use the default unit.
*
* @property RE_DEFAULT_UNIT
* @static
*/
/**
* The default unit to use with properties that pass the RE_DEFAULT_UNIT test.
*
* @property DEFAULT_UNIT
* @static
*/
DEFAULT_UNIT: 'px',
/**
* Time in milliseconds passed to setInterval for frame processing
*
* @property intervalTime
* @default 20
* @static
*/
intervalTime: 20,
/**
* Bucket for custom getters and setters
*
* @property behaviors
* @static
*/
behaviors: {
left: {
}
}
},
/**
* The default setter to use when setting object properties.
*
* @property DEFAULT_SETTER
* @static
*/
} else {
}
},
/**
* The default getter to use when getting object properties.
*
* @property DEFAULT_GETTER
* @static
*/
val = '';
} else {
}
return val;
},
_startTimer: function() {
if (!Transition._timer) {
}
},
_stopTimer: function() {
Transition._timer = null;
},
/**
* Called per Interval to handle each animation frame.
* @method _runFrame
* @private
* @static
*/
_runFrame: function() {
var done = true,
anim;
done = false;
}
}
if (done) {
}
},
cubicBezier: function(p, t) {
var x0 = 0,
y0 = 0,
x1 = p[0],
y1 = p[1],
x2 = p[2],
y2 = p[3],
x3 = 1,
y3 = 0,
D = x0,
H = y0,
x = (((A*t) + B)*t + C)*t + D,
y = (((E*t) + F)*t + G)*t + H;
return [x, y];
},
easings: {
'ease-in': [0.42, 0, 1, 1],
'ease-out': [0, 0, 0.58, 1],
'ease-in-out': [0.42, 0, 0.58, 1]
},
_running: {},
_timer: null,
}, true);
Transition.behaviors.top = Transition.behaviors.bottom = Transition.behaviors.right = Transition.behaviors.left;
Y.Transition = Transition;