tatsuya_m_tribute

by Admiral Potato

HTML

<script src="https://unpkg.com/vue@2"></script>
<link rel="stylesheet" href="https://admiralpotato.github.io/vue-perfectlooper/demo.css">
<script src="https://cdn.jsdelivr.net/npm/vue-perfectlooper"></script>
<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);
const base = 'http://root.nuclearpixel.com/animation_frames/tatsuya_m_tribute/';
const animationNameList = 
`03-comp_a 64
04-comp_a 64
05-comp_a 64
06-comp_a 64
07-comp_a 64
08-comp_a 64`.split('\n').reverse();
const animationList = animationNameList.map(function(animationName){
	const split = animationName.split(' ');
	const path = split[0];
	const 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: 24
	}
});
new Vue({
	el: '#app',
	data: {
		animationList: animationList
	}
});