warm_wooden_toy_revisited
by Admiral Potato
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/warm_wooden_toy_revisited/warm_wooden_toy_revisited-';
let animationNameList =
`00 48 000000 000001.png
01-comp_a 48 0000 0001.png`.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": path,
"poster": base + path + "/" +split[3],
"src": base + path,
"frames": frames,
"sequenceTemplate": split[2],
"suffix": ".png"
}
});
new Vue({
el: '#app',
data: {
animationList: animationList
}
});