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
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mayu</title>
</head>
<body>
<style>
@import url("https://fonts.googleapis.com/css2?family=Overpass:ital,wght@0,100..900;1,100..900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");
body {
background-color: #0b1622;
color: rgb(159, 173, 189);
font-family: Roboto, -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
main {
background-color: #151f2e;
padding: 20px 35.4px;
border-radius: 4px;
display: flex;
gap: 80px;
max-width: 100%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-shadow: 0 0 8px -2px rgba(0, 0, 0, 0.1),
0 6px 20px -3px rgba(0, 0, 0, 0.2);
}
img {
display: block;
margin: 10px 0;
width: 100%;
border-radius: 3px;
}
h2 {
font-size: 1rem;
font-weight: 500;
margin-bottom: 15px;
}
input,
select {
background-color: rgb(11, 22, 34);
color: rgb(159, 173, 189);
border-radius: 4px;
border: 0;
height: 40px;
padding: 0 15px;
line-height: 40px;
display: inline-block;
font-size: 0.9rem;
}
::placeholder {
color: #9fadbd;
}
select {
color: #9fadbd;
}
select:focus {
outline: none;
}
input:focus {
outline: none;
}
.label {
margin-top: -10px;
padding-bottom: 0px;
font-size: 0.9rem;
color: rgb(114, 138, 161);
font-weight: normal;
}
pre {
font-family: monospace;
}
.copy-codes {
background-color: #0f1926;
padding: 10px;
border-radius: 4px;
color: #9fadbd;
font-size: 0.9rem;
overflow-x: auto;
white-space: pre-wrap;
word-wrap: break-word;
max-width: 100%;
margin-top: 30px;
}
a {
color: rgb(61, 180, 242);
text-decoration: none;
}
p {
font-size: 0.9rem;
color: #9fadbd;
line-height: 1.4;
}
.attribution {
position: absolute;
bottom: 20px;
left: 35.4px;
}
.attribution-2 {
display: none;
}
@media (max-width: 768px) {
main {
flex-direction: column;
gap: 60px;
}
.attribution-1 {
display: none;
}
.attribution-2 {
display: block;
}
.attribution {
position: unset;
margin-top: 40px;
}
}
</style>
<main>
<div>
<h2>Username</h2>
<p class="label">
Enter the username you'd like to use as the ID of your counter.
</p>
<input type="text" id="idInput" placeholder="@demo" />
<p></p>
<select id="themeSelect">
<option value="asoul">asoul</option>
<option value="gelbooru">gelbooru</option>
<option value="gelbooru-h">gelbooru-h</option>
<option value="moebooru">moebooru</option>
<option value="moebooru-h">moebooru-h</option>
<option value="rule34">rule34</option>
<option value="urushi">urushi</option>
</select>
<p class="attribution attribution-1">
Written by
<a href="https://anilist.co/user/fuwn/" target="_blank">@Fuwn</a>
<br />
Source code available on
<a href="https://github.com/Fuwn/mayu" target="_blank">GitHub</a>
</p>
</div>
<div class="counter">
<img
id="example"
src="https://counter.due.moe/get/@demo"
alt="Example counter"
/>
<pre id="copy-codes" class="copy-codes">hi</pre>
<p class="attribution attribution-2">
Written by
<a href="https://anilist.co/user/fuwn/" target="_blank">@Fuwn</a>
<br />
Source code available on
<a href="https://github.com/Fuwn/mayu" target="_blank">GitHub</a>
</p>
</div>
</main>
<script>
let inputTimeout;
const idInput = document.getElementById("idInput");
const themeSelect = document.getElementById("themeSelect");
const image = document.getElementById("example");
const copyCodesInput = document.getElementById("copy-codes");
let inputValue = "demo";
let themeValue = "asoul";
const set = () => {
inputValue = idInput.value || "demo";
themeValue = themeSelect.value || "asoul";
image.src = `https://counter.due.moe/get/@${inputValue}?theme=${themeValue}`;
copyCodesInput.innerText = `\n\n<img src="${image.src}" alt="${inputValue}" />`;
};
copyCodesInput.innerText = `\n\n<img src="${image.src}" alt="${inputValue}" />`;
idInput.addEventListener("input", () => {
clearTimeout(inputTimeout);
inputTimeout = setTimeout(set, 500);
});
themeSelect.addEventListener("change", set);
</script>
</body>
</html>
|