Skip to content

Commit b0b8db4

Browse files
authored
Website Update
1 parent b7c4487 commit b0b8db4

3 files changed

Lines changed: 78 additions & 55 deletions

File tree

docs/assets/css/style.css

Lines changed: 36 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ a {
149149
}
150150

151151
.container {
152-
width: min(var(--container), calc(100% - 3rem));
152+
width: min(var(--container), calc(100% - 3.25rem));
153153
margin: 0 auto;
154154
}
155155

156156
.section:not(.hero) .container,
157157
.projects-shell {
158-
width: min(var(--container), calc(100% - 4.25rem));
158+
width: min(var(--container), calc(100% - 4.5rem));
159159
}
160160

161161
.section {
@@ -1001,7 +1001,7 @@ a {
10011001
letter-spacing: 0.005em;
10021002
line-height: 0.92;
10031003
text-transform: uppercase;
1004-
transform: translate3d(0, var(--parallax-y), 0);
1004+
transform: translateY(var(--parallax-y));
10051005
filter: drop-shadow(0 0 34px rgba(255, 157, 77, 0.08)) drop-shadow(0 0 24px rgba(89, 109, 255, 0.08));
10061006
will-change: transform, filter;
10071007
}
@@ -1169,6 +1169,13 @@ a {
11691169
line-height: 1.6;
11701170
}
11711171

1172+
.hero-subtitle[data-parallax] {
1173+
--parallax-y: 0px;
1174+
display: block;
1175+
transform: translateY(var(--parallax-y));
1176+
will-change: transform;
1177+
}
1178+
11721179
.button {
11731180
position: relative;
11741181
display: inline-flex;
@@ -1186,9 +1193,17 @@ a {
11861193
text-transform: uppercase;
11871194
overflow: hidden;
11881195
isolation: isolate;
1196+
touch-action: manipulation;
1197+
-webkit-tap-highlight-color: transparent;
11891198
transition: transform 220ms ease, filter 220ms ease, border-color 220ms ease;
11901199
}
11911200

1201+
.hero-actions,
1202+
.project-actions {
1203+
position: relative;
1204+
z-index: 2;
1205+
}
1206+
11921207
.button.primary {
11931208
background: var(--button-bg);
11941209
color: var(--button-text);
@@ -1294,7 +1309,7 @@ a {
12941309
flex-direction: column;
12951310
align-items: flex-start;
12961311
width: max-content;
1297-
transform: translate3d(0, calc(-1 * var(--about-role-shift)), 0);
1312+
transform: translateY(calc(-1 * var(--about-role-shift)));
12981313
transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
12991314
will-change: transform;
13001315
-webkit-user-select: none;
@@ -1512,21 +1527,33 @@ a {
15121527
--reveal-delay: 0ms;
15131528
--reveal-distance: 20px;
15141529
opacity: 1;
1515-
transform: translate3d(0, var(--parallax-y), 0);
1530+
transform: none;
1531+
}
1532+
1533+
.reveal[data-parallax] {
1534+
transform: translateY(var(--parallax-y));
15161535
}
15171536

15181537
.js .reveal {
15191538
opacity: 0;
1520-
transform: translate3d(0, calc(var(--reveal-distance) + var(--parallax-y)), 0);
1539+
transform: translateY(var(--reveal-distance));
15211540
transition:
15221541
opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
15231542
transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
15241543
transition-delay: var(--reveal-delay);
15251544
}
15261545

1546+
.js .reveal[data-parallax] {
1547+
transform: translateY(calc(var(--reveal-distance) + var(--parallax-y)));
1548+
}
1549+
15271550
.js .reveal.is-visible {
15281551
opacity: 1;
1529-
transform: translate3d(0, var(--parallax-y), 0);
1552+
transform: none;
1553+
}
1554+
1555+
.js .reveal[data-parallax].is-visible {
1556+
transform: translateY(var(--parallax-y));
15301557
}
15311558

15321559
.js .reveal[data-parallax].is-visible.reveal-settled {
@@ -1581,11 +1608,6 @@ a {
15811608

15821609
/* Mobile portrait nav */
15831610
@media (max-width: 980px) and (orientation: portrait) {
1584-
.button {
1585-
touch-action: manipulation;
1586-
-webkit-tap-highlight-color: transparent;
1587-
}
1588-
15891611
.nav {
15901612
top: calc(env(safe-area-inset-top, 0px) + 6px);
15911613
}
@@ -1613,33 +1635,6 @@ a {
16131635
.hero-bottom {
16141636
margin-top: 0.32rem;
16151637
}
1616-
1617-
.hero-title {
1618-
-webkit-transform: translateY(var(--parallax-y));
1619-
transform: translateY(var(--parallax-y));
1620-
will-change: auto;
1621-
}
1622-
1623-
.reveal {
1624-
-webkit-transform: translateY(var(--parallax-y));
1625-
transform: translateY(var(--parallax-y));
1626-
}
1627-
1628-
.js .reveal {
1629-
-webkit-transform: translateY(calc(var(--reveal-distance) + var(--parallax-y)));
1630-
transform: translateY(calc(var(--reveal-distance) + var(--parallax-y)));
1631-
}
1632-
1633-
.js .reveal.is-visible {
1634-
-webkit-transform: translateY(var(--parallax-y));
1635-
transform: translateY(var(--parallax-y));
1636-
}
1637-
1638-
.about-operator-track {
1639-
-webkit-transform: translateY(calc(-1 * var(--about-role-shift)));
1640-
transform: translateY(calc(-1 * var(--about-role-shift)));
1641-
will-change: auto;
1642-
}
16431638
}
16441639

16451640
@media (max-width: 980px) and (orientation: landscape) {
@@ -1655,13 +1650,12 @@ a {
16551650
@media (max-width: 680px) {
16561651
.section:not(.hero) .container,
16571652
.projects-shell {
1658-
width: calc(100% - 2.2rem);
1653+
width: calc(100% - 2.35rem);
16591654
}
16601655

16611656
.hero .container {
1662-
width: calc(100% - 1.9rem);
1657+
width: calc(100% - 2.05rem);
16631658
}
1664-
16651659
}
16661660

16671661
@media (prefers-reduced-motion: reduce) {

docs/assets/js/shell.js

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,9 +1135,13 @@
11351135
let metrics = { height: 0, widths: [] };
11361136
let sequenceFrame = 0;
11371137
let nextStepAt = 0;
1138+
let pendingRefresh = false;
11381139
let lastLayoutWidth = 0;
11391140
let lastViewportWidth = 0;
11401141

1142+
const measureLayoutWidth = () => Math.round(title.offsetWidth || title.clientWidth || title.getBoundingClientRect().width);
1143+
const measureViewportWidth = () => Math.round(document.documentElement.clientWidth || window.innerWidth || 0);
1144+
11411145
const setImmediateTransitions = (enabled) => {
11421146
const value = enabled ? "none" : "";
11431147
viewport.style.transition = value;
@@ -1158,13 +1162,13 @@
11581162
};
11591163

11601164
const captureLayoutWidths = () => {
1161-
lastLayoutWidth = Math.round(title.getBoundingClientRect().width);
1162-
lastViewportWidth = Math.round(window.innerWidth || document.documentElement.clientWidth || 0);
1165+
lastLayoutWidth = measureLayoutWidth();
1166+
lastViewportWidth = measureViewportWidth();
11631167
};
11641168

11651169
const layoutWidthChanged = () => {
1166-
const currentTitleWidth = Math.round(title.getBoundingClientRect().width);
1167-
const currentViewportWidth = Math.round(window.innerWidth || document.documentElement.clientWidth || 0);
1170+
const currentTitleWidth = measureLayoutWidth();
1171+
const currentViewportWidth = measureViewportWidth();
11681172
const titleDelta = Math.abs(currentTitleWidth - lastLayoutWidth);
11691173
const viewportDelta = Math.abs(currentViewportWidth - lastViewportWidth);
11701174

@@ -1219,6 +1223,12 @@
12191223
nextStepAt = now + transitionDuration + holdDuration;
12201224

12211225
if (activeIndex >= finalIndex) {
1226+
if (pendingRefresh) {
1227+
pendingRefresh = false;
1228+
updateMetrics();
1229+
applyIndex(finalIndex, { immediate: true });
1230+
captureLayoutWidths();
1231+
}
12221232
sequenceFrame = 0;
12231233
return;
12241234
}
@@ -1233,6 +1243,7 @@
12331243
}
12341244

12351245
started = true;
1246+
pendingRefresh = false;
12361247

12371248
if (prefersReducedMotion) {
12381249
updateMetrics();
@@ -1254,6 +1265,11 @@
12541265
return;
12551266
}
12561267

1268+
if (started && activeIndex < finalIndex) {
1269+
pendingRefresh = true;
1270+
return;
1271+
}
1272+
12571273
updateMetrics();
12581274
applyIndex(started ? activeIndex : 0, { immediate: true });
12591275
captureLayoutWidths();
@@ -1316,17 +1332,30 @@
13161332
return;
13171333
}
13181334

1335+
const entries = layers.map((layer) => ({
1336+
layer,
1337+
speed: Number(layer.getAttribute("data-parallax")) || 0.02,
1338+
section: layer.closest(".section")
1339+
}));
1340+
13191341
let raf = 0;
13201342

13211343
const render = () => {
13221344
raf = 0;
13231345
const viewportCenter = window.innerHeight * 0.5;
1346+
const sectionDistances = new Map();
1347+
1348+
entries.forEach(({ section, layer, speed }) => {
1349+
const key = section || layer;
1350+
1351+
if (!sectionDistances.has(key)) {
1352+
const rect = key.getBoundingClientRect();
1353+
const distance = rect.top + rect.height * 0.5 - viewportCenter;
1354+
sectionDistances.set(key, distance);
1355+
}
13241356

1325-
layers.forEach((layer) => {
1326-
const speed = Number(layer.getAttribute("data-parallax")) || 0.02;
1327-
const rect = layer.getBoundingClientRect();
1328-
const distance = rect.top + rect.height * 0.5 - viewportCenter;
1329-
const shift = Math.max(-34, Math.min(34, -distance * speed));
1357+
const distance = sectionDistances.get(key) || 0;
1358+
const shift = Math.max(-28, Math.min(28, -distance * speed));
13301359

13311360
layer.style.setProperty("--parallax-y", `${shift.toFixed(2)}px`);
13321361
});

docs/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<link rel="preconnect" href="https://fonts.googleapis.com">
99
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
1010
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Unbounded:wght@500;700;800&display=swap" rel="stylesheet">
11-
<link rel="stylesheet" href="assets/css/style.css?v=20260409d">
11+
<link rel="stylesheet" href="assets/css/style.css?v=20260409g">
1212

1313
<link rel="icon" type="image/svg+xml" href="favicon.svg">
1414
<link rel="icon" sizes="192x192" href="android-chrome-192x192.png">
@@ -56,8 +56,8 @@ <h1 class="hero-title hero-title--pending" aria-label="SHAPE THE UNSEEN." data-h
5656
<span class="hero-title-text">SHAPE THE UNSEEN.</span>
5757
</h1>
5858

59-
<div class="hero-bottom reveal" data-reveal data-reveal-delay="260" data-parallax="0.03">
60-
<p class="hero-subtitle">The endless journey of a creative technologist Jason Lee.</p>
59+
<div class="hero-bottom reveal" data-reveal data-reveal-delay="260">
60+
<p class="hero-subtitle" data-parallax="0.03">The endless journey of a creative technologist Jason Lee.</p>
6161
<div class="hero-actions">
6262
<a class="button primary" href="#projects">View Current Project</a>
6363
</div>
@@ -163,6 +163,6 @@ <h2>Open Repositories and Direct Channels</h2>
163163

164164
<div id="footer-slot"></div>
165165

166-
<script src="assets/js/shell.js?v=20260409c" defer></script>
166+
<script src="assets/js/shell.js?v=20260409g" defer></script>
167167
</body>
168168
</html>

0 commit comments

Comments
 (0)