Refine scroll-driven mode transition

This commit is contained in:
Meta Vens 2026-08-25 18:53:29 +02:00
commit a3d58999ce
3 changed files with 108 additions and 37 deletions

View file

@ -4,7 +4,7 @@ import DelveholdMasthead from "./quartz/components/DelveholdMasthead"
export const sharedPageComponents: SharedLayout = {
head: Component.Head(),
header: [DelveholdMasthead(), Component.Spacer(), Component.Search()],
header: [DelveholdMasthead()],
afterBody: [],
footer: Component.Footer({
links: {

View file

@ -18,7 +18,9 @@ export default (() => {
return (
<section class="delvehold-masthead">
<a class="delvehold-wordmark" href={resolveRelative(currentSlug, "index" as FullSlug)}>
DELVE/HOLD
<span class="delvehold-wordmark-delve">DELVE</span>
<span class="delvehold-wordmark-slash">/</span>
<span class="delvehold-wordmark-hold">HOLD</span>
</a>
<nav class="delvehold-nav" aria-label="DELVE/HOLD sections">
{routes.map((route) => {

View file

@ -1,39 +1,57 @@
@use "./base.scss";
@use "./variables.scss" as *;
@property --mode-accent {
syntax: "<color>";
inherits: true;
initial-value: #2f9663;
}
:root {
--delve-green: #2f9663;
--hold-purple: #996de3;
--mode-accent: var(--delve-green);
}
body {
background: #050505;
}
.page > #quartz-body .page-header {
position: sticky;
z-index: 20;
top: 0;
margin-top: 0;
padding: 1.35rem 0;
background: rgba(5, 5, 5, 0.92);
backdrop-filter: blur(12px);
}
.delvehold-masthead {
display: flex;
flex: 1 1 auto;
align-items: baseline;
gap: 2rem;
flex: 1 1 100%;
flex-direction: column;
align-items: center;
gap: 0.8rem;
min-width: 0;
text-align: center;
}
.delvehold-wordmark {
color: var(--mode-accent);
font-family: var(--titleFont);
font-size: 1.75rem;
font-weight: 100;
letter-spacing: 0.055em;
white-space: nowrap;
}
.delvehold-wordmark-delve {
color: var(--delve-green);
font-weight: 100;
}
.delvehold-wordmark-hold {
color: var(--hold-purple);
font-weight: 100;
}
.delvehold-wordmark-slash {
color: #fff;
font-weight: 100;
}
.article-title,
article > h1,
article > h2,
@ -58,7 +76,7 @@ article > h3 {
a:hover,
a.active {
color: var(--mode-accent);
color: var(--delve-green);
}
}
@ -71,13 +89,7 @@ article > h3 {
}
body[data-slug="index"] {
--secondary: var(--mode-accent);
--tertiary: var(--mode-accent);
--highlight: color-mix(in srgb, var(--mode-accent) 15%, transparent);
--textHighlight: color-mix(in srgb, var(--mode-accent) 34%, transparent);
animation: delvehold-mode-color linear both;
animation-timeline: scroll(root block);
animation-range: 10% 90%;
background: color-mix(in srgb, var(--delve-green) 8%, #050505);
&::before {
content: "";
@ -85,11 +97,28 @@ body[data-slug="index"] {
z-index: 0;
inset: -35vmax;
pointer-events: none;
background: color-mix(in srgb, var(--hold-purple) 9%, transparent);
clip-path: polygon(100% 0, 100% 0, 100% 0);
background: color-mix(in srgb, var(--hold-purple) 9%, #050505);
clip-path: polygon(120% 0, 100% 0, 100% 100%, 100% 100%);
animation: delvehold-diagonal-wipe linear both;
animation-timeline: scroll(root block);
animation-range: 20% 80%;
animation-range: 8% 92%;
}
&::after {
content: "";
position: fixed;
z-index: 0;
top: -20vh;
left: 0;
width: 2px;
height: 140vh;
pointer-events: none;
background: rgba(255, 255, 255, 0.58);
transform: translateX(130vw) rotate(11deg);
transform-origin: center;
animation: delvehold-wipe-edge linear both;
animation-timeline: scroll(root block);
animation-range: 8% 92%;
}
#quartz-root {
@ -109,6 +138,18 @@ body[data-slug="index"] {
.sidebar {
display: none !important;
}
.delvehold-wordmark-delve {
animation: delvehold-delve-weight linear both;
animation-timeline: scroll(root block);
animation-range: 8% 92%;
}
.delvehold-wordmark-hold {
animation: delvehold-hold-weight linear both;
animation-timeline: scroll(root block);
animation-range: 8% 92%;
}
}
.delvehold-landing {
@ -141,13 +182,20 @@ body[data-slug="index"] {
.delvehold-mode-label {
margin: 0 0 1.2rem;
color: var(--mode-accent);
font-family: var(--titleFont);
font-size: 0.82rem;
font-weight: 400;
letter-spacing: 0.22em;
}
.delvehold-mode-panel-delve .delvehold-mode-label {
color: var(--delve-green);
}
.delvehold-mode-panel-hold .delvehold-mode-label {
color: var(--hold-purple);
}
.delvehold-landing-links {
display: flex;
flex-wrap: wrap;
@ -155,35 +203,56 @@ body[data-slug="index"] {
padding: 3rem 0 8rem;
a {
color: var(--mode-accent);
color: #fff;
}
}
@keyframes delvehold-mode-color {
0%,
38% {
--mode-accent: var(--delve-green);
@keyframes delvehold-delve-weight {
0%, 42% {
font-weight: 400;
}
62%,
100% {
--mode-accent: var(--hold-purple);
58%, 100% {
font-weight: 100;
}
}
@keyframes delvehold-hold-weight {
0%, 42% {
font-weight: 100;
}
58%, 100% {
font-weight: 400;
}
}
@keyframes delvehold-diagonal-wipe {
from {
clip-path: polygon(100% 0, 100% 0, 100% 0);
clip-path: polygon(120% 0, 100% 0, 100% 100%, 100% 100%);
}
to {
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
clip-path: polygon(0 0, 100% 0, 100% 100%, -20% 100%);
}
}
@keyframes delvehold-wipe-edge {
from {
transform: translateX(130vw) rotate(11deg);
}
to {
transform: translateX(-30vw) rotate(11deg);
}
}
@media (prefers-reduced-motion: reduce) {
body[data-slug="index"],
body[data-slug="index"]::before {
body[data-slug="index"]::before,
body[data-slug="index"]::after,
body[data-slug="index"] .delvehold-wordmark-delve,
body[data-slug="index"] .delvehold-wordmark-hold {
animation: none;
}
}