aboutsummaryrefslogtreecommitdiff
path: root/web/pw-frontend/src/lib/Visualizer.svelte
blob: 35b0677657b3115d1a56c505fac27dd7212746f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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:&nbsp;</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>