This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| solartime [2026/02/20 01:40] – created Yuki | solartime [2026/02/20 16:39] (current) – Yuki | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| font-family: | font-family: | ||
| src: url(" | src: url(" | ||
| + | } | ||
| + | #clock | ||
| + | { | ||
| + | text-align: center; | ||
| } | } | ||
| #output | #output | ||
| Line 10: | Line 14: | ||
| font-family: | font-family: | ||
| font-size: 12em; | font-size: 12em; | ||
| - | text-align: center; | + | |
| + | padding: 0 0.1em; | ||
| + | color: #fcc; | ||
| + | | ||
| + | } | ||
| } | } | ||
| </ | </ | ||
| - | < | + | < |
| - | <div id=" | + | <!-- Fallback contents if the element is not supported --> |
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | Longitude: <input id=" | ||
| + | | ||
| + | < | ||
| <script src=" | <script src=" | ||
| < | < | ||
| setInterval(()=> | setInterval(()=> | ||
| var instant = temporal.Temporal.Now.instant(); | var instant = temporal.Temporal.Now.instant(); | ||
| - | var time = parseFloat(document.querySelector("# | + | var time = parseFloat(document.querySelector("# |
| var zone = temporal.Temporal.Duration.from({nanoseconds: | var zone = temporal.Temporal.Duration.from({nanoseconds: | ||
| + | var gmt = temporal.Temporal.Instant.fromEpochNanoseconds(BigInt(Math.floor(Math.abs(time)*240000000000))) | ||
| instant=instant.add(zone); | instant=instant.add(zone); | ||
| - | document.querySelector("# | + | document.querySelector("# |
| + | document.querySelector("# | ||
| }, 100); | }, 100); | ||
| + | |||
| + | function handleLocation(event) { | ||
| + | // Directly access the GeolocationPosition object on the element | ||
| + | if (event.target.position) { | ||
| + | const { latitude, longitude } = event.target.position.coords; | ||
| + | console.log(" | ||
| + | document.querySelector("# | ||
| + | } else if (event.target.error) { | ||
| + | console.error(" | ||
| + | } | ||
| + | } | ||
| </ | </ | ||
| </ | </ | ||