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

@@ -6,6 +6,7 @@
import type { AnimeTimelineInstance } from 'animejs'
// Components
import Metas from '$components/Metas.svelte'
import PageTransition from '$components/PageTransition.svelte'
import SiteTitle from '$components/atoms/SiteTitle.svelte'
import Image from '$components/atoms/Image.svelte'
import ButtonCart from '$components/atoms/ButtonCart.svelte'
@@ -37,7 +38,7 @@
/**
* Transition: Anime timeline
*/
let timeline: AnimeTimelineInstance
let timeline: AnimeTimelineInstance
if (browser) {
requestAnimationFrame(() => {
@@ -103,7 +104,8 @@
image=""
/>
<main class="shop-page">
<PageTransition name="shop-page">
<Cart />
<section class="shop-page__intro" bind:this={introEl}>
@@ -180,7 +182,9 @@
</div>
</section>
<slot />
{#key product}
<slot />
{/key}
{#if posters}
<section class="shop-page__posters grid">
@@ -195,12 +199,12 @@
{/each}
</div>
<div class="subscribe">
<p>Subscribe to be notified when new posters become available</p>
<label class="subscribe__text" for="SUB_EMAIL">Subscribe to be notified when new posters become available</label>
<EmailForm />
</div>
</section>
{/if}
</main>
</PageTransition>
<script context="module" lang="ts">