Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
265 lines (246 loc) · 11.7 KB
/
Copy pathindex.html
File metadata and controls
265 lines (246 loc) · 11.7 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="https://sunset.observable.science/">
<link rel="icon" href="favicon.ico" sizes="32x32 48x48">
<link rel="icon" href="img/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="img/apple-touch-icon.png">
<title>Sunset Visualiser</title>
<meta name="description" content="Why the Sun does not shrink as it sets, and what it would do if the Earth were flat. Every number is computed in the open and independently tested.">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="app">
<header class="topbar">
<div class="brand">
<h1>Sunset Visualiser</h1>
<p>A flat Earth predicts a Sun that shrinks as it sets. A globe predicts one that doesn’t.</p>
<p class="scenario" id="scenario-line"> </p>
</div>
<div class="globals">
<div class="picker-wrap">
<button type="button" class="pill" id="location-btn" aria-expanded="false" aria-controls="location-panel">
<svg viewBox="0 0 16 16" aria-hidden="true" class="pill-icon">
<circle cx="8" cy="8" r="6.4" fill="none" stroke="currentColor" stroke-width="1.3"/>
<ellipse cx="8" cy="8" rx="2.6" ry="6.4" fill="none" stroke="currentColor" stroke-width="1.3"/>
<path d="M1.8 8h12.4M2.9 4.8h10.2M2.9 11.2h10.2" stroke="currentColor" stroke-width="1.1" fill="none"/>
</svg>
<span id="location-label">Equator</span>
</button>
<div class="popover" id="location-panel" hidden>
<h3>Where, and when?</h3>
<canvas id="location-globe" width="240" height="240"
aria-label="Globe. Drag to spin it, click to choose a location."></canvas>
<div class="fields">
<label>Lat <input type="number" id="lat-input" min="-80" max="80" step="0.01"><span class="unit">°N</span></label>
<label>Lon <input type="number" id="lon-input" min="-180" max="180" step="0.01"><span class="unit">°E</span></label>
</div>
<div class="presets" id="location-presets"></div>
<div class="fields">
<label>Date <input type="date" id="date-input" min="2020-01-01" max="2040-12-31"></label>
</div>
<div class="presets" id="date-presets"></div>
<p class="hint" id="picker-note">Beyond 80° of latitude the Sun barely
climbs at an equinox and the whole window is twilight, so the picker stops
there. Some dates have no sunset at all at high latitude; those are refused.</p>
</div>
</div>
<div role="group" aria-label="Units">
<span class="seg-label">Units</span>
<span class="seg" id="units">
<button type="button" data-value="metric" aria-pressed="false">Metric</button>
<button type="button" data-value="imperial" aria-pressed="false">Imperial</button>
<button type="button" data-value="both" aria-pressed="true">Both</button>
</span>
</div>
<label class="field">
<span class="seg-label">Refraction</span>
<select id="refraction" aria-label="Atmospheric refraction"></select>
</label>
<span class="note" id="refraction-note"></span>
<nav>
<a href="tests.html">Verification tests</a>
<a href="maths.html">The maths</a>
<a href="privacy.html">Privacy</a>
<a href="https://github.com/james-debono/sunset-visualiser" target="_blank" rel="noopener"
title="Read the source, check the workings, or open an issue with a correction">Source & feedback on GitHub <span aria-hidden="true">↗</span></a>
<a href="https://www.youtube.com/@jamesdebono" target="_blank" rel="noopener">James DeBono on YouTube <span aria-hidden="true">↗</span></a>
</nav>
</div>
</header>
<main class="quads">
<!-- Top left: globe, camera -->
<section class="quad" aria-labelledby="h-globe-camera">
<div class="quad-head">
<span class="key globe" aria-hidden="true"></span>
<h2 id="h-globe-camera">Globe Earth <span class="view">· camera view</span></h2>
<span class="meta" id="globe-camera-meta"></span>
</div>
<div class="stage">
<canvas id="globe-camera" role="img" aria-label="Camera view of the sunset on a spherical Earth"></canvas>
<dl class="readout on-photo" id="globe-camera-readout"></dl>
</div>
</section>
<!-- Top right: globe, side -->
<section class="quad" aria-labelledby="h-globe-side">
<div class="quad-head">
<span class="key globe" aria-hidden="true"></span>
<h2 id="h-globe-side">Globe Earth <span class="view">· side view</span></h2>
<span class="meta">Distances not to scale · angles exact</span>
</div>
<div class="stage">
<canvas id="globe-side" role="img" aria-label="Diagram of the observer rotating on the Earth, showing the horizon line, the line to the Sun and the angle between them"></canvas>
<dl class="readout on-diagram" id="globe-side-readout"></dl>
</div>
</section>
<!-- Bottom left: flat, camera -->
<section class="quad" aria-labelledby="h-flat-camera">
<div class="quad-head">
<span class="key flat" aria-hidden="true"></span>
<h2 id="h-flat-camera">Flat Earth <span class="view">· camera view</span></h2>
<span class="meta" id="flat-camera-meta"></span>
</div>
<div class="stage">
<canvas id="flat-camera" role="img" aria-label="Camera view of the sunset if the Earth were flat"></canvas>
<dl class="readout on-photo" id="flat-camera-readout"></dl>
</div>
</section>
<!-- Bottom right: flat, side -->
<section class="quad" aria-labelledby="h-flat-side">
<div class="quad-head">
<span class="key flat" aria-hidden="true"></span>
<h2 id="h-flat-side">Flat Earth <span class="view">· side view</span></h2>
<span class="head-controls">
<span class="seg-label">Model</span>
<span class="seg seg-sm" id="path">
<button type="button" data-value="straight" aria-pressed="true" title="Local plane: the Sun recedes in a straight line at the measured speed of the subsolar point. The most charitable version.">Local plane</button>
<button type="button" data-value="gleason" aria-pressed="false" title="The azimuthal-equidistant disc that flat-Earth maps use. The Sun circles above the pole and its whole path follows from the map.">Gleason map</button>
</span>
</span>
</div>
<div class="quad-controls">
<label class="field">
Sun height
<input type="range" id="height-slider" min="0" max="1000" step="1" aria-label="Sun height, logarithmic slider">
</label>
<span class="field" id="height-km-field">
<input type="number" id="height-km" min="1" step="any" aria-label="Sun height in kilometres">
<span class="unit">km</span>
</span>
<span class="field" id="height-mi-field">
<span class="unit eq" id="height-eq" aria-hidden="true">=</span>
<input type="number" id="height-mi" min="1" step="any" aria-label="Sun height in miles">
<span class="unit">mi</span>
</span>
<label class="field">
<select id="height-presets" aria-label="Height presets"></select>
</label>
<label class="field" id="anchor-field">
Starts
<select id="anchor" aria-label="Where the flat Sun starts">
<option value="elevation">at the real elevation</option>
<option value="subsolar">above the real subsolar point</option>
</select>
</label>
<span class="field note" id="path-note" hidden>The map fixes where the Sun
starts and how it travels, so there is nothing left to choose.</span>
</div>
<div class="stage">
<canvas id="flat-side" role="img" aria-label="Scale diagram of the Sun moving away above a flat Earth, showing the line of sight and its angle to the ground"></canvas>
<dl class="readout on-diagram" id="flat-side-readout"></dl>
</div>
</section>
</main>
<section class="analysis" aria-label="Analysis">
<div class="card">
<div class="card-head">
<h3>Angular diameter</h3>
<span class="sub">arcminutes</span>
<span class="legend" aria-hidden="true">
<span><i class="key globe"></i>Globe</span>
<span><i class="key flat"></i>Flat</span>
</span>
</div>
<div class="chart" id="chart-size">
<canvas role="img" aria-label="Chart of angular diameter against time for both models"></canvas>
</div>
</div>
<div class="card">
<div class="card-head">
<h3>Rate of change</h3>
<span class="sub">arcseconds per minute · below zero = shrinking</span>
<span class="legend" aria-hidden="true">
<span><i class="key globe"></i>Globe</span>
<span><i class="key flat"></i>Flat</span>
</span>
</div>
<div class="chart" id="chart-rate">
<canvas role="img" aria-label="Chart of the rate of change of angular diameter against time for both models"></canvas>
</div>
</div>
<div class="card compare-card">
<div class="card-head">
<h3>Right now</h3>
<span class="sub" id="compare-time"></span>
<button type="button" class="link-btn" id="table-toggle" aria-expanded="false" style="margin-left:auto">Show data table</button>
</div>
<div id="compare-view">
<table class="compare" id="compare">
<thead>
<tr>
<th scope="col"></th>
<th scope="col"><i class="key globe"></i>Globe</th>
<th scope="col"><i class="key flat"></i>Flat</th>
</tr>
</thead>
<tbody></tbody>
</table>
<p class="verdict" id="verdict"></p>
</div>
<div class="table-view" id="table-view" hidden></div>
</div>
</section>
<footer class="transport" aria-label="Playback">
<div class="buttons">
<button type="button" class="icon-btn" id="restart" aria-label="Restart" title="Restart (Home)">
<svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M3 2h2v12H3zM14 2v12L6 8z"/></svg>
</button>
<button type="button" class="icon-btn primary" id="play" aria-label="Play" title="Play / pause (Space)">
<svg viewBox="0 0 16 16" aria-hidden="true" id="play-icon"><path fill="currentColor" d="M4 2.5v11l9.5-5.5z"/></svg>
</button>
</div>
<div class="clock" aria-live="off">
<div class="time" id="clock-time">15:00:00</div>
<div class="rel" id="clock-rel">apparent solar time</div>
</div>
<div class="scrub">
<input type="range" id="scrub" min="0" max="1" step="1" value="0" aria-label="Time">
<div class="scrub-ticks" id="scrub-ticks" aria-hidden="true"></div>
</div>
<div class="settings">
<label class="field">
Speed
<input type="range" id="speed" min="0" max="1000" step="1" aria-label="Playback speed">
<span class="value" id="speed-value"></span>
</label>
<label class="field">
Lens
<input type="range" id="focal" min="0" max="1" step="1" aria-label="Camera focal length">
<span class="value" id="focal-value"></span>
</label>
<label class="field">
Loupe
<select id="loupe" aria-label="Loupe focal length">
<option value="400">400 mm</option>
<option value="800" selected>800 mm</option>
<option value="1600">1600 mm</option>
</select>
</label>
</div>
</footer>
</div>
<script type="module" src="js/main.js"></script>
</body>
</html>