Updates on routes and path
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Alessio Davoli 2023-07-10 19:48:11 +02:00
parent a18dd9a04e
commit f4ec06a1b1
5 changed files with 45 additions and 4 deletions

View file

@ -8,6 +8,7 @@ declare global {
// interface Platform {} // interface Platform {}
interface Route { interface Route {
id: number;
name: string; name: string;
duration: number; duration: number;
image: string; image: string;

View file

@ -9,6 +9,8 @@
<style> <style>
div { div {
color: white;
padding: 5px;
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-evenly; justify-content: space-evenly;

View file

@ -0,0 +1,24 @@
<script lang="ts">
export let route: App.Route;
</script>
<a href="/routes/{route.id}"
><img src="/images/test-1.jpg" alt="route" />
<p>{route.name}</p>
{route.duration}
</a>
<style>
a {
display: block;
box-shadow: 0 0 50px #ccc;
border-radius: 30px;
padding: 10px;
height: 200px;
max-width: 150px;
}
a img {
width: 100%;
object-fit: cover;
}
</style>

View file

@ -6,9 +6,9 @@ export async function load({ params }) {
return { return {
title: params.slug, title: params.slug,
routes: [ routes: [
{title: 'Percorso Pianello 1', image: '/images/test-1.jpg', duration: 123123123}, {id: 1, name: 'Percorso Pianello 1', image: '/images/test-1.jpg', duration: 123123123},
{title: 'Percorso Pianello 1', image: '/images/test-1.jpg', duration: 123123123}, {id: 2, name: 'Percorso Pianello 2', image: '/images/test-1.jpg', duration: 123123123},
{title: 'Percorso Pianello 1', image: '/images/test-1.jpg', duration: 123123123} {id: 3, name: 'Percorso Pianello 3', image: '/images/test-1.jpg', duration: 123123123}
] ]
} }
} }

View file

@ -1,6 +1,20 @@
<script lang="ts"> <script lang="ts">
import Route from '$lib/components/Route.svelte';
import Header from '$lib/components/Header.svelte'; import Header from '$lib/components/Header.svelte';
export let data; export let data;
</script> </script>
<Header title={data.title}></Header> <Header title={data.title}></Header>
<div>
{#each data.routes as route}
<Route {route}></Route>
{/each}
</div>
<style>
div {
display: flex;
flex-wrap: wrap;
}
</style>