snowflake_latice
HTML
<script src="https://unpkg.com/vue-perfectlooper"></script>
<link rel="stylesheet" href="https://admiralpotato.github.io/vue-perfectlooper/demo.css">
<div id="app" class="container">
<div v-for="item in animationList">
<h2>{{item.id}}</h2>
<vue-perfectlooper v-bind="item"></vue-perfectlooper>
</div>
</div>
JavaScript
Vue.component('vue-perfectlooper', VuePerfectlooper);
let base = 'http://root.nuclearpixel.com/animation_frames/misterymyra_collaboration-snowflake_lattice/';
let animationNameList =
`00-comp_a
00-comp_b
00-comp_c
01-comp_a
01-comp_b
01-comp_c
02-comp_a
02-comp_b
02-comp_c
03-comp_a
03-comp_b
03-comp_c
04-comp_a
04-comp_b
04-comp_c
05-comp_a
05-comp_b
05-comp_c
06-comp_a
06-comp_d
06-comp_e`.split('\n').reverse();
let animationList = animationNameList.map(function(animationName){
let split = animationName.split(' ');
let path = split[0];
let frames = split.length > 1 ? parseInt(split[1], 10) : 48;
return {
"id": animationName,
"poster": base + path + "/0001.png",
"src": base + path,
"frames": frames,
"suffix": ".png",
framerate: 48
}
});
new Vue({
el: '#app',
data: {
animationList: animationList
}
});