Fixed css of routes page
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Alessio Davoli 2023-07-18 15:35:40 +02:00
parent 28190d0804
commit d6bbb9bcb4
3 changed files with 22 additions and 5 deletions

View file

@ -2,6 +2,8 @@
import InfoTab from './tabs/InfoTab.svelte';
import DescTab from './tabs/DescTab.svelte';
import MapTab from './tabs/MapTab.svelte';
import { createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher();
let component = InfoTab;
const activeClicked = (evt) => {
@ -24,6 +26,8 @@
component = MapTab;
break;
}
dispatch('map-click', {component});
};
</script>
@ -64,6 +68,7 @@
.tab {
padding: 10px;
height: 100%;
background-color: white;
}

View file

@ -43,7 +43,7 @@
<style>
@import 'leaflet/dist/leaflet.css';
#map {
height: 60vh;
z-index: 1;
height: calc(45vh + 60px);
z-index: 0;
}
</style>

View file

@ -1,19 +1,29 @@
<script lang="ts">
import Header from '$lib/components/Header.svelte';
import Tabs from '$lib/components/Tabs.svelte';
import MapTab from '$lib/components/tabs/MapTab.svelte';
export let data;
let divider;
const mapClick = (evt) => {
if(evt.detail.component === MapTab)
divider.style.transform = "translateY(calc(0vh + 70px))";
else
divider.style.transform = "translateY(20vh)";
}
</script>
<Header></Header>
<img src='/splash.jpeg' alt='splash'>
<div id='divider'>
<div bind:this={divider} id='divider'>
<div id='banner'>
<p>Percorso <b>{data.name}</b></p>
<p id='duration'>Durata {Math.floor(Number(data.duration) / 60)}'</p>
</div>
<Tabs></Tabs>
<Tabs on:map-click={mapClick}></Tabs>
</div>
@ -21,7 +31,9 @@
#divider {
background: white;
margin-top: 0px;
margin-top: 20vh;
margin-top: 0;
transform: translateY(20vh);
transition: transform 400ms;
}
img {