ソースを参照

feat: Liquid Glass pass: search button, night stages, optical sizes

- Nav: the "Ctrl K" label is replaced by a glass search button that
  matches the theme toggle; the shortcut shows in its hover label, in
  aria-keyshortcuts, and in the footer.
- Dark mode: project cards keep their hue but trade the bright pastel
  stage for a deep tint of it, with the blob as a soft glow, so they sit
  in the dark grid instead of glaring. The paper card moves to lilac so
  it no longer repeats the chatbot card's yellow.
- FinOps and Q panels sit closer to the card edge with corners
  concentric to the card's (16px in a 28px card at 12px, 14px in 24px
  at 10px), which also gives the chart and notifications more room.
- Type: Fraunces now includes its optical-size axis, so the headline is
  drawn from the display master (tighter, crisper) and small titles
  from the text master; before, every size used the 9 pt design. The
  italic "Eric" subset carries the same axis. Still loaded after the
  first paint.
- Blog posts: the back link, date, and title align with the body text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEPoSHwHCYMNpm2iKxY9hL
Claude 1 ヶ月 前
親
コミット
85f0c10d09

BIN
assets/fonts/fraunces-italic-eric.woff2


+ 3 - 2
components/blog/notion-page.tsx

@@ -136,15 +136,16 @@ export const NotionPage = ({
 
   return (
     <article ref={articleRef} className="mx-auto max-w-[760px]">
+      {/* Header and back link line up with the Notion body (its page padding plus the text's 2px). */}
       <Link
-        className="lg inline-flex h-9 items-center gap-1.5 rounded-full px-3.5 text-[13px] font-medium"
+        className="lg ml-[calc(min(16px,8vw)_+_2px)] inline-flex h-9 items-center gap-1.5 rounded-full px-3.5 text-[13px] font-medium"
         data-cursor="All posts"
         href="/blog"
       >
         <span aria-hidden className="lg-caustic" />
         <span>← All posts</span>
       </Link>
-      <header className="mt-8 mb-6 px-[var(--notion-gutter,0px)]">
+      <header className="mt-8 mb-6 px-[calc(min(16px,8vw)_+_2px)]">
         {created && (
           <time className="eyebrow" dateTime={new Date(created).toISOString()}>
             {new Date(created).toLocaleDateString("en-US", {

+ 2 - 1
components/cards/artifacts.tsx

@@ -253,8 +253,9 @@ export function ArtifactsCard() {
         </div>
       </div>
 
+      {/* Like FinOps: closer to the edge than the text, concentric corners. */}
       <div
-        className="flex min-h-0 flex-1 flex-col gap-2 rounded-[20px] bg-inset p-2.5 ring-1 ring-line ring-inset [container-type:size]"
+        className="-mx-2.5 -mb-2.5 flex min-h-0 flex-1 flex-col gap-2 rounded-[14px] bg-inset p-2.5 ring-1 ring-line ring-inset [container-type:size] sm:mx-0 sm:-my-3 sm:-mr-3 sm:rounded-[16px]"
         data-nodrag
       >
         <div

+ 3 - 1
components/cards/finops.tsx

@@ -97,9 +97,11 @@ export function FinOpsCard() {
         </div>
       </div>
 
+      {/* The panel sits closer to the card's edge than the text (10px, 12px from
+          640px) with its corners concentric with the card's (24 - 10, 28 - 12). */}
       <div
         ref={rootRef}
-        className="relative min-h-0 flex-1 cursor-pointer overflow-hidden rounded-[20px] [container-type:size] bg-gradient-to-b from-inset to-[color-mix(in_oklab,var(--blush)_34%,var(--card-inset))] ring-1 ring-line ring-inset dark:to-[color-mix(in_oklab,var(--ember)_12%,var(--card-inset))]"
+        className="relative -mx-2.5 -mb-2.5 min-h-0 flex-1 cursor-pointer overflow-hidden rounded-[14px] [container-type:size] bg-gradient-to-b from-inset to-[color-mix(in_oklab,var(--blush)_34%,var(--card-inset))] ring-1 ring-line ring-inset sm:mx-0 sm:-my-3 sm:-mr-3 sm:rounded-[16px] dark:to-[color-mix(in_oklab,var(--ember)_12%,var(--card-inset))]"
         data-cursor="Replay"
         data-nodrag
         role="button"

+ 8 - 9
components/cards/project.tsx

@@ -6,35 +6,36 @@ import type { Project } from "@/config/site";
 import { cn } from "@/lib/utils";
 
 /*
- * Each composition keeps the original, hand-tuned placement: a pastel card,
- * a soft pink blob, and the screenshot tilted -30°. On top of that the
+ * Each composition keeps the original, hand-tuned placement: a pastel card
+ * (a deep tint of it in dark mode), a soft pink blob, and the screenshot
+ * tilted -30°. On top of that the
  * screenshot leans toward the cursor (the grid feeds --tx/--ty), lifts on
  * hover, and gets a liquid-glass loupe.
  */
 const LOOKS = {
   secondself: {
-    bg: "bg-sky",
+    bg: "bg-stage-sky",
     blob: "-bottom-32 left-1/2 h-56 w-64 -translate-x-1/2 md:-bottom-52 md:h-96 md:w-96",
     shot: "top-16 left-20 w-[80%] -translate-y-1/2 md:top-36 md:left-44",
     img: "h-full w-full object-contain",
     sizes: "(max-width: 768px) 300px, 500px",
   },
   webagent: {
-    bg: "bg-mint",
+    bg: "bg-stage-mint",
     blob: "-bottom-96 left-16 h-full w-[145%]",
     shot: "top-1/2 left-24 w-[80%] -translate-y-1/2 md:left-32",
     img: "h-full w-full object-contain",
     sizes: "(max-width: 768px) 300px, 500px",
   },
   chatbot: {
-    bg: "bg-butter",
+    bg: "bg-stage-butter",
     blob: "-top-40 left-40 h-full w-[135%]",
     shot: "top-1/2 left-20 w-[400px] -translate-y-1/2 md:left-44 md:w-[800px]",
     img: "h-48 object-cover md:h-96",
     sizes: "(max-width: 768px) 400px, 800px",
   },
   paper: {
-    bg: "bg-butter",
+    bg: "bg-stage-lilac",
     blob: "-top-40 left-40 h-full w-[135%]",
     shot: "top-16 left-12 w-full -translate-y-1/2 md:top-1/2 md:left-16",
     img: "h-full w-full object-contain",
@@ -60,9 +61,7 @@ export function ProjectCard({
 
   return (
     <div className={cn("group relative h-full w-full overflow-hidden", l.bg)}>
-      <div
-        className={cn("absolute rounded-full bg-blush dark:hidden", l.blob)}
-      />
+      <div className={cn("absolute rounded-full bg-stage-blob", l.blob)} />
       <div
         className={cn(
           "absolute rounded-2xl -rotate-[30deg] transition-[rotate,scale,translate] duration-700 ease-[cubic-bezier(.2,.9,.25,1)] [transform:perspective(1100px)_rotateX(calc(var(--ty,0)*-6deg))_rotateY(calc(var(--tx,0)*8deg))] group-hover:scale-[1.03] group-hover:-rotate-[27deg]",

+ 43 - 9
components/nav/site-nav.tsx

@@ -85,15 +85,10 @@ export function SiteNav() {
           glass={{ chroma: 0.1, blur: 3, saturate: 1.8 }}
         >
           <Tabs activeIndex={activeIndex} onSelect={select} />
-          <button
-            aria-label={`${shortcut} command palette`}
-            className="hidden h-10 items-center gap-1 rounded-full px-3 text-[13px] font-medium text-muted transition-colors hover:text-ink md:flex"
-            data-cursor="Command palette"
-            type="button"
-            onClick={() => setPaletteOpen(true)}
-          >
-            {shortcut}
-          </button>
+          <SearchButton
+            shortcut={shortcut}
+            onOpen={() => setPaletteOpen(true)}
+          />
           <ThemeButton />
         </LiquidGlass>
       </header>
@@ -279,6 +274,45 @@ function Tabs({
   );
 }
 
+/** Opens the command palette; its shortcut lives in the hover label and the footer. */
+function SearchButton({
+  shortcut,
+  onOpen,
+}: {
+  shortcut: string;
+  onOpen: () => void;
+}) {
+  const ref = useRef<HTMLButtonElement>(null);
+
+  useGlassLight(ref);
+
+  return (
+    <button
+      ref={ref}
+      aria-keyshortcuts="Meta+K Control+K"
+      aria-label="Search"
+      className="lg hidden size-10 place-items-center rounded-full md:grid"
+      data-cursor={`Search ${shortcut}`}
+      type="button"
+      onClick={onOpen}
+    >
+      <span className="lg-caustic" />
+      <svg
+        aria-hidden
+        className="size-[17px]"
+        fill="none"
+        stroke="currentColor"
+        strokeLinecap="round"
+        strokeWidth="2"
+        viewBox="0 0 24 24"
+      >
+        <circle cx="10.5" cy="10.5" r="6.5" />
+        <path d="m15.5 15.5 4.5 4.5" />
+      </svg>
+    </button>
+  );
+}
+
 function ThemeButton() {
   const { resolvedTheme, setTheme } = useTheme();
   const ref = useRef<HTMLButtonElement>(null);

+ 6 - 4
config/fonts.ts

@@ -15,19 +15,21 @@ export const fontText = Figtree({
 
 /**
  * Display: Fraunces, a soft variable serif. Its SOFT axis rounds the letters,
- * so the headline can melt like liquid under the cursor. The optical-size
- * axis is left out to keep the file small (about 60 KB).
+ * so the headline can melt like liquid under the cursor, and its optical-size
+ * axis draws each size as designed: crisp, high-contrast cuts for the big
+ * headline, sturdier ones for card titles. (Without it every size is drawn
+ * from the 9 pt master.) About 120 KB, fetched after the first paint.
  */
 export const fontDisplay = Fraunces({
   subsets: ["latin"],
-  axes: ["SOFT"],
+  axes: ["SOFT", "opsz"],
   variable: "--ff-display",
   display: "swap",
   // Loaded after the first paint by <FontLoader />.
   preload: false,
 });
 
-/** The italic "Eric" in the headline: Fraunces Italic subset to four glyphs (4 KB). */
+/** The italic "Eric" in the headline: Fraunces Italic subset to four glyphs, all axes (6 KB). */
 export const fontName = localFont({
   src: "../assets/fonts/fraunces-italic-eric.woff2",
   style: "italic",

+ 17 - 0
styles/globals.css

@@ -27,6 +27,11 @@
   --color-mint: var(--mint);
   --color-blush: var(--blush);
   --color-butter: var(--butter);
+  --color-stage-sky: var(--stage-sky);
+  --color-stage-mint: var(--stage-mint);
+  --color-stage-butter: var(--stage-butter);
+  --color-stage-lilac: var(--stage-lilac);
+  --color-stage-blob: var(--stage-blob);
 
   /* backwards, not both: a held end state would override drag/FLIP transforms */
   --animate-rise: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
@@ -75,6 +80,12 @@ html.ff {
   --mint: #63ccae;
   --blush: #ffbfd1;
   --butter: #ffdf9a;
+  /* Project cards: a pastel stage by day, a deep tint of the same hue by night. */
+  --stage-sky: var(--sky);
+  --stage-mint: var(--mint);
+  --stage-butter: var(--butter);
+  --stage-lilac: #cbbffd;
+  --stage-blob: var(--blush);
   --glacier: #2a86dd;
   --ember: #d9487a;
   /* Deeper shades of the same hues for small text (WCAG AA on white). */
@@ -229,6 +240,12 @@ html.ff {
 }
 
 .dark {
+  --stage-sky: #142f49;
+  --stage-mint: #103830;
+  --stage-butter: #362a12;
+  --stage-lilac: #231d42;
+  --stage-blob: rgb(255 159 189 / 0.12);
+
   /* Neutrals: the original night palette. */
   --bg: #0b0f11;
   --card: #0f1217;