-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
88 lines (70 loc) · 3.93 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Space Filling Image</title>
<link rel="icon" type="image/png" href="./sample.png" />
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Josefin+Sans&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="container">
<div class="sidebar-container">
<div class="sidebar">
<h1>Space-Filling Curve Image Unroller</h1>
<h2>Upload an image:</h2>
<div class="file-input">
<div>
<button id="browse">Browse...</button>
<span id="selected-file">No file selected.</span>
<input type="file" style="display:none;" accept="image/*" id="img-input" />
</div>
<div>
<button id="sample" onclick="load_sample()">Use Sample Image</button>
</div>
<div>
<button id="unroll" onclick="do_it()">Start Unrolling</button>
</div>
</div>
<div class="text-section">
<h2>What is this?</h2>
<p>Inspired by discussions of cardinality, this program takes an image and traces it along three different space filling curves.</p>
<p>A more in-depth writeup can be found in the GitHub repository, linked <a href="https://github.com/richzli/space-filling-image/blob/master/README.md">here</a>.</p>
</div>
<div class="text-section">
<h2>How does it work?</h2>
<p>Start by uploading any image into the input box. You can also click the "Use Sample Image" button to load a sample image. It will be automatically resized to 32x32. The best images to use should have distinct groups of color.</p>
<p>Then click the "Start Unrolling" button to fill out the lower three images. You can right-click them to save them on your computer, if you wish.</p>
<p>Want to do the calculations in the reverse direction? Click <a href="reverse.html">here</a>.</p>
</div>
<h4>Check out the <a href="https://github.com/richzli/space-filling-image/">Github repository</a> here!</h4>
<h4 class="right-aligned">made by <a href="https://richz.li/">richard li</a></h4>
</div>
</div>
<div class="results-container">
<div class="input">
<div class="input-group">
<canvas id="original" class="square-image" width="32" height="32"></canvas>
</div>
</div>
<div class="results">
<div class="line-results-group">
<h3>Z-order curve</h3>
<canvas id="z-order" class="line-image" width="1024" height="50"></canvas>
</div>
<div class="line-results-group">
<h3>Hilbert curve</h3>
<canvas id="hilbert" class="line-image" width="1024" height="50"></canvas>
</div>
<div class="line-results-group">
<h3>Peano curve</h3>
<canvas id="peano" class="line-image" width="729" height="50"></canvas>
</div>
</div>
</div>
</div>
<script src="curves.js"></script>
<script src="index.js"></script>
</body>
</html>