-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
61 lines (60 loc) · 2.3 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
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
</head>
<style>
body {
background-color: #032B43
}
#surround {
background-color: #F8F4E3;
text-align: center;
border-radius: 4em;
}
button {
background-color: #305252;
color: #FFFFFF;
border-radius: 1em;
padding: 1em;
}
</style>
<body>
<div id="surround">
<div>
<h1 style="margin:1rem">I think the world revolves around...</h1>
<button id="button-me">Me!</button>
<button id="button-santa">Santa</button>
<button id="button-cyprus">Cyprus</button>
<button id="button-capehorn">Cape Horn</button>
<button id="button-new-york">New York</button>
<button id="button-beijing">Beijing</button>
<button id="button-paris">Paris</button>
<br/>
<p style="margin:1rem">Latitude (-90 to 90):
<input type="number" id="custom-lat" name="custom latitude" min="-90" max="90" value=0.0 step=5.0>
Longitude (-180 to 180):
<input type="number" id="custom-long" name="custom longitude" min="-180" max="180" value=0.0 step=5.0>
</p>
Zoom (0 to 1):
<input type="number" id="zoominput" name="zoom" min="0" max="1" value=0.95 step=0.05>
<br/>
<br/>
</div>
<p id="loading-message" style="position:absolute; text-align:center;width:100%;">
<br/>
<br/>
<br/>
Loading...
</p>
<canvas id="canvas" height="750rem" width="750rem"></canvas>
<br/>
<br/>
<p>This was a fun opportunity for me to learn Rust/JS interop. The image generation is all done in Rust using <a href="https://docs.rs/web-sys/latest/i686-unknown-linux-gnu/web_sys/index.html">Web-sys</a> and <a href="https://github.com/rustwasm/wasm-bindgen">wasm-bindgen</a>. I was inspired by <a href="https://mathworld.wolfram.com/AzimuthalEquidistantProjection.html"> Azimuthal Equidistant Projection</a> as it does a really good job of making one spot look like the center of the world. I got the map of the Earth from <a href="https://en.wikipedia.org/wiki/File:Blue_Marble_2002.png">wikipedia</a>.</p>
<p><a href="https://github.com/zaporter/latticeanimal-center-of-the-world">Source Code</a></p>
<br/>
<br/>
<br/>
<br/>
</div>
</body>
</html>