forked from u-blusky/sweph-wasm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
355 lines (328 loc) · 15.7 KB
/
index.html
File metadata and controls
355 lines (328 loc) · 15.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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Sweph-Wasm">
<meta name="author" content="u-blusky">
<meta name="generator" content="">
<title>Sweph-Wasm</title>
<link rel="shortcut icon" href="assets/img/favicon.ico" type="image/x-icon">
<link rel="icon" href="assets/img/favicon.ico" type="image/x-icon">
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<style>
.myDivLonLat {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
}
.myPadding {
padding: .375rem .75rem !important;
}
.myTable {
padding: 0 !important;
margin: 0 !important;
width: 100%;
}
.myTable th:first-of-type {
text-align: right;
}
.myTable th {
text-align: center;
padding-right: 40px;
}
.myTable td {
text-align: right;
padding-right: 40px;
}
.asteroid-preset {
display: inline-block;
margin: 2px;
padding: 2px 8px;
background-color: #e9ecef;
border-radius: 12px;
font-size: 12px;
cursor: pointer;
border: 1px solid #dee2e6;
}
.asteroid-preset:hover {
background-color: #dee2e6;
}
.asteroid-preset.selected {
background-color: #0d6efd;
color: white;
}
</style>
</head>
<body class="bg-light">
<div class="container">
<main>
<div class="text-center" style="margin:50px auto;max-width:700px;">
<h2>Sweph-Wasm <span class="badge bg-success">Single File</span></h2>
<p class="lead">Complete Swiss Ephemeris in a single 6.1MB file. All planets and houses for dates 600-2400, asteroids 5-50 for dates 1504-2400.</p>
<div class="alert alert-success" role="alert">
<strong>✅ Optimized Single File Build:</strong><br>
• One file: <code>astro-embedded.js</code> (6.1MB)<br>
• No separate .wasm or .data files to load<br>
• Includes all 49 ephemeris files embedded<br>
• 5% smaller than 3-file version (6.4MB → 6.1MB)<br>
<small>Complete Swiss Ephemeris accuracy with simplified deployment</small>
</div>
</div>
<div class="row g-5" style="margin:0 auto;max-width:700px;">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="margin-top:0;">
<h4 class="d-flex justify-content-between align-items-center mb-3">
<span class="text-primary">Input data</span>
</h4>
<ul class="list-group mb-3">
<li class="list-group-item d-flex justify-content-between lh-sm">
<div class="col-sm-5">
<h6 class="my-0">Date</h6>
<small class="text-muted">Range years 600 - 2400</small>
</div>
<div class="col-sm-7">
<input type="date" id="initDate" class="form-control" min="0600-01-01" max="2400-12-31"
pattern="\d{4}-\d{2}-\d{2}" required />
</div>
</li>
<li class="list-group-item d-flex justify-content-between lh-sm">
<div class="col-sm-5">
<h6 class="my-0">Time</h6>
<small class="text-muted">Time in UT (Universal Time)</small>
</div>
<div class="col-sm-7">
<input type="time" id="initTime" class="form-control" required />
</div>
</li>
<li class="list-group-item d-flex justify-content-between lh-sm">
<div class="col-sm-5">
<h6 class="my-0">Longitude</h6>
<small class="text-muted">For Calculate houses</small>
</div>
<div class="col-sm-7">
<div class="myDivLonLat">
<div style="width: 60px;margin-right:5px;">
<input type="text" id="lonG" class="form-control myPadding"
oninput="this.value = this.value.replace(/[^0-9]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"
required />
</div>
<div style="width: 10px;">°</div>
<div style="width: 50px;margin-right:5px;">
<input type="text" id="lonM" class="form-control myPadding"
oninput="this.value = this.value.replace(/[^0-9]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"
required />
</div>
<div style="width: 10px;margin-right:5px;">'</div>
<div style="width: 50px;">
<input type="text" id="lonS" class="form-control myPadding"
oninput="this.value = this.value.replace(/[^0-9]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"
required />
</div>
<div style="width: 10px;">"</div>
<select class="form-select myPadding" id="lonEW" style="margin-left:5px;width:90px;" required>
<option value="E">E</option>
<option value="W">W</option>
</select>
</div>
</div>
</li>
<li class="list-group-item d-flex justify-content-between lh-sm">
<div class="col-sm-5">
<h6 class="my-0">Latitude</h6>
<small class="text-muted">For calculate houses</small>
</div>
<div class="col-sm-7">
<div class="myDivLonLat">
<div style="width: 60px;margin-right:5px;">
<input type="text" id="latG" class="form-control myPadding"
oninput="this.value = this.value.replace(/[^0-9]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"
required />
</div>
<div style="width: 10px;">°</div>
<div style="width: 50px;margin-right:5px;">
<input type="text" id="latM" class="form-control myPadding"
oninput="this.value = this.value.replace(/[^0-9]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"
required />
</div>
<div style="width: 10px;margin-right:5px;">'</div>
<div style="width: 50px;">
<input type="text" id="latS" class="form-control myPadding"
oninput="this.value = this.value.replace(/[^0-9]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"
required />
</div>
<div style="width: 10px;">"</div>
<select class="form-select myPadding" id="latNS" style="margin-left:5px;width:90px;" required>
<option value="N">N</option>
<option value="S">S</option>
</select>
</div>
</div>
</li>
<li class="list-group-item d-flex justify-content-between lh-sm">
<div class="col-sm-5">
<h6 class="my-0">House System</h6>
<small class="text-muted">For calculate houses</small>
</div>
<div class="col-sm-7">
<select class="form-select myPadding" id="houseSystem" style="margin-left:5px;" required>
<option value="P">Placidus</option>
<option value="K">Koch</option>
<option value="O">Porphyry</option>
<option value="R">Regiomontanus</option>
<option value="C">Campanus</option>
<option value="A">Equal</option>
<option value="E">Equal</option>
<option value="V">Equal/Vehlow</option>
<option value="W">Equal/Whole Sign</option>
<option value="M">Morinus</option>
<option value="B">Alcabitius</option>
<option value="T">Polich/Page (Topocentric)</option>
<option value="S">Sripati</option>
<option value="G">Gauquelin Sectors</option>
<option value="H">Horizon/Azimut</option>
<option value="X">Axial Rotation/Meridian</option>
<option value="Y">APC Houses</option>
<option value="L">Pullen SD</option>
<option value="Q">Pullen SR</option>
<option value="F">Carter Poli-Equ.</option>
<option value="I">Sunshine</option>
<option value="i">Sunshine/Alt.</option>
<option value="J">Savard-A</option>
<option value="U">Krusinski-Pisa-Goelzer</option>
<option value="N">Equal/1=Aries</option>
<option value="D">Equal (MC)</option>
</select>
</div>
</li>
<li class="list-group-item d-flex justify-content-between lh-sm">
<div class="col-sm-5">
<h6 class="my-0">Calculate Nodes</h6>
<small class="text-muted">Planetary nodes and apsides</small>
</div>
<div class="col-sm-7">
<div class="form-check" style="margin-top: 8px;">
<input class="form-check-input" type="checkbox" id="calculateNodes" checked>
<label class="form-check-label" for="calculateNodes">
Include planetary nodes
</label>
</div>
</div>
</li>
<li class="list-group-item d-flex justify-content-between lh-sm">
<div class="col-sm-5">
<h6 class="my-0">Node Method</h6>
<small class="text-muted">Calculation method for nodes</small>
</div>
<div class="col-sm-7">
<select class="form-select myPadding" id="nodeMethod" style="margin-left:5px;">
<option value="0">Mean (Sun-Neptune), Osculating (Pluto+)</option>
<option value="1">Osculating (All planets)</option>
<option value="2">Barycentric Osculating (Outer planets)</option>
<option value="4">Focal Points (instead of aphelia)</option>
</select>
</div>
</li>
<li class="list-group-item d-flex justify-content-between lh-sm">
<div class="col-sm-5">
<h6 class="my-0">Calculate Asteroids</h6>
<small class="text-muted">Asteroids 5-50 included in this build<br>
<strong>Note:</strong> Available for dates 1504-2400 only</small>
</div>
<div class="col-sm-7">
<div class="form-check" style="margin-top: 8px;">
<input class="form-check-input" type="checkbox" id="calculateAsteroids" checked>
<label class="form-check-label" for="calculateAsteroids">
Include asteroids (5-50 available)
</label>
</div>
</div>
</li>
<li class="list-group-item" id="asteroidOptions">
<div>
<h6 class="my-0">Asteroid Selection</h6>
<small class="text-muted">Choose from 46 available asteroids (5-50)</small>
</div>
<div class="mt-2">
<div class="form-check">
<input class="form-check-input" type="radio" name="asteroidMode" id="asteroidModePopular" value="popular" checked>
<label class="form-check-label" for="asteroidModePopular">
All 46 asteroids (5-50)
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="asteroidMode" id="asteroidModeRange" value="range">
<label class="form-check-label" for="asteroidModeRange">
Range within 5-50
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="asteroidMode" id="asteroidModeCustom" value="custom">
<label class="form-check-label" for="asteroidModeCustom">
Custom selection
</label>
</div>
</div>
<!-- Popular asteroids display -->
<div id="popularAsteroidsDiv" class="mt-3">
<div class="mb-2">
<strong>Available Asteroids (5-50):</strong>
<button type="button" class="btn btn-sm btn-outline-secondary ms-2" id="selectAllAsteroids">Select All</button>
<button type="button" class="btn btn-sm btn-outline-secondary ms-1" id="clearAllAsteroids">Clear All</button>
</div>
<div id="popularAsteroidsList">
<!-- Will be populated by JavaScript -->
</div>
</div>
<!-- Range input -->
<div id="asteroidRangeDiv" class="mt-3" style="display: none;">
<div class="row">
<div class="col-6">
<label for="asteroidStart" class="form-label">Start:</label>
<input type="number" class="form-control" id="asteroidStart" min="5" max="50" value="5">
</div>
<div class="col-6">
<label for="asteroidEnd" class="form-label">End:</label>
<input type="number" class="form-control" id="asteroidEnd" min="5" max="50" value="30">
</div>
</div>
<small class="text-muted">Available range: 5-50 (46 asteroids total)</small>
</div>
<!-- Custom list input -->
<div id="asteroidCustomDiv" class="mt-3" style="display: none;">
<label for="asteroidCustomList" class="form-label">Custom asteroid numbers (comma-separated):</label>
<textarea class="form-control" id="asteroidCustomList" rows="2" placeholder="5,6,7,8,16,19,26,37"></textarea>
<small class="text-muted">Available: 5-50 (e.g., 5,6,7,8,16,19,26,37 - max 46 asteroids)</small>
</div>
</li>
</ul>
<button type="button" id="btnCalculate" class="btn btn-secondary"
style="width:200px;float:right;">Calculate</button>
</div>
<div id="resultDiv" class="col-xs-12 col-sm-12 col-md-12 col-lg-12"
style="white-space:pre;font-family: monospace;font-size: 14px;padding: 0;">
</div>
</div>
</main>
<footer class="my-5 pt-5 text-muted text-center text-small">
<p class="mb-1">Sweph-Wasm based on <a href="https://www.astro.com/swisseph/swephinfo_e.htm?"
target="_blank">©Swiss Ephemeris</a></p>
</footer>
</div>
<div class="toast-container position-fixed bottom-0 end-0 p-3">
<div id="liveToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<strong class="me-auto">Sweph-Wasm</strong>
<small>Oops! Check the data</small>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div id="toastbody" class="toast-body"></div>
</div>
</div>
<script type="text/javascript" src="assets/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript" src="assets/js/jquery-3.6.4.min.js"></script>
<script type="text/javascript" src="assets/js/moment.min.js"></script>
<script type="text/javascript" src="js/sweph.js"></script>
<script type="text/javascript" src="js/calculate.js"></script>
</body>
</html>