-
Notifications
You must be signed in to change notification settings - Fork 0
/
reverse.html
88 lines (70 loc) · 3.96 KB
/
reverse.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 Reversed</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 Roller-upper</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 Rolling-upping</button>
</div>
</div>
<div class="text-section">
<h2>What is this?</h2>
<p>Inspired by discussions of cardinality, this program stretches an image and draws 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 should automatically be resized to 1024x1 and displayed in the top box.</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="index.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-reverse">
<div class="input">
<div class="input-group">
<canvas id="original" class="line-image" width="1024" height="1"></canvas>
</div>
</div>
<div class="results-horizontal">
<div class="square-results-group">
<h3>Z-order curve</h3>
<canvas id="z-order" class="square-image" width="32" height="32"></canvas>
</div>
<div class="square-results-group">
<h3>Hilbert curve</h3>
<canvas id="hilbert" class="square-image" width="32" height="32"></canvas>
</div>
<div class="square-results-group">
<h3>Peano curve</h3>
<canvas id="peano" class="square-image" width="27" height="27"></canvas>
</div>
</div>
</div>
</div>
<script src="curves.js"></script>
<script src="reverse.js"></script>
</body>
</html>