Skip to content

Commit 8cf3a77

Browse files
authored
Website Update
1 parent ba20c89 commit 8cf3a77

2 files changed

Lines changed: 72 additions & 14 deletions

File tree

docs/assets/css/style.css

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,21 @@
5353
--home-next-layer-shift: 18px;
5454
--home-next-layer-overlap: clamp(34rem, 68vh, 46rem);
5555
--site-atmosphere-opacity: 1;
56+
57+
--site-atmosphere-viewport-height: 100svh;
58+
--site-atmosphere-viewport-width: 100vw;
59+
--site-atmosphere-render-height: 100svh;
60+
--site-atmosphere-render-width: 100vw;
61+
--site-atmosphere-safe-top: 0px;
62+
--site-atmosphere-safe-bottom: 0px;
63+
5664
--site-atmosphere-width: 148vw;
57-
--site-atmosphere-height: clamp(calc(100svh + 8rem), 132dvh, calc(100svh + 16rem));
58-
--site-atmosphere-offset-y: clamp(0.75rem, 2.2dvh, 2.25rem);
65+
--site-atmosphere-height: clamp(
66+
calc(var(--site-atmosphere-render-height) * 1.04),
67+
calc(var(--site-atmosphere-render-height) * 1.12),
68+
calc(var(--site-atmosphere-render-height) * 1.18)
69+
);
70+
--site-atmosphere-offset-y: clamp(0.2rem, 1.2dvh, 1.2rem);
5971
}
6072

6173
* {
@@ -100,9 +112,9 @@ body.page-home {
100112
top: 0;
101113
left: 50%;
102114
width: 100%;
103-
height: 100vh;
104-
height: 100svh;
105-
height: 100dvh;
115+
height: var(--site-atmosphere-render-height);
116+
min-height: var(--site-atmosphere-render-height);
117+
max-height: var(--site-atmosphere-render-height);
106118
opacity: var(--site-atmosphere-opacity);
107119
will-change: opacity;
108120
isolation: isolate;
@@ -994,8 +1006,12 @@ a {
9941006

9951007
.site-atmosphere__layer {
9961008
--site-atmosphere-width: 170vw;
997-
--site-atmosphere-height: clamp(calc(100svh + 10rem), 138dvh, calc(100svh + 20rem));
998-
--site-atmosphere-offset-y: clamp(1.25rem, 3dvh, 3.25rem);
1009+
--site-atmosphere-height: clamp(
1010+
calc(var(--site-atmosphere-render-height) * 1.05),
1011+
calc(var(--site-atmosphere-render-height) * 1.13),
1012+
calc(var(--site-atmosphere-render-height) * 1.2)
1013+
);
1014+
--site-atmosphere-offset-y: clamp(0.35rem, 1.6dvh, 1.4rem);
9991015
background:
10001016
radial-gradient(78% 62% at 39% 31%, rgba(255, 157, 77, 0.13) 0%, rgba(255, 157, 77, 0.094) 28%, rgba(255, 157, 77, 0.03) 52%, rgba(255, 157, 77, 0) 72%),
10011017
radial-gradient(72% 58% at 61% 34%, rgba(82, 104, 255, 0.12) 0%, rgba(82, 104, 255, 0.086) 28%, rgba(82, 104, 255, 0.026) 52%, rgba(82, 104, 255, 0) 72%);
@@ -2484,8 +2500,12 @@ body.page-home #about {
24842500

24852501
.site-atmosphere__layer {
24862502
--site-atmosphere-width: 156vw;
2487-
--site-atmosphere-height: clamp(calc(100svh + 9rem), 134dvh, calc(100svh + 18rem));
2488-
--site-atmosphere-offset-y: clamp(1rem, 2.6dvh, 2.75rem);
2503+
--site-atmosphere-height: clamp(
2504+
calc(var(--site-atmosphere-render-height) * 1.03),
2505+
calc(var(--site-atmosphere-render-height) * 1.1),
2506+
calc(var(--site-atmosphere-render-height) * 1.16)
2507+
);
2508+
--site-atmosphere-offset-y: clamp(0.25rem, 1.4dvh, 1.4rem);
24892509
}
24902510
}
24912511

@@ -2666,8 +2686,12 @@ body.page-home #about {
26662686

26672687
.site-atmosphere__layer {
26682688
--site-atmosphere-width: 178vw;
2669-
--site-atmosphere-height: clamp(calc(100svh + 10rem), 140dvh, calc(100svh + 22rem));
2670-
--site-atmosphere-offset-y: clamp(1.5rem, 3.2dvh, 3.75rem);
2689+
--site-atmosphere-height: clamp(
2690+
calc(var(--site-atmosphere-render-height) * 1.04),
2691+
calc(var(--site-atmosphere-render-height) * 1.1),
2692+
calc(var(--site-atmosphere-render-height) * 1.16)
2693+
);
2694+
--site-atmosphere-offset-y: clamp(0.3rem, 1.5dvh, 1.2rem);
26712695
background:
26722696
radial-gradient(80% 64% at 40% 32%, rgba(255, 157, 77, 0.13) 0%, rgba(255, 157, 77, 0.094) 28%, rgba(255, 157, 77, 0.03) 52%, rgba(255, 157, 77, 0) 72%),
26732697
radial-gradient(74% 60% at 60% 35%, rgba(82, 104, 255, 0.12) 0%, rgba(82, 104, 255, 0.086) 28%, rgba(82, 104, 255, 0.026) 52%, rgba(82, 104, 255, 0) 72%);
@@ -2724,8 +2748,12 @@ body.page-home #about {
27242748

27252749
.site-atmosphere__layer {
27262750
--site-atmosphere-width: 154vw;
2727-
--site-atmosphere-height: clamp(calc(100svh + 7rem), 126dvh, calc(100svh + 13rem));
2728-
--site-atmosphere-offset-y: clamp(0.75rem, 2dvh, 2rem);
2751+
--site-atmosphere-height: clamp(
2752+
calc(var(--site-atmosphere-render-height) * 1.02),
2753+
calc(var(--site-atmosphere-render-height) * 1.08),
2754+
calc(var(--site-atmosphere-render-height) * 1.14)
2755+
);
2756+
--site-atmosphere-offset-y: clamp(0.1rem, 1dvh, 0.9rem);
27292757
}
27302758
}
27312759

docs/assets/js/shell.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,8 @@
12711271
atmosphere.style.removeProperty('bottom');
12721272
atmosphere.style.removeProperty('margin-top');
12731273
atmosphere.style.removeProperty('margin-bottom');
1274+
atmosphere.style.removeProperty('height');
1275+
atmosphere.style.removeProperty('min-height');
12741276

12751277
layer.style.removeProperty('transform');
12761278
layer.style.removeProperty('translate');
@@ -1282,10 +1284,38 @@
12821284
layer.style.removeProperty('margin-bottom');
12831285
layer.style.removeProperty('transition');
12841286
layer.style.removeProperty('animation');
1287+
layer.style.removeProperty('height');
1288+
layer.style.removeProperty('min-height');
1289+
layer.style.removeProperty('max-height');
1290+
};
1291+
1292+
const syncViewportVars = () => {
1293+
const vv = window.visualViewport;
1294+
const viewportHeight = Math.max(
1295+
1,
1296+
Math.round(vv?.height || window.innerHeight || document.documentElement.clientHeight || 0)
1297+
);
1298+
const viewportWidth = Math.max(
1299+
1,
1300+
Math.round(vv?.width || window.innerWidth || document.documentElement.clientWidth || 0)
1301+
);
1302+
const viewportTop = Math.max(0, Math.round(vv?.offsetTop || 0));
1303+
const viewportBottomInset = Math.max(
1304+
0,
1305+
Math.round((window.innerHeight || viewportHeight) - (viewportTop + viewportHeight))
1306+
);
1307+
1308+
root.style.setProperty('--site-atmosphere-viewport-height', `${viewportHeight}px`);
1309+
root.style.setProperty('--site-atmosphere-viewport-width', `${viewportWidth}px`);
1310+
root.style.setProperty('--site-atmosphere-safe-top', `${viewportTop}px`);
1311+
root.style.setProperty('--site-atmosphere-safe-bottom', `${viewportBottomInset}px`);
1312+
root.style.setProperty('--site-atmosphere-render-height', `${viewportHeight}px`);
1313+
root.style.setProperty('--site-atmosphere-render-width', `${viewportWidth}px`);
12851314
};
12861315

12871316
const sync = () => {
12881317
clearInlineMotion();
1318+
syncViewportVars();
12891319
root.style.removeProperty('--site-atmosphere-shift-y');
12901320
body.dataset.siteAtmosphereLocked = '1';
12911321
};
@@ -2388,6 +2418,7 @@
23882418

23892419
async function boot() {
23902420
initHeroViewportLock();
2421+
initSiteAtmosphereLock();
23912422

23922423
await Promise.all([
23932424
injectPartial('#nav-slot', 'nav.html'),
@@ -2403,7 +2434,6 @@
24032434
initSectionSpy();
24042435
initReveal();
24052436
initHeroIntro();
2406-
initSiteAtmosphereLock();
24072437
initHomeScrollTransition();
24082438
initRockSaltSafeAreas();
24092439
initAboutCreator();

0 commit comments

Comments
 (0)