feat: add transitions between pages
This commit is contained in:
parent
f2b408fce5
commit
68a43b6b9c
9 changed files with 269 additions and 227 deletions
|
@ -59,7 +59,11 @@ const close = () => {
|
||||||
<LanguageButton>
|
<LanguageButton>
|
||||||
<LanguageIcon @click.prevent="showModal()" />
|
<LanguageIcon @click.prevent="showModal()" />
|
||||||
</LanguageButton>
|
</LanguageButton>
|
||||||
<RouterView />
|
<RouterView v-slot="{ Component }">
|
||||||
|
<Transition name="fade" mode="out-in">
|
||||||
|
<component :is="Component" :key="$route.path" />
|
||||||
|
</Transition>
|
||||||
|
</RouterView>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<SiteFooter>v{{ version }} © {{ new Date().getFullYear() }} Sebin Nyshkim</SiteFooter>
|
<SiteFooter>v{{ version }} © {{ new Date().getFullYear() }} Sebin Nyshkim</SiteFooter>
|
||||||
|
|
|
@ -10,7 +10,11 @@ import CircleInfoIcon from '@/assets/icons/CircleInfoIcon.vue'
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(import.meta.env.BASE_URL),
|
history: createWebHistory(import.meta.env.BASE_URL),
|
||||||
scrollBehavior: () => {
|
scrollBehavior: () => {
|
||||||
return { top: 0 }
|
return new Promise((resolve) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
resolve({ top: 0 })
|
||||||
|
}, 500)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
routes: [
|
routes: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,6 +43,8 @@
|
||||||
--page-background-image: url(@/assets/layered-waves-light.svg);
|
--page-background-image: url(@/assets/layered-waves-light.svg);
|
||||||
--page-background-image-height: 100vw;
|
--page-background-image-height: 100vw;
|
||||||
--page-background-image-max-height: 50vh;
|
--page-background-image-max-height: 50vh;
|
||||||
|
--page-transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
|
||||||
|
--page-transform: translateY(5em);
|
||||||
|
|
||||||
--paragraph-margin: 1rem;
|
--paragraph-margin: 1rem;
|
||||||
|
|
||||||
|
@ -286,3 +288,10 @@
|
||||||
--navigation-width-expanded: calc(var(--navigation-size) * 3.75 + env(safe-area-inset-left));
|
--navigation-width-expanded: calc(var(--navigation-size) * 3.75 + env(safe-area-inset-left));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion) {
|
||||||
|
:root {
|
||||||
|
--page-transition: opacity 0.5s ease;
|
||||||
|
--page-transform: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -171,3 +171,14 @@ table {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fade-enter-active,
|
||||||
|
.fade-leave-active {
|
||||||
|
transition: var(--page-transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-enter-from,
|
||||||
|
.fade-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: var(--page-transform);
|
||||||
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ const colors = [
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<article>
|
||||||
<section>
|
<section>
|
||||||
<h1>{{ $t(`${$route.meta.title}`) }}</h1>
|
<h1>{{ $t(`${$route.meta.title}`) }}</h1>
|
||||||
</section>
|
</section>
|
||||||
|
@ -160,4 +161,5 @@ const colors = [
|
||||||
<section>
|
<section>
|
||||||
<p v-for="(p, i) in $tm('anatomy.paragraphs[1]')" :key="i">{{ p }}</p>
|
<p v-for="(p, i) in $tm('anatomy.paragraphs[1]')" :key="i">{{ p }}</p>
|
||||||
</section>
|
</section>
|
||||||
|
</article>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -25,6 +25,7 @@ const attributions = [
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<article>
|
||||||
<section>
|
<section>
|
||||||
<h1>{{ $t(`${$route.meta.title}`) }}</h1>
|
<h1>{{ $t(`${$route.meta.title}`) }}</h1>
|
||||||
<h2>{{ $t('attributions.artwork.heading') }}</h2>
|
<h2>{{ $t('attributions.artwork.heading') }}</h2>
|
||||||
|
@ -44,7 +45,11 @@ const attributions = [
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $t('attributions.other.icons[0]') }}</td>
|
<td>{{ $t('attributions.other.icons[0]') }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="https://fontawesome.com/license/free" target="_blank" rel="noopener noreferrer">
|
<a
|
||||||
|
href="https://fontawesome.com/license/free"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
Font Awesome
|
Font Awesome
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -94,4 +99,5 @@ const attributions = [
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</article>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -26,6 +26,7 @@ const jobIcons = [
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<article>
|
||||||
<section>
|
<section>
|
||||||
<h1>{{ $t(`${$route.meta.title}`) }}</h1>
|
<h1>{{ $t(`${$route.meta.title}`) }}</h1>
|
||||||
<p v-for="(p, i) in $tm('career.paragraphs')" :key="i">{{ p }}</p>
|
<p v-for="(p, i) in $tm('career.paragraphs')" :key="i">{{ p }}</p>
|
||||||
|
@ -42,4 +43,5 @@ const jobIcons = [
|
||||||
</template>
|
</template>
|
||||||
</TimelineItem>
|
</TimelineItem>
|
||||||
</TimelineList>
|
</TimelineList>
|
||||||
|
</article>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -48,6 +48,7 @@ const sexData = [
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<article>
|
||||||
<section>
|
<section>
|
||||||
<h1>{{ $t(`${$route.meta.title}`) }}</h1>
|
<h1>{{ $t(`${$route.meta.title}`) }}</h1>
|
||||||
</section>
|
</section>
|
||||||
|
@ -68,4 +69,5 @@ const sexData = [
|
||||||
<section>
|
<section>
|
||||||
<p v-for="(p, i) in $tm('general.sexuality.paragraphs')" :key="i">{{ p }}</p>
|
<p v-for="(p, i) in $tm('general.sexuality.paragraphs')" :key="i">{{ p }}</p>
|
||||||
</section>
|
</section>
|
||||||
|
</article>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -3,6 +3,7 @@ import WelcomeHeader from '@/components/WelcomeHeader.vue'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<article>
|
||||||
<WelcomeHeader>
|
<WelcomeHeader>
|
||||||
<template #main>{{ $t('welcomeHeader.mainTitle') }}</template>
|
<template #main>{{ $t('welcomeHeader.mainTitle') }}</template>
|
||||||
<template #sub>{{ $t('welcomeHeader.subTitle') }}</template>
|
<template #sub>{{ $t('welcomeHeader.subTitle') }}</template>
|
||||||
|
@ -13,4 +14,5 @@ import WelcomeHeader from '@/components/WelcomeHeader.vue'
|
||||||
|
|
||||||
<p v-for="(p, i) in $tm('home.paragraphs')" :key="i">{{ p }}</p>
|
<p v-for="(p, i) in $tm('home.paragraphs')" :key="i">{{ p }}</p>
|
||||||
</section>
|
</section>
|
||||||
|
</article>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue