forked from Wizcorp/tina.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSSTween.js
26 lines (22 loc) · 844 Bytes
/
CSSTween.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var Tween = require('./Tween');
/**
*
* @classdesc
* Manages transition of properties of an object
*
* @param {object} object - Object to tween
* @param {array} properties - Properties of the object to tween
*
*/
function CSSTween(object, properties) {
if ((this instanceof CSSTween) === false) {
return new CSSTween(object, properties);
}
var tweenedObject = (typeof object === 'string') ? document.querySelector(object) : object;
// TODO: change inheritance to NestedTween for support of css transform properties
// and add an internal method for replacing unprefixed properties by prefixed properties when necessary
Tween.call(this, tweenedObject.style, properties);
}
CSSTween.prototype = Object.create(Tween.prototype);
CSSTween.prototype.constructor = CSSTween;
module.exports = CSSTween;