diff --git a/src/Main.svelte b/src/Main.svelte index 56db596..bb3e99a 100644 --- a/src/Main.svelte +++ b/src/Main.svelte @@ -1,7 +1,7 @@ @@ -12,13 +12,19 @@
{#each $feedData.features as feature (feature.properties.code)}
-
- = 4.5} class:text-red-600={feature.properties.mag >= 7}> - {round1(feature.properties.mag)} - +
= 4.5 && !$magnitudeColorScale} + class:text-red-600={feature.properties.mag >= 7 && !$magnitudeColorScale} + > + {round1(feature.properties.mag)}
diff --git a/src/Settings.svelte b/src/Settings.svelte index 1097de5..e0cd13e 100644 --- a/src/Settings.svelte +++ b/src/Settings.svelte @@ -9,19 +9,23 @@ refreshIntervalTimer, DEFAULT_MAGNITUDE_NOTIFICATION_THRESHOLD, magnitudeNotificationThreshold, + magnitudeColorScale, } from "./store" import { startFeedRefreshInterval } from "./feed" import { tooltip } from "./tooltip" import { setTheme } from "./utils" + import { MagnitudeColor } from "./types" let selectedTheme = $theme $: newRefreshInterval = $refreshInterval $: newMagnitudeNotificationThreshold = $magnitudeNotificationThreshold + $: newMagnitudeColorScale = $magnitudeColorScale $: refreshIntervalChanged = newRefreshInterval !== $refreshInterval $: magnitudeNotificationThresholdChanged = newMagnitudeNotificationThreshold !== $magnitudeNotificationThreshold - $: disabled = !refreshIntervalChanged && !magnitudeNotificationThresholdChanged + $: magnitudeColorScaleChanged = newMagnitudeColorScale !== $magnitudeColorScale + $: disabled = !refreshIntervalChanged && !magnitudeNotificationThresholdChanged && !magnitudeColorScaleChanged const preferences = { themes: [ @@ -48,6 +52,10 @@ if (magnitudeNotificationThresholdChanged) { magnitudeNotificationThreshold.set(newMagnitudeNotificationThreshold || DEFAULT_MAGNITUDE_NOTIFICATION_THRESHOLD) } + + if (magnitudeColorScaleChanged) { + magnitudeColorScale.set(newMagnitudeColorScale) + } } function closeSettings() { @@ -125,6 +133,35 @@
+ +
+
+

Magnitude color scale

+
+
+ +
+
+ +
+ {#each Object.keys(MagnitudeColor) as magnitude, i (magnitude)} + {@const totalMagnitudes = Object.keys(MagnitudeColor).length} +
+ {magnitude.replace("m-", "")} +
+ {/each} +
+ +