-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
245 lines (242 loc) Β· 6.42 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
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#444455" />
<title>Tsoding Emote generator</title>
<style>
:root {
color-scheme: dark;
}
body {
background: #445;
color: white;
color-scheme: dark;
margin-bottom: 80px;
}
.main-wrapper {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
}
#CanvasResult {
border: 2px solid black;
}
button {
height: 36px;
user-select: none;
}
label, input, button {
cursor: pointer;
}
.layers-selector label {
display: flex;
align-items: center;
}
label {
display: inline-block;
line-height: 40px;
padding-left: 8px;
user-select: none;
}
label:hover {
background: #0002;
}
input {
transform: scale(1.5);
margin-right: 10px;
}
input[type="color"] {
margin: 0 23px;
}
.layers-selector {
display: flex;
flex-direction: column;
flex-wrap: wrap;
margin: 0;
max-height: 360px;
}
ul {
margin: 0;
list-style-type: none;
}
li {
line-height: 40px;
}
.unwanted {
text-decoration: line-through;
}
.desired {
text-decoration: underline;
}
.unicode-eyes {
width: 1.5em;
margin-left: 15px;
}
details {
margin: 1em 0;
}
summary {
width: fit-content;
padding: 20px 5px;
cursor: pointer;
}
summary:hover {
background: #0002;
}
kbd {
background-color: #eee;
border-radius: 3px;
border: 1px solid #b4b4b4;
box-shadow: 0 1px 1px rgba(0, 0, 0, .2), 0 2px 0 0 rgba(255, 255, 255, .7) inset;
color: #333;
display: inline-block;
font-size: 1.25em;
font-weight: 700;
line-height: 1;
padding: 2px 4px;
white-space: nowrap;
}
#CanvasHistory {
position: fixed;
bottom: 0;
left: 0;
cursor: pointer;
}
@media (max-width: 1450px) {
.layers-selector {
max-height: 490px;
}
}
@media (max-width: 1270px) {
.layers-selector {
max-height: 700px;
}
}
@media (max-width: 1000px) {
.main-wrapper {
flex-direction: column;
}
#CanvasResult {
position: sticky;
top: 0;
z-index: 1;
}
}
@media (max-width: 620px) {
.layers-selector {
max-height: none;
}
#CanvasResult {
width: 250px;
}
ul {
padding: 0;
}
label {
padding-left: 4px;
}
input {
margin-right: 6px;
transform: scale(1.2);
}
}
</style>
<script defer src="emote-generator.js"></script>
</head>
<body>
<p>Generator for emotes that are created by <a href="https://tsoding.org/">Tsoding</a> and his community.</p>
<div class="main-wrapper">
<canvas id="CanvasResult"></canvas>
<ul class="layers-selector">
</ul>
</div>
<button id="DownloadElem" title="Keyboard shortcut - D">Download</button>
<button id="ShareElem" title="Keyboard shortcut - S">Share</button>
<details open>
<summary>Randomization:</summary>
<ul id="randomization-selector">
<li>
<button id="Random-all" title="Keyboard shortcut - R">Randomize everything</button>
<label title="Randomize everything including color">
<input id="including-color" type="checkbox">
+ color
</label>
<label title="Randomize everything including order">
<input id="including-order" type="checkbox">
+ order
</label>
</li>
<li>
<button id="Random-eyes" title="Eyes">Randomize π</button>
<label title="limit randomization to one pair of eyes">
<input id="limit-eyes" type="checkbox" checked>
limit to 1
</label>
</li>
<li>
<button id="Random-mouth" title="Mouth">Randomize π</button>
<label title="limit randomization to one mouth">
<input id="limit-mouth" type="checkbox" checked>
limit to 1
</label>
</li>
<li>
<button id="Random-face" title="Face features">Randomize π</button>
<label title="limit randomization to one facial feature">
<input id="limit-face" type="checkbox">
limit to 1
</label>
</li>
<li>
<button id="Random-accessories" title="Accessories">Randomize πΆοΈ</button>
<label title="limit randomization to one accessory">
<input id="limit-accessories" type="checkbox">
limit to 1
</label>
</li>
<li>
<button id="Random-color" title="Keyboard shortcut - C">Randomize skin color</button>
<button id="Reset-color" title="Set default skin color (Shift+C)">Reset color</button>
</li>
<li>
<button id="Shuffle" title="Keyboard shortcut - S">Shuffle layer order</button>
<button id="Order-up" title="Move last clicked layer up (Arrow left)">β</button>
<button id="Order-down" title="Move last clicked layer down (Arrow right)">β</button>
<button id="Reset-order" title="Reset order of layers (Shift+S)">Reset order</button>
</li>
</ul>
</details>
<details>
<summary>Keyboard controls:</summary>
<ul>
<li>
<kbd>R</kbd> β press <strong>R</strong>andom button from randomization list
</li>
<li>
<kbd>C</kbd> β Random <strong>C</strong>olor (Shift+C to reset)
</li>
<li>
<kbd>D</kbd> β <strong>D</strong>ownload result
</li>
<li>
<kbd>Shift</kbd> Click β Lock enabled
</li>
<li>
<kbd>Ctrl</kbd> Click β Lock disabled
</li>
<li>
<kbd>β</kbd> or <kbd>β</kbd> β Change order of last selected layer
</li>
<li>
<kbd>S</kbd> β <strong>S</strong>huffle layer order (Shift+S to reset)
</li>
<li>
Ctrl Z β Undo, Ctrl Shift Z or Ctrl Y β Redo
</li>
</ul>
</details>
<canvas id="CanvasHistory"></canvas>
</body>
</html>