-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
74 lines (72 loc) · 3.85 KB
/
index.html
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>WPT Filmstrip</title>
<!-- <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> -->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<link rel="stylesheet" href="https://gitcdn.link/repo/Chalarangelo/mini.css/master/dist/mini-dark.min.css">
<link rel="stylesheet" href="filmstrip.css">
</head>
<body>
<div id="app">
<div class="header">
<h2>
WPT Filmstrip </small><a v-if="waterfallUrl" :href="waterfallUrl" target="_blank">{{testLabel}}<span class="icon-link"></span></a>
</h2>
<a class="github-link" href="https://github.com/iteratec/wpt-filmstrip">GitHub</a>
<div class="testSelection">
<input class="testUrl" :value="state.testUrl" @change="loadDataByUrl($event.target.value)" placeholder="181122_MY_testid OR https://mywpt.com/result/181122_MY_testid" />
<button type="button" @click="loadData" class="primary">Load Test</button>
<label>Run:</label>
<select :value="state.run" @change="selectRun($event.target.value)">
<option v-for="i in availableRuns" :value="i">{{i}}</option>
</select>
<label>Step:</label>
<select :value="state.step" @change="selectStep($event.target.value)">
<option v-for="(name, index) in availableSteps" :value="index + 1">{{name}}</option>
</select>
<div class="button-group">
<button @click="store.setView('animation')" :class="{primary: showAnimation}">Animation</button>
<button @click="store.setView('filmstrip')" :class="{primary: !showAnimation}">Filmstrip</button>
</div>
</div>
</div>
<main>
<div v-if="loading" class="spinner"></div>
<p v-else-if="error" class="card error">{{ error }}</p>
<filmstrip-animation v-else-if="showAnimation && stepData" :step-data="stepData" :timings="timings"></filmstrip-animation>
<filmstrip-view v-else-if="stepData" :step-data="stepData" :timings="timings"></filmstrip-view>
<div v-else class="empty-state">
<h3>Run a test on <a :href="state.wptUrl" target="_blank">WebPagetest</a> and enter the result URL or test ID to explore its filmstrip.</h3>
<p>Example: <a href="https://iteratec.github.io/wpt-filmstrip/#testId=181222_H8_48d7b7cb240cb62a7f4faa4b38482501&run=2&step=2">https://iteratec.github.io/wpt-filmstrip/#testId=181222_H8_48d7b7cb240cb62a7f4faa4b38482501&run=2&step=2</a></p>
<p>Check out the <a href="https://github.com/iteratec/wpt-filmstrip">documentation</a> for more information.</p>
</div>
</main>
<div class="collapse" v-if="timings.length">
<input type="checkbox" id="collapse-metrics" aria-hidden="true">
<label for="collapse-metrics" aria-hidden="true">Show Metrics</label>
<div>
<table class="horizontal striped">
<thead>
<tr>
<th v-for="timing in timings">{{ timing.name }}</th>
</tr>
</thead>
<tbody>
<tr>
<td v-for="timing in timings">{{ timing.value.toFixed(3) }}s</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="framePreload">
<img v-for="url in frameImages" :src="url" />
</div>
</div>
<script src="filmstrip.js"></script>
</body>
</html>