File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import siteConfig from ' ../../site.config.json' ;
33---
44
5- <footer class =" mt-16 border-t border-(--color-border-glass) bg-(--color-bg)" >
5+ <footer class =" mt-16 border-t border-(--color-border-glass) bg-(--color-bg)" transition:persist = " site-footer " >
66 <div
77 class =" mx-auto flex max-w-7xl flex-col gap-6 px-4 py-8 text-sm text-(--color-fg-meta) sm:px-6 md:flex-row md:items-center md:justify-between"
88 >
Original file line number Diff line number Diff line change @@ -6,20 +6,24 @@ const continents = [
66];
77---
88
9- <div class =" page-bg" aria-hidden =" true" >
9+ <div class =" page-bg" aria-hidden =" true" transition:persist = " page-bg " >
1010 <div id =" page-bg-image" class =" page-bg-image" ></div >
1111 <div class =" page-bg-overlay" ></div >
1212</div >
1313
1414<script is:inline define:vars ={ { continents }} >
15- /* Randomize the continent on each page load. No animation, no random
16- offset — just one of three maps, centered. */
15+ /* Pick one of the three continent maps at random on the first page
16+ load. Once picked, stay on that map for the rest of the session:
17+ the bg element is persisted across view-transition navigations
18+ (transition:persist) so re-randomising on every doc click would
19+ cause a hard cut underneath an otherwise smooth nav transition. */
1720 (() => {
18- const img = continents[Math.floor(Math.random() * continents.length)];
1921 const el = document.getElementById('page-bg-image');
20- if (!el) return;
22+ if (!el || el.dataset.bgSet === '1') return;
23+ const img = continents[Math.floor(Math.random() * continents.length)];
2124 el.style.backgroundImage = `url('${img}')`;
2225 el.classList.add('is-ready');
26+ el.dataset.bgSet = '1';
2327 })();
2428</script >
2529
Original file line number Diff line number Diff line change 11---
22import ' ../styles/global.css' ;
3+ import { ClientRouter } from ' astro:transitions' ;
34import Header from ' ../components/Header.astro' ;
45import Footer from ' ../components/Footer.astro' ;
56import PageBackground from ' ../components/PageBackground.astro' ;
@@ -34,11 +35,12 @@ const release = await getLatestRelease();
3435 type =" font/woff"
3536 crossorigin =" anonymous"
3637 />
38+ <ClientRouter />
3739 </head >
3840 <body class =" min-h-screen flex flex-col" >
3941 <PageBackground />
4042 <Header release ={ release } pathname ={ Astro .url .pathname } />
41- <main class =" flex-1" >
43+ <main class =" flex-1" transition:animate = " fade " >
4244 <slot />
4345 </main >
4446 <Footer />
Original file line number Diff line number Diff line change 11@import 'tailwindcss' ;
22@plugin '@tailwindcss/typography' ;
33
4- /* Opt into the browser's native cross-document view transitions for
5- same-origin navigations. Supporting browsers (Chrome/Edge 126+,
6- Safari 18+) apply a default crossfade between the outgoing and
7- incoming page; everything else just navigates normally. No JS, no
8- framework involvement. */
9- @view-transition {
10- navigation : auto;
11- }
12-
134/* Self-hosted display face — sourced from tolkano.com's font kit. */
145@font-face {
156 font-family : 'Fremont' ;
You can’t perform that action at this time.
0 commit comments