Updates on routes and path
All checks were successful
ci/woodpecker/push/build Pipeline was successful
All checks were successful
ci/woodpecker/push/build Pipeline was successful
This commit is contained in:
parent
a18dd9a04e
commit
f4ec06a1b1
5 changed files with 45 additions and 4 deletions
1
frontend/src/app.d.ts
vendored
1
frontend/src/app.d.ts
vendored
|
@ -8,6 +8,7 @@ declare global {
|
|||
// interface Platform {}
|
||||
|
||||
interface Route {
|
||||
id: number;
|
||||
name: string;
|
||||
duration: number;
|
||||
image: string;
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
<style>
|
||||
div {
|
||||
color: white;
|
||||
padding: 5px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
|
|
24
frontend/src/lib/components/Route.svelte
Normal file
24
frontend/src/lib/components/Route.svelte
Normal 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>
|
|
@ -6,9 +6,9 @@ export async function load({ params }) {
|
|||
return {
|
||||
title: params.slug,
|
||||
routes: [
|
||||
{title: 'Percorso Pianello 1', image: '/images/test-1.jpg', duration: 123123123},
|
||||
{title: 'Percorso Pianello 1', image: '/images/test-1.jpg', duration: 123123123},
|
||||
{title: 'Percorso Pianello 1', image: '/images/test-1.jpg', duration: 123123123}
|
||||
{id: 1, name: 'Percorso Pianello 1', image: '/images/test-1.jpg', duration: 123123123},
|
||||
{id: 2, name: 'Percorso Pianello 2', image: '/images/test-1.jpg', duration: 123123123},
|
||||
{id: 3, name: 'Percorso Pianello 3', image: '/images/test-1.jpg', duration: 123123123}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,20 @@
|
|||
<script lang="ts">
|
||||
import Route from '$lib/components/Route.svelte';
|
||||
import Header from '$lib/components/Header.svelte';
|
||||
export let data;
|
||||
</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>
|
Loading…
Reference in a new issue