q78kgblog 1.0.4 → 2.0.0-1711191136897
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/404.html +10 -10
- package/BingSiteAuth.xml +3 -3
- package/about/index.html +14 -14
- package/archives/2022/06/index.html +11 -11
- package/archives/2022/index.html +11 -11
- package/archives/2023/02/index.html +11 -11
- package/archives/2023/04/index.html +11 -11
- package/archives/2023/05/index.html +11 -11
- package/archives/2023/08/index.html +11 -11
- package/archives/2023/09/index.html +11 -11
- package/archives/2023/index.html +11 -11
- package/archives/2024/01/index.html +11 -11
- package/archives/2024/02/index.html +11 -11
- package/archives/2024/index.html +11 -11
- package/archives/index.html +11 -11
- package/atom.xml +41 -41
- package/baidusitemap.xml +18 -18
- package/bangumis/index.html +16 -16
- package/bigpie/index.html +12 -12
- package/categories/Hello-World/index.html +11 -11
- package/categories/Hexo/index.html +11 -11
- package/categories/index.html +12 -12
- package/categories//345/271/264/347/273/210/346/200/273/347/273/223/index.html +11 -11
- package/categories//346/201/260/351/245/255/index.html +11 -11
- package/categories//347/264/240/346/235/220/index.html +11 -11
- package/categories//351/227/262/350/201/212/346/235/202/350/260/210/index.html +11 -11
- package/content.json +1 -1
- package/css/ariasakablog.css +1 -1
- package/css/iconfont.css +4 -4
- package/essay/index.html +10 -10
- package/fcircle/index.html +12 -12
- package/fontawesome/index.html +12 -12
- package/index.html +21 -21
- package/links/index.html +47 -20
- package/live2d-widget/LICENSE +674 -674
- package/live2d-widget/README.md +188 -188
- package/live2d-widget/autoload.js +63 -63
- package/live2d-widget/demo/demo.html +34 -34
- package/live2d-widget/demo/login.html +271 -271
- package/live2d-widget/live2d.min.js +1 -1
- package/live2d-widget/package.json +31 -31
- package/live2d-widget/rollup.config.js +38 -38
- package/live2d-widget/src/index.js +178 -178
- package/live2d-widget/src/message.js +22 -22
- package/live2d-widget/src/model.js +75 -75
- package/live2d-widget/src/tools.js +78 -78
- package/live2d-widget/src/utils.js +5 -5
- package/live2d-widget/src/waifu-tips.js +3 -3
- package/live2d-widget/waifu-tips.js +5 -5
- package/live2d-widget/waifu-tips.json +255 -255
- package/live2d-widget/waifu.css +310 -310
- package/noie.html +68 -68
- package/othersite/index.html +11 -11
- package/package.json +1 -1
- package/people.html +23 -23
- package/posts/164ef646/index.html +14 -14
- package/posts/228c2ef8/index.html +15 -15
- package/posts/4a17b156/index.html +14 -14
- package/posts/6f3c565b/index.html +14 -14
- package/posts/7da7c3f6/index.html +14 -14
- package/posts/a9a6c1fb/index.html +14 -14
- package/posts/c262e439/index.html +14 -14
- package/posts/c81531cf/index.html +14 -14
- package/posts/da2093a1/index.html +14 -14
- package/posts/e54f7476/index.html +14 -14
- package/projects.html +423 -423
- package/random.html +15 -17
- package/robots.txt +17 -17
- package/search.xml +10 -10
- package/sitemap.txt +15 -17
- package/sitemap.xml +79 -97
- package/sw.js +1 -1
- package/tags/AI/index.html +12 -12
- package/tags/Butterfly/index.html +12 -12
- package/tags/Cloudflare/index.html +12 -12
- package/tags/DiffSinger/index.html +12 -12
- package/tags/Hexo/index.html +12 -12
- package/tags/Next/index.html +12 -12
- package/tags/RAID/index.html +12 -12
- package/tags/VPS/index.html +12 -12
- package/tags/Vercel/index.html +12 -12
- package/tags/Workers/index.html +12 -12
- package/tags/hello-world/index.html +12 -12
- package/tags/index.html +12 -12
- package/tags//344/270/273/351/242/230/index.html +12 -12
- package/tags//344/272/221/346/234/215/345/212/241/345/231/250/index.html +12 -12
- package/tags//344/276/277/345/256/234/index.html +12 -12
- package/tags//345/206/231/344/275/234/index.html +12 -12
- package/tags//345/245/263/346/200/247/346/204/217/350/257/206/index.html +12 -12
- package/tags//345/255/246/344/271/240/index.html +12 -12
- package/tags//345/256/266/351/207/214/344/272/221/index.html +12 -12
- package/tags//345/271/264/347/273/210/346/200/273/347/273/223/index.html +12 -12
- package/tags//346/200/247/344/273/267/346/257/224/index.html +12 -12
- package/tags//346/212/230/350/205/276/index.html +12 -12
- package/tags//346/217/220/344/276/233/345/225/206/index.html +12 -12
- package/tags//346/227/245/345/270/270/index.html +12 -12
- package/tags//346/234/215/345/212/241/345/231/250/index.html +12 -12
- package/tags//346/265/252/346/275/256/index.html +12 -12
- package/tags//347/256/200/347/210/261/index.html +12 -12
- package/tags//350/207/252/345/212/250/346/240/207/346/263/250/index.html +12 -12
- package/tags//350/256/272/346/226/207/index.html +12 -12
- package/tags//350/260/267/346/255/214/347/277/273/350/257/221/index.html +12 -12
- package/tags//350/264/237/350/275/275/345/235/207/350/241/241/index.html +12 -12
- package/tags//351/207/221/345/217/245/index.html +12 -12
- package/tags//351/255/224/346/224/271/index.html +12 -12
- package/img-col/index.html +0 -802
@@ -1,271 +1,271 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="UTF-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
6
|
-
<title>看板娘登陆平台</title>
|
7
|
-
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/bootstrap@5/dist/css/bootstrap.min.css">
|
8
|
-
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css">
|
9
|
-
<script src="../live2d.min.js"></script>
|
10
|
-
<style>
|
11
|
-
html, body {
|
12
|
-
height: 100%;
|
13
|
-
}
|
14
|
-
body {
|
15
|
-
display: flex;
|
16
|
-
align-items: center;
|
17
|
-
justify-content: center;
|
18
|
-
padding-top: 40px;
|
19
|
-
padding-bottom: 40px;
|
20
|
-
background-color: #f5f5f5;
|
21
|
-
}
|
22
|
-
.form-signin {
|
23
|
-
width: 100%;
|
24
|
-
max-width: 330px;
|
25
|
-
padding: 15px;
|
26
|
-
margin: 0 auto;
|
27
|
-
}
|
28
|
-
.form-signin .checkbox {
|
29
|
-
font-weight: 400;
|
30
|
-
}
|
31
|
-
.form-signin .form-control {
|
32
|
-
position: relative;
|
33
|
-
box-sizing: border-box;
|
34
|
-
height: auto;
|
35
|
-
padding: 10px;
|
36
|
-
font-size: 16px;
|
37
|
-
}
|
38
|
-
.form-signin .form-control:focus {
|
39
|
-
z-index: 2;
|
40
|
-
}
|
41
|
-
.form-signin input[type=text] {
|
42
|
-
margin-bottom: -1px;
|
43
|
-
border-bottom-right-radius: 0;
|
44
|
-
border-bottom-left-radius: 0;
|
45
|
-
}
|
46
|
-
.form-signin input[type=password] {
|
47
|
-
margin-bottom: 10px;
|
48
|
-
border-top-left-radius: 0;
|
49
|
-
border-top-right-radius: 0;
|
50
|
-
}
|
51
|
-
#stage {
|
52
|
-
position: relative;
|
53
|
-
}
|
54
|
-
#stage img {
|
55
|
-
width: 100%;
|
56
|
-
margin-bottom: 20px;
|
57
|
-
border-radius: 20px;
|
58
|
-
}
|
59
|
-
#stage button {
|
60
|
-
position: absolute;
|
61
|
-
padding: 0;
|
62
|
-
}
|
63
|
-
#inner {
|
64
|
-
position: relative;
|
65
|
-
background-color: #999;
|
66
|
-
clip-path: circle(120px at center);
|
67
|
-
}
|
68
|
-
#cover {
|
69
|
-
position: absolute;
|
70
|
-
background-color: #CB3837;
|
71
|
-
width: 100%;
|
72
|
-
height: 100%;
|
73
|
-
bottom: 10%;
|
74
|
-
transition: all 1s;
|
75
|
-
box-shadow: 0 0 0 5px rgba(0, 0, 0, .1);
|
76
|
-
}
|
77
|
-
#text {
|
78
|
-
position: absolute;
|
79
|
-
bottom: 30%;
|
80
|
-
font-size: 2em;
|
81
|
-
left: 50%;
|
82
|
-
transform: translateX(-50%);
|
83
|
-
opacity: 0.4;
|
84
|
-
font-weight: bold;
|
85
|
-
}
|
86
|
-
#detail {
|
87
|
-
position: absolute;
|
88
|
-
background: rgba(255, 255, 255, .1);
|
89
|
-
width: 100%;
|
90
|
-
height: 10px;
|
91
|
-
bottom: 0;
|
92
|
-
}
|
93
|
-
#handle {
|
94
|
-
position: absolute;
|
95
|
-
background: #ccc;
|
96
|
-
bottom: -2px;
|
97
|
-
box-shadow: 0 1px 0 1px rgba(0, 0, 0, .1);
|
98
|
-
height: 8px;
|
99
|
-
left: 50%;
|
100
|
-
margin-left: -15px;
|
101
|
-
width: 30px;
|
102
|
-
cursor: pointer;
|
103
|
-
}
|
104
|
-
#info {
|
105
|
-
left: 40px;
|
106
|
-
bottom: 20px;
|
107
|
-
}
|
108
|
-
#refresh {
|
109
|
-
right: 40px;
|
110
|
-
bottom: 20px;
|
111
|
-
}
|
112
|
-
#live2d {
|
113
|
-
cursor: grab;
|
114
|
-
height: 300px;
|
115
|
-
width: 300px;
|
116
|
-
}
|
117
|
-
#live2d:active {
|
118
|
-
cursor: grabbing;
|
119
|
-
}
|
120
|
-
</style>
|
121
|
-
</head>
|
122
|
-
<body class="text-center">
|
123
|
-
<form class="form-signin" action="login.php" method="post">
|
124
|
-
<div id="stage">
|
125
|
-
<div id="inner">
|
126
|
-
<div id="cover">
|
127
|
-
<div id="text">
|
128
|
-
<span style="color: cyan;">MIMI</span><span style="color: white;">POWERED</span>
|
129
|
-
</div>
|
130
|
-
<div id="detail"></div>
|
131
|
-
<div id="handle"></div>
|
132
|
-
</div>
|
133
|
-
<canvas class="mb-4" id="live2d" width="800" height="800"></canvas>
|
134
|
-
</div>
|
135
|
-
<button class="btn btn-link" id="info"><i class="fa fa-lg fa-info"></i></button>
|
136
|
-
<button class="btn btn-link" id="refresh"><i class="fa fa-lg fa-sync-alt"></i></button>
|
137
|
-
</div>
|
138
|
-
<h1 class="h3 mb-3 fw-normal">看板娘登陆平台</h1>
|
139
|
-
<label for="room" class="sr-only">用户名</label>
|
140
|
-
<input type="text" name="room" class="form-control" placeholder="用户名" required autofocus>
|
141
|
-
<label for="pass" class="sr-only">密码</label>
|
142
|
-
<input type="password" name="pass" class="form-control" placeholder="密码" required>
|
143
|
-
<div class="checkbox mb-4">
|
144
|
-
<label>
|
145
|
-
<input type="checkbox" value="remember-me"> 记住我
|
146
|
-
</label>
|
147
|
-
</div>
|
148
|
-
<div class="d-grid">
|
149
|
-
<button class="btn btn-lg btn-primary" type="submit">登录</button>
|
150
|
-
</div>
|
151
|
-
<p class="mt-5 mb-3 text-muted">Copyleft © Mimi 2019</p>
|
152
|
-
</form>
|
153
|
-
<script>
|
154
|
-
/*
|
155
|
-
* _(:з」∠)_
|
156
|
-
* Created by Shuqiao Zhang in 2019.
|
157
|
-
* https://zhangshuqiao.org
|
158
|
-
*/
|
159
|
-
|
160
|
-
/*
|
161
|
-
* This program is free software: you can redistribute it and/or modify
|
162
|
-
* it under the terms of the GNU General Public License as published by
|
163
|
-
* the Free Software Foundation, either version 3 of the License, or
|
164
|
-
* (at your option) any later version.
|
165
|
-
*
|
166
|
-
* This program is distributed in the hope that it will be useful,
|
167
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
168
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
169
|
-
* GNU General Public License for more details.
|
170
|
-
*/
|
171
|
-
window.addEventListener("load", () => {
|
172
|
-
"use strict";
|
173
|
-
|
174
|
-
if (!CSS.supports("clip-path", "circle(120px at center)")) {
|
175
|
-
document.getElementById("stage").innerHTML = '<img src="../assets/screenshot-1.png">';
|
176
|
-
return;
|
177
|
-
}
|
178
|
-
|
179
|
-
const apiPath = "https://live2d.fghrsh.net/api";
|
180
|
-
let state = 0, loading = false,
|
181
|
-
modelId = localStorage.getItem("modelId"),
|
182
|
-
modelTexturesId = localStorage.getItem("modelTexturesId");
|
183
|
-
if (modelId === null) {
|
184
|
-
modelId = 1;
|
185
|
-
modelTexturesId = 53;
|
186
|
-
}
|
187
|
-
loadModel(modelId, modelTexturesId);
|
188
|
-
|
189
|
-
function loadModel(modelId, modelTexturesId) {
|
190
|
-
localStorage.setItem("modelId", modelId);
|
191
|
-
if (modelTexturesId === undefined) modelTexturesId = 0;
|
192
|
-
localStorage.setItem("modelTexturesId", modelTexturesId);
|
193
|
-
loadlive2d("live2d", `${apiPath}/get/?id=${modelId}-${modelTexturesId}`, null);
|
194
|
-
console.log("live2d", `模型 ${modelId}-${modelTexturesId} 加载完成`);
|
195
|
-
setTimeout(() => {
|
196
|
-
coverPosition("80%");
|
197
|
-
state = 2;
|
198
|
-
}, 2000);
|
199
|
-
}
|
200
|
-
|
201
|
-
function loadRandModel() {
|
202
|
-
const modelId = localStorage.getItem("modelId"),
|
203
|
-
modelTexturesId = localStorage.getItem("modelTexturesId");
|
204
|
-
fetch(`${apiPath}/rand_textures/?id=${modelId}-${modelTexturesId}`)
|
205
|
-
.then(response => response.json())
|
206
|
-
.then(result => {
|
207
|
-
loadModel(modelId, result.textures.id);
|
208
|
-
setTimeout(() => {
|
209
|
-
state = 2;
|
210
|
-
coverPosition("80%");
|
211
|
-
loading = false;
|
212
|
-
}, 1000);
|
213
|
-
});
|
214
|
-
}
|
215
|
-
|
216
|
-
function loadOtherModel() {
|
217
|
-
const modelId = localStorage.getItem("modelId");
|
218
|
-
fetch(`${apiPath}/switch/?id=${modelId}`)
|
219
|
-
.then(response => response.json())
|
220
|
-
.then(result => {
|
221
|
-
loadModel(result.model.id);
|
222
|
-
});
|
223
|
-
}
|
224
|
-
|
225
|
-
function coverPosition(pos) {
|
226
|
-
document.getElementById("cover").style.bottom = pos;
|
227
|
-
}
|
228
|
-
|
229
|
-
document.getElementById("info").addEventListener("click", () => {
|
230
|
-
fetch("https://v1.hitokoto.cn")
|
231
|
-
.then(response => response.json())
|
232
|
-
.then(result => {
|
233
|
-
alert("「" + result.hitokoto + "」——" + result.from);
|
234
|
-
});
|
235
|
-
});
|
236
|
-
|
237
|
-
document.getElementById("refresh").addEventListener("click", () => {
|
238
|
-
if (loading) return;
|
239
|
-
state = 0;
|
240
|
-
coverPosition("10%");
|
241
|
-
loading = true;
|
242
|
-
setTimeout(loadRandModel, 1000);
|
243
|
-
});
|
244
|
-
|
245
|
-
document.getElementById("handle").addEventListener("click", () => {
|
246
|
-
if (state === 1) {
|
247
|
-
state = 2;
|
248
|
-
coverPosition("80%");
|
249
|
-
}
|
250
|
-
else if (state === 2) {
|
251
|
-
state = 1;
|
252
|
-
coverPosition("20%");
|
253
|
-
}
|
254
|
-
});
|
255
|
-
|
256
|
-
document.querySelector("input[type=password]").addEventListener("focus", () => {
|
257
|
-
if (state === 2) {
|
258
|
-
state = 1;
|
259
|
-
coverPosition("20%");
|
260
|
-
}
|
261
|
-
});
|
262
|
-
document.querySelector("input[type=password]").addEventListener("blur", () => {
|
263
|
-
if (state === 1) {
|
264
|
-
state = 2;
|
265
|
-
coverPosition("80%");
|
266
|
-
}
|
267
|
-
});
|
268
|
-
});
|
269
|
-
</script>
|
270
|
-
</body>
|
271
|
-
</html>
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
6
|
+
<title>看板娘登陆平台</title>
|
7
|
+
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/bootstrap@5/dist/css/bootstrap.min.css">
|
8
|
+
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css">
|
9
|
+
<script src="../live2d.min.js"></script>
|
10
|
+
<style>
|
11
|
+
html, body {
|
12
|
+
height: 100%;
|
13
|
+
}
|
14
|
+
body {
|
15
|
+
display: flex;
|
16
|
+
align-items: center;
|
17
|
+
justify-content: center;
|
18
|
+
padding-top: 40px;
|
19
|
+
padding-bottom: 40px;
|
20
|
+
background-color: #f5f5f5;
|
21
|
+
}
|
22
|
+
.form-signin {
|
23
|
+
width: 100%;
|
24
|
+
max-width: 330px;
|
25
|
+
padding: 15px;
|
26
|
+
margin: 0 auto;
|
27
|
+
}
|
28
|
+
.form-signin .checkbox {
|
29
|
+
font-weight: 400;
|
30
|
+
}
|
31
|
+
.form-signin .form-control {
|
32
|
+
position: relative;
|
33
|
+
box-sizing: border-box;
|
34
|
+
height: auto;
|
35
|
+
padding: 10px;
|
36
|
+
font-size: 16px;
|
37
|
+
}
|
38
|
+
.form-signin .form-control:focus {
|
39
|
+
z-index: 2;
|
40
|
+
}
|
41
|
+
.form-signin input[type=text] {
|
42
|
+
margin-bottom: -1px;
|
43
|
+
border-bottom-right-radius: 0;
|
44
|
+
border-bottom-left-radius: 0;
|
45
|
+
}
|
46
|
+
.form-signin input[type=password] {
|
47
|
+
margin-bottom: 10px;
|
48
|
+
border-top-left-radius: 0;
|
49
|
+
border-top-right-radius: 0;
|
50
|
+
}
|
51
|
+
#stage {
|
52
|
+
position: relative;
|
53
|
+
}
|
54
|
+
#stage img {
|
55
|
+
width: 100%;
|
56
|
+
margin-bottom: 20px;
|
57
|
+
border-radius: 20px;
|
58
|
+
}
|
59
|
+
#stage button {
|
60
|
+
position: absolute;
|
61
|
+
padding: 0;
|
62
|
+
}
|
63
|
+
#inner {
|
64
|
+
position: relative;
|
65
|
+
background-color: #999;
|
66
|
+
clip-path: circle(120px at center);
|
67
|
+
}
|
68
|
+
#cover {
|
69
|
+
position: absolute;
|
70
|
+
background-color: #CB3837;
|
71
|
+
width: 100%;
|
72
|
+
height: 100%;
|
73
|
+
bottom: 10%;
|
74
|
+
transition: all 1s;
|
75
|
+
box-shadow: 0 0 0 5px rgba(0, 0, 0, .1);
|
76
|
+
}
|
77
|
+
#text {
|
78
|
+
position: absolute;
|
79
|
+
bottom: 30%;
|
80
|
+
font-size: 2em;
|
81
|
+
left: 50%;
|
82
|
+
transform: translateX(-50%);
|
83
|
+
opacity: 0.4;
|
84
|
+
font-weight: bold;
|
85
|
+
}
|
86
|
+
#detail {
|
87
|
+
position: absolute;
|
88
|
+
background: rgba(255, 255, 255, .1);
|
89
|
+
width: 100%;
|
90
|
+
height: 10px;
|
91
|
+
bottom: 0;
|
92
|
+
}
|
93
|
+
#handle {
|
94
|
+
position: absolute;
|
95
|
+
background: #ccc;
|
96
|
+
bottom: -2px;
|
97
|
+
box-shadow: 0 1px 0 1px rgba(0, 0, 0, .1);
|
98
|
+
height: 8px;
|
99
|
+
left: 50%;
|
100
|
+
margin-left: -15px;
|
101
|
+
width: 30px;
|
102
|
+
cursor: pointer;
|
103
|
+
}
|
104
|
+
#info {
|
105
|
+
left: 40px;
|
106
|
+
bottom: 20px;
|
107
|
+
}
|
108
|
+
#refresh {
|
109
|
+
right: 40px;
|
110
|
+
bottom: 20px;
|
111
|
+
}
|
112
|
+
#live2d {
|
113
|
+
cursor: grab;
|
114
|
+
height: 300px;
|
115
|
+
width: 300px;
|
116
|
+
}
|
117
|
+
#live2d:active {
|
118
|
+
cursor: grabbing;
|
119
|
+
}
|
120
|
+
</style>
|
121
|
+
</head>
|
122
|
+
<body class="text-center">
|
123
|
+
<form class="form-signin" action="login.php" method="post">
|
124
|
+
<div id="stage">
|
125
|
+
<div id="inner">
|
126
|
+
<div id="cover">
|
127
|
+
<div id="text">
|
128
|
+
<span style="color: cyan;">MIMI</span><span style="color: white;">POWERED</span>
|
129
|
+
</div>
|
130
|
+
<div id="detail"></div>
|
131
|
+
<div id="handle"></div>
|
132
|
+
</div>
|
133
|
+
<canvas class="mb-4" id="live2d" width="800" height="800"></canvas>
|
134
|
+
</div>
|
135
|
+
<button class="btn btn-link" id="info"><i class="fa fa-lg fa-info"></i></button>
|
136
|
+
<button class="btn btn-link" id="refresh"><i class="fa fa-lg fa-sync-alt"></i></button>
|
137
|
+
</div>
|
138
|
+
<h1 class="h3 mb-3 fw-normal">看板娘登陆平台</h1>
|
139
|
+
<label for="room" class="sr-only">用户名</label>
|
140
|
+
<input type="text" name="room" class="form-control" placeholder="用户名" required autofocus>
|
141
|
+
<label for="pass" class="sr-only">密码</label>
|
142
|
+
<input type="password" name="pass" class="form-control" placeholder="密码" required>
|
143
|
+
<div class="checkbox mb-4">
|
144
|
+
<label>
|
145
|
+
<input type="checkbox" value="remember-me"> 记住我
|
146
|
+
</label>
|
147
|
+
</div>
|
148
|
+
<div class="d-grid">
|
149
|
+
<button class="btn btn-lg btn-primary" type="submit">登录</button>
|
150
|
+
</div>
|
151
|
+
<p class="mt-5 mb-3 text-muted">Copyleft © Mimi 2019</p>
|
152
|
+
</form>
|
153
|
+
<script>
|
154
|
+
/*
|
155
|
+
* _(:з」∠)_
|
156
|
+
* Created by Shuqiao Zhang in 2019.
|
157
|
+
* https://zhangshuqiao.org
|
158
|
+
*/
|
159
|
+
|
160
|
+
/*
|
161
|
+
* This program is free software: you can redistribute it and/or modify
|
162
|
+
* it under the terms of the GNU General Public License as published by
|
163
|
+
* the Free Software Foundation, either version 3 of the License, or
|
164
|
+
* (at your option) any later version.
|
165
|
+
*
|
166
|
+
* This program is distributed in the hope that it will be useful,
|
167
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
168
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
169
|
+
* GNU General Public License for more details.
|
170
|
+
*/
|
171
|
+
window.addEventListener("load", () => {
|
172
|
+
"use strict";
|
173
|
+
|
174
|
+
if (!CSS.supports("clip-path", "circle(120px at center)")) {
|
175
|
+
document.getElementById("stage").innerHTML = '<img src="../assets/screenshot-1.png">';
|
176
|
+
return;
|
177
|
+
}
|
178
|
+
|
179
|
+
const apiPath = "https://live2d.fghrsh.net/api";
|
180
|
+
let state = 0, loading = false,
|
181
|
+
modelId = localStorage.getItem("modelId"),
|
182
|
+
modelTexturesId = localStorage.getItem("modelTexturesId");
|
183
|
+
if (modelId === null) {
|
184
|
+
modelId = 1;
|
185
|
+
modelTexturesId = 53;
|
186
|
+
}
|
187
|
+
loadModel(modelId, modelTexturesId);
|
188
|
+
|
189
|
+
function loadModel(modelId, modelTexturesId) {
|
190
|
+
localStorage.setItem("modelId", modelId);
|
191
|
+
if (modelTexturesId === undefined) modelTexturesId = 0;
|
192
|
+
localStorage.setItem("modelTexturesId", modelTexturesId);
|
193
|
+
loadlive2d("live2d", `${apiPath}/get/?id=${modelId}-${modelTexturesId}`, null);
|
194
|
+
console.log("live2d", `模型 ${modelId}-${modelTexturesId} 加载完成`);
|
195
|
+
setTimeout(() => {
|
196
|
+
coverPosition("80%");
|
197
|
+
state = 2;
|
198
|
+
}, 2000);
|
199
|
+
}
|
200
|
+
|
201
|
+
function loadRandModel() {
|
202
|
+
const modelId = localStorage.getItem("modelId"),
|
203
|
+
modelTexturesId = localStorage.getItem("modelTexturesId");
|
204
|
+
fetch(`${apiPath}/rand_textures/?id=${modelId}-${modelTexturesId}`)
|
205
|
+
.then(response => response.json())
|
206
|
+
.then(result => {
|
207
|
+
loadModel(modelId, result.textures.id);
|
208
|
+
setTimeout(() => {
|
209
|
+
state = 2;
|
210
|
+
coverPosition("80%");
|
211
|
+
loading = false;
|
212
|
+
}, 1000);
|
213
|
+
});
|
214
|
+
}
|
215
|
+
|
216
|
+
function loadOtherModel() {
|
217
|
+
const modelId = localStorage.getItem("modelId");
|
218
|
+
fetch(`${apiPath}/switch/?id=${modelId}`)
|
219
|
+
.then(response => response.json())
|
220
|
+
.then(result => {
|
221
|
+
loadModel(result.model.id);
|
222
|
+
});
|
223
|
+
}
|
224
|
+
|
225
|
+
function coverPosition(pos) {
|
226
|
+
document.getElementById("cover").style.bottom = pos;
|
227
|
+
}
|
228
|
+
|
229
|
+
document.getElementById("info").addEventListener("click", () => {
|
230
|
+
fetch("https://v1.hitokoto.cn")
|
231
|
+
.then(response => response.json())
|
232
|
+
.then(result => {
|
233
|
+
alert("「" + result.hitokoto + "」——" + result.from);
|
234
|
+
});
|
235
|
+
});
|
236
|
+
|
237
|
+
document.getElementById("refresh").addEventListener("click", () => {
|
238
|
+
if (loading) return;
|
239
|
+
state = 0;
|
240
|
+
coverPosition("10%");
|
241
|
+
loading = true;
|
242
|
+
setTimeout(loadRandModel, 1000);
|
243
|
+
});
|
244
|
+
|
245
|
+
document.getElementById("handle").addEventListener("click", () => {
|
246
|
+
if (state === 1) {
|
247
|
+
state = 2;
|
248
|
+
coverPosition("80%");
|
249
|
+
}
|
250
|
+
else if (state === 2) {
|
251
|
+
state = 1;
|
252
|
+
coverPosition("20%");
|
253
|
+
}
|
254
|
+
});
|
255
|
+
|
256
|
+
document.querySelector("input[type=password]").addEventListener("focus", () => {
|
257
|
+
if (state === 2) {
|
258
|
+
state = 1;
|
259
|
+
coverPosition("20%");
|
260
|
+
}
|
261
|
+
});
|
262
|
+
document.querySelector("input[type=password]").addEventListener("blur", () => {
|
263
|
+
if (state === 1) {
|
264
|
+
state = 2;
|
265
|
+
coverPosition("80%");
|
266
|
+
}
|
267
|
+
});
|
268
|
+
});
|
269
|
+
</script>
|
270
|
+
</body>
|
271
|
+
</html>
|