diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2021-12-22 13:59:13 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2021-12-22 13:59:13 +0100 |
commit | 96ee00242f350b391dcc1cf4d72a442c969f565e (patch) | |
tree | a9c57feb105200556c76559b3c775d159c98aef9 /web/pw-frontend/src/lib/Visualizer.svelte | |
parent | 218ebc3b8f5024a0813f8378b83d91dbb9aa7db2 (diff) | |
download | planetwars.dev-96ee00242f350b391dcc1cf4d72a442c969f565e.tar.xz planetwars.dev-96ee00242f350b391dcc1cf4d72a442c969f565e.zip |
add pw-frontend
Diffstat (limited to 'web/pw-frontend/src/lib/Visualizer.svelte')
-rw-r--r-- | web/pw-frontend/src/lib/Visualizer.svelte | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/web/pw-frontend/src/lib/Visualizer.svelte b/web/pw-frontend/src/lib/Visualizer.svelte new file mode 100644 index 0000000..35b0677 --- /dev/null +++ b/web/pw-frontend/src/lib/Visualizer.svelte @@ -0,0 +1,49 @@ +<script lang="ts"> + import { onMount } from 'svelte'; + import * as visualizer from '../lib/visualizer/index'; + + onMount(() => { + visualizer.init(); + fetch("match.log") + .then(response => response.text()) + .then(data => visualizer.set_instance(data)); + }); +</script> + +<div id="main" class="loading"> + <canvas id="canvas" /> + <div id="name" /> + <div id="addbutton" class="button" /> + + <div id="meta"> + <div id="turnCounter">0 / 0</div> + <div> + <span>Ms per frame: </span> + <input type="number" id="speed" value="300" /> + </div> + <div class="slidecontainer"> + <input + type="range" + min="0" + max="1" + value="1" + class="slider" + id="turnSlider" + /> + </div> + </div> + <div class="lds-roller"> + <div /> + <div /> + <div /> + <div /> + <div /> + <div /> + <div /> + <div /> + </div> +</div> + +<style scoped> + @import 'visualizer/style.css'; +</style> |