First commit
This commit is contained in:
67
application/demo/animations/animation.rotate.js
Normal file
67
application/demo/animations/animation.rotate.js
Normal file
@@ -0,0 +1,67 @@
|
||||
|
||||
|
||||
import panelRow from '/elements/panel/row.js';
|
||||
|
||||
import label from '/elements/label.js';
|
||||
|
||||
|
||||
class animationBlock{
|
||||
|
||||
width = 100;
|
||||
|
||||
height = 100;
|
||||
|
||||
margin = 20;
|
||||
|
||||
background = "#03a9f4";
|
||||
|
||||
create() {
|
||||
|
||||
this.animation = this.createAnimation("rotateAnimation");
|
||||
|
||||
var key = this.animation.createKeyFrame( 0 );
|
||||
|
||||
key.setProperty( "rotate", "0deg" );
|
||||
|
||||
|
||||
var key = this.animation.createKeyFrame( 20 );
|
||||
|
||||
key.setProperty( "rotate", "60deg" );
|
||||
|
||||
|
||||
var key = this.animation.createKeyFrame( 60 );
|
||||
|
||||
key.setProperty( "rotate", "120deg" );
|
||||
|
||||
|
||||
var key = this.animation.createKeyFrame( 100 );
|
||||
|
||||
key.setProperty( "rotate", "0deg" );
|
||||
|
||||
}
|
||||
|
||||
async click() {
|
||||
|
||||
this.animation.play("2s");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class rowLabel extends label{
|
||||
|
||||
flex = "1";
|
||||
|
||||
}
|
||||
|
||||
|
||||
export default class row extends panelRow{
|
||||
|
||||
boxWidth = "95%"
|
||||
|
||||
rowLabel = new rowLabel("Rotate");
|
||||
|
||||
animationBlock = new animationBlock();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user