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

View file

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

View file

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