From 54069f40260cc9b636c052160f4df6131c15d8fa Mon Sep 17 00:00:00 2001 From: Nguyen Marc Date: Fri, 19 Jan 2024 21:24:53 +0100 Subject: [PATCH] refactor: move header and footer --- src/app.d.ts | 12 ++ src/app.scss | 10 ++ src/lib/components/Applications.svelte | 16 -- src/routes/+layout.svelte | 160 +++++++++++------- src/routes/+page.svelte | 67 ++++---- src/routes/Footer.svelte | 67 ++++++++ .../Nav.svelte => routes/Header.svelte} | 6 + src/routes/solutions/+page.svelte | 53 ------ 8 files changed, 223 insertions(+), 168 deletions(-) create mode 100644 src/routes/Footer.svelte rename src/{lib/components/Nav.svelte => routes/Header.svelte} (99%) diff --git a/src/app.d.ts b/src/app.d.ts index 743f07b2..12271898 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -8,6 +8,18 @@ declare global { // interface PageState {} // interface Platform {} } + + // add these lines + interface ViewTransition { + updateCallbackDone: Promise; + ready: Promise; + finished: Promise; + skipTransition: () => void; + } + + interface Document { + startViewTransition(updateCallback: () => Promise): ViewTransition; + } } export {}; diff --git a/src/app.scss b/src/app.scss index 21c7681d..1a5aea0c 100644 --- a/src/app.scss +++ b/src/app.scss @@ -209,6 +209,7 @@ nav details[role=list] summary, nav li[role=list] a { align-self: center; } +// TODO: view transition disable for heade header nav a, header nav a[role="button"], header nav summary[role="link"] { color: #fff; font-weight: 600; @@ -325,3 +326,12 @@ details > summary { [data-theme='dark'] .drop-shadow-a { filter: drop-shadow(0 4px 3px rgba(255, 255, 255, 0.212)) drop-shadow(0 2px 2px rgba(255, 255, 255, 0.212)); } + +/** ViewTransitions */ +@media (prefers-reduced-motion) { + ::view-transition-group(*), + ::view-transition-old(*), + ::view-transition-new(*) { + animation: none !important; + } +} diff --git a/src/lib/components/Applications.svelte b/src/lib/components/Applications.svelte index 517295e0..124da1a1 100644 --- a/src/lib/components/Applications.svelte +++ b/src/lib/components/Applications.svelte @@ -74,19 +74,3 @@ {/each} - - diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index e8e8a19d..29ff7128 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,77 +1,107 @@ -