Prechádzať zdrojové kódy

fix: balance the desktop hero instead of leaving a hole under the byline

On a Mac the bio wraps a line shorter (SF Pro is narrower than the
fallback face), and all the spare height of the square hero piled up
between the byline and the headline: about 89px of white there against
43 and 29 below. The spare height is now shared evenly above and below
the statement, which sits centred between the byline and the links,
and the headline steps up to ~110px on the largest card. At the 587px
card the gaps now read 52/45/46 on a Mac and 38/45/36 elsewhere; phones
and tablets are unchanged where the hero has no spare height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEPoSHwHCYMNpm2iKxY9hL
Claude 1 mesiac pred
rodič
commit
9b363fe6c3
2 zmenil súbory, kde vykonal 17 pridanie a 8 odobranie
  1. 6 5
      components/cards/hero.tsx
  2. 11 3
      styles/globals.css

+ 6 - 5
components/cards/hero.tsx

@@ -54,10 +54,11 @@ export function HeroCard({
           </p>
         </div>
       </div>
-      {/* The byline holds the top; the statement and its links hold the bottom
-          as one block, so any spare height is a single field of space under
-          the byline rather than gaps that pull the block apart. Below 768px
-          the card is as tall as its content and nothing is spare. */}
+      {/* The byline holds the top and the links the bottom; any spare height
+          is shared evenly above and below the statement, so it sits centred
+          between them however its lines fall (the bio wraps differently from
+          one platform's text face to another). Below 768px the card is as tall
+          as its content and nothing is spare. */}
       <div className="mt-auto pt-5 min-[480px]:pt-6">
         <HeroTitle />
         <p className="mt-4 max-w-[32em] text-[16px] leading-[1.5] text-pretty text-muted @max-[270px]/hero:text-[15px] min-[480px]:text-[17px] md:mt-5 md:text-[clamp(16px,3.5cqi,21px)]">
@@ -69,7 +70,7 @@ export function HeroCard({
       </div>
       <nav
         aria-label="Social links"
-        className="dock mt-6 flex items-center gap-2"
+        className="dock mt-6 flex items-center gap-2 md:mt-auto md:pt-6"
       >
         {socials.map((s) => (
           <a

+ 11 - 3
styles/globals.css

@@ -1012,9 +1012,11 @@ html .notion-yt-lite {
  * The hero headline: one line that grows with its card (it runs ~6.2em wide).
  * Below 768px the hero is a full-width row as tall as its content, so the line
  * stays single. From 768px it is a square beside other cards: the headline
- * breaks to "Hey, I'm / Eric." and grows once the card is tall enough, while
- * the bio scales with the card, so the square fills alike at every size
- * (measured: the spare height under the byline stays within 28-75px).
+ * breaks to "Hey, I'm / Eric." and grows in two steps as the card gets taller,
+ * while the bio scales with the card, so the square fills alike at every size.
+ * Measured at the 587px card: the gaps from byline to headline, headline to
+ * bio and bio to links come out about even (~38/45/36px of white between the
+ * ink), and ~52/51/46 where the bio wraps a line shorter (SF Pro on a Mac).
  */
 .hero-title {
   font-size: clamp(2rem, 15.5cqi, 5.2rem);
@@ -1037,6 +1039,12 @@ html .notion-yt-lite {
       font-size: min(18.5cqi, 7.5rem);
     }
   }
+
+  @container hero (min-height: 530px) and (min-aspect-ratio: 9 / 10) {
+    .hero-title {
+      font-size: min(20.4cqi, 7.5rem);
+    }
+  }
 }
 
 /* The name in the hero: a sky-to-blush gradient, Apple Intelligence style. */