scenejs
scenejs copied to clipboard
how to update keyframes? i try to use this way to update keyframes,but it is no change?
html
<div class="wrapper">
<div class="circle-area">
<ngx-scene
#scene
[keyframes]="keyframes2"
fillMode="forwards"
easing="ease-in-out"
(sceneAnimate)="onAnimate($event)"
(scenePlay)="onPlay($event)"
(scenePaused)="onPaused($event)"
>
<div class="circles">
<div class="circle circle1"></div>
<div class="circle circle2"></div>
<div class="circle circle3"></div>
</div>
</ngx-scene>
<div class="player">
<div [class]="playState" (click)="onClick()"></div>
<input
class="progress"
type="range"
[value]="time"
min="0"
max="100"
(input)="onInput($event)"
/>
</div>
</div>
</div>
ts
keyframes2 = {};
ngAfterViewInit() {
this.keyframes2 = {
item1: {
0: {
display: 'none',
},
1: {
display: 'block',
opacity: 0,
},
2: {
opacity: 1,
},
},
item2: {
2: {
opacity: 1,
},
},
};
const tl = new Timeline(this.scene.getItem(), this.timeline.nativeElement, {
keyboard: true,
});
tl.on('select', (e: SelectEvent) => {
console.log(e.selectedItem);
});
}
}

I try to use this way to update keyframes,but it is no change?
ngAfterViewInit() {
const frame = {
item1: {
0: {
display: 'none',
},
1: {
display: 'block',
opacity: 0,
},
2: {
opacity: 1,
},
},
item2: {
2: {
opacity: 1,
},
},
};
const a = this.scene.getItem();
a.set(frame);
console.log(a);
}
is it right? This way can change it

@qikong333
Oh sorry. The scenejs for the framework can only be set at the init.
You have to do it like you did.
@qikong333
Oh sorry. The
scenejsfor the framework can only be set at the init.You have to do it like you did.
ok ,thinks