Added custom animation curve support and spring animations

This commit is contained in:
Tsvetan Raikov
2016-02-09 14:50:32 +02:00
parent 630daa03e9
commit cc92fc329f
7 changed files with 212 additions and 42 deletions

View File

@@ -27,6 +27,21 @@ export interface PropertyAnimation {
curve?: any;
}
export class CustomAnimationCurve implements definition.CustomAnimationCurve {
public x1: number;
public y1: number;
public x2: number;
public y2: number;
constructor(x1: number, y1: number, x2: number, y2: number) {
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
}
}
export class Animation implements definition.Animation {
public _propertyAnimations: Array<PropertyAnimation>;
public _playSequentially: boolean;
@@ -98,7 +113,7 @@ export class Animation implements definition.Animation {
}
var propertyAnimations = new Array<PropertyAnimation>();
// opacity
if (animationDefinition.opacity !== undefined) {
propertyAnimations.push({