-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
182 lines (168 loc) · 9.79 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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>wtherion</title>
<meta name="description" content="A web-based Therion map editor">
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#3AAB75">
<meta name="built-at" content="<%= builtAt %>">
<link rel="icon" href="assets/web-icons/favicon.ico" sizes="any">
<link rel="apple-touch-icon" href="assets/web-icons/apple-touch-icon.png">
<!-- Inlined style for loading screen -->
<style>
.loadingScreen {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: white;
opacity: 1;
z-index: 200;
transition: opacity 0.5s ease;
display: flex;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
flex-direction: column;
justify-content: center;
align-items: center;
}
.loadingScreen.disabled {
display: none;
}
</style>
</head>
<body>
<canvas id="paperCanvas" data-paper-resize="true" data-paper-hidpi="off"></canvas>
<div id="loadingScreen" class="loadingScreen">
<div class="panel"><%= loc.loading %></div>
</div>
<!-- Main Menu -->
<nav class="appNav" id="appNav">
<ul class="topMenu">
<li class="topMenuButton">
<svg class="burgerButton" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><line stroke-width="12" x1="0" y1="9.5" x2="100" y2="9.5"/><line stroke-width="12" x1="0" y1="50.5" x2="100" y2="50.5"/><line stroke-width="12" x1="0" y1="90.5" x2="100" y2="90.5"/></svg>
<%= loc.menu.main %>
<ul class="subMenu">
<li onclick="pg.menu.handlers.clearDocument()"><%= loc.menu.new %></li>
<li onclick="pg.menu.handlers.open()"><%= loc.menu.open %></li>
<li onclick="pg.menu.handlers.saveJSON()"><%= loc.menu.save %></li>
<li onclick="pg.menu.handlers.saveJSON(true)"><%= loc.menu.saveAs %></li>
<li class="space"></li>
<li onclick="pg.menu.handlers.undo()" class="halfWidth left"><%= loc.menu.undo %></li>
<li onclick="pg.menu.handlers.redo()" class="halfWidth right"><%= loc.menu.redo %></li>
<li class="space"></li>
<li class="importMenu hasSubSubMenu"><%= loc.menu.import %>
<ul class="subSubMenu">
<li><%= loc.menu.json %><input id="fileUploadJSON" class="fileUploadInput" type="file" accept=".json" ></li>
<li class="importImage_button"><%= loc.menu.image %><input id="fileUploadImage" class="fileUploadInput" type="file" accept=".gif, .jpg, .jpeg, .png" ></li>
<li class="importImageFromURL_button"><%= loc.menu.imageFromURL %></li>
<li class="importSVG_button"><%= loc.menu.svg %><input id="fileUploadSVG" class="fileUploadInput" type="file" accept=".svg" ></li>
<li class="importSVGFromURL_button"><%= loc.menu.svgFromURL %></li>
<li class="importTH2_button"><%= loc.menu.th2 %><input id="fileUploadTH2" class="fileUploadInput" type="file" accept=".th2" ></li>
<li class="importXVI_button"><%= loc.menu.xvi %><input id="fileUploadXVI" class="fileUploadInput" type="file" accept=".xvi" ></li>
</ul>
</li>
<li onclick="pg.menu.handlers.exportTH2()"><%= loc.menu.export %></li>
<li onclick="pg.menu.handlers.exportTH2(true)"><%= loc.menu.exportAs %></li>
<li class="space"></li>
<li class="exportMenu hasSubSubMenu"><%= loc.menu.otherExports %>
<ul class="subSubMenu">
<li onclick="pg.menu.handlers.exportImage()"><%= loc.menu.image %></li>
<li onclick="pg.menu.handlers.exportSVG()"><%= loc.menu.svg %></li>
<li onclick="pg.menu.handlers.downloadJSON()"><%= loc.menu.downloadSave %></li>
</ul>
</li>
<li class="space"></li>
<li class="hasSubSubMenu"><%= loc.menu.view %>
<ul class="subSubMenu">
<li onclick="pg.menu.handlers.panToScrap()"><%= loc.menu.center %></li>
<li onclick="pg.menu.handlers.zoomIn()" title="Ctrl-ScrollUp"><%= loc.menu.zoomIn %></li>
<li onclick="pg.menu.handlers.zoomOut()" title="Ctrl-ScrollDown"><%= loc.menu.zoomOut %></li>
<li onclick="pg.menu.handlers.resetZoom()" title="Ctrl-1"><%= loc.menu.resetZoom %></li>
<li onclick="pg.menu.handlers.resetPan()"><%= loc.menu.resetPan %></li>
</ul>
</li>
<li class="space"></li>
<li onclick="pg.menu.handlers.resetSettings()"><%= loc.menu.resetSettings %></li>
<li class="space"></li>
<li onclick="pg.menu.handlers.showConfigEditor()"><%= loc.menu.showConfigEditor %></li>
<li class="space"></li>
<li onclick="pg.menu.handlers.about()" title="About"><%= loc.menu.about %></li>
</ul>
</li>
<li class="topMenuButton"><%= loc.menu.scraps %>
<ul class="subMenu">
<li onclick="pg.menu.handlers.layerPanel()" title="Scrap Panel"><%= loc.menu.scrapPanel %></li>
<li onclick="pg.editTH2.showScrapOptionsPanel()"><%= loc.menu.editScrap %></li>
<li onclick="pg.menu.handlers.xviMode()"><%= loc.menu.xviEdit %></li>
</ul>
</li>
<li class="topMenuButton"><%= loc.menu.tool %>
<ul class="subMenu" id="toolSubMenu">
</ul>
</li>
</ul>
</nav>
<div id="toolSettingsBar" class="hidden">
<div class="">Settings</div>
<div class="settingsBarContainer"></div>
</div>
<div id="toolbar" class="toolbar">
<!-- Tools Container -->
<div class="toolsContainer toolbarSection"></div>
</div>
<div id="statusBar" class="statusBar">
<div id="modeInfo" class="statusBarSection hidden"><%= loc.menu.xviEdit %></div>
<div id="selectionInfoBar" class="statusBarSection">
<div id="selectionTypeLabel" class="selectionTypeLabel"></div>
</div>
<!-- Zoom Container -->
<div class="zoomContainer statusBarSection">
<label class="zoomLabel"><%= loc.zoom %></label>
<input type="number" min="0" max="6000" maxlength="4" id="zoomInput" value="100" class="zoomInput comboInput"/>
<select id="zoomSelect" class="zoomSelect comboSelect">
<option class="hidden" selected value=""></option>
<option value="10">1000%</option>
<option value="5">500%</option>
<option value="3">300%</option>
<option value="2">200%</option>
<option value="1.5">150%</option>
<option value="1">100%</option>
<option value="0.5">50%</option>
<option value="0.2">20%</option>
<option value="0.1">10%</option>
</select>
</div>
</div>
<div id="codeEditorContainer" class="codeEditorContainer hidden">
<nav class="codeEditorButtons appNav">
<ul class="topMenu">
<li id="runScriptButton" class="runScriptButton">Run</li>
</ul>
</nav>
<textarea id="codeEditorArea" class="codeEditorArea"></textarea>
<div class="consoleOutput" id="consoleOutput"><div id="clearConsoleButton" class="clearConsoleButton">Clear</div></div>
</div>
<div id="menuInputBlocker" class="menuInputBlocker hidden"></div>
<div id="colorInputBlocker" class="colorInputBlocker hidden"></div>
</body>
<% if (isProduction) { %>
<script>
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker
.register("service-worker.js")
.then((registration) => {
console.log("Service Worker registered: ", registration);
})
.catch((registrationError) => {
console.error("Service Worker registration failed: ", registrationError);
});
});
}
</script>
<% } %>
</html>