-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
84 lines (72 loc) · 4.76 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
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>dithertool</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="description" content="An online tool that dithers uploaded images, entirely on client side without a server component.">
<link rel="stylesheet" href="src/styles.css">
<link rel="icon" href="favicon.png">
</head>
<body class="text-gray-800">
<div class="flex flex-row">
<div class="flex flex-col min-h-screen p-1 border-r-4 border-pink-400 bg-slate-100 basis-1/6">
<h1
class="text-6xl font-extrabold text-right text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-pink-600">
dithertool</h1>
<h1
class="font-mono text-xs font-extrabold text-right text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-pink-600">
powered by FFmpeg</h1>
<div id="options" class="flex flex-col gap-6 mt-5">
<div>
<label for="uploader" class="block mb-2 text-lg font-medium"> 1️⃣ Choose an image </label>
<input type="file" id="uploader" accept="image/*">
</div>
<div class="flex justify-center">
<img class="max-h-48" id="thumbnail">
</div>
<div>
<label for="colors" class="block mb-2 text-lg font-medium"> 2️⃣ Choose a palette </label>
<select name="colors" id="colors"
class="block w-full p-2 text-base text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500">
<option value="gen">use picture's colors (4 colors)</option>
<option value="bw">black & white (2 colors)</option>
<option value="g3">black & white & grey (3 colors)</option>
<option value="gb">GameBoy (4 colors)</option>
<option value="c64">C64 (16 colors)</option>
<option value="demichrome">demichrome (4 colors)</option>
<option value="autumn">autumn (4 colors)</option>
<option value="win16">Windows (16 colors)</option>
<option value="bw6">"Black and White 6" (6 colors)</option>
</select>
</div>
<div>
<label for="dither" class="block mb-2 text-lg font-medium"> 3️⃣ Choose an algorithm </label>
<select name="dither" id="dither"
class="block w-full p-2 text-base text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500">
<option value="bayer">Bayer</option>
<option value="heckbert">Heckbert</option>
<option value="floyd_steinberg">Floyd & Steinberg</option>
<option value="sierra2">Frankie Sierra v2 </option>
<option value="sierra2_4a">Frankie Sierra v2 "Lite"</option>
</select>
</div>
<button type="button" id="ditherbutton"
class="min-w-full px-5 py-2 mr-2 text-xl font-medium text-white bg-purple-700 rounded-lg hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 mb-2focus:outline-none">
<span id="dithertext"> dither! </span>
<svg id="ditherspinner" aria-hidden="true" role="status" class="hidden w-4 h-4 m-1.5 text-white animate-spin" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="#E5E7EB"/>
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentColor"/>
</svg>
</button>
</div>
<div class="mt-auto">
<a target="_blank" class="text-blue-500 underline" href="https://github.com/ijanos/dither">source</a>
</div>
</div>
<div class="bg-[url('/grid.png')] bg-repeat basis-5/6">
<img class="p-2" src="data:image/gif;base64,R0lGODlhAQABAIABAAAAAJmZmSH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" id="output-image" alt="dithered output image"></img>
</div>
</div>
<script type="module" src="src/index.ts"></script>
</body>
</html>