forked from betairylia/dragalialost-dbm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
258 lines (226 loc) · 10.2 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<!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>Dragalia Lost timelines</title>
<link rel = "stylesheet" type = "text/css" href = "loading-bar/dist/loading-bar.css"/>
<link rel = "stylesheet" type = "text/css" href = "UIDesign/css/normalize.min.css">
<link rel = "stylesheet" type = "text/css" href = "UIDesign/css/main.css">
<link rel = "stylesheet" type = "text/css" href = "style.css"/>
<script type = "text/javascript" src = "loading-bar/dist/loading-bar.js"></script>
<script type = "text/javascript" src = "js/localization.js"></script>
<script type = "text/javascript" src = "js/renderer.js"></script>
<script type = "text/javascript" src = "js/timeline.js"></script>
</head>
<body>
<template id = 'bigTimer'>
<div class = 'timer bigTimer'>
<div class = 'ld' style = "width: 100%; height: 100%; margin: auto;"></div>
<div class = 'labels'>
<div class = 'name_label'></div>
<div class = 'time_label'></div>
</div>
</div>
</template>
<template id = 'basicTimer'>
<li class = 'timer basicTimer'>
<!-- <div class = 'ld' style = "width: 100%; height: fit-content;"></div> -->
<div class = 'timerBar'>
<div class = 'bar'></div>
<div class = 'bg'></div>
</div>
<div class = 'labels'>
<div class = 'name_label'></div>
<div class = 'time_label'></div>
</div>
</li>
</template>
<template id = "timelineEventItem">
<ul class = "timeline-event">
<p id = "idx">
1.
</p>
<p>
(R)
<input id = "min" type = "text" size = "1"/>
m
<input id = "sec" type = "text" size = "1" style = "width: 2.2em;"/>
s
</p>
<p>
<select id = "action">
</select>
</p>
</ul>
</template>
<template id = "timelineTreeBlock">
<div class = "timeline-block">
<div class = "title">
</div>
<div class = "contents">
<li class = "timeline-content-list">
</li>
</div>
</div>
</template>
<div class = 'overlay' id = 'import-export'>
<textarea id = 'stringIOBox'></textarea>
<div id = 'buttons'>
<button onclick = "ImportText()" class = "BTNred autoLoc_importNew" style = "flex: 1;"> Import from text </button>
<button onclick = "RemoveSpace()" class = "BTNred autoLoc_removeSpc" style = "flex: 1;"> Remove spaces </button>
<button onclick = "HideOverlay()" class = "BTNred autoLoc_close" style = "flex: 1;"> Close </button>
</div>
</div>
<div id = 'mainFrame'>
<div class = 'leftcontainer'>
<div class = 'fixwrapper'>
<div id = 'menu' class = 'mainMenu'>
<div style = "padding: 10px 0px; display: flex; justify-content: space-between;">
<button onclick = "resetAll()" class = "BTNred autoLoc_reload" style = "flex: 1;"> Reload everything </button>
<button id = "btnAudio" class = "BTNred autoLoc_audioOff" onclick = "enableSound = !enableSound; updateAudioButton()" style = "flex: 1;"> Audio </button>
</div>
<form id = 'mainMenu'>
<div class = 'smallform'>
<label for = 'language'>语言 / Languages / 言語</label>
<select id = "language" name = 'language' onchange = "resetAll();">
<option value = "en-us">English</option>
<option value = "zh-cn" selected>中文(简体)</option>
</select>
</div>
<div class = 'smallform' style = 'margin-right: 0;'>
<label for = 'boss'>Boss:</label>
<select id = 'boss' name = 'boss' onchange = "resetAll();">
<option class = "autoLoc_HBH" value = "HBH">High Brunhilda</option>
<option class = "autoLoc_MHBH" value = "MHBH" selected>High Brunhilda (Master)</option>
<option class = "autoLoc_HMC" value = "HMC">High Mercury</option>
<option class = "autoLoc_HJP" value = "HJP">High Jupiter</option>
</select>
</div>
</form>
</div>
<div class = "controlCenter">
<div class = "containerTitle autoLoc_controlPanel">控制面板</div>
<div class = "containerBox">
<button onclick = "playing = !playing;" class = "BTNwhite autoLoc_play-pause"> Pause / Play </button>
<button onclick = "tl.reset(); playing = false;" class = "BTNwhite autoLoc_stop"> Stop </button>
<button onclick = "tl.adjust(-0.5);" class = "BTNwhite"> + 0.5s (←) </button>
<button onclick = "tl.adjust(0.5);" class = 'BTNwhite'> - 0.5s (→) </button>
<button onclick = "ShowOverlay();" class = 'BTNwhite autoLoc_save-load'> Import / Export </button>
<!-- <span><input type="checkbox" id="enableAudio" class = "autoLoc_audio" onclick="var cb = document.getElementById('enableAudio'); enableSound = cb.checked;"/> Audio</span> -->
</div>
</div>
<div class = "detailCenter">
<div class="autoLoc_timeline-preview containerTitle">Timeline preview</div>
<div id = "timeline_container" class="containerBox long-preview">
<!-- <div class="oneline">
<p>初始状太(标准:5m 0s)</p> <input id="BTNred" type="submit" value="RESET">
</div>
<div class="innerform">表格在这里</div> -->
</div>
</div>
</div>
</div>
<div id = 'timers'>
<div id = 'mainTimer' class = 'framePanel'>
<div id = 'specialComment'>
<p><button onclick="tl.trigger('break');">BREAK</button></p>
<p>Space bar (up) = <strong> BREAK !! </strong></p>
</div>
<div id = 'upcomingTimers'>
<p class = 'name_label autoLoc_next' style = "font-size: 12px">接下来</p>
<div id = 'upcomingTimerContainer'>
</div>
</div>
<div id = 'mainTimerContainer' class = 'framePanel'>
</div>
</div>
<ul id = 'subTimerContainer' class = 'framePanel'></ul>
</div>
</div>
<p style="position: absolute; bottom: 0; right: 1em"><a href="https://github.com/betairylia/dragalialost-dbm">github</a></p>
<script>
var tl;
var renderer;
var tlRender;
var playing = false;
var custom_cnt = 0;
var custom_str = [];
var overlay = document.querySelector('div.overlay');
function resetAll()
{
setLocale(document.getElementById('language').value);
document.getElementById("timeline_container").innerHTML = "";
document.getElementById("subTimerContainer").innerHTML = "";
document.getElementById("mainTimerContainer").innerHTML = "";
document.getElementById("upcomingTimerContainer").innerHTML = "";
tl = new Timeline(document.getElementById("boss").value);
renderer = new Renderer("mainTimerContainer", "subTimerContainer", "upcomingTimerContainer", tl);
tlRender = new TLRenderer("timeline_container", "timelineEventItem", "timelineTreeBlock", tl);
// Set color
let root = document.documentElement;
root.style.setProperty('--main-color', tl.mainColor);
root.style.setProperty('--dark-main-color', LightenDarkenColor(tl.mainColor, -60));
updateAudioButton();
}
function ImportText()
{
var str = document.getElementById('stringIOBox').value;
custom_str.push(str);
custom_cnt += 1;
tl.fromString(str);
var option = document.createElement("option");
option.text = `${tl.name[document.locale]}-${custom_cnt}`;
option.value = `${custom_cnt - 1}`;
option.selected = true;
document.querySelector("select#boss").add(option);
resetAll();
}
function HideOverlay()
{
overlay.style.display = 'none';
}
function ShowOverlay()
{
document.getElementById('stringIOBox').value = tl.getString();
overlay.style.display = 'flex';
}
function RemoveSpace()
{
document.getElementById('stringIOBox').value = tl.getString(false);
}
var r = document.getElementById("subTimerContainer");
document.onkeyup = function(ev)
{
if(ev.key == ' ')
{
tl.trigger('break');
}
if(ev.keyCode == 37) // <-
{
tl.adjust(-0.5);
}
if(ev.keyCode == 39) // ->
{
tl.adjust(0.5);
}
}
let lastTime = Date.now();
function upd()
{
let nowTime = Date.now();
let dt = nowTime - lastTime;
lastTime = nowTime;
if(this.playing)
{
tl.update(dt / 1000.0);
}
renderer.render();
requestAnimationFrame(upd);
}
resetAll();
upd();
</script>
</body>
</html>