Skip to content

Instantly share code, notes, and snippets.

@salmanyaqoob
Created January 28, 2021 08:42
Show Gist options
  • Select an option

  • Save salmanyaqoob/feb0945118cee8372d2eb34faf1e79e9 to your computer and use it in GitHub Desktop.

Select an option

Save salmanyaqoob/feb0945118cee8372d2eb34faf1e79e9 to your computer and use it in GitHub Desktop.
Animator Screen JS
import utils from '../../common/utils.js';
export default {
data: {
images: [
{ src: '/common/pic1.png' },
{ src: '/common/pic2.png' },
{ src: '/common/pic3.png' },
{ src: '/common/pic4.png' },
{ src: '/common/pic5.png' },
{ src: '/common/pic6.png' },
],
handleClick() {
const animator = this.$refs.animator; // Obtain the DOM element whose ref attribute is animator.
const state = animator.getState();
console.log(state);
if (state === 'paused') {
animator.resume();
} else if (state === 'stopped') {
animator.start();
} else {
animator.pause();
}
},
backAction() {
utils.backToHome();
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment