Skip to content

Commit ff9826a

Browse files
committed
Align and fade hero artwork
1 parent 5dd9557 commit ff9826a

1 file changed

Lines changed: 32 additions & 9 deletions

File tree

‎src/index.css‎

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -338,16 +338,23 @@
338338
position: absolute;
339339
top: 50%;
340340
/*
341-
* Keep the copy and artwork on one centered 100rem stage. The artwork
342-
* grows through normal desktop widths, then tapers toward 54rem so
343-
* browser zoom-out cannot pull a giant illustration toward the far edge.
344-
* The transparent artwork deliberately sits beneath the foreground copy.
341+
* The generated 1600px asset has 126px of transparent padding on its
342+
* right edge. Clip that measured 7.875% tail and compensate by the same
343+
* amount so the visible genome track aligns with the page content edge.
345344
*/
346-
right: max(1.5rem, calc(50vw - 50rem));
345+
--hero-source-right-trim: 7.875%;
346+
/*
347+
* Anchor the visible artwork to the shared 72rem content stage. It grows
348+
* through normal desktop widths, then tapers toward 54rem so browser
349+
* zoom-out cannot pull a giant illustration toward the far edge. The
350+
* transparent artwork deliberately sits beneath the foreground copy.
351+
*/
352+
right: max(2rem, calc(50vw - 34rem));
347353
width: min(60vw, clamp(54rem, calc(72rem - 10vw), 64rem));
348354
margin: 0;
355+
clip-path: inset(0 var(--hero-source-right-trim) 0 0);
349356
opacity: 0.9;
350-
transform: translateY(-50%);
357+
transform: translate(var(--hero-source-right-trim), -50%);
351358
}
352359

353360
.dark .hero-science-field {
@@ -358,10 +365,26 @@
358365
@media (min-width: 1280px) {
359366
.hero-science-field {
360367
/*
361-
* Let the protein ribbon enter the copy column while keeping the denser
362-
* heatmap and genome track aligned with the centered content stage.
368+
* The fade ends at the copy's right edge. Its position is derived from
369+
* the shared 72rem container, 2rem gutters, and the measured source trim,
370+
* so it follows the overlap instead of relying on viewport-specific stops.
363371
*/
364-
right: max(3rem, calc(50vw - 35.25rem));
372+
--hero-overlap-end: calc(92.125% - 39.5rem);
373+
--hero-fade-start: max(0px, calc(var(--hero-overlap-end) - 10rem));
374+
-webkit-mask-image: linear-gradient(
375+
90deg,
376+
rgb(0 0 0 / 0.12) 0,
377+
rgb(0 0 0 / 0.12) var(--hero-fade-start),
378+
#000 var(--hero-overlap-end),
379+
#000 100%
380+
);
381+
mask-image: linear-gradient(
382+
90deg,
383+
rgb(0 0 0 / 0.12) 0,
384+
rgb(0 0 0 / 0.12) var(--hero-fade-start),
385+
#000 var(--hero-overlap-end),
386+
#000 100%
387+
);
365388
}
366389
}
367390

0 commit comments

Comments
 (0)