Skip to content

Commit

Permalink
feat: add button with map link to current city
Browse files Browse the repository at this point in the history
  • Loading branch information
istudyatuni committed Oct 15, 2023
1 parent e5f1237 commit 4ab3c2c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
24 changes: 23 additions & 1 deletion src/components/Main.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script context="module">
import GithubIcon from '~icons/tabler/brand-github'
import MapIcon from '~icons/tabler/map'
import SettingsIcon from '~icons/tabler/settings'
import { settings } from 'src/stores'
Expand All @@ -12,11 +13,23 @@
// <a href="/" /> will open <Route path="/settings" />
// and vice versa
let settingsNotOpened = true
$: mapLinkParams = new URLSearchParams({
mlat: $settings.current_city.lat,
mlon: $settings.current_city.lon,
})
</script>

<div class="grid-item">
<div class="inline">
<h4 class="city">{$settings.current_city.name}</h4>
<div class="city">
<h4 class="city-name">{$settings.current_city.name}</h4>
<a
class="map"
href="http://www.openstreetmap.org/?{mapLinkParams.toString()}">
<MapIcon />
</a>
</div>

<div class="inline">
<a
Expand Down Expand Up @@ -45,8 +58,17 @@
background-color: var(--second-bg-color);
}
.city {
display: flex;
align-items: stretch;
}
.city-name {
margin-top: 0;
}
.map {
margin-left: 8px;
color: var(--second-fg-color);
cursor: pointer;
}
.inline {
display: flex;
justify-content: space-between;
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/Tooltip.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</script>

<div class="tooltip">
<slot name="under" />
<slot />
<div class="text">{text}</div>
</div>

Expand Down
5 changes: 3 additions & 2 deletions src/components/highlights/BaseHighlight.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
</script>

<script>
export let title, help
export let title,
help = null
</script>

<div class="wrapper">
Expand All @@ -14,7 +15,7 @@
{#if help}
<span class="help">
<Tooltip text={help}>
<Question slot="under" width="20" height="20" />
<Question width="20" height="20" />
</Tooltip>
</span>
{/if}
Expand Down
1 change: 1 addition & 0 deletions src/components/highlights/UVIndex.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
// (7.7, 15 + 2/5, 23.1, 30 + 4/5, 38 + 1/2, 46 + 1/5, 53.9, 61 + 3/5, 69.3, 77, 84.7, 92 + 2/5)
//
// colors from: https://www.sciencedirect.com/science/article/pii/S2666469023000210, Appendix C
// prettier-ignore
background: linear-gradient(
90deg,
#658d1b 0%, // duplicate for start
Expand Down

0 comments on commit 4ab3c2c

Please sign in to comment.