Skip to content

Commit 325dbc8

Browse files
authored
Website Update
1 parent b10e457 commit 325dbc8

2 files changed

Lines changed: 75 additions & 58 deletions

File tree

docs/assets/css/style.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ a {
11581158
z-index: 3;
11591159
height: clamp(9rem, 28%, 16rem);
11601160
background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.12) 18%, rgba(0, 0, 0, 0.42) 54%, rgba(0, 0, 0, 0.82) 82%, #000 100%);
1161-
opacity: clamp(0, calc(var(--home-image-base-layer-opacity) + (var(--home-image-silhouette-layer-opacity) * 0.35)), 1);
1161+
opacity: var(--home-image-base-layer-opacity);
11621162
pointer-events: none;
11631163
will-change: opacity;
11641164
}
@@ -1334,7 +1334,7 @@ a {
13341334
}
13351335

13361336
.js .hero-image-gradient {
1337-
opacity: 1;
1337+
opacity: 0;
13381338
}
13391339

13401340
.js body.hero-ready .hero-shape-fill {
@@ -1370,6 +1370,9 @@ a {
13701370
.js body.hero-ready .hero-home-image--base {
13711371
animation: hero-image-base-reveal 2480ms cubic-bezier(0.18, 0.9, 0.22, 1) 120ms forwards;
13721372
}
1373+
.js body.hero-ready .hero-image-gradient {
1374+
animation: hero-image-base-reveal 2480ms cubic-bezier(0.18, 0.9, 0.22, 1) 120ms forwards;
1375+
}
13731376

13741377
@keyframes hero-mask-reveal {
13751378
0% {

docs/assets/js/shell.js

Lines changed: 70 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,11 @@
10161016
setActive(matching.length ? matching : [firstLinkForHash(hash)]);
10171017
};
10181018

1019-
const homeSection = document.querySelector("#hero");
1019+
const homeSection = document.querySelector("#hero");
1020+
const getDocumentBottom = () => {
1021+
const scrollEl = document.scrollingElement || document.documentElement || document.body;
1022+
return Math.max(0, (scrollEl?.scrollHeight || document.documentElement.scrollHeight || 0) - window.innerHeight);
1023+
};
10201024
let lockedHash = "";
10211025
let lockTimer = 0;
10221026

@@ -1047,33 +1051,43 @@
10471051
return;
10481052
}
10491053

1050-
const syncFromViewport = () => {
1051-
if (lockedHash) {
1052-
setActiveByHash(lockedHash);
1053-
return;
1054-
}
1054+
const syncFromViewport = () => {
1055+
if (lockedHash) {
1056+
setActiveByHash(lockedHash);
1057+
return;
1058+
}
10551059

1056-
const focusLine = Math.max(
1057-
getNavOffset() + 18,
1058-
Math.round(window.innerHeight * 0.34)
1059-
);
1060+
const scrollTop = getScrollTop();
1061+
const documentBottom = getDocumentBottom();
1062+
const lastSection = sectionsInOrder[sectionsInOrder.length - 1] || null;
10601063

1061-
let currentSection = homeSection || sectionsInOrder[0] || null;
1064+
if (lastSection && scrollTop >= Math.max(0, documentBottom - 8)) {
1065+
const lastHash = lastSection.id ? `#${lastSection.id}` : "";
1066+
setActiveByHash(lastHash);
1067+
return;
1068+
}
10621069

1063-
sectionsInOrder.forEach((section) => {
1064-
const rect = section.getBoundingClientRect();
1065-
if (rect.top <= focusLine) {
1066-
currentSection = section;
1067-
}
1068-
});
1070+
const focusLine = Math.max(
1071+
getNavOffset() + 18,
1072+
Math.round(window.innerHeight * 0.34)
1073+
);
10691074

1070-
if (!currentSection) {
1071-
return;
1072-
}
1075+
let currentSection = homeSection || sectionsInOrder[0] || null;
10731076

1074-
const currentHash = currentSection.id ? `#${currentSection.id}` : "";
1075-
setActiveByHash(currentHash);
1076-
};
1077+
sectionsInOrder.forEach((section) => {
1078+
const rect = section.getBoundingClientRect();
1079+
if (rect.top <= focusLine) {
1080+
currentSection = section;
1081+
}
1082+
});
1083+
1084+
if (!currentSection) {
1085+
return;
1086+
}
1087+
1088+
const currentHash = currentSection.id ? `#${currentSection.id}` : "";
1089+
setActiveByHash(currentHash);
1090+
};
10771091

10781092
const observer = new IntersectionObserver(
10791093
() => {
@@ -1297,39 +1311,39 @@
12971311
root.style.setProperty("--home-next-layer-shift", "0px");
12981312
};
12991313

1300-
const sync = () => {
1301-
rafId = 0;
1302-
1303-
const scrollTop = getScrollTop();
1304-
const progress = clamp(scrollTop / transitionDistance, 0, 1);
1305-
const uiOpacity = 1 - range(progress, 0.06, 0.56, linear);
1306-
const imageScale = lerp(1, 1.125, range(progress, 0, 0.72, easeOutCubic));
1307-
const baseFade = 1 - range(progress, 0.08, 0.52, linear);
1308-
const baseBrightness = lerp(1, 0.68, range(progress, 0.1, 0.48, easeInOutCubic));
1309-
const baseContrast = lerp(1, 0.92, range(progress, 0.12, 0.48, easeInOutCubic));
1310-
const silhouetteAppear = range(progress, 0.2, 0.28, easeInOutCubic);
1311-
const silhouetteFade = 1 - range(progress, 0.28, 0.48, easeInOutCubic);
1312-
const silhouetteOpacity = 0.74 * silhouetteAppear * silhouetteFade;
1313-
const atmosphereProgress = range(progress, 0.48, 0.88, easeInOutCubic);
1314-
const nextLayerMotionProgress = range(progress, 0.48, 0.86, easeInOutCubic);
1315-
const nextLayerOpacityProgress = range(progress, 0.48, 0.72, easeInOutCubic);
1316-
const backdropSuppression = progress < 0.88 ? "1" : "0";
1317-
1318-
root.style.setProperty("--home-ui-opacity", Math.max(0, uiOpacity).toFixed(4));
1319-
root.style.setProperty("--home-image-scroll-scale", imageScale.toFixed(4));
1320-
root.style.setProperty("--home-image-base-layer-opacity", Math.max(0, baseFade).toFixed(4));
1321-
root.style.setProperty("--home-image-base-brightness", baseBrightness.toFixed(4));
1322-
root.style.setProperty("--home-image-base-contrast", baseContrast.toFixed(4));
1323-
root.style.setProperty("--home-image-silhouette-layer-opacity", Math.max(0, silhouetteOpacity).toFixed(4));
1324-
setAtmosphere(atmosphereProgress);
1325-
setLowerLayer(nextLayerOpacityProgress);
1326-
1327-
if (backdropSuppression !== lastBackdropSuppression) {
1328-
body.dataset.homeBackdropSuppressed = backdropSuppression;
1329-
lastBackdropSuppression = backdropSuppression;
1330-
window.dispatchEvent(new Event("home-transition-sync"));
1331-
}
1332-
};
1314+
const sync = () => {
1315+
rafId = 0;
1316+
1317+
const scrollTop = getScrollTop();
1318+
const progress = clamp(scrollTop / transitionDistance, 0, 1);
1319+
const uiOpacity = 1 - range(progress, 0.06, 0.56, linear);
1320+
const imageScale = lerp(1, 1.125, range(progress, 0, 0.72, easeOutCubic));
1321+
const baseFade = 1 - range(progress, 0.08, 0.52, linear);
1322+
const baseBrightness = lerp(1, 0.68, range(progress, 0.1, 0.48, easeInOutCubic));
1323+
const baseContrast = lerp(1, 0.92, range(progress, 0.12, 0.48, easeInOutCubic));
1324+
const silhouetteAppear = range(progress, 0.2, 0.28, easeInOutCubic);
1325+
const silhouetteFade = 1 - range(progress, 0.28, 0.48, easeInOutCubic);
1326+
const silhouetteOpacity = 0.74 * silhouetteAppear * silhouetteFade;
1327+
const atmosphereProgress = range(progress, 0.48, 0.88, easeInOutCubic);
1328+
const nextLayerMotionProgress = range(progress, 0.48, 0.86, easeInOutCubic);
1329+
const nextLayerOpacityProgress = range(progress, 0.48, 0.72, easeInOutCubic);
1330+
const backdropSuppression = progress < 0.88 ? "1" : "0";
1331+
1332+
root.style.setProperty("--home-ui-opacity", Math.max(0, uiOpacity).toFixed(4));
1333+
root.style.setProperty("--home-image-scroll-scale", imageScale.toFixed(4));
1334+
root.style.setProperty("--home-image-base-layer-opacity", Math.max(0, baseFade).toFixed(4));
1335+
root.style.setProperty("--home-image-base-brightness", baseBrightness.toFixed(4));
1336+
root.style.setProperty("--home-image-base-contrast", baseContrast.toFixed(4));
1337+
root.style.setProperty("--home-image-silhouette-layer-opacity", Math.max(0, silhouetteOpacity).toFixed(4));
1338+
setAtmosphere(atmosphereProgress);
1339+
setLowerLayer(nextLayerOpacityProgress);
1340+
1341+
if (backdropSuppression !== lastBackdropSuppression) {
1342+
body.dataset.homeBackdropSuppressed = backdropSuppression;
1343+
lastBackdropSuppression = backdropSuppression;
1344+
window.dispatchEvent(new Event("home-transition-sync"));
1345+
}
1346+
};
13331347

13341348
const requestSync = () => {
13351349
if (rafId) {

0 commit comments

Comments
 (0)