|
1 | 1 | <script lang="ts"> |
2 | 2 | import appLogo from "./assets/128x128@2x.png" |
3 | | - import { feedDownloadError, fetchingFeed, feedData, refreshInterval, refreshIntervalTimer } from "./store" |
| 3 | + import { feedDownloadError, fetchingFeed, feedData } from "./store" |
4 | 4 | import { tooltip } from "./tooltip" |
5 | | - import { refreshFeed, startFeedRefreshInterval } from "./feed" |
| 5 | + import { refreshFeed } from "./feed" |
6 | 6 | import { round1, timestampToLocalString } from "./utils" |
7 | 7 | import SettingsButton from "./lib/SettingsButton.svelte" |
8 | | -
|
9 | 8 | </script> |
10 | 9 |
|
11 | 10 | <main class="w-full overflow-hide"> |
12 | | - <header class="sticky top-0 z-10 bg-gray-100"> |
| 11 | + <header class="sticky top-0 z-10 bg-gray-100 dark:bg-gray-900"> |
13 | 12 | <div class="flex items-center justify-between gap-4 px-4 py-2"> |
14 | 13 | <button |
15 | 14 | on:click={refreshFeed} |
|
22 | 21 | </button> |
23 | 22 |
|
24 | 23 | {#if $fetchingFeed} |
25 | | - <small class="font-xs text-gray-600">fetching data...</small> |
| 24 | + <small class="font-xs dark:text-gray-400">fetching data...</small> |
26 | 25 | {/if} |
27 | 26 |
|
28 | 27 | {#if $feedDownloadError} |
29 | 28 | <small class="font-xs text-red-600">{$feedDownloadError}</small> |
30 | 29 | {/if} |
31 | 30 |
|
32 | | - <!-- <small class="font-xs text-gray-600" title={timestampToLocalString($lastFetchedAt)}> |
| 31 | + <!-- <small class="font-xs dark:text-gray-400" title={timestampToLocalString($lastFetchedAt)}> |
33 | 32 | {diffForHumans($lastFetchedAt)} |
34 | 33 | </small> --> |
35 | 34 |
|
36 | 35 | <SettingsButton /> |
37 | 36 | </div> |
38 | 37 |
|
39 | 38 | {#if $feedData && $feedData.type === "FeatureCollection"} |
40 | | - <div class="w-full bg-white p-2 text-sm border-b"> |
| 39 | + <div class="w-full bg-white dark:bg-gray-800 p-2 text-sm border-b dark:border-gray-600"> |
41 | 40 | {$feedData.metadata.title} - <small class="font-bold text-xs">{$feedData.metadata.count}</small> events |
42 | 41 | </div> |
43 | 42 | {/if} |
44 | 43 | </header> |
45 | 44 |
|
46 | 45 | {#if $feedData && $feedData.type === "FeatureCollection"} |
47 | | - <div class="w-full h-full min-h-screen bg-white"> |
| 46 | + <div class="w-full h-full min-h-screen bg-white dark:bg-gray-800"> |
48 | 47 | {#each $feedData.features as feature} |
49 | | - <div class="flex items-center justify-between border-b hover:bg-gray-100 p-2"> |
| 48 | + <div |
| 49 | + class="flex items-center justify-between border-b dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-900 p-2" |
| 50 | + > |
50 | 51 | <div class="w-full flex items-center gap-4"> |
51 | 52 | <div class="w-8 text-center"> |
52 | 53 | <span class:font-bold={feature.properties.mag >= 4.5} class:text-red-600={feature.properties.mag >= 7}> |
|
57 | 58 | <p class:font-bold={feature.properties.mag >= 4.5} class:text-red-600={feature.properties.mag >= 7}> |
58 | 59 | {feature.properties.place} |
59 | 60 | </p> |
60 | | - <small class="font-xs text-gray-600">{timestampToLocalString(feature.properties.time)}</small> |
| 61 | + <small class="font-xs dark:text-gray-400">{timestampToLocalString(feature.properties.time)}</small> |
61 | 62 | </div> |
62 | 63 | </div> |
63 | 64 |
|
64 | 65 | <div class="w-24 text-right"> |
65 | | - <small class="font-xs text-gray-600" title="Depth"> |
| 66 | + <small class="font-xs dark:text-gray-400" title="Depth"> |
66 | 67 | {round1(feature.geometry.coordinates[2])} km |
67 | 68 | </small> |
68 | 69 | </div> |
69 | 70 | </div> |
70 | 71 | {/each} |
71 | 72 | </div> |
72 | 73 | {:else} |
73 | | - <p class="mt-36 text-center text-gray-600">💡 click the logo to refresh earthquake data</p> |
| 74 | + <p class="mt-36 text-center dark:text-gray-400">💡 click the logo to refresh earthquake data</p> |
74 | 75 | {/if} |
75 | 76 | </main> |
76 | 77 |
|
|
0 commit comments