-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
374 lines (266 loc) · 18.5 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
<!DOCTYPE html>
<html class="h-full">
<!--<link rel="preconnect" href="https://fonts.bunny.net">-->
<link rel="stylesheet" href="./index_full.css">
<!-- <link href="https://fonts.bunny.net/css?family=inter:100,200,300,400,500,600,700,800,900" rel="stylesheet" /> -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.1.5/purify.min.js"></script>
<script src="./index.js"></script>
<!--<script src="https://cdn.tailwindcss.com"></script>-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/dom-to-image/2.6.0/dom-to-image.min.js"
integrity="sha512-01CJ9/g7e8cUmY0DFTMcUw/ikS799FHiOA0eyHsUWfOetgbx/t6oV4otQ5zXKQyIrQGTHSmRVPIgrgLcZi/WMA=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="./js/jszip.js"></script>
<script src="./js/FileSaver.js"></script>
<script src="https://unpkg.com/lucide@latest"></script>
<head>
<title> Badger </title>
<link rel="icon" href="./img/badger.png" />
<meta name="title" content="Badger: A badge creator for the web">
<meta name="description" content="Create beautiful modern, and unique badges using Badger.">
<meta name="keywords" content="badge, design, edit">
<meta name="robots" content="index, follow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="English">
<meta name="author" content="WorldWidePixel">
<meta property="og:title" content="Badger: A badge creator for the web" />
<meta property="og:url" content="https://badger.worldwidepixel.ca/" />
<meta property="og:image" content="https://badger.worldwidepixel.ca/img/ogimg.png" />
<meta property="og:description" content="Create beautiful modern, and unique badges using Badger.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
console.log("%cBadger, by WorldWidePixel", "font-family: 'Inter', 'Helvetica', 'Segoe UI', sans-serif; font-size: 1.5rem;");
console.log("%cA badge designer for the web", "font-family: 'Inter', 'Helvetica', 'Segoe UI', sans-serif; font-size: 1rem;");
if (localStorage.getItem('theme') === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
//document.documentElement.classList.add('dark');
}
</script>
</head>
<div id="tooltips">
</div>
<body class="bg-white dark:bg-black dark:text-white h-full m-0">
<div id="page" class="p-4 gap-4 flex flex-col h-full">
<div class="flex flex-col md:flex-row gap-4 justify-between items-center">
<span class="flex flex-row gap-2 items-center text-xl select-none">
<img class="w-12 h-12" src="./img/badger.png">
Badger
<span class="font-[100] text-sm">
v1.3.7
</span>
<a target="_blank" class="flex flex-row gap-1 items-center border text-sm rounded-full p-2" href="https://badger-staging.worldwidepixel.ca">
<i data-lucide="sparkles" class="icon"></i>
Try the beta
</a>
</span>
<div class="flex-row gap-[1.5rem] items-center flex">
<span onclick="shareBadge()"
class="flex flex-row gap-2 border p-2 rounded-xl select-none cursor-pointer">
Share <i class="icon" data-lucide="share-2"></i>
</span>
<i id="light" onclick="toggleTheme()" class="hidden dark:block icon cursor-pointer"
data-lucide="sun"></i>
<i id="dark" onclick="toggleTheme()" class="block dark:hidden icon cursor-pointer"
data-lucide="moon"></i>
<a href="https://worldwidepixel.ca">
<img class="h-[30px] w-[30px] select-none" src="https://worldwidepixel.ca/img/icon512.png">
</a>
<a href="https://github.com/worldwidepixel/badger">
<i class="icon" data-lucide="github"></i>
</a>
<a href="./changelog.html">
<i class="icon" data-lucide="scroll"></i>
</a>
</div>
</div>
<hr>
<div class="flex items-center lg:items-start flex-col lg:flex-row gap-4 h-full">
<div class="flex flex-col gap-4 grow shrink-0">
<span class="select-none font-semibold text-3xl"> Edit </span>
<span class="font-medium text-xl"> Background Gradient </span>
<div class="flex flex-row gap-8 items-center">
<div class="flex flex-col gap-4">
<div class="flex flex-row gap-2 items-center">
<input
class="colourInput p-1 h-10 w-14 block dark:bg-black bg-white border dark:border-gray-700 border-gray-200 cursor-pointer rounded-lg disabled:opacity-50 disabled:pointer-events-none"
type="color" id="gradientStart" name="gradientStart" value="#076137" />
<label for="gradientStart">Top</label>
</div>
<div class="flex flex-row gap-2 items-center">
<input
class="colourInput p-1 h-10 w-14 block dark:bg-black bg-white border dark:border-gray-700 border-gray-200 cursor-pointer rounded-lg disabled:opacity-50 disabled:pointer-events-none"
type="color" id="gradientEnd" name="gradientEnd" value="#084e28" />
<label for="gradientEnd">Bottom</label>
</div>
</div>
<div id="gradientPreview" class="gradientPreview"
style="background: linear-gradient(180deg, #076137 0%, #084e28 100%)"></div>
</div>
<span class="font-medium text-xl"> Image </span>
<div class="flex flex-col gap-3">
<div class="flex flex-row gap-2 items-center">
<input
class="p-1 h-10 w-fit block dark:bg-black bg-white border dark:border-gray-700 border-gray-200 cursor-pointer rounded-lg disabled:opacity-50 disabled:pointer-events-none"
type="file" id="iconInput" name="iconInput" accept="image/png, image/jpeg" />
</div>
<div class="flex flex-row gap-2 items-center">
<label for="iconInput">Icon</label>
<img class="w-12 h-12" id="iconPreview" src="./img/badger.png">
</div>
</div>
<span class="font-medium text-xl"> Text </span>
<div class="flex flex-col gap-3">
<div class="flex flex-col lg:flex-row gap-2 lg:items-center">
<label for="textOneInput">Line/Part One</label>
<div class="flex flex-row gap-2 items-center">
<input
class="p-1 h-10 w-fit block dark:bg-black bg-white border dark:border-gray-700 border-gray-200 rounded-lg disabled:opacity-50 disabled:pointer-events-none"
type="text" id="textOneInput" name="textOneInput" placeholder="Type anything here" />
<input
class="colourInput p-1 h-10 w-14 block dark:bg-black bg-white border dark:border-gray-700 border-gray-200 cursor-pointer rounded-lg disabled:opacity-50 disabled:pointer-events-none"
type="color" id="textOneColour" name="textOneColour" value="#ffffff" />
</div>
</div>
<div class="flex flex-col lg:flex-row gap-2 lg:items-center">
<label for="textTwoInput">Line/Part Two</label>
<div class="flex flex-row gap-2 items-center">
<input
class="p-1 h-10 w-fit block dark:bg-black bg-white border dark:border-gray-700 border-gray-200 rounded-lg disabled:opacity-50 disabled:pointer-events-none"
type="text" id="textTwoInput" name="textTwoInput" placeholder="Type anything here" />
<input
class="colourInput p-1 h-10 w-14 block dark:bg-black bg-white border dark:border-gray-700 border-gray-200 cursor-pointer rounded-lg disabled:opacity-50 disabled:pointer-events-none"
type="color" id="textTwoColour" name="textTwoColour" value="#ff0000" />
</div>
</div>
</div>
<br>
</div>
<!-- VIEW PREVIEW -->
<div class="hidden lg:block h-full bg-[#e5e7eb] w-[1px]"></div>
<div class="select-none flex flex-col gap-4 grow-0 shrink">
<hr class="lg:hidden block">
<span class="font-semibold text-3xl"> View </span>
<div class="flex flex-row gap-2 w-fit">
<div id="cozyMinimal" style="background: linear-gradient(180deg, #076137 0%, #084e28 100%)"
class="badge">
<div class="cozyMinimalBody">
<img id="cozyMinimalImg" src="./img/badger.png" class="cozyImg"> </img>
</div>
</div>
<div id="cozy" style="background: linear-gradient(180deg, #076137 0%, #084e28 100%)" class="badge">
<div class="cozyBody">
<img id="cozyImg" src="./img/badger.png" class="cozyImg"> </img>
<div class="cozyTextContainer">
<span id="cozyLineOne" class="lineOne"> Anything here </span>
<span id="cozyLineTwo" class="lineTwo"> Something else </span>
</div>
</div>
</div>
</div>
<!-- COMPACT -->
<div class="flex flex-row gap-2 w-fit">
<div id="compactMinimal" style="background: linear-gradient(180deg, #076137 0%, #084e28 100%)"
class="badge">
<div class="compactMinimalBody">
<img id="compactMinimalImg" src="./img/badger.png" class="compactImg"> </img>
</div>
</div>
<div id="compact" style="background: linear-gradient(180deg, #076137 0%, #084e28 100%)"
class="badge">
<div class="compactBody">
<img id="compactImg" src="./img/badger.png" class="compactImg"> </img>
<div class="compactTextContainer">
<span id="compactLineOne" class="lineOne"> Anything here </span>
<span id="compactLineTwo" class="lineTwo"> Something else </span>
</div>
</div>
</div>
</div>
<hr>
<span class="font-semibold text-3xl"> Export </span>
<span id="exportAllPng" class="flex gap-2 flex-row rounded-lg border p-2 w-fit cursor-pointer"> Export
all in PNG (zipped) <i class="icon" data-lucide="image-down"></i></span>
<span id="exportAllSvg" class="flex gap-2 flex-row rounded-lg border p-2 w-fit cursor-pointer"> Export
all in SVG (zipped) <i class="icon" data-lucide="pen-tool"></i></span>
<div class="flex flex-row gap-2 items-center">
Cozy
<div class="flex gap-2 flex-row border rounded-lg p-2 w-fit cursor-pointer">
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Download PNG')" onclick="downloadPng(cozy)" class="w-fit"><i class="icon"
data-lucide="image-down"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy data URL')" onclick="copyDataUrl(cozy)" class="w-fit"><i class="icon" data-lucide="box"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy HTML sample')" onclick="copyHtmlSample(cozy)" class="w-fit"><i class="icon"
data-lucide="code-xml"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy MD sample')" onclick="copyMarkdownSample(cozy)" class="w-fit"><i class="icon"
data-lucide="a-arrow-down"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy image')" onclick="copyImage(cozy)" class="w-fit"><i class="icon" data-lucide="copy"></i></span>
</div>
</div>
<div class="flex flex-row gap-2 items-center">
Cozy Minimal
<div class="flex gap-2 flex-row border rounded-lg p-2 w-fit cursor-pointer">
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Download PNG')" onclick="downloadPng(cozyMinimal)" class="w-fit"><i class="icon"
data-lucide="image-down"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy data URL')" onclick="copyDataUrl(cozyMinimal)" class="w-fit"><i class="icon"
data-lucide="box"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy HTML sample')" onclick="copyHtmlSample(cozyMinimal)" class="w-fit"><i class="icon"
data-lucide="code-xml"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy MD sample')" onclick="copyMarkdownSample(cozyMinimal)" class="w-fit"><i class="icon"
data-lucide="a-arrow-down"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy image')" onclick="copyImage(cozyMinimal)" class="w-fit"><i class="icon"
data-lucide="copy"></i></span>
</div>
</div>
<div class="flex flex-row gap-2 items-center">
Compact
<div class="flex gap-2 flex-row border rounded-lg p-2 w-fit cursor-pointer">
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Download PNG')" onclick="downloadPng(compact)" class="w-fit"><i class="icon"
data-lucide="image-down"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy data URL')" onclick="copyDataUrl(compact)" class="w-fit"><i class="icon" data-lucide="box"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy HTML sample')" onclick="copyHtmlSample(compact)" class="w-fit"><i class="icon"
data-lucide="code-xml"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy MD sample')" onclick="copyMarkdownSample(compact)" class="w-fit"><i class="icon"
data-lucide="a-arrow-down"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy image')" onclick="copyImage(compact)" class="w-fit"><i class="icon" data-lucide="copy"></i></span>
</div>
</div>
<div class="flex flex-row gap-2 items-center">
Compact Minimal
<div class="flex gap-2 flex-row border rounded-lg p-2 w-fit cursor-pointer">
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Download PNG')" onclick="downloadPng(compactMinimal)" class="w-fit"><i class="icon"
data-lucide="image-down"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy data URL')" onclick="copyDataUrl(compactMinimal)" class="w-fit"><i class="icon"
data-lucide="box"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy HTML sample')" onclick="copyHtmlSample(compactMinimal)" class="w-fit"><i class="icon"
data-lucide="code-xml"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy MD sample')" onclick="copyMarkdownSample(compactMinimal)" class="w-fit"><i class="icon"
data-lucide="a-arrow-down"></i></span>
<div class="h-full bg-[#e5e7eb] w-[1px]"> </div>
<span onmouseleave="removeTooltip()" onmouseover="tooltip('Copy image')" onclick="copyImage(compactMinimal)" class="w-fit"><i class="icon"
data-lucide="copy"></i></span>
</div>
</div>
<br class="block lg:hidden">
</div>
</div>
</div>
</body>
<script>
lucide.createIcons();
</script>
</html>