-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
243 lines (238 loc) · 8.21 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link
rel="icon"
href="https://cdn.discordapp.com/attachments/913760038361890867/931879891417317386/show.png"
/>
<meta
name="description"
content="Draw things with machines! Every time you lift your pen up, a machine learning algorithm tries to finish that stroke and match the category you've selected. Try drawing multiple categories on the same page!
"
/>
<meta
name="viewport"
content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=no"
/>
<meta
name="viewport"
content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=no"
/>
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="stylesheet" href="./style.css" />
<link
href="https://fonts.googleapis.com/css?family=IBM+Plex+Mono:400,700"
rel="stylesheet"
/>
<title>:)</title>
</head>
<body>
<div id="splash">
<div class="content">
<h1>SKETCHPAD :)</h1>
<p>
Draw things with machines! Every time you <b>lift your pen up</b>, a
machine learning algorithm tries to finish that stroke and match the
category you've selected. Try drawing multiple categories on the same
page!
</p>
<button class="box big" id="btnGo">Let's go!</button>
<p class="built-with">
Built by
<a target="_blank" href="https://www.instagram.com/lolwtf139/"
>@lolwtf139</a
>
with
<a target="_blank" href="https://magenta.tensorflow.org">Magenta.js</a
>. Learn more about
<a
target="_blank"
href="https://magenta.tensorflow.org/sketch-rnn-demo"
>Sketch RNN</a
>, or see the code on
<a target="_blank" href="https://github.com/XR7-Samir"
>Github</a
>.
</p>
</div>
</div>
<header>
<div class="wrapper top">
<div>
<h1></h1>
</div>
<div class="controls">
<button class="box" id="btnClear" alt="clear drawing">
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path fill="none" d="M0 0h24v24H0V0z" />
<path
d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"
/>
<path fill="none" d="M0 0h24v24H0z" />
</svg>
</button>
<button class="box" id="btnRetry" alt="retry magic drawing">
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path d="M0 0h24v24H0z" fill="none" />
<path
d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"
/>
</svg>
</button>
<div class="box select-wrapper">
<select id="selectModels"></select>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path d="M7 10l5 5 5-5z" />
<path d="M0 0h24v24H0z" fill="none" />
</svg>
</div>
<button class="box" id="btnSave" alt="save sketch">
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path d="M0 0h24v24H0z" fill="none" />
<path
d="M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"
/>
</svg>
</button>
<button class="box" id="btnHelp" alt="show help">
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path d="M0 0h24v24H0z" fill="none" />
<path
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"
/>
</svg>
</button>
</div>
</div>
<div class="wrapper">
<div>
<h1></h1>
</div>
<div id="colorsContainer">
<button
data-index="0"
style="background-color: rgb(0, 0, 0)"
class="active"
onclick="changeColor(event)"
></button>
<button
data-index="1"
style="background-color: rgb(244, 67, 54)"
onclick="changeColor(event)"
></button>
<button
data-index="2"
style="background-color: rgb(233, 30, 99)"
onclick="changeColor(event)"
></button>
<button
data-index="3"
style="background-color: rgb(156, 39, 176)"
onclick="changeColor(event)"
></button>
<button
data-index="4"
style="background-color: rgb(103, 58, 183)"
onclick="changeColor(event)"
></button>
<button
data-index="5"
style="background-color: rgb(63, 81, 181)"
onclick="changeColor(event)"
></button>
<button
data-index="6"
style="background-color: rgb(33, 150, 243)"
onclick="changeColor(event)"
></button>
<button
data-index="7"
style="background-color: rgb(0, 188, 212)"
onclick="changeColor(event)"
></button>
<button
data-index="8"
style="background-color: rgb(0, 150, 136)"
onclick="changeColor(event)"
></button>
<button
data-index="9"
style="background-color: rgb(76, 175, 80)"
onclick="changeColor(event)"
></button>
<button
data-index="10"
style="background-color: rgb(139, 195, 74)"
onclick="changeColor(event)"
></button>
<button
data-index="11"
style="background-color: rgb(205, 220, 57)"
onclick="changeColor(event)"
></button>
<button
data-index="12"
style="background-color: rgb(255, 235, 59)"
onclick="changeColor(event)"
></button>
<button
data-index="13"
style="background-color: rgb(255, 193, 7)"
onclick="changeColor(event)"
></button>
<button
data-index="14"
style="background-color: rgb(255, 152, 0)"
onclick="changeColor(event)"
></button>
<button
data-index="15"
style="background-color: rgb(255, 87, 34)"
onclick="changeColor(event)"
></button>
<button
data-index="16"
style="background-color: rgb(121, 85, 72)"
onclick="changeColor(event)"
></button>
<button
data-index="17"
style="background-color: rgb(158, 158, 158)"
onclick="changeColor(event)"
></button>
</div>
</div>
</header>
<div id="sketch" class="loading"></div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@magenta/[email protected]/dist/magentasketch.min.js"></script>
<script src="script.js"></script>
</html>