diff --git a/frontend/src/lib/components/Route.svelte b/frontend/src/lib/components/Route.svelte index 9cbf680..b2b23c0 100644 --- a/frontend/src/lib/components/Route.svelte +++ b/frontend/src/lib/components/Route.svelte @@ -22,13 +22,12 @@ box-shadow: 0 0 50px #ccc; border-radius: 30px; width: calc((100% - 50px) / 2); - height: calc(100vh/3 - 10vh ); font-size: 18px; } #image { width: 100%; - height: 150px; + height: 140px; object-position: center; background-position: center; object-fit: cover; diff --git a/frontend/src/lib/components/Tabs.svelte b/frontend/src/lib/components/Tabs.svelte index a6efa3e..b4b7098 100644 --- a/frontend/src/lib/components/Tabs.svelte +++ b/frontend/src/lib/components/Tabs.svelte @@ -2,10 +2,18 @@ import InfoTab from './tabs/InfoTab.svelte'; import DescTab from './tabs/DescTab.svelte'; import MapTab from './tabs/MapTab.svelte'; - import { createEventDispatcher } from 'svelte'; + import { createEventDispatcher, onMount } from 'svelte'; + const dispatch = createEventDispatcher(); + let ref; let component = InfoTab; + onMount(() => { + const gbcr = ref.getBoundingClientRect(); + console.log(gbcr); + ref.style.height = `${gbcr.height}px`; + }); + const activeClicked = (evt) => { const clickedTab = evt.target.closest('button'); @@ -24,6 +32,7 @@ break; case 'map': component = MapTab; + requestAnimationFrame() break; } @@ -39,7 +48,7 @@ -
+
@@ -47,7 +56,6 @@ \ No newline at end of file + diff --git a/frontend/src/lib/components/tabs/InfoTab.svelte b/frontend/src/lib/components/tabs/InfoTab.svelte index 94a59a4..a59d3b1 100644 --- a/frontend/src/lib/components/tabs/InfoTab.svelte +++ b/frontend/src/lib/components/tabs/InfoTab.svelte @@ -1,6 +1,3 @@ - -

Distanza

diff --git a/frontend/src/lib/components/tabs/MapTab.svelte b/frontend/src/lib/components/tabs/MapTab.svelte index aedc00d..f6af7b7 100644 --- a/frontend/src/lib/components/tabs/MapTab.svelte +++ b/frontend/src/lib/components/tabs/MapTab.svelte @@ -87,7 +87,7 @@ diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte index b30e385..6f9e524 100644 --- a/frontend/src/routes/+layout.svelte +++ b/frontend/src/routes/+layout.svelte @@ -41,6 +41,9 @@ diff --git a/frontend/src/routes/routes/[slug]/+page.svelte b/frontend/src/routes/routes/[slug]/+page.svelte index 95cfa4a..5edae6b 100644 --- a/frontend/src/routes/routes/[slug]/+page.svelte +++ b/frontend/src/routes/routes/[slug]/+page.svelte @@ -8,9 +8,9 @@ const mapClick = (evt) => { if(evt.detail.component === MapTab) - divider.style.transform = "translateY(calc(0vh + 70px))"; + requestAnimationFrame(() => divider.style.transform = "translateY(-10vh)"); else - divider.style.transform = "translateY(30vh)"; + requestAnimationFrame(() => divider.style.transform = "translateY(calc(0vh - 70px))"); } @@ -32,13 +32,13 @@ background: white; margin-top: 0px; margin-top: 0; - transform: translateY(30vh); transition: transform 400ms; + align-self: end; } img { width: 100%; - height: calc(100% - 10vh); + height: calc(100% - 10vh - 10px); position: absolute; z-index: -1; }