emiogiwara commited on
Commit
07f7653
·
1 Parent(s): 0d5fbb0
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .github/ISSUE_TEMPLATE/contribute-theme.yml +39 -0
  2. .gitignore +28 -0
  3. Dockerfile +11 -0
  4. LICENSE +21 -0
  5. README.md +309 -8
  6. assets/favicon.png +0 -0
  7. assets/img/back-to-top.png +0 -0
  8. assets/img/failed.svg +1 -0
  9. assets/img/loading.svg +1 -0
  10. assets/script.js +208 -0
  11. assets/style.less +243 -0
  12. assets/theme/3d-num/0.gif +0 -0
  13. assets/theme/3d-num/1.gif +0 -0
  14. assets/theme/3d-num/2.gif +0 -0
  15. assets/theme/3d-num/3.gif +0 -0
  16. assets/theme/3d-num/4.gif +0 -0
  17. assets/theme/3d-num/5.gif +0 -0
  18. assets/theme/3d-num/6.gif +0 -0
  19. assets/theme/3d-num/7.gif +0 -0
  20. assets/theme/3d-num/8.gif +0 -0
  21. assets/theme/3d-num/9.gif +0 -0
  22. assets/theme/ai-1/0.png +0 -0
  23. assets/theme/ai-1/1.png +0 -0
  24. assets/theme/ai-1/2.png +0 -0
  25. assets/theme/ai-1/3.png +0 -0
  26. assets/theme/ai-1/4.png +0 -0
  27. assets/theme/ai-1/5.png +0 -0
  28. assets/theme/ai-1/6.png +0 -0
  29. assets/theme/ai-1/7.png +0 -0
  30. assets/theme/ai-1/8.png +0 -0
  31. assets/theme/ai-1/9.png +0 -0
  32. assets/theme/asoul/0.gif +0 -0
  33. assets/theme/asoul/1.gif +0 -0
  34. assets/theme/asoul/2.gif +0 -0
  35. assets/theme/asoul/3.gif +0 -0
  36. assets/theme/asoul/4.gif +0 -0
  37. assets/theme/asoul/5.gif +0 -0
  38. assets/theme/asoul/6.gif +0 -0
  39. assets/theme/asoul/7.gif +0 -0
  40. assets/theme/asoul/8.gif +0 -0
  41. assets/theme/asoul/9.gif +0 -0
  42. assets/theme/booru-ffsr/0.gif +0 -0
  43. assets/theme/booru-ffsr/1.gif +0 -0
  44. assets/theme/booru-ffsr/2.gif +0 -0
  45. assets/theme/booru-ffsr/3.gif +0 -0
  46. assets/theme/booru-ffsr/4.gif +0 -0
  47. assets/theme/booru-ffsr/5.gif +0 -0
  48. assets/theme/booru-ffsr/6.gif +0 -0
  49. assets/theme/booru-ffsr/7.gif +0 -0
  50. assets/theme/booru-ffsr/8.gif +0 -0
.github/ISSUE_TEMPLATE/contribute-theme.yml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Contribute Themes
2
+ description: Contribute themes for everyone to use.
3
+ title: "[Theme]: "
4
+ labels: ["theme"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ ### Contribute themes is welcome! Please read this brief tips to get started:
10
+
11
+ - Create images of numbers from *0-9*, file type can be *jpeg, png, gif, webp*,
12
+ - Then named these images as *0.gif, 1.gif, ..., 9.gif* (or other extension).
13
+ - Try to ensure that each image has an equal height, and that the image size is not too large.
14
+ > Online image compressor: [TinyPNG](https://tinypng.com/) [Ezgif](https://ezgif.com/optimize)
15
+ - Then pack these images into a ZIP file.
16
+
17
+ Additionally, please refrain from using political figures or controversial figures or characters.
18
+ - type: checkboxes
19
+ id: tips
20
+ attributes:
21
+ label: Tips
22
+ options:
23
+ - label: I have read and understood the tips above
24
+ required: true
25
+ - type: input
26
+ id: name
27
+ attributes:
28
+ label: Theme Name
29
+ description: Describe this theme with a short name that can include letters, numbers, and hyphens
30
+ placeholder: ex. awesome
31
+ validations:
32
+ required: true
33
+ - type: textarea
34
+ id: theme
35
+ attributes:
36
+ label: Preview and ZIP file
37
+ description: Upload the theme preview, and ZIP file
38
+ validations:
39
+ required: true
.gitignore ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+ count.db
4
+ /.history
5
+
6
+ # dependencies
7
+ /node_modules
8
+ /.pnp
9
+ .pnp.js
10
+
11
+ # testing
12
+ /coverage
13
+
14
+ # production
15
+ /build
16
+
17
+ # misc
18
+ .DS_Store
19
+ .env
20
+ .env.local
21
+ .env.development.local
22
+ .env.test.local
23
+ .env.production.local
24
+
25
+ npm-debug.log*
26
+ yarn-debug.log*
27
+ yarn-error.log*
28
+ yarn.lock*
Dockerfile ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:14
2
+
3
+ WORKDIR /app
4
+
5
+ COPY . .
6
+
7
+ RUN yarn install
8
+
9
+ EXPOSE 3000
10
+
11
+ CMD ["yarn", "start"]
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2020 journey-ad
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md CHANGED
@@ -1,10 +1,311 @@
1
- ---
2
- title: Count
3
- emoji: 👀
4
- colorFrom: red
5
- colorTo: green
6
- sdk: docker
7
- pinned: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
1
+ # *Moe Counter!*
2
+
3
+ 多种风格可选的萌萌计数器
4
+
5
+ <p align="center">
6
+ <a href="https://count.getloli.com" target="_blank">
7
+ <img alt="Moe Counter!" src="https://count.getloli.com/@Moe-counter.github?name=Moe-counter.github&theme=booru-lewd&padding=7&offset=0&align=top&scale=1&pixelated=1&darkmode=auto">
8
+ </a>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://hellogithub.com/repository/ed741b376efe46789ce9bb140ac19a52" target="_blank">
13
+ <picture>
14
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=ed741b376efe46789ce9bb140ac19a52&claim_uid=NyJh2Vejq3984f5&theme=dark" />
15
+ <source media="(prefers-color-scheme: light)" srcset="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=ed741b376efe46789ce9bb140ac19a52&claim_uid=NyJh2Vejq3984f5&theme=neutral" />
16
+ <img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=ed741b376efe46789ce9bb140ac19a52&claim_uid=NyJh2Vejq3984f5&theme=neutral" alt="Featured|HelloGitHub" style="width: 250px; height: 54px;" width="250" height="54" />
17
+ </picture>
18
+ </a>
19
+ </p>
20
+
21
+ <details>
22
+ <summary><h2>More theme</h2></summary>
23
+
24
+ ### *[Contribute themes is welcome!](https://github.com/journey-ad/Moe-Counter/issues/new?assignees=&labels=theme&projects=&template=contribute-theme.yml&title=%5BTheme%5D%3A+)*
25
+
26
+ ##### 3d-num
27
+
28
+ ![3d-num](https://count.getloli.com/@demo?theme=3d-num)
29
+
30
+ ##### ai-1
31
+
32
+ ![ai-1](https://count.getloli.com/@demo?theme=ai-1)
33
+
34
+ ##### asoul
35
+
36
+ ![asoul](https://count.getloli.com/@demo?theme=asoul)
37
+
38
+ ##### booru-ffsr
39
+
40
+ ![booru-ffsr](https://count.getloli.com/@demo?theme=booru-ffsr)
41
+
42
+ ##### booru-helltaker
43
+
44
+ ![booru-helltaker](https://count.getloli.com/@demo?theme=booru-helltaker)
45
+
46
+ ##### booru-huggboo
47
+
48
+ ![booru-huggboo](https://count.getloli.com/@demo?theme=booru-huggboo)
49
+
50
+ ##### booru-jaypee
51
+
52
+ ![booru-jaypee](https://count.getloli.com/@demo?theme=booru-jaypee)
53
+
54
+ ##### booru-koe
55
+
56
+ ![booru-koe](https://count.getloli.com/@demo?theme=booru-koe)
57
+
58
+ ##### booru-lewd
59
+
60
+ ![booru-lewd](https://count.getloli.com/@demo?theme=booru-lewd)
61
+
62
+ ##### booru-lisu
63
+
64
+ ![booru-lisu](https://count.getloli.com/@demo?theme=booru-lisu)
65
+
66
+ ##### booru-mjg
67
+
68
+ ![booru-mjg](https://count.getloli.com/@demo?theme=booru-mjg)
69
+
70
+ ##### booru-mof
71
+
72
+ ![booru-mof](https://count.getloli.com/@demo?theme=booru-mof)
73
+
74
+ ##### booru-nandroid
75
+
76
+ ![booru-nandroid](https://count.getloli.com/@demo?theme=booru-nandroid)
77
+
78
+ ##### booru-qualityhentais
79
+
80
+ ![booru-qualityhentais](https://count.getloli.com/@demo?theme=booru-qualityhentais)
81
+
82
+ ##### booru-r6gdrawfriends
83
+
84
+ ![booru-r6gdrawfriends](https://count.getloli.com/@demo?theme=booru-r6gdrawfriends)
85
+
86
+ ##### booru-rfck
87
+
88
+ ![booru-rfck](https://count.getloli.com/@demo?theme=booru-rfck)
89
+
90
+ ##### booru-smtg
91
+
92
+ ![booru-smtg](https://count.getloli.com/@demo?theme=booru-smtg)
93
+
94
+ ##### booru-snyde
95
+
96
+ ![booru-snyde](https://count.getloli.com/@demo?theme=booru-snyde)
97
+
98
+ ##### booru-the-collection
99
+
100
+ ![booru-the-collection](https://count.getloli.com/@demo?theme=booru-the-collection)
101
+
102
+ ##### booru-touhoulat
103
+
104
+ ![booru-touhoulat](https://count.getloli.com/@demo?theme=booru-touhoulat)
105
+
106
+ ##### booru-townofgravityfalls
107
+
108
+ ![booru-townofgravityfalls](https://count.getloli.com/@demo?theme=booru-townofgravityfalls)
109
+
110
+ ##### booru-twifanartsfw
111
+
112
+ ![booru-twifanartsfw](https://count.getloli.com/@demo?theme=booru-twifanartsfw)
113
+
114
+ ##### booru-ve
115
+
116
+ ![booru-ve](https://count.getloli.com/@demo?theme=booru-ve)
117
+
118
+ ##### booru-vivi
119
+
120
+ ![booru-vivi](https://count.getloli.com/@demo?theme=booru-vivi)
121
+
122
+ ##### booru-vp
123
+
124
+ ![booru-vp](https://count.getloli.com/@demo?theme=booru-vp)
125
+
126
+ ##### booru-yuyuyui
127
+
128
+ ![booru-yuyuyui](https://count.getloli.com/@demo?theme=booru-yuyuyui)
129
+
130
+ ##### capoo-1
131
+
132
+ ![capoo-1](https://count.getloli.com/@demo?theme=capoo-1)
133
+
134
+ ##### capoo-2
135
+
136
+ ![capoo-2](https://count.getloli.com/@demo?theme=capoo-2)
137
+
138
+ ##### e621
139
+
140
+ ![e621](https://count.getloli.com/@demo?theme=e621)
141
+
142
+ ##### food
143
+
144
+ ![food](https://count.getloli.com/@demo?theme=food)
145
+
146
+ ##### gelbooru
147
+
148
+ ![gelbooru](https://count.getloli.com/@demo?theme=gelbooru)
149
+
150
+ ##### green
151
+
152
+ ![green](https://count.getloli.com/@demo?theme=green)
153
+
154
+ ##### kasuterura-1
155
+
156
+ ![kasuterura-1](https://count.getloli.com/@demo?theme=kasuterura-1)
157
+
158
+ ##### kasuterura-2
159
+
160
+ ![kasuterura-2](https://count.getloli.com/@demo?theme=kasuterura-2)
161
+
162
+ ##### kasuterura-3
163
+
164
+ ![kasuterura-3](https://count.getloli.com/@demo?theme=kasuterura-3)
165
+
166
+ ##### kasuterura-4
167
+
168
+ ![kasuterura-4](https://count.getloli.com/@demo?theme=kasuterura-4)
169
+
170
+ ##### kyun
171
+
172
+ ![kyun](https://count.getloli.com/@demo?theme=kyun)
173
+
174
+ ##### love-and-deepspace
175
+
176
+ ![love-and-deepspace](https://count.getloli.com/@demo?theme=love-and-deepspace)
177
+
178
+ ##### miku
179
+
180
+ ![miku](https://count.getloli.com/@demo?theme=miku)
181
+
182
+ ##### minecraft
183
+
184
+ ![minecraft](https://count.getloli.com/@demo?theme=minecraft)
185
+
186
+ ##### moebooru
187
+
188
+ ![moebooru](https://count.getloli.com/@demo?theme=moebooru)
189
+
190
+ ##### morden-num
191
+
192
+ ![morden-num](https://count.getloli.com/@demo?theme=morden-num)
193
+
194
+ ##### nixietube-1
195
+
196
+ ![nixietube-1](https://count.getloli.com/@demo?theme=nixietube-1)
197
+
198
+ ##### nixietube-2
199
+
200
+ ![nixietube-2](https://count.getloli.com/@demo?theme=nixietube-2)
201
+
202
+ ##### normal-1
203
+
204
+ ![normal-1](https://count.getloli.com/@demo?theme=normal-1)
205
+
206
+ ##### normal-2
207
+
208
+ ![normal-2](https://count.getloli.com/@demo?theme=normal-2)
209
+
210
+ ##### original-new
211
+
212
+ ![original-new](https://count.getloli.com/@demo?theme=original-new)
213
+
214
+ ##### original-old
215
+
216
+ ![original-old](https://count.getloli.com/@demo?theme=original-old)
217
+
218
+ ##### rule34
219
+
220
+ ![rule34](https://count.getloli.com/@demo?theme=rule34)
221
+
222
+ ##### shimmie2
223
+
224
+ ![shimmie2](https://count.getloli.com/@demo?theme=shimmie2)
225
+
226
+ ##### sketch-1
227
+
228
+ ![sketch-1](https://count.getloli.com/@demo?theme=sketch-1)
229
+
230
+ ##### sketch-2
231
+
232
+ ![sketch-2](https://count.getloli.com/@demo?theme=sketch-2)
233
+
234
+ </details>
235
+
236
+ ## Demo
237
+ [https://count.getloli.com](https://count.getloli.com)
238
+
239
+ ## How to use
240
+
241
+ For information on counter usage and configuration, refer to the [demo website](https://count.getloli.com).
242
+
243
+ ## Usage
244
+
245
+ ### Install
246
+
247
+ #### Run on Glitch
248
+
249
+ - Open [Glitch project](https://glitch.com/~moe-counter-api)
250
+ - Just hit the **Remix your own** button
251
+ - That's it!
252
+
253
+ #### Deploying on your own server
254
+
255
+ ```shell
256
+ $ git clone https://github.com/journey-ad/Moe-Counter.git
257
+ $ cd Moe-Counter
258
+ $ pnpm install
259
+
260
+ $ pnpm run start
261
+ ```
262
+
263
+ ### Configuration
264
+
265
+ Set `.env` file to specify the environment variables. *[.env.example](./.env.example)*
266
+
267
+ ```dosini
268
+ # Specify your website URL
269
+ # APP_SITE=https://count.getloli.com
270
+
271
+ # Application port
272
+ APP_PORT=3000
273
+
274
+ # Database type: either 'sqlite' or 'mongodb'
275
+ DB_TYPE=sqlite
276
+
277
+ # If using MongoDB, provide the connection string
278
+ # DB_URL=mongodb://127.0.0.1:27017
279
+
280
+ # Database write interval in seconds (0 for real-time)
281
+ DB_INTERVAL=60
282
+
283
+ # Log level: either 'debug' | 'info' | 'warn' | 'error' | 'none'
284
+ LOG_LEVEL=debug
285
+
286
+ # Google Analytics `G-Tag` ID
287
+ # GA_ID=G-XXXX
288
+ ```
289
+
290
+ ## Credits
291
+
292
+ * [Glitch](https://glitch.com/)
293
+ * [A-SOUL_Official](https://space.bilibili.com/703007996)
294
+ * [moebooru](https://github.com/moebooru/moebooru)
295
+ * gelbooru.com NSFW
296
+ * [Icons8](https://icons8.com/icon/80355/star)
297
+ * *And all booru site...*
298
+
299
+ ## License
300
+
301
+ [MIT License](./LICENSE), excluding all themes
302
+
303
  ---
304
 
305
+ <a href="https://star-history.com/?repos=journey-ad/Moe-Counter&type=Date#journey-ad/Moe-Counter&Date">
306
+ <picture>
307
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=journey-ad/Moe-Counter&type=Date&theme=dark" />
308
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=journey-ad/Moe-Counter&type=Date" />
309
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=journey-ad/Moe-Counter&type=Date" />
310
+ </picture>
311
+ </a>
assets/favicon.png ADDED
assets/img/back-to-top.png ADDED
assets/img/failed.svg ADDED
assets/img/loading.svg ADDED
assets/script.js ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function () {
2
+ const btn = document.getElementById('get');
3
+ const img = document.getElementById('result');
4
+ const code = document.getElementById('code');
5
+
6
+ const elements = {
7
+ name: document.getElementById('name'),
8
+ theme: document.getElementById('theme'),
9
+ padding: document.getElementById('padding'),
10
+ offset: document.getElementById('offset'),
11
+ align: document.getElementById('align'),
12
+ scale: document.getElementById('scale'),
13
+ pixelated: document.getElementById('pixelated'),
14
+ darkmode: document.getElementById('darkmode'),
15
+ num: document.getElementById('num'),
16
+ prefix: document.getElementById('prefix')
17
+ };
18
+
19
+ btn.addEventListener('click', throttle(handleButtonClick, 500));
20
+ code.addEventListener('click', selectCodeText);
21
+
22
+ const mainTitle = document.querySelector('#main_title i');
23
+ const themes = document.querySelector('#themes');
24
+ const moreTheme = document.querySelector('#more_theme');
25
+
26
+ mainTitle.addEventListener('click', throttle(() => party.sparkles(document.documentElement, { count: party.variation.range(40, 100) }), 1000));
27
+ moreTheme.addEventListener('click', scrollToThemes);
28
+
29
+ function handleButtonClick() {
30
+ const { name, theme, padding, offset, scale, pixelated, darkmode, num } = elements;
31
+ const nameValue = name.value.trim();
32
+
33
+ if (!nameValue) {
34
+ alert('Please input counter name.');
35
+ return;
36
+ }
37
+
38
+ const params = {
39
+ name: nameValue,
40
+ theme: theme.value || 'moebooru',
41
+ padding: padding.value || '7',
42
+ offset: offset.value || '0',
43
+ align: align.value || 'top',
44
+ scale: scale.value || '1',
45
+ pixelated: pixelated.checked ? '1' : '0',
46
+ darkmode: darkmode.value || 'auto'
47
+ };
48
+
49
+ if (num.value > 0) {
50
+ params.num = num.value;
51
+ }
52
+ if (prefix.value !== '') {
53
+ params.prefix = prefix.value;
54
+ }
55
+
56
+ const query = new URLSearchParams(params).toString();
57
+ const imgSrc = `${__global_data.site}/@${nameValue}?${query}`;
58
+
59
+ img.src = `${imgSrc}&_=${Math.random()}`;
60
+ btn.setAttribute('disabled', '');
61
+
62
+ img.onload = () => {
63
+ img.scrollIntoView({ block: 'start', behavior: 'smooth' });
64
+ code.textContent = imgSrc;
65
+ code.style.visibility = 'visible';
66
+ party.confetti(btn, { count: party.variation.range(20, 40) });
67
+ btn.removeAttribute('disabled');
68
+ };
69
+
70
+ img.onerror = async () => {
71
+ try {
72
+ const res = await fetch(img.src);
73
+ if (!res.ok) {
74
+ const { message } = await res.json();
75
+ alert(message);
76
+ }
77
+ } finally {
78
+ btn.removeAttribute('disabled');
79
+ }
80
+ };
81
+ }
82
+
83
+ function selectCodeText(e) {
84
+ e.preventDefault();
85
+ e.stopPropagation();
86
+
87
+ const target = e.target;
88
+ const range = document.createRange();
89
+ const selection = window.getSelection();
90
+
91
+ range.selectNodeContents(target);
92
+ selection.removeAllRanges();
93
+ selection.addRange(range);
94
+ }
95
+
96
+ function scrollToThemes() {
97
+ if (!themes.hasAttribute('open')) {
98
+ party.sparkles(moreTheme.querySelector('h3'), { count: party.variation.range(20, 40) });
99
+ themes.scrollIntoView({ block: 'start', behavior: 'smooth' });
100
+ }
101
+ }
102
+
103
+ function throttle(fn, threshold = 250) {
104
+ let last, deferTimer;
105
+ return function (...args) {
106
+ const now = Date.now();
107
+ if (last && now < last + threshold) {
108
+ clearTimeout(deferTimer);
109
+ deferTimer = setTimeout(() => {
110
+ last = now;
111
+ fn.apply(this, args);
112
+ }, threshold);
113
+ } else {
114
+ last = now;
115
+ fn.apply(this, args);
116
+ }
117
+ };
118
+ }
119
+ })();
120
+
121
+ // Lazy Load
122
+ (() => {
123
+ function lazyLoad(options = {}) {
124
+ const { selector = 'img[data-src]:not([src])', loading = '', failed = '', rootMargin = '200px', threshold = 0.01 } = options;
125
+
126
+ const images = document.querySelectorAll(selector);
127
+
128
+ const observer = new IntersectionObserver((entries, observer) => {
129
+ entries.forEach(entry => {
130
+ if (entry.isIntersecting) {
131
+ const img = entry.target;
132
+ observer.unobserve(img);
133
+
134
+ img.onerror = failed ? () => { img.src = failed; img.setAttribute('data-failed', ''); } : null;
135
+ img.src = img.getAttribute('data-src');
136
+ img.removeAttribute('data-loading');
137
+ }
138
+ });
139
+ }, { rootMargin, threshold });
140
+
141
+ images.forEach(img => {
142
+ if (loading) {
143
+ img.src = loading;
144
+ img.setAttribute('data-loading', '');
145
+ }
146
+ observer.observe(img);
147
+ });
148
+ }
149
+
150
+ const lazyLoadOptions = {
151
+ selector: 'img[data-src]:not([src])',
152
+ loading: `${__global_data.site}/img/loading.svg`,
153
+ failed: `${__global_data.site}/img/failed.svg`,
154
+ rootMargin: '200px',
155
+ threshold: 0.01
156
+ };
157
+
158
+ document.readyState === 'loading'
159
+ ? document.addEventListener("DOMContentLoaded", () => lazyLoad(lazyLoadOptions))
160
+ : lazyLoad(lazyLoadOptions);
161
+ })();
162
+
163
+ // Back to top
164
+ (() => {
165
+ let isShow = false, lock = false;
166
+ const btn = document.querySelector('.back-to-top');
167
+
168
+ const handleScroll = () => {
169
+ if (lock) return;
170
+ if (document.body.scrollTop >= 1000) {
171
+ if (!isShow) {
172
+ btn.classList.add('load');
173
+ isShow = true;
174
+ }
175
+ } else if (isShow) {
176
+ btn.classList.remove('load');
177
+ isShow = false;
178
+ }
179
+ };
180
+
181
+ const handleClick = () => {
182
+ lock = true;
183
+ btn.classList.add('ani-leave');
184
+ window.scrollTo({ top: 0, behavior: 'smooth' });
185
+
186
+ setTimeout(() => {
187
+ btn.classList.remove('ani-leave');
188
+ btn.classList.add('leaved');
189
+ }, 390);
190
+
191
+ setTimeout(() => btn.classList.add('ending'), 120);
192
+ setTimeout(() => btn.classList.remove('load'), 1500);
193
+
194
+ setTimeout(() => {
195
+ lock = false;
196
+ isShow = false;
197
+ btn.classList.remove('leaved', 'ending');
198
+ }, 2000);
199
+ };
200
+
201
+ window.addEventListener('scroll', handleScroll);
202
+ btn.addEventListener('click', handleClick);
203
+ })();
204
+
205
+ // Prevent safari gesture
206
+ (() => {
207
+ document.addEventListener('gesturestart', e => e.preventDefault());
208
+ })();
assets/style.less ADDED
@@ -0,0 +1,243 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ html {
2
+ scroll-padding: 50px 0;
3
+ }
4
+
5
+ #main_title {
6
+ margin-top: 0.5em;
7
+ }
8
+
9
+ #themes {
10
+ margin-top: 2em;
11
+
12
+ & > p {
13
+ margin: 0;
14
+ }
15
+ }
16
+
17
+ #more_theme h3 {
18
+ display: inline-block;
19
+ margin: 0;
20
+ cursor: pointer;
21
+ }
22
+
23
+ #get {
24
+ margin-bottom: 1em;
25
+ }
26
+
27
+ #code {
28
+ visibility: hidden;
29
+ display: inline-block;
30
+ margin-bottom: 1em;
31
+ }
32
+
33
+ #result {
34
+ display: block;
35
+ }
36
+
37
+ .github {
38
+ margin-top: 2em;
39
+ }
40
+
41
+ code {
42
+ word-break: break-all;
43
+ }
44
+
45
+ input[type="checkbox"][role="switch"] {
46
+ height: 0;
47
+ width: 0;
48
+ visibility: hidden;
49
+
50
+ & + label {
51
+ cursor: pointer;
52
+ width: 3.6em;
53
+ height: 1.8em;
54
+ margin: 0;
55
+ background: grey;
56
+ display: block;
57
+ border-radius: 1.8em;
58
+ position: relative;
59
+ transition: 0.3s;
60
+
61
+ &:active:after {
62
+ width: 2.34em;
63
+ }
64
+
65
+ &:after {
66
+ content: "";
67
+ position: absolute;
68
+ top: 0.1em;
69
+ left: 0.1em;
70
+ width: 1.6em;
71
+ height: 1.6em;
72
+ background: #fff;
73
+ border-radius: 1.6em;
74
+ transition: 0.3s;
75
+ }
76
+
77
+ span {
78
+ position: absolute;
79
+ top: 0;
80
+ left: 0;
81
+ right: 0;
82
+ bottom: 0;
83
+ display: flex;
84
+ justify-content: space-between;
85
+ align-items: center;
86
+ padding: 0 12.5%;
87
+ font-size: 10px;
88
+
89
+ &::before,
90
+ &::after {
91
+ display: block;
92
+ color: #fff;
93
+ font-weight: bold;
94
+ box-sizing: border-box;
95
+ }
96
+
97
+ &::before {
98
+ content: "ON";
99
+ }
100
+
101
+ &::after {
102
+ content: "OFF";
103
+ color: #ccc;
104
+ }
105
+ }
106
+ }
107
+
108
+ &:checked + label {
109
+ background: var(--b-btn-bg);
110
+
111
+ &:after {
112
+ left: calc(100% - 0.1em);
113
+ transform: translateX(-100%);
114
+ }
115
+ }
116
+ }
117
+
118
+ img[data-loading],
119
+ img[data-failed] {
120
+ width: 40px;
121
+ }
122
+
123
+ details > summary {
124
+ list-style: none;
125
+
126
+ &::-webkit-details-marker,
127
+ &::marker {
128
+ display: none;
129
+ }
130
+ }
131
+
132
+ summary::before {
133
+ border-bottom: 6px solid transparent;
134
+ border-left: 10px solid var(--b-txt);
135
+ border-top: 6px solid transparent;
136
+ content: "";
137
+ display: inline-block;
138
+ height: 0;
139
+ margin-right: 10px;
140
+ position: relative;
141
+ transition: 0.2s;
142
+ width: 0;
143
+ }
144
+
145
+ details[open] summary::before {
146
+ transform: rotate(90deg);
147
+ }
148
+
149
+ h2,
150
+ h3,
151
+ h4,
152
+ h5 {
153
+ margin: 1.5em 0 0.6em;
154
+ }
155
+
156
+ table {
157
+ tr {
158
+ .caption {
159
+ margin: 1em 0 0;
160
+ }
161
+ }
162
+ }
163
+
164
+ .back-to-top {
165
+ position: fixed;
166
+ z-index: 2;
167
+ right: -108px;
168
+ bottom: 0;
169
+ width: 108px;
170
+ height: 150px;
171
+ background: url("./img/back-to-top.png?v=1") no-repeat 0 0;
172
+ background-size: 108px 450px;
173
+ opacity: 0.6;
174
+ transition: opacity 0.3s, right 0.8s;
175
+ cursor: pointer;
176
+
177
+ &:hover {
178
+ background-position: 0 -150px;
179
+ opacity: 1;
180
+ }
181
+
182
+ &::after {
183
+ content: "";
184
+ position: fixed;
185
+ z-index: 2;
186
+ right: 0;
187
+ bottom: 0;
188
+ width: 108px;
189
+ height: 150px;
190
+ background: url("./img/back-to-top.png?v=1") no-repeat 0 0;
191
+ background-size: 108px 450px;
192
+ background-position: 0 -300px;
193
+ transition: opacity 0.3s;
194
+ opacity: 0;
195
+ pointer-events: none;
196
+ }
197
+
198
+ &.load {
199
+ right: 0;
200
+ }
201
+
202
+ &.ani-leave {
203
+ background-position: 0 -150px;
204
+ animation: ani-leave 390ms ease-in-out forwards;
205
+
206
+ @keyframes ani-leave {
207
+ 0% {
208
+ transform: translateX(0);
209
+ }
210
+
211
+ 100% {
212
+ transform: translateX(108px);
213
+ }
214
+ }
215
+ }
216
+
217
+ &.leaved,
218
+ &.ending {
219
+ pointer-events: none;
220
+ }
221
+
222
+ &.leaved {
223
+ background: none;
224
+ transition: none;
225
+ }
226
+
227
+ &.ending::after {
228
+ opacity: 1;
229
+ transition-delay: 0.35s;
230
+ }
231
+ }
232
+
233
+ @media screen and (min-width: 800px) {
234
+ body {
235
+ max-width: ~"min(90%, 800px)";
236
+ }
237
+ }
238
+
239
+ @media screen and (max-width: 900px) {
240
+ iframe {
241
+ display: none;
242
+ }
243
+ }
assets/theme/3d-num/0.gif ADDED
assets/theme/3d-num/1.gif ADDED
assets/theme/3d-num/2.gif ADDED
assets/theme/3d-num/3.gif ADDED
assets/theme/3d-num/4.gif ADDED
assets/theme/3d-num/5.gif ADDED
assets/theme/3d-num/6.gif ADDED
assets/theme/3d-num/7.gif ADDED
assets/theme/3d-num/8.gif ADDED
assets/theme/3d-num/9.gif ADDED
assets/theme/ai-1/0.png ADDED
assets/theme/ai-1/1.png ADDED
assets/theme/ai-1/2.png ADDED
assets/theme/ai-1/3.png ADDED
assets/theme/ai-1/4.png ADDED
assets/theme/ai-1/5.png ADDED
assets/theme/ai-1/6.png ADDED
assets/theme/ai-1/7.png ADDED
assets/theme/ai-1/8.png ADDED
assets/theme/ai-1/9.png ADDED
assets/theme/asoul/0.gif ADDED
assets/theme/asoul/1.gif ADDED
assets/theme/asoul/2.gif ADDED
assets/theme/asoul/3.gif ADDED
assets/theme/asoul/4.gif ADDED
assets/theme/asoul/5.gif ADDED
assets/theme/asoul/6.gif ADDED
assets/theme/asoul/7.gif ADDED
assets/theme/asoul/8.gif ADDED
assets/theme/asoul/9.gif ADDED
assets/theme/booru-ffsr/0.gif ADDED
assets/theme/booru-ffsr/1.gif ADDED
assets/theme/booru-ffsr/2.gif ADDED
assets/theme/booru-ffsr/3.gif ADDED
assets/theme/booru-ffsr/4.gif ADDED
assets/theme/booru-ffsr/5.gif ADDED
assets/theme/booru-ffsr/6.gif ADDED
assets/theme/booru-ffsr/7.gif ADDED
assets/theme/booru-ffsr/8.gif ADDED