Update routes

This commit is contained in:
Alessio Davoli 2023-11-27 03:58:33 +01:00
parent 2644aa37f0
commit f1858c6fef
2 changed files with 13 additions and 6 deletions

View file

@ -6,11 +6,11 @@
<div id="image" style="background-image: url(/images/test-1.jpg" /> <div id="image" style="background-image: url(/images/test-1.jpg" />
<div id='path-holder'> <div id='path-holder'>
<div style='font-size: 20px;'>Percorso</div> <div style='font-size: 20px;'>Percorso</div>
<p>{route.name}</p> <p>{route.title_it}</p>
</div> </div>
<div id='duration-holder'> <div id='duration-holder'>
<div style='font-size: 15px;'>Durata</div> <div style='font-size: 15px;'>Dislivello</div>
<p id="duration">{Math.floor(Number(route.duration) / 60)}'</p> <p id="duration">{route.elevation_gain}</p>
</div> </div>
</a> </a>

View file

@ -2,15 +2,22 @@
import BottomAppBar from '$lib/components/BottomAppBar.svelte'; import BottomAppBar from '$lib/components/BottomAppBar.svelte';
import Path from '$lib/components/Path.svelte'; import Path from '$lib/components/Path.svelte';
import Splash from '$lib/components/Splash.svelte'; import Splash from '$lib/components/Splash.svelte';
import { onMount } from 'svelte';
import {getRouteCategories} from '$lib/repo';
let categories = [];
onMount(async () => {
categories = await getRouteCategories();
})
</script> </script>
<Splash /> <Splash />
<main> <main>
<div id="welcome-message">Benvenuti a <span class="bold">Pianello Val Tidone</span></div> <div id="welcome-message">Benvenuti a <span class="bold">Pianello Val Tidone</span></div>
<div id="route-cards"> <div id="route-cards">
<Path color="#de0e1b" type="naturalistici" /> {#each categories as category}
<Path color="#f6ae04" type="storici" /> <Path color="#de0e1b" name="{category.name_it}" id="{category.id}" />
<Path color="#213c8b" type="tradizionalistici" /> {/each}
</div> </div>
</main> </main>