Use PageTransition component on every route

- Scrolls back to top when mounting new page with a timeout of the delay
- Rename photo Viewer class
- Change Shop posters section text from p to label
This commit is contained in:
2021-12-07 21:58:17 +01:00
parent f15a2f2e47
commit 06db598b90
14 changed files with 79 additions and 66 deletions

View File

@@ -8,7 +8,6 @@
import '$utils/polyfills'
// Components
import SVGSprite from '$components/SVGSprite.svelte'
import PageTransition from '$components/PageTransition.svelte'
import Switcher from '$components/molecules/Switcher.svelte'
import Footer from '$components/organisms/Footer.svelte'
@@ -41,14 +40,6 @@
setTimeout(() => {
$pageLoading = false
}, DURATION.PAGE_IN * 1.25)
// Scroll back to top between page transitions
setTimeout(() => {
// Disable scroll when changing filters on /photos and shop?
if (!$page.query.get('country') && !$page.path.includes('/shop/poster')) {
scrollToTop()
}
}, DURATION.PAGE_OUT + 1)
}
})
@@ -60,9 +51,7 @@
<Switcher isOver={!!$page.params.location && !!$page.params.photo} />
<PageTransition path={$page.path}>
<slot />
</PageTransition>
<slot />
{#if !$page.params.photo}
<Footer />