-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
executable file
·197 lines (184 loc) · 5.64 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
<!DOCTYPE html>
<html lang="cn">
<head>
<meta charset="UTF-8">
<meta content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1" name="viewport">
<meta content="ie=edge" http-equiv="X-UA-Compatible">
<link href="./assets/mipmap/[email protected]" rel="icon">
<title>PassionPenguin/RailMapMaker</title>
<style>
html, body {
background: var(--white);
margin: 0;
overflow: hidden;
}
#drawable {
position: absolute;
left: 0;
top: 0;
z-index: 1;
}
#cursor {
overflow: hidden;
width: 5px;
height: 5px;
background: #8b0000;
position: fixed;
z-index: 2;
transition: 50ms;
border-radius: 50%;
transform: translate(-50%, -50%)
}
#scroll-use {
width: 100vw;
height: 100vh;
position: relative;
}
#pg-app {
width: 100vw;
height: 100vh;
overflow: scroll;
position: relative
}
#resSvg {
position: absolute;
left: 0;
top: 0
}
#lineEditorPrompt {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 400px;
background: #fff;
z-index: 2;
border-radius: 10px 10px 0 0
}
#lineEditorColorPicker, #lineEditorNameInput, #lineEditorOpacityPicker {
display: block;
width: 200px;
height: 36px;
background: 0 0;
border: 0;
outline: 0;
font: 14px/1 Anodina, sans-serif;
text-align: left;
margin: 0 auto;
white-space: pre;
color: #444
}
#lineEditorPrompt .typeInfo {
width: 200px;
height: 24px;
text-align: left;
margin: 20px auto 0;
font: 900 12px/2 Anoidina, sans-serif;
padding-left: 15px
}
.toggle-Helper {
position: fixed;
bottom: 0;
right: 0;
width: 96px;
height: 48px;
background: var(--white);
text-align: center;
z-index: 999;
user-select: none;
}
.toggle-Helper .mi, .helper_list_item > .mi {
vertical-align: middle;
font: 18px/36px 'Material Icons', sans-serif;
margin-right: 12px;
}
.helper_list {
position: fixed;
bottom: 44px;
right: 0;
width: 96px;
background: var(--white);
z-index: 1001;
user-select: none;
}
.helper_list_item {
display: block;
margin: 10px 0;
text-align: center;
}
</style>
<link href="./manifest.webmanifest" rel="manifest">
</head>
<body>
<div id="scroll-use">
<div id="pg-app"></div>
</div>
<script src="./dist/libs/build.package.js"></script>
<script>
window.pg = {
$: e => {
return document.querySelectorAll(e)
},
};
window.Int = val => {
return parseInt(val)
};
window.cE = data => {
if (data === undefined) data = {
type: 'div',
attr: [],
innerText: undefined,
innerHTML: undefined,
onclick: undefined
};
let e = document.createElement(data.type);
if (data.attr !== undefined) data.attr.forEach(attr => {
e.setAttribute(attr[0], attr[1])
});
if (data.innerText !== undefined) e.innerText = data.innerText;
if (data.innerHTML !== undefined) e.innerHTML = data.innerHTML;
if (data.onclick !== undefined) e.onclick = e => {
data.onclick(e)
};
return e
};
window.min = val => {
return val % 25 > 12.5 ? val + (25 - (val % 25)) : val - (val % 25)
};
if (!Array.prototype.last) {
Array.prototype.last = function () {
return this[this.length - 1]
}
}
builder.importScripts(['./dist/libs/bundle/PenguinUI/bundle.PenguinUI.js', "./dist/libs/bundle/ColorUtils/bundle.colorUtils.js"], () => {
initPenguinUI(() => {
ProgressManager.create(0, 0, 0);
builder.init(() => {
initInterface(0);
if ('serviceWorker' in navigator && !builder.debugMode) {
navigator.serviceWorker
.register('./ServiceWorker.js')
.then(() => {
builder.debug("PassionPenguin/RailMapMaker", "Main Script", "Service", "Service Worker Registered");
if (CookieManager.get("popup_swRegistered") !== "true")
NotificationManager.create(strings.serviceWorkerDescription, 999, {
icon: "settings",
priority: 2
});
CookieManager.set("popup_swRegistered", "true");
});
}
});
})
});
window.installAppPrompt = null;
window.addEventListener('beforeinstallprompt', (e) => {
// Prevent the mini-infoBar from appearing on mobile
e.preventDefault();
// Stash the event so it can be triggered later.
window.installAppPrompt = e;
// Update UI notify the user they can install the PWA
});
</script>
</body>
</html>