diff --git a/.gitignore b/.gitignore index 375f8be..926ed22 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ node_modules/ .wrangler/ .DS_Store + +# Impeccable working files: mockups, review captures, build state. The surface brief and live config are kept. +.impeccable/mocks/ +.impeccable/review/ +.impeccable/build/ +.impeccable/questions/ diff --git a/.impeccable/design.json b/.impeccable/design.json new file mode 100644 index 0000000..b42f7dc --- /dev/null +++ b/.impeccable/design.json @@ -0,0 +1,374 @@ +{ + "schemaVersion": 2, + "generatedAt": "2026-11-05T20:36:33+00:00", + "title": "Design System: Selfie", + "extensions": { + "colorMeta": { + "sky": { + "role": "neutral", + "displayName": "Sky", + "canonical": "oklch(87.3% 0.042 245.0)", + "tonalRamp": [ + "oklch(15% 0.015 245.0)", + "oklch(26% 0.025 245.0)", + "oklch(37% 0.036 245.0)", + "oklch(48% 0.042 245.0)", + "oklch(59% 0.042 245.0)", + "oklch(70% 0.038 245.0)", + "oklch(82% 0.025 245.0)", + "oklch(94% 0.013 245.0)" + ] + }, + "ink": { + "role": "neutral", + "displayName": "Primer Ink", + "canonical": "oklch(25.4% 0.011 254.0)", + "tonalRamp": [ + "oklch(15% 0.004 254.0)", + "oklch(26% 0.007 254.0)", + "oklch(37% 0.009 254.0)", + "oklch(48% 0.011 254.0)", + "oklch(59% 0.011 254.0)", + "oklch(70% 0.010 254.0)", + "oklch(82% 0.007 254.0)", + "oklch(94% 0.003 254.0)" + ] + }, + "muted": { + "role": "neutral", + "displayName": "Primer Muted", + "canonical": "oklch(43.5% 0.019 254.0)", + "tonalRamp": [ + "oklch(15% 0.007 254.0)", + "oklch(26% 0.011 254.0)", + "oklch(37% 0.016 254.0)", + "oklch(48% 0.019 254.0)", + "oklch(59% 0.019 254.0)", + "oklch(70% 0.017 254.0)", + "oklch(82% 0.011 254.0)", + "oklch(94% 0.006 254.0)" + ] + }, + "paper": { + "role": "neutral", + "displayName": "Paper", + "canonical": "oklch(100% 0 0)", + "tonalRamp": [ + "oklch(15% 0.000 0.0)", + "oklch(26% 0.000 0.0)", + "oklch(37% 0.000 0.0)", + "oklch(48% 0.000 0.0)", + "oklch(59% 0.000 0.0)", + "oklch(70% 0.000 0.0)", + "oklch(82% 0.000 0.0)", + "oklch(94% 0.000 0.0)" + ] + }, + "yellow": { + "role": "primary", + "displayName": "Button Yellow", + "canonical": "oklch(87.9% 0.168 95.4)", + "tonalRamp": [ + "oklch(15% 0.059 95.4)", + "oklch(26% 0.101 95.4)", + "oklch(37% 0.143 95.4)", + "oklch(48% 0.168 95.4)", + "oklch(59% 0.168 95.4)", + "oklch(70% 0.151 95.4)", + "oklch(82% 0.101 95.4)", + "oklch(94% 0.050 95.4)" + ] + }, + "cam-yellow": { + "role": "secondary", + "displayName": "Camera Chrome Yellow", + "canonical": "oklch(88.5% 0.181 94.8)", + "tonalRamp": [ + "oklch(15% 0.063 94.8)", + "oklch(26% 0.109 94.8)", + "oklch(37% 0.154 94.8)", + "oklch(48% 0.181 94.8)", + "oklch(59% 0.181 94.8)", + "oklch(70% 0.163 94.8)", + "oklch(82% 0.109 94.8)", + "oklch(94% 0.054 94.8)" + ] + }, + "hot-pink": { + "role": "tertiary", + "displayName": "Annotation Hot Pink", + "canonical": "oklch(66.0% 0.255 355.0)", + "tonalRamp": [ + "oklch(15% 0.089 355.0)", + "oklch(26% 0.153 355.0)", + "oklch(37% 0.217 355.0)", + "oklch(48% 0.255 355.0)", + "oklch(59% 0.255 355.0)", + "oklch(70% 0.230 355.0)", + "oklch(82% 0.153 355.0)", + "oklch(94% 0.076 355.0)" + ] + }, + "signal-pink": { + "role": "tertiary", + "displayName": "Signal Pink", + "canonical": "oklch(65.8% 0.200 353.5)", + "tonalRamp": [ + "oklch(15% 0.070 353.5)", + "oklch(26% 0.120 353.5)", + "oklch(37% 0.170 353.5)", + "oklch(48% 0.200 353.5)", + "oklch(59% 0.200 353.5)", + "oklch(70% 0.180 353.5)", + "oklch(82% 0.120 353.5)", + "oklch(94% 0.060 353.5)" + ] + }, + "screen-black": { + "role": "neutral", + "displayName": "Screen Black", + "canonical": "oklch(16.9% 0.004 286.0)", + "tonalRamp": [ + "oklch(15% 0.001 286.0)", + "oklch(26% 0.002 286.0)", + "oklch(37% 0.003 286.0)", + "oklch(48% 0.004 286.0)", + "oklch(59% 0.004 286.0)", + "oklch(70% 0.004 286.0)", + "oklch(82% 0.002 286.0)", + "oklch(94% 0.001 286.0)" + ] + }, + "slate-note": { + "role": "neutral", + "displayName": "Slate Note", + "canonical": "oklch(76.5% 0.021 250.4)", + "tonalRamp": [ + "oklch(15% 0.007 250.4)", + "oklch(26% 0.013 250.4)", + "oklch(37% 0.018 250.4)", + "oklch(48% 0.021 250.4)", + "oklch(59% 0.021 250.4)", + "oklch(70% 0.019 250.4)", + "oklch(82% 0.013 250.4)", + "oklch(94% 0.006 250.4)" + ] + } + }, + "typographyMeta": { + "display": { + "displayName": "Display", + "purpose": "The hero headline; desktop size is 82 comp units, italic word at the same weight 600." + }, + "headline": { + "displayName": "Headline", + "purpose": "Section heads; italic words inside drop to 600." + }, + "title": { + "displayName": "Title", + "purpose": "Hero argument line; the 600-weight family of smaller titles (1.375rem video titles, 1.25rem feature names)." + }, + "body": { + "displayName": "Body", + "purpose": "Running copy, held to about 42-48em." + }, + "label": { + "displayName": "Label", + "purpose": "Fine print; the notice strip uses 1.0625rem." + }, + "hand": { + "displayName": "Hand", + "purpose": "Neucha handwriting on the artwork only: the note and the print caption." + }, + "code": { + "displayName": "Code", + "purpose": "Inline code and the terminal." + } + }, + "shadows": [ + { + "name": "pressable", + "value": "4px 4px 0 #1f2328", + "purpose": "Buttons at rest; the shadow is the button travel." + }, + { + "name": "pressable-hover", + "value": "5px 5px 0 #1f2328", + "purpose": "Button hover, with a -1px translate." + }, + { + "name": "pressable-active", + "value": "1px 1px 0 #1f2328", + "purpose": "Button press, with a 3px translate." + }, + { + "name": "print-drop", + "value": "0.6cqw 0.8cqw 1.6cqw rgb(31 35 40 / 0.18)", + "purpose": "The paper print of yesterday, the one soft shadow." + } + ], + "motion": [ + { + "name": "press", + "value": "0.12s ease-out", + "purpose": "Button and shutter transform and shadow." + }, + { + "name": "flash", + "value": "0.32s ease-out", + "purpose": "White screen flash when the shutter fires." + }, + { + "name": "arrow-draw", + "value": "0.6s 0.6s cubic-bezier(0.3, 0, 0.2, 1)", + "purpose": "The annotation arrow draws in from the note; head follows at 0.22s after 1.15s. Skipped under reduced motion." + }, + { + "name": "note-in", + "value": "0.35s 0.35s ease-out", + "purpose": "The handwritten note fades in before the arrow." + } + ], + "breakpoints": [ + { + "name": "phone", + "value": "600px" + }, + { + "name": "stack", + "value": "860px" + }, + { + "name": "stage", + "value": "1100px" + } + ] + }, + "components": [ + { + "name": "Primary Button", + "kind": "button", + "refersTo": "button-primary", + "description": "Yellow, ink-outlined, hard offset shadow that moves with hover and press. The main call to action.", + "html": "Get started on GitHub", + "css": ".ds-btn { display: inline-block; padding: 0.7rem 1.25rem; font-family: Jost, system-ui, sans-serif; font-size: 1.1875rem; font-weight: 600; color: var(--ink, #1f2328); text-decoration: none; border: 3px solid var(--ink, #1f2328); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink, #1f2328); transition: transform 0.12s ease-out, box-shadow 0.12s ease-out; } .ds-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink, #1f2328); } .ds-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink, #1f2328); } .ds-btn:focus-visible { outline: 3px solid var(--pink, #e8509b); outline-offset: 3px; } .ds-btn-primary { background: var(--yellow, #f9d535); }" + }, + { + "name": "Dark Button", + "kind": "button", + "refersTo": "button-dark", + "description": "Ink fill, white text; a second action on the yellow band.", + "html": "Read the quickstart", + "css": ".ds-btn { display: inline-block; padding: 0.7rem 1.25rem; font-family: Jost, system-ui, sans-serif; font-size: 1.1875rem; font-weight: 600; color: var(--ink, #1f2328); text-decoration: none; border: 3px solid var(--ink, #1f2328); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink, #1f2328); transition: transform 0.12s ease-out, box-shadow 0.12s ease-out; } .ds-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink, #1f2328); } .ds-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink, #1f2328); } .ds-btn:focus-visible { outline: 3px solid var(--pink, #e8509b); outline-offset: 3px; } .ds-btn-dark { background: var(--ink, #1f2328); color: #fff; }" + }, + { + "name": "Secondary Button", + "kind": "button", + "refersTo": "button-secondary", + "description": "White fill, ink text, same outline and shadow.", + "html": "Join the list", + "css": ".ds-btn { display: inline-block; padding: 0.7rem 1.25rem; font-family: Jost, system-ui, sans-serif; font-size: 1.1875rem; font-weight: 600; color: var(--ink, #1f2328); text-decoration: none; border: 3px solid var(--ink, #1f2328); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink, #1f2328); transition: transform 0.12s ease-out, box-shadow 0.12s ease-out; } .ds-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink, #1f2328); } .ds-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink, #1f2328); } .ds-btn:focus-visible { outline: 3px solid var(--pink, #e8509b); outline-offset: 3px; } .ds-btn-secondary { background: #fff; }" + }, + { + "name": "Notice Strip", + "kind": "nav", + "refersTo": "notice-strip", + "description": "Top ink strip with one sentence and one yellow link; the only navigation.", + "html": "", + "css": ".ds-strip { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0.25rem 1.25rem; padding: 0.7rem 1.25rem; background: var(--ink, #1f2328); color: #fff; font-family: Jost, system-ui, sans-serif; font-size: 1.0625rem; line-height: 1.5; } .ds-strip p { margin: 0; } .ds-strip a { color: var(--yellow, #f9d535); font-weight: 600; white-space: nowrap; text-underline-offset: 0.15em; } .ds-strip a:hover { text-decoration-thickness: 2px; } .ds-strip a:focus-visible { outline: 3px solid var(--pink, #e8509b); outline-offset: 3px; } .ds-arrow { display: inline-block; width: 0.95em; height: 0.95em; margin-left: 0.15em; vertical-align: -0.12em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }" + }, + { + "name": "Video Card", + "kind": "card", + "refersTo": "video-thumb", + "description": "16:9 thumbnail in a 3px ink frame, no shadow, with a signal-pink play disc; title and muted description below.", + "html": "Product demoA two-line CSS change touches all 124 stories.", + "css": ".ds-video { display: flex; flex-direction: column; gap: 0.25rem; width: 320px; color: var(--ink, #1f2328); text-decoration: none; font-family: Jost, system-ui, sans-serif; font-size: 1.1875rem; line-height: 1.5; } .ds-thumb { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; background: var(--sky, #bfd9f0); border: 3px solid var(--ink, #1f2328); border-radius: 14px; } .ds-play { position: absolute; left: 1rem; bottom: 1rem; width: 3.5rem; height: 3.5rem; background: var(--pink, #e8509b); border: 3px solid var(--ink, #1f2328); border-radius: 50%; } .ds-play::after { content: ''; position: absolute; left: 1.2rem; top: 0.85rem; border-style: solid; border-width: 0.75rem 0 0.75rem 1.2rem; border-color: transparent transparent transparent #fff; } .ds-video strong { margin-top: 0.75rem; font-size: 1.375rem; font-weight: 600; } .ds-video:hover strong { text-decoration: underline; text-underline-offset: 0.15em; } .ds-video:focus-visible { outline: 3px solid var(--pink, #e8509b); outline-offset: 3px; } .ds-desc { color: var(--muted, #4a525c); }" + }, + { + "name": "Terminal", + "kind": "card", + "refersTo": "terminal", + "description": "Screen-black command block on the ink band, slate comments.", + "html": "
# JSON naming the diff images\nselfie review\n\n# after looking at them\nselfie approve <batch> --all
", + "css": ".ds-terminal { margin: 0; padding: 1.25rem 1.5rem; overflow-x: auto; background: #0f0f11; color: #fff; border: 1px solid rgb(255 255 255 / 0.14); border-radius: 14px; font: 1.125rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; } .ds-terminal:focus-visible { outline: 3px solid var(--pink, #e8509b); outline-offset: 3px; } .ds-c { color: #a9b4c0; }" + }, + { + "name": "Shutter", + "kind": "custom", + "refersTo": "shutter", + "description": "The camera shutter: a white ringed circle that is a real link, with camera-yellow mode row; focus in annotation hot pink.", + "html": "
Join the list
", + "css": ".ds-cam { display: grid; justify-items: center; gap: 1rem; width: 280px; padding: 1.25rem; background: #0f0f11; border-radius: 24px; font-family: Jost, system-ui, sans-serif; } .ds-shutter { display: grid; place-items: center; width: 96px; aspect-ratio: 1; background: #f7f7f7; border-radius: 50%; color: #1f2328; font-size: 0.8rem; font-weight: 600; text-decoration: none; box-shadow: inset 0 0 0 4px #f7f7f7, inset 0 0 0 6px #151516; transition: transform 0.12s ease-out; } .ds-shutter:hover { text-decoration: underline; text-decoration-thickness: 2px; } .ds-shutter:active { transform: scale(0.95); } .ds-shutter:focus-visible { outline: 3px solid var(--hot, #fd259a); outline-offset: 3px; } .ds-modes { display: flex; gap: 1.5rem; margin: 0; padding: 0; list-style: none; color: #f2f3f3; font-size: 0.8rem; font-weight: 500; letter-spacing: 0.02em; } .ds-on { color: var(--cam, #ffd60a); border-bottom: 3px solid var(--cam, #ffd60a); padding-bottom: 0.2em; }" + }, + { + "name": "Handwritten Annotation", + "kind": "custom", + "refersTo": "handwritten-note", + "description": "Neucha note in annotation hot pink with a code-drawn arrow; the only place pink and Neucha appear together.", + "html": "

this changed

", + "css": ".ds-annot { position: relative; width: 260px; height: 140px; background: #bfd9f0; } .ds-note { position: absolute; right: 12px; top: 8px; margin: 0; color: #fd259a; font: 400 2.2rem/0.92 Neucha, Jost, sans-serif; transform: rotate(-12deg) skewX(-10deg); } .ds-arrow-draw { position: absolute; left: 10px; top: 50px; width: 150px; height: 74px; overflow: visible; fill: none; stroke: #fd259a; stroke-width: 4.6; stroke-linecap: round; stroke-linejoin: round; } .ds-arrow-draw path { stroke-dasharray: 1; animation: ds-draw 0.6s 0.3s cubic-bezier(0.3, 0, 0.2, 1) both; } @keyframes ds-draw { from { stroke-dashoffset: 1; } } @media (prefers-reduced-motion: reduce) { .ds-arrow-draw path { animation: none; } }" + } + ], + "narrative": { + "northStar": "The Robot's Own Selfie", + "overview": "Selfie's world is a flat sky-blue field with ink-outlined objects on it, and a serious, photoreal robot doing a playful thing: holding up a phone and checking today's selfie against yesterday's print. The premise is a joke; the art is not. The robot is a matte white ceramic and dark-metal studio robot, lit like product photography, and it is only ever shown in the selfie situation: the phone in its hand, yesterday's print beside it, and the one changed plate circled in hot pink. Never the robot alone as a mascot.\n\nEverything around the art is quiet and graphic so the photograph can carry the page. Copy is one typeface, Jost, set heavy and close with real italics for the single stressed word in a line. Surfaces are flat fields of colour (sky, white paper, ink, yellow) divided by full-width bands rather than cards. Objects that can be touched or picked up (buttons, thumbnails, the print, the phone) get a 3px ink outline. The neighbouring product, the review app, is stock GitHub Primer, and the marketing world was chosen to sit beside it: Primer's ink and muted greys are this system's text colours.\n\nRejected and not to return: the cute anime or cartoon robot style, and the typefaces Bagel Fat One and Andika.", + "keyCharacteristics": [ + "One flat sky ground (#bfd9f0) for the first screen and the 404; white, ink, and yellow bands below.", + "3px ink outlines on handled objects; flat colour everywhere else.", + "Jost for all UI and copy, with true italics for emphasis; Neucha only for handwriting.", + "Hot pink belongs to the annotation layer alone.", + "A photoreal studio robot, always mid-selfie, never alone.", + "The camera interface is drawn in code with its own yellow." + ], + "rules": [ + { + "name": "The Pen Rule", + "body": "Hot pink is the annotation layer: handwriting, arrows, circles, and the shutter's focus ring. It never fills a button, a band, a logo, or a headline.", + "section": "colors" + }, + { + "name": "The Two Yellows Rule", + "body": "Button Yellow belongs to the page; Camera Chrome Yellow belongs to the phone. Don't swap them.", + "section": "colors" + }, + { + "name": "The Sky Ground Rule", + "body": "The first screen sits on the one flat sky, with no gradient, texture, or second tint.", + "section": "colors" + }, + { + "name": "The One Family Rule", + "body": "Jost sets every word of UI and copy. Emphasis is Jost Italic, a real italic, applied to one stressed word (\"*Distributed*\", \"*inside*\", \"*own*\", \"*early*\"), not to whole phrases.", + "section": "typography" + }, + { + "name": "The Marker Rule", + "body": "Neucha appears only where a person would have written by hand on the artwork. It never sets a heading, button, or paragraph.", + "section": "typography" + }, + { + "name": "The Pressable Rule", + "body": "The hard offset shadow means \"you can press this\". It belongs to buttons and nothing else; thumbnails, panels and frames get the outline without the shadow.", + "section": "elevation" + } + ], + "dos": [ + "Do set the first screen on flat Sky (#bfd9f0) with ink text.", + "Do set every UI and copy word in Jost, and use Jost Italic at the surrounding weight for the single stressed word.", + "Do keep Annotation Hot Pink (#fd259a) for handwriting, drawn arrows, circles, and the shutter focus ring.", + "Do give buttons the 3px ink outline and the 4px hard offset shadow, and let the shadow move with hover and press.", + "Do use Camera Chrome Yellow (#ffd60a) for anything that belongs to the phone's own interface.", + "Do show the robot as a photoreal matte-white studio robot in the selfie situation: phone, yesterday's print, the circled change.", + "Do build robot plates from `art/source` and `art/masks` with `art/build-plates.sh`, and keep every difference between yesterday and today to the one masked plate." + ], + "donts": [ + "Don't use hot pink as a brand colour: no pink buttons, bands, logos or headings.", + "Don't put the hard offset shadow on anything that isn't pressable; thumbnails and frames get the outline only.", + "Don't set headings, buttons, or paragraphs in Neucha, and don't bring back Bagel Fat One or Andika.", + "Don't show the robot alone as a mascot, or draw it in a cute, anime, or cartoon style.", + "Don't add gradients, textures, or a second tint to the sky ground.", + "Don't let the page drift from Primer's ink and muted greys for text; the app it sits beside is stock GitHub Primer." + ] + } +} \ No newline at end of file diff --git a/.impeccable/live/config.json b/.impeccable/live/config.json new file mode 100644 index 0000000..c4a62dc --- /dev/null +++ b/.impeccable/live/config.json @@ -0,0 +1,6 @@ +{ + "files": ["public/**/*.html"], + "insertBefore": "", + "commentSyntax": "html", + "cspChecked": true +} diff --git a/.impeccable/surfaces/public-index-html.md b/.impeccable/surfaces/public-index-html.md new file mode 100644 index 0000000..59194e8 --- /dev/null +++ b/.impeccable/surfaces/public-index-html.md @@ -0,0 +1,42 @@ +--- +version: 1 +slug: "public-index-html" +primary_target: "public/index.html" +related_targets: [] +--- + +# selfie.dev home + +Scope: the public landing page, Persuade mode. Audience and product truth live in PRODUCT.md. + +Approved comp: `.impeccable/mocks/serious-studio.png`. + +## Direction contract + +THESIS: The visitor stands where the robot stands, holding up the phone, and a coding agent checks its own work by taking a selfie. Refuses the framed app screenshot beside a headline. + +OWN-WORLD: One flat sky blue (#bfd9f0), ink outlines, yellow button, handwritten pink note. A photoreal matte-white ceramic and dark-metal robot, with a phone camera interface on its screen. + +STORY: The visitor sees yesterday's and today's selfies differ by one recolored plate, understands that this is what Selfie catches, and either starts from GitHub or joins the list through the shutter. + +FIRST VIEWPORT: Copy in the left column. Portrait phone right of center, held by a robot arm entering from the lower right corner, thumb at the shutter. "Yesterday" print fanned at the phone's upper right with a pink note. Primary actions: the yellow GitHub button and the shutter. + +FORM: Phone front camera, seventh on the ordered list, seed:a81eb6e7e3cedd89. + +FINISH: unreviewed and undocumented is unfinished; this build ends with the finish review, the verdict, DESIGN.md, and every shipping raster carrying its provenance + +## Decided with the owner + +- Portrait selfie only, with the real arm coming from the viewer's side and the phone screen as a mirror. +- Hand pose follows the owner's photos. +- The change is a color change on one head plate, red yesterday and blue today, and nothing else differs. +- Style B was chosen because it fits next to the GitHub Primer app. +- The ground is the existing homepage's sky blue, #bfd9f0, not the comp's drifted #aed2f1. Owner: "I think the solid color of our existing homepage is pretty good too." +- First-viewport copy, set by the owner after the comp: no logo or wordmark; "*Distributed* Storybook testing." (Jost Italic at the headline's weight, 600); the 100x-to-1000x argument above the fold; "Selfie lets your agent take its own snapshots." then "$0 per snapshot"; the phone's readout is "~500 stories per minute on M4 MacBook Air". +- The arrow from the note to the circle is drawn in code (owner: "the pink arrow should be pure code"). + +## Unresolved + +- MailerLite form details, and how the shutter opens signup. Until then it links to nedshed.dev/subscribe. +- Whether the phone shell becomes a raster with a lit metal rim, as in the comp. +- A new poster for the "Why Selfie" video, whose own thumbnail is the rejected cartoon robot. diff --git a/DESIGN.md b/DESIGN.md new file mode 100644 index 0000000..fa3493b --- /dev/null +++ b/DESIGN.md @@ -0,0 +1,237 @@ +--- +name: Selfie +description: Distributed Storybook testing, shown as a robot checking its own selfie against yesterday's. +colors: + sky: "#bfd9f0" + ink: "#1f2328" + muted: "#4a525c" + paper: "#ffffff" + yellow: "#f9d535" + cam-yellow: "#ffd60a" + hot-pink: "#fd259a" + signal-pink: "#e8509b" + screen-black: "#0f0f11" + slate-note: "#a9b4c0" +typography: + display: + fontFamily: "Jost, system-ui, sans-serif" + fontSize: "clamp(2.6rem, 9vw, 4.75rem)" + fontWeight: 600 + lineHeight: 1.12 + letterSpacing: "-0.012em" + headline: + fontFamily: "Jost, system-ui, sans-serif" + fontSize: "clamp(2rem, 4vw, 2.75rem)" + fontWeight: 700 + lineHeight: 1.08 + letterSpacing: "-0.015em" + title: + fontFamily: "Jost, system-ui, sans-serif" + fontSize: "1.5rem" + fontWeight: 600 + lineHeight: 1.25 + letterSpacing: "-0.01em" + body: + fontFamily: "Jost, system-ui, sans-serif" + fontSize: "1.1875rem" + fontWeight: 400 + lineHeight: 1.5 + label: + fontFamily: "Jost, system-ui, sans-serif" + fontSize: "1rem" + fontWeight: 400 + lineHeight: 1.5 + hand: + fontFamily: "Neucha, Jost, sans-serif" + fontWeight: 400 + lineHeight: 0.92 + code: + fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace" + fontSize: "0.86em" +rounded: + button: "12px" + frame: "14px" + round: "50%" +spacing: + gutter: "1.25rem" + grid-gap: "2rem" + column-gap: "3.5rem" + section: "5rem" + section-compact: "3.25rem" + container: "1120px" +components: + button-primary: + backgroundColor: "{colors.yellow}" + textColor: "{colors.ink}" + rounded: "{rounded.button}" + padding: "0.7rem 1.25rem" + button-dark: + backgroundColor: "{colors.ink}" + textColor: "{colors.paper}" + rounded: "{rounded.button}" + padding: "0.7rem 1.25rem" + button-secondary: + backgroundColor: "{colors.paper}" + textColor: "{colors.ink}" + rounded: "{rounded.button}" + padding: "0.7rem 1.25rem" + notice-strip: + backgroundColor: "{colors.ink}" + textColor: "{colors.paper}" + padding: "0.7rem 1.25rem" + video-thumb: + rounded: "{rounded.frame}" + play-disc: + backgroundColor: "{colors.signal-pink}" + rounded: "{rounded.round}" + size: "3.5rem" + terminal: + backgroundColor: "{colors.screen-black}" + textColor: "{colors.paper}" + rounded: "{rounded.frame}" + padding: "1.25rem 1.5rem" + shutter: + backgroundColor: "#f7f7f7" + textColor: "{colors.ink}" + rounded: "{rounded.round}" + handwritten-note: + textColor: "{colors.hot-pink}" + typography: "{typography.hand}" +--- + +# Design System: Selfie + +## Overview + +**Creative North Star: "The Robot's Own Selfie"** + +Selfie's world is a flat sky-blue field with ink-outlined objects on it, and a serious, photoreal robot doing a playful thing: holding up a phone and checking today's selfie against yesterday's print. The premise is a joke; the art is not. The robot is a matte white ceramic and dark-metal studio robot, lit like product photography, and it is only ever shown in the selfie situation: the phone in its hand, yesterday's print beside it, and the one changed plate circled in hot pink. Never the robot alone as a mascot. + +Everything around the art is quiet and graphic so the photograph can carry the page. Copy is one typeface, Jost, set heavy and close with real italics for the single stressed word in a line. Surfaces are flat fields of colour (sky, white paper, ink, yellow) divided by full-width bands rather than cards. Objects that can be touched or picked up (buttons, thumbnails, the print, the phone) get a 3px ink outline. The neighbouring product, the review app, is stock GitHub Primer, and the marketing world was chosen to sit beside it: Primer's ink and muted greys are this system's text colours. + +Rejected and not to return: the cute anime or cartoon robot style, and the typefaces Bagel Fat One and Andika. + +**Key Characteristics:** +- One flat sky ground (#bfd9f0) for the first screen and the 404; white, ink, and yellow bands below. +- 3px ink outlines on handled objects; flat colour everywhere else. +- Jost for all UI and copy, with true italics for emphasis; Neucha only for handwriting. +- Hot pink belongs to the annotation layer alone. +- A photoreal studio robot, always mid-selfie, never alone. +- The camera interface is drawn in code with its own yellow. + +## Colors + +A cool sky and Primer ink carry the page; two yellows and one hot pink each own a single job. + +### Primary +- **Button Yellow** (`yellow`): the yellow of every primary button, the full-width "early" band, the highlighter stroke under the key number, link colour on ink bands, inline code on ink, and text selection. + +### Secondary +- **Camera Chrome Yellow** (`cam-yellow`): the phone's own UI only: the focus brackets around the head plate, the active "SELFIE" mode and its underline, and the bracket mark in the icon. It stays distinct from Button Yellow so the phone reads as a device, not as page chrome. + +### Tertiary +- **Annotation Hot Pink** (`hot-pink`): the handwritten "this changed" note, the drawn arrow, the marker circle baked into today's plate, and the shutter's focus ring inside the phone. It is a pen, not a brand colour. +- **Signal Pink** (`signal-pink`): the page-level focus ring and the video play discs. + +### Neutral +- **Sky** (`sky`): the ground of the first viewport and the 404 page, chosen by the owner from the earlier homepage. +- **Primer Ink** (`ink`): text, outlines, the notice strip, the "loop" band and the footer. +- **Primer Muted** (`muted`): secondary text on white, such as video descriptions. +- **Paper** (`paper`): the body ground below the hero, and text on ink. +- **Screen Black** (`screen-black`): the phone screen and the terminal block. +- **Slate Note** (`slate-note`): terminal comments and fine print on ink. + +### Named Rules +**The Pen Rule.** Hot pink is the annotation layer: handwriting, arrows, circles, and the shutter's focus ring. It never fills a button, a band, a logo, or a headline. + +**The Two Yellows Rule.** Button Yellow belongs to the page; Camera Chrome Yellow belongs to the phone. Don't swap them. + +**The Sky Ground Rule.** The first screen sits on the one flat sky, with no gradient, texture, or second tint. + +## Typography + +**Display Font:** Jost (variable 100-900, with real Jost Italic), falling back to system-ui +**Body Font:** Jost +**Label Font:** Neucha, for handwritten labels only +**Code:** the system monospace stack + +**Character:** Jost's geometric construction set heavy and tight reads confident and technical; its true italic gives one word per line a voice without a second family. Neucha is the marker on the print, never the page. + +### Hierarchy +- **Display** (600, clamp(2.6rem, 9vw, 4.75rem), 1.12; 82 comp-pixels and 1.06 at 1100px and up; 2.35rem and 1.05 under 600px): the hero headline. The italic word is set at the same weight, 600. +- **Headline** (700, clamp(2rem, 4vw, 2.75rem), 1.08, -0.015em): section heads; italic words inside drop to 600. +- **Title** (600, 1.5rem, 1.25, -0.01em): the hero argument line. Smaller titles at 1.375rem (video titles) and 1.25rem (feature names) share weight 600; the price line steps up to 700 at 2rem. +- **Body** (400, 1.1875rem, 1.5): running copy, held to about 42-48em. +- **Label** (400, 1rem): fine print. The notice strip runs at 1.0625rem. +- **Hand** (Neucha 400, sized to its container): "this changed" and "yesterday". Rotated and skewed as if written. + +### Named Rules +**The One Family Rule.** Jost sets every word of UI and copy. Emphasis is Jost Italic, a real italic, applied to one stressed word ("*Distributed*", "*inside*", "*own*", "*early*"), not to whole phrases. + +**The Marker Rule.** Neucha appears only where a person would have written by hand on the artwork. It never sets a heading, button, or paragraph. + +## Layout + +Full-bleed horizontal bands in a fixed sequence of grounds: an ink notice strip, the sky hero, then white, ink, yellow, and ink bands. Content inside the bands sits in a centred container (1120px, with 1.25rem gutters at each side). Sections pad 5rem top and bottom (4.5rem for the yellow band, 2.5rem for the footer), dropping to 3.25rem at 860px and below, where every two-column grid becomes one column. Grids use 2rem gaps for cards and 3.5rem between text columns (2.25rem when stacked). + +The hero is drawn from the approved comp. At 1100px and up it is a fixed-proportion stage: every size is comp pixels times a unit of min(100vw, 150vh) / 1536, the copy column sits 112 units in and is vertically centred, and the phone stage pins to the right edge. Below 1100px the copy flows first and the phone stage follows, right-aligned and capped at 560px; under 600px the hero type tightens so the shutter stays near the fold. Inside the phone, positions are percentages of the stage and sizes are container-query units, so the camera UI scales as one picture. + +## Elevation & Depth + +Flat by default. Depth comes from 3px ink outlines and colour bands, not from ambient shadows. Two shadows exist, and each has one job. + +### Shadow Vocabulary +- **Pressable offset** (`box-shadow: 4px 4px 0 #1f2328`; hover `5px 5px 0`, active `1px 1px 0` with a 3px translate): buttons only. The shadow is the button's travel: it grows on hover and collapses on press. +- **Print drop** (`box-shadow: 0.6cqw 0.8cqw 1.6cqw rgb(31 35 40 / 0.18)`): the paper print of yesterday's selfie, a physical object lying above the sky. + +### Named Rules +**The Pressable Rule.** The hard offset shadow means "you can press this". It belongs to buttons and nothing else; thumbnails, panels and frames get the outline without the shadow. + +## Shapes + +Softly rounded rectangles with a heavy ink line. Buttons round at 12px; frames (video thumbnails, the terminal) at 14px; the shutter, play discs and the last-photo chip are full circles. The phone is a deep-radius slab with a thinner ink rim, drawn in CSS. The print is a slightly rounded white card tilted 8 degrees. The hero band closes on a 3px ink rule. The icon is the same family: an ink rounded square with yellow focus brackets around a blue head plate. + +## Components + +### Buttons +Chunky and tactile, like a sticker with a shadow you can push. +- **Shape:** gently rounded (12px), 3px ink outline. +- **Primary:** Button Yellow with ink text, weight 600, padding 0.7rem 1.25rem. The hero version scales with the comp (33 units, weight 700, a 6-unit outline, 14-unit radius). +- **Dark:** ink fill, white text, same outline and shadow. +- **Secondary:** white fill, ink text. +- **Hover / Focus / Active:** lifts 1px with a 5px shadow; presses 3px in with a 1px shadow; 0.12s ease-out, removed under reduced motion. Focus is a 3px Signal Pink outline offset 3px. + +### Cards / Containers +- **Video thumbnail:** 16:9 image in a 3px ink frame with 14px corners, no shadow. A Signal Pink play disc (3.5rem, ink outline, white triangle) sits 1rem in from the lower left. Title below at 1.375rem/600, underlining on hover; description in Primer Muted. +- **Terminal:** Screen Black block on the ink band, 1px hairline at 14% white, 14px corners, monospace at 1.125rem/1.55, comments in Slate Note. + +### Navigation +There is no nav bar. The ink notice strip at the top carries one sentence and one Button Yellow link with an inline stroke arrow; it wraps and centres on narrow screens. The home page has no logo or wordmark; the 404 carries the icon-and-word lockup ("selfie", Jost 700, 1.875rem). + +### Camera Interface (signature) +The phone screen is built in code over the photo plate: a Screen Black screen, a white readout line with a stroke icon, Camera Chrome Yellow focus brackets around the subject, a white shutter ring that is a real link ("Join the list"), a round last-photo chip showing yesterday's plate, and a VIDEO / SELFIE / PHOTO mode row with the active mode in Camera Chrome Yellow and underlined. Pressing the shutter fires a 0.32s white flash; on fine pointers the robot's thumb tracks the cursor and presses it. + +### Annotation +The annotation layer marks the one thing that changed. Handwriting in Neucha and Annotation Hot Pink, rotated about -12 degrees; an arrow drawn in SVG strokes (4.6 wide, round caps) from the note to the circled plate, drawing itself in on load (0.6s line, then 0.22s head) unless reduced motion is set. The circle is part of the raster plate. + +### Highlight +One key figure per screen can carry a Button Yellow highlighter band behind its lower half (58% to 92% of the line), set in bold. + +## Do's and Don'ts + +### Do: +- **Do** set the first screen on flat Sky (#bfd9f0) with ink text. +- **Do** set every UI and copy word in Jost, and use Jost Italic at the surrounding weight for the single stressed word. +- **Do** keep Annotation Hot Pink (#fd259a) for handwriting, drawn arrows, circles, and the shutter focus ring. +- **Do** give buttons the 3px ink outline and the 4px hard offset shadow, and let the shadow move with hover and press. +- **Do** use Camera Chrome Yellow (#ffd60a) for anything that belongs to the phone's own interface. +- **Do** show the robot as a photoreal matte-white studio robot in the selfie situation: phone, yesterday's print, the circled change. +- **Do** build robot plates from `art/source` and `art/masks` with `art/build-plates.sh`, and keep every difference between yesterday and today to the one masked plate. + +### Don't: +- **Don't** use hot pink as a brand colour: no pink buttons, bands, logos or headings. +- **Don't** put the hard offset shadow on anything that isn't pressable; thumbnails and frames get the outline only. +- **Don't** set headings, buttons, or paragraphs in Neucha, and don't bring back Bagel Fat One or Andika. +- **Don't** show the robot alone as a mascot, or draw it in a cute, anime, or cartoon style. +- **Don't** add gradients, textures, or a second tint to the sky ground. +- **Don't** let the page drift from Primer's ink and muted greys for text; the app it sits beside is stock GitHub Primer. diff --git a/PRODUCT.md b/PRODUCT.md new file mode 100644 index 0000000..6b57df6 --- /dev/null +++ b/PRODUCT.md @@ -0,0 +1,78 @@ +# Product + + + +## Platform + +web + +## Users + +Two primary audiences, weighted equally: + +- **Developers steering coding agents on a StorybookJS project**, who want visual review inside the agent's loop. +- **Frontend teams paying for a hosted visual testing service such as Chromatic**, who are looking for a cheaper or local replacement. + +Secondary audience: existing users of the Selfie snapshot testing library (Java, Kotlin, Python). They need one thing from selfie.dev, which is to get to lib.selfie.dev. + +## Product Purpose + +Selfie is distributed Storybook testing: a visual review gate that runs on your machine beside your agent, in CI, and on GitHub. It exists because putting renders inside the coding loop can multiply render counts by 100x to 1000x, which is wildly unaffordable with centralized render services. + +selfie.dev is the product's home. It introduces Selfie, sends people to the repository and quickstart, and honors the permanent redirects for the older library. + +**Near-term milestone:** the local-only install and a selfie.dev mailing list signup launch together. + +## Positioning + +Renders happen where the agent runs, with no cloud required and no bill per image, and `selfie review` gives the agent one JSON document and an exit code. That is what makes visual review affordable at agent scale. + +## Operating Context + +- An agent runs `selfie review`, looks at the diff images it names, runs `selfie approve --all`, commits, and reviews again. +- A person uses `selfie ui` for the same loop, and can leave notes on an image for the agent to act on and answer. +- In CI, a GitHub Action renders each push, and the commit gets a `selfie` status linking to its review. +- Setup starts from a checkout, by pasting the quickstart prompt into a coding agent. It needs Node 26 or later, pnpm, and Docker. + +## Capabilities and Constraints + +**Built:** the local loop, CI, and commit statuses, in use on Selfie's own repository. Change classification (moved or gained spacing versus really changed), notes on images, Git-following approvals, reproducible renders in a digest-pinned container, and `selfie flakes`. + +**Not built:** an npm package, signing in through GitHub, private repositories, notes in the cloud, and trusting local results without re-rendering. Don't imply any of these exist. + +**The app:** the review UI uses GitHub Primer and looks exactly like GitHub, with no distinctive style of its own. + +**Hosting:** Cloudflare Pages project `selfie-landing`, serving static files from `public/`. `lib.selfie.dev` stays on a separate project. + +**Reserved paths:** `/jvm`, `/py`, `/demo-gif`, `/go`, `/other-platforms`, and `/js` are permanent redirects, because released jars and wheels link to them. They can't be reused for anything on this site. + +**Terminology:** the library and this product share a name and a general theme but no code. Keep them clearly separate. + +**Mailing list:** MailerLite form "selfie.dev signup", which adds people to the group "selfie.dev launch" with double opt-in. Mail comes from Selfie , a Google Workspace group, and selfie.dev is authenticated for sending (DKIM, SPF). The signup replaced the nedshed.dev link, and the list launches at the same time as the local-only install. + +## Brand Commitments + +- The name is Selfie, from DiffPlug LLC. +- The "robots taking selfies" theme stays, and the premise can be playful. The art itself should be serious: the owner rejected the cute anime style. The current hero robot isn't binding, and the logo and mascot reused from the earlier library (Apache-2.0, `LICENSE-branding`) are available rather than required. +- Background: [Surrendering to grooves in latent space](https://nedshed.dev/p/surrendering-to-grooves-in-latent-space) tells how the name and theme came about. Phones beat DSLRs because they have fewer, simpler controls, and that idea shaped the earlier library's design. +- Jost is the typeface. Bagel Fat One and Andika were tried and rejected. +- Muse Spark stays off selfie.dev. The owner treats it as hackathon-only, not lasting product truth. +- The library notice stays verbatim, as specified in selfie-hackathon#26. + +The rest of the branding is unsettled. The owner intends to work it out next, and the mailing list's branding will follow it. + +## Evidence on Hand + +- **Render timing on an M4 MacBook Air, per the selfie-hackathon README:** about 140 stories in under 30 seconds, and 541 stories in about 70 seconds. Reviewing an already-rendered build takes under half a second. +- **Scale example:** one style tweak changed 290 of a Storybook's 541 stories. +- **Videos:** [Why Selfie](https://youtu.be/8B3-v4DTwfU), and an [older product demo](https://youtu.be/FiGuwfB13b0) of a two-line CSS change touching all 124 stories. The README's [current demo](https://youtu.be/ZrUv0Pn7yyc) is built around Muse Spark. +- **Live proof:** [Selfie reviewing itself](https://hackathon.selfie.dev/diffplug/selfie-hackathon), viewable without signing in. +- **Assets:** `public/img/mascot.webp`, `public/logo-icon.svg`, `public/img/video-why.webp`, `public/img/video-demo.webp`, `public/img/og.png`. +- **Absent:** customers, testimonials, press, pricing, and a mailing list. Don't fabricate them. + +## Product Principles + +1. Be exact about what's built. It's a pilot, and saying so plainly is part of being believable. +2. Serve both primary audiences without making either feel like an afterthought. +3. Never strand a library user. Released artifacts link here, and those links must keep working. +4. Lead with what a local, agent-sized workflow makes possible, backed by real measurements. diff --git a/README.md b/README.md index 8cba04e..5900a0d 100644 --- a/README.md +++ b/README.md @@ -27,4 +27,4 @@ pnpm test # checks the redirects, the links, and the 404 against that server ## Licenses -The logo and mascot come from [`branding/`](https://github.com/diffplug/selfie-hackathon/tree/main/branding) in selfie-hackathon, under Apache-2.0 ([LICENSE-branding](LICENSE-branding)). Jost is under OFL-1.1. +The video thumbnails come from the selfie-hackathon videos, and selfie-hackathon's [`branding/`](https://github.com/diffplug/selfie-hackathon/tree/main/branding) is under Apache-2.0 ([LICENSE-branding](LICENSE-branding)). The icon is new. The hero's robot was generated with Codex's image tool; its sources and the script that cuts it into layers are in [`art/`](art/README.md). Jost and Neucha are under OFL-1.1. diff --git a/art/README.md b/art/README.md new file mode 100644 index 0000000..ac41094 --- /dev/null +++ b/art/README.md @@ -0,0 +1,20 @@ +# Hero art sources + +`public/img/plates/` is built from these files by `sh art/build-plates.sh`. Don't edit the plates directly: edit a mask here and rerun the script. + +## source/ + +Untouched output from Codex's image tool, with the prompts in the `.json` sidecars. + +- `arm.png`: the robot's forearm and hand, transparent. The tool leaves solid areas at alpha 253, so the script raises alpha of 250 and above to 255. +- `today.png`: today's selfie, before the pink circle. +- `marker.png`: the pink marker strokes. The script takes only the circle; the arrow on the page is drawn in code. + +## masks/ + +8-bit grayscale, the same size as the image they cut. White belongs to the layer. + +- `thumb-tip.png` and `thumb-base.png`, on `arm.png`: the two thumb segments. The hand is whatever neither mask covers. The segments rotate in `public/hero.js` about the joints it names (base joint 960,600 and knuckle 713,510, in arm pixels), so keep each cut near its joint. +- `head-plate.png`, on `today.png`: the plate that turns red in yesterday's photo. Nothing else may differ between the two photos. + +The crop offsets in the script (`340x340+655+395` for the base, `260x210+480+410` for the tip) are also in `public/style.css`. Change them together. diff --git a/art/build-plates.sh b/art/build-plates.sh new file mode 100644 index 0000000..efde376 --- /dev/null +++ b/art/build-plates.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# Rebuilds the hero's cutouts in public/img/plates from art/source and art/masks. +# Edit a mask (white = belongs to that layer), then run: sh art/build-plates.sh +# Needs ImageMagick 7 (magick) and cwebp. +set -eu +cd "$(dirname "$0")/.." +src=art/source +masks=art/masks +out=public/img/plates +tmp=$(mktemp -d) +trap 'rm -rf "$tmp"' EXIT + +# Codex's image tool leaves solid areas at alpha 253. Raise only values >= 250 to 255. +opaque() { magick "$1" -channel A -fx 'u>=0.9803?1:u' +channel "$2"; } + +# The arm, cut into the still hand and the two thumb segments, all aligned on the same canvas. +opaque "$src/arm.png" "$tmp/arm.png" +magick "$tmp/arm.png" -alpha extract "$tmp/alpha.png" +magick "$tmp/alpha.png" "$masks/thumb-tip.png" -compose multiply -composite "$tmp/tip-alpha.png" +magick "$tmp/alpha.png" \( "$masks/thumb-tip.png" -negate \) -compose multiply -composite \ + "$masks/thumb-base.png" -compose multiply -composite "$tmp/base-alpha.png" +magick "$tmp/alpha.png" \( "$masks/thumb-tip.png" -negate \) -compose multiply -composite \ + \( "$masks/thumb-base.png" -negate \) -compose multiply -composite "$tmp/hand-alpha.png" +magick "$tmp/arm.png" -alpha off "$tmp/hand-alpha.png" -compose CopyOpacity -composite "$out/arm-hand.png" +# The crops below set where each segment sits; hero.css and hero.js assume these offsets. +magick "$tmp/arm.png" -alpha off "$tmp/base-alpha.png" -compose CopyOpacity -composite -crop 340x340+655+395 +repage "$out/arm-thumb-base.png" +magick "$tmp/arm.png" -alpha off "$tmp/tip-alpha.png" -compose CopyOpacity -composite -crop 260x210+480+410 +repage "$out/arm-thumb.png" + +# Today's selfie, with the pink circle from the marker drawing around the head plate. +opaque "$src/marker.png" "$tmp/marker.png" +magick "$tmp/marker.png" -crop 585x528+49+322 +repage -resize 400x340\! "$tmp/circle.png" +magick "$src/today.png" "$tmp/circle.png" -geometry +261+152 -compose over -composite "$out/today.png" + +# Yesterday's selfie: the same photo with only the head plate turned red, and no circle. +magick "$src/today.png" -modulate 100,105,175 "$tmp/red.png" +magick "$src/today.png" "$tmp/red.png" "$masks/head-plate.png" -compose over -composite \ + -crop 1024x1052+0+40 +repage "$out/yesterday.png" + +for f in today yesterday; do cwebp -quiet -q 84 "$out/$f.png" -o "$out/$f.webp"; done +for f in arm-hand arm-thumb-base arm-thumb; do cwebp -quiet -q 86 -alpha_q 100 -exact "$out/$f.png" -o "$out/$f.webp"; done +echo "Rebuilt $out. Check the result at http://localhost:8788/ with pnpm dev." diff --git a/art/masks/head-plate.png b/art/masks/head-plate.png new file mode 100644 index 0000000..031d03c Binary files /dev/null and b/art/masks/head-plate.png differ diff --git a/art/masks/thumb-base.png b/art/masks/thumb-base.png new file mode 100644 index 0000000..ef2f381 Binary files /dev/null and b/art/masks/thumb-base.png differ diff --git a/art/masks/thumb-tip.png b/art/masks/thumb-tip.png new file mode 100644 index 0000000..84ea749 Binary files /dev/null and b/art/masks/thumb-tip.png differ diff --git a/art/source/arm.png b/art/source/arm.png new file mode 100644 index 0000000..fcad601 Binary files /dev/null and b/art/source/arm.png differ diff --git a/art/source/arm.png.json b/art/source/arm.png.json new file mode 100644 index 0000000..5f41046 --- /dev/null +++ b/art/source/arm.png.json @@ -0,0 +1,17 @@ +{ + "prompt": "Edit the FIFTH attached image, the generated robot-hand cutout. First four attachments are the approved crop and pose photographs. Keep the exact existing artwork, placement, size, and silhouette. Fix its alpha channel: the current output incorrectly gives most solid metal/white ceramic interior pixels alpha 253. ALL solid foreground interiors must be fully opaque alpha 255. Only the narrow antialiased silhouette boundary may use intermediate alpha. All background and the large former-phone hole must stay fully transparent alpha 0. This is solid painted metal, not translucent glass. Do not reduce opacity globally. Do not add a background or checkerboard. Preserve the white paint and every existing mechanical part. Keep the landscape 1.2:1 frame, foreground exits right and bottom. Highest quality transparent PNG output. Full asset brief:\n\nProduce one clean production image asset using your highest available image quality. Follow the attached approved crop exactly; this is asset reconstruction, not a new design.\n\nTransparent PNG, landscape, the closest size you support to the crop's 1.2:1 aspect. References: `.impeccable/build/crops/arm.png`, and the hand photos `.impeccable/mocks/refs/thumb/hand-a.jpg`, `hand-b.jpg`, and `hand-c.jpg` for pose only (their gray boxes are privacy redactions, so ignore them).\n\nUse the provided crop as the approved visual reference and recreate it as a clean production asset at the target aspect ratio. This is a designed illustration plate. Output the same drawing, same style, same line weight and shading. Preserve silhouette, composition, perspective, palette (#abd7f4, #101010, #282833), lighting, material, and texture exactly. Remove every piece of UI text, label, caption, button, and interface chrome that is not part of the artwork itself. Remove interface borders, card corners, and layout backgrounds; retain only shadows that belong to the referenced object itself. Do not add objects, change the concept, or restyle. Preserve the reference's placement, scale, and clear margins exactly; do not enlarge the subject to fill the frame. Remove the page ground and interior gaps to genuine transparent alpha. Keep white paint and other solid foreground colors opaque, preserve fine edges, and retain partial alpha only for genuinely translucent material or soft shadows in the reference. No chroma background, baked-in checkerboard, or matte. Output a transparent PNG cutout. Region: photoreal white and dark metal robot forearm and hand holding the phone, diagonal thumb at the shutter, fingertips on far edge, one finger under the phone.\n\nAdditional requirements:\n- Only the robot's forearm and hand. Remove the phone completely, and everything on it. Where the phone was, the image is transparent, except for the thumb lying across where the screen was and the fingertips that wrap around the phone's left and bottom edges. Those stay exactly where they are in the crop, so the hand lines up when it's placed over the phone.\n- The forearm runs off the right and bottom edges of the frame.\n\nOutput landscape 1536x1280 (1.2:1), or the closest supported landscape size to that aspect ratio. Use TRUE TRANSPARENT ALPHA for all non-hand pixels. The first attachment defines exact layout and placement; the other three define natural grip anatomy only. Remove the entire phone body, bezel, screen and every pixel of selfie artwork inside the phone, as well as sky, blue page, photo print, UI and redaction blocks. Retain only the EXISTING visible outside hand and forearm pieces at their same normalized positions: the diagonal thumb projecting from the right across the former screen, the two detached-looking fingertips peeking at the far left, the supporting finger horizontally beneath the former phone, the mechanical palm, wrist and lower-right forearm. Do not invent a palm filling the transparent phone-shaped gap. Do not connect isolated fingertips with new visible fingers across the empty area. Keep white ceramic paint fully opaque; the hand's internal open gaps must be transparent. No backdrop or visible checkerboard. Forearm exits both bottom and right edges as in crop.", + "references": [ + ".impeccable/build/crops/arm.png", + ".impeccable/mocks/refs/thumb/hand-a.jpg", + ".impeccable/mocks/refs/thumb/hand-b.jpg", + ".impeccable/mocks/refs/thumb/hand-c.jpg", + "an earlier attempt from Codex (not kept)" + ], + "alpha_correction": { + "rule": "Set alpha values >= 250 to 255. Leave alpha values < 250 and all RGB values exactly unchanged.", + "changed_pixels": 495145, + "source_sha256": "0934762a1bb04f0c8b300a6a00bf1b6cef10b85b5c5726debc19b8a1c628d1ec", + "verified_rgb_unchanged": true, + "verified_alpha_below_250_unchanged": true + } +} \ No newline at end of file diff --git a/art/source/marker.png b/art/source/marker.png new file mode 100644 index 0000000..fd07395 Binary files /dev/null and b/art/source/marker.png differ diff --git a/art/source/today.png b/art/source/today.png new file mode 100644 index 0000000..73adb12 Binary files /dev/null and b/art/source/today.png differ diff --git a/art/source/today.png.json b/art/source/today.png.json new file mode 100644 index 0000000..ae049ca --- /dev/null +++ b/art/source/today.png.json @@ -0,0 +1,7 @@ +{ + "prompt": "Produce one clean production image asset using your highest available image quality. Follow the attached approved crop exactly; this is asset reconstruction, not a new design.\n\nOpaque, portrait 1024x1536. Reference: `.impeccable/build/crops/today.png`, and the full comp for context.\n\nUse the provided crop as the approved visual reference and recreate it as a clean production asset at the target aspect ratio. This is a photographic or illustrated image region. Output the same subject, same framing, same lighting. Preserve silhouette, composition, perspective, palette (#abd7f4, #101010, #282833), lighting, material, and texture exactly. Remove every piece of UI text, label, caption, button, and interface chrome that is not part of the artwork itself. Remove letterboxing, borders, card corners, drop shadows, and any layout background that the page will draw in code. Do not add objects. Do not change the concept. Do not restyle. The artwork fills the whole frame edge to edge at the same scale as the reference; no margins, no border, no background band. Region: photoreal white robot selfie, face and shoulders, blue head plate, pale sky.\n\nAdditional requirements:\n- Remove the yellow focus brackets, the pink circle, the pink arrow, and the robot thumb at the bottom. None of them are part of this photo.\n- The image is the phone's front-camera view, and it's taller than the crop: extend the same pale overcast sky above, and more of the robot's chest and reaching arm below, so that the crop's area sits in the upper middle of the frame.\n- The robot's head plate is a clean saturated blue, as in the reference, and the plate is one distinct flat-faced part, so it can be recolored precisely.\n\nOutput 1024x1536 portrait, fully opaque. Attachment 1 is the exact artwork crop to reproduce, attachment 2 is context only. Only the actual selfie photo fills the output: no webpage, phone, interface, annotation, external hand or thumb. Keep the expressionless white ceramic robot and dark sensor cluster exactly as approved. Extend pale overcast sky above and the same chest and image-right reaching arm below; preserve the approved subject scale and pose. The separate foreground thumb visible at the very bottom of the crop is removed; the robot's own reaching arm IN the selfie remains.", + "references": [ + ".impeccable/build/crops/today.png", + ".impeccable/mocks/serious-studio.png" + ] +} diff --git a/public/404.html b/public/404.html index f4c6ca1..6777880 100644 --- a/public/404.html +++ b/public/404.html @@ -5,12 +5,13 @@ Page not found | Selfie - + +
- selfie + selfie

Nothing in frame.

There's no page at this address.

Looking for the JVM/Python snapshot testing library (expectSelfie, expect_selfie)? It moved to diffplug/selfie-lib, with docs at lib.selfie.dev.

diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..19d0c89 Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/fonts/Jost-Italic.woff2 b/public/fonts/Jost-Italic.woff2 new file mode 100644 index 0000000..82d5b4b Binary files /dev/null and b/public/fonts/Jost-Italic.woff2 differ diff --git a/public/fonts/Neucha.woff2 b/public/fonts/Neucha.woff2 new file mode 100644 index 0000000..24d0f86 Binary files /dev/null and b/public/fonts/Neucha.woff2 differ diff --git a/public/hero.js b/public/hero.js new file mode 100644 index 0000000..b86d454 --- /dev/null +++ b/public/hero.js @@ -0,0 +1,143 @@ +// The robot's thumb follows the cursor near the shutter and presses it on click. +// Two-bone inverse kinematics: the thumb base pivots where it meets the palm, and +// the tip pivots at the knuckle. Both segment lengths stay fixed, so only the +// angles change. Coordinates are pixels of the 1373x1145 arm image. +(() => { + const arm = document.querySelector(".arm"); + const base = arm && arm.querySelector(".thumb-base"); + const tip = arm && arm.querySelector(".thumb-tip"); + const shutter = document.querySelector(".shutter"); + if (!arm || !base || !tip || !shutter) return; + + const fine = matchMedia("(hover: hover) and (pointer: fine)"); + const calm = matchMedia("(prefers-reduced-motion: reduce)"); + + const IMAGE_WIDTH = 1373; + const B = { x: 960, y: 600 }; // base joint, where the thumb meets the palm + const K = { x: 713, y: 510 }; // knuckle, between the base and the tip + const T = { x: 512, y: 520 }; // the tip's contact point, resting on the shutter + const L1 = Math.hypot(K.x - B.x, K.y - B.y); + const L2 = Math.hypot(T.x - K.x, T.y - K.y); + const REST1 = Math.atan2(K.y - B.y, K.x - B.x); + const REST2 = Math.atan2(T.y - K.y, T.x - K.x) - REST1; + const LIMIT1 = (10 * Math.PI) / 180; // straight cuts show a gap past this + const LIMIT2 = (16 * Math.PI) / 180; + const REACH = 0.9; // how far past the shutter's edge the thumb reaches, in shutter widths + + const clamp = (v, lo, hi) => Math.min(hi, Math.max(lo, v)); + + // Where the tip lands for a given pair of joint rotations (relative to rest). + function tipAt(d1, d2) { + const a1 = REST1 + d1, a2 = a1 + REST2 + d2; + const kx = B.x + L1 * Math.cos(a1), ky = B.y + L1 * Math.sin(a1); + return { x: kx + L2 * Math.cos(a2), y: ky + L2 * Math.sin(a2) }; + } + + // The joint rotations, within their limits, that bring the tip closest to P. When P is + // reachable the tip lands on it; otherwise the thumb leans toward it as far as it can. + // A coarse grid, then a finer one around the best cell, is plenty for two joints. + function solve(P) { + let best = { d1: 0, d2: 0, e: Infinity }; + const search = (c1, c2, r1, r2, steps) => { + for (let i = 0; i <= steps; i++) { + const d1 = clamp(c1 - r1 + (2 * r1 * i) / steps, -LIMIT1, LIMIT1); + for (let j = 0; j <= steps; j++) { + const d2 = clamp(c2 - r2 + (2 * r2 * j) / steps, -LIMIT2, LIMIT2); + const t = tipAt(d1, d2); + const e = (t.x - P.x) ** 2 + (t.y - P.y) ** 2; + if (e < best.e) best = { d1, d2, e }; + } + } + }; + search(0, 0, LIMIT1, LIMIT2, 16); + search(best.d1, best.d2, LIMIT1 / 8, LIMIT2 / 8, 8); + return { d1: best.d1, d2: best.d2 }; + } + + function toImage(clientX, clientY) { + const r = arm.getBoundingClientRect(); + const s = r.width / IMAGE_WIDTH; + return { x: (clientX - r.left) / s, y: (clientY - r.top) / s }; + } + + function shutterCenter() { + const r = shutter.getBoundingClientRect(); + return { x: r.left + r.width / 2, y: r.top + r.height / 2, w: r.width }; + } + + let cur = { d1: 0, d2: 0, s: 1 }; + let goal = { d1: 0, d2: 0, s: 1 }; + let frame = 0; + let pressing = false; + + function render() { + cur.d1 += (goal.d1 - cur.d1) * 0.22; + cur.d2 += (goal.d2 - cur.d2) * 0.22; + cur.s += (goal.s - cur.s) * 0.3; + base.style.transform = `rotate(${cur.d1}rad)`; + tip.style.transform = `rotate(${cur.d2}rad) scale(${cur.s})`; + const settled = Math.abs(goal.d1 - cur.d1) < 1e-4 && Math.abs(goal.d2 - cur.d2) < 1e-4 && Math.abs(goal.s - cur.s) < 1e-4; + frame = settled ? 0 : requestAnimationFrame(render); + } + + function aim(target) { + goal = { s: 1, ...target }; + if (!frame) frame = requestAnimationFrame(render); + } + + function rest() { + aim({ d1: 0, d2: 0 }); + } + + function follow(clientX, clientY) { + if (pressing) return; + const c = shutterCenter(); + const near = Math.hypot(clientX - c.x, clientY - c.y) < c.w * (0.5 + REACH); + if (!near) return rest(); + // Land the tip just beside the cursor, so the thumb never hides what you point at. + const p = toImage(clientX, clientY); + aim(solve({ x: p.x + 16, y: p.y + 12 })); + } + + // The screen faces the viewer, so a press pushes the tip away from us: from wherever + // it's hovering, it dips a little and shrinks, as if moving into the screen. + function press() { + aim({ d1: cur.d1, d2: clamp(cur.d2 + (3 * Math.PI) / 180, -LIMIT2, LIMIT2), s: 0.95 }); + } + + // The camera's capture moment: the screen blinks white when the shutter goes down. + const flashEl = document.querySelector(".flash"); + function flash() { + if (!flashEl || calm.matches) return; + flashEl.classList.remove("on"); + void flashEl.offsetWidth; // restart the animation + flashEl.classList.add("on"); + } + + function enabled() { + return fine.matches && !calm.matches; + } + + addEventListener("pointermove", (e) => { + if (e.pointerType === "mouse" && enabled()) follow(e.clientX, e.clientY); + }, { passive: true }); + document.documentElement.addEventListener("pointerleave", () => { if (!pressing) rest(); }); + + shutter.addEventListener("pointerdown", (e) => { + if (e.pointerType !== "mouse" || !enabled()) return flash(); + pressing = true; + shutter.classList.add("pressed"); + press(); + flash(); + }); + addEventListener("pointerup", (e) => { + if (!pressing) return; + pressing = false; + shutter.classList.remove("pressed"); + follow(e.clientX, e.clientY); + }); + shutter.addEventListener("focus", () => { if (enabled() && shutter.matches(":focus-visible")) press(); }); + shutter.addEventListener("blur", () => { if (!pressing) rest(); }); + + calm.addEventListener("change", () => { if (!enabled()) { goal = { d1: 0, d2: 0, s: 1 }; cur = { d1: 0, d2: 0, s: 1 }; render(); } }); +})(); diff --git a/public/icon.svg b/public/icon.svg new file mode 100644 index 0000000..e54d562 --- /dev/null +++ b/public/icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/img/mascot.webp b/public/img/mascot.webp deleted file mode 100644 index 007bb02..0000000 Binary files a/public/img/mascot.webp and /dev/null differ diff --git a/public/img/og.png b/public/img/og.png index 5f63315..a971d4d 100644 Binary files a/public/img/og.png and b/public/img/og.png differ diff --git a/public/img/plates/arm-hand.png b/public/img/plates/arm-hand.png new file mode 100644 index 0000000..2aea243 Binary files /dev/null and b/public/img/plates/arm-hand.png differ diff --git a/public/img/plates/arm-hand.webp b/public/img/plates/arm-hand.webp new file mode 100644 index 0000000..631553f Binary files /dev/null and b/public/img/plates/arm-hand.webp differ diff --git a/public/img/plates/arm-hand.webp.json b/public/img/plates/arm-hand.webp.json new file mode 100644 index 0000000..9dd2f88 --- /dev/null +++ b/public/img/plates/arm-hand.webp.json @@ -0,0 +1,4 @@ +{ + "prompt": "WebP of public/img/plates/arm-hand.png, made by art/build-plates.sh with cwebp. See that PNG's embedded prompt and art/README.md for its origin.", + "createdAt": "2026-11-05T19:45:25.539Z" +} \ No newline at end of file diff --git a/public/img/plates/arm-thumb-base.png b/public/img/plates/arm-thumb-base.png new file mode 100644 index 0000000..d221aaf Binary files /dev/null and b/public/img/plates/arm-thumb-base.png differ diff --git a/public/img/plates/arm-thumb-base.webp b/public/img/plates/arm-thumb-base.webp new file mode 100644 index 0000000..c10fd9a Binary files /dev/null and b/public/img/plates/arm-thumb-base.webp differ diff --git a/public/img/plates/arm-thumb-base.webp.json b/public/img/plates/arm-thumb-base.webp.json new file mode 100644 index 0000000..3506857 --- /dev/null +++ b/public/img/plates/arm-thumb-base.webp.json @@ -0,0 +1,4 @@ +{ + "prompt": "WebP of public/img/plates/arm-thumb-base.png, made by art/build-plates.sh with cwebp. See that PNG's embedded prompt and art/README.md for its origin.", + "createdAt": "2026-11-05T19:45:25.555Z" +} \ No newline at end of file diff --git a/public/img/plates/arm-thumb.png b/public/img/plates/arm-thumb.png new file mode 100644 index 0000000..01b2a8c Binary files /dev/null and b/public/img/plates/arm-thumb.png differ diff --git a/public/img/plates/arm-thumb.webp b/public/img/plates/arm-thumb.webp new file mode 100644 index 0000000..e88d5a2 Binary files /dev/null and b/public/img/plates/arm-thumb.webp differ diff --git a/public/img/plates/arm-thumb.webp.json b/public/img/plates/arm-thumb.webp.json new file mode 100644 index 0000000..4441f4a --- /dev/null +++ b/public/img/plates/arm-thumb.webp.json @@ -0,0 +1,4 @@ +{ + "prompt": "WebP of public/img/plates/arm-thumb.png, made by art/build-plates.sh with cwebp. See that PNG's embedded prompt and art/README.md for its origin.", + "createdAt": "2026-11-05T19:45:25.572Z" +} \ No newline at end of file diff --git a/public/img/plates/today.png b/public/img/plates/today.png new file mode 100644 index 0000000..db6d9aa Binary files /dev/null and b/public/img/plates/today.png differ diff --git a/public/img/plates/today.png.json b/public/img/plates/today.png.json new file mode 100644 index 0000000..ae049ca --- /dev/null +++ b/public/img/plates/today.png.json @@ -0,0 +1,7 @@ +{ + "prompt": "Produce one clean production image asset using your highest available image quality. Follow the attached approved crop exactly; this is asset reconstruction, not a new design.\n\nOpaque, portrait 1024x1536. Reference: `.impeccable/build/crops/today.png`, and the full comp for context.\n\nUse the provided crop as the approved visual reference and recreate it as a clean production asset at the target aspect ratio. This is a photographic or illustrated image region. Output the same subject, same framing, same lighting. Preserve silhouette, composition, perspective, palette (#abd7f4, #101010, #282833), lighting, material, and texture exactly. Remove every piece of UI text, label, caption, button, and interface chrome that is not part of the artwork itself. Remove letterboxing, borders, card corners, drop shadows, and any layout background that the page will draw in code. Do not add objects. Do not change the concept. Do not restyle. The artwork fills the whole frame edge to edge at the same scale as the reference; no margins, no border, no background band. Region: photoreal white robot selfie, face and shoulders, blue head plate, pale sky.\n\nAdditional requirements:\n- Remove the yellow focus brackets, the pink circle, the pink arrow, and the robot thumb at the bottom. None of them are part of this photo.\n- The image is the phone's front-camera view, and it's taller than the crop: extend the same pale overcast sky above, and more of the robot's chest and reaching arm below, so that the crop's area sits in the upper middle of the frame.\n- The robot's head plate is a clean saturated blue, as in the reference, and the plate is one distinct flat-faced part, so it can be recolored precisely.\n\nOutput 1024x1536 portrait, fully opaque. Attachment 1 is the exact artwork crop to reproduce, attachment 2 is context only. Only the actual selfie photo fills the output: no webpage, phone, interface, annotation, external hand or thumb. Keep the expressionless white ceramic robot and dark sensor cluster exactly as approved. Extend pale overcast sky above and the same chest and image-right reaching arm below; preserve the approved subject scale and pose. The separate foreground thumb visible at the very bottom of the crop is removed; the robot's own reaching arm IN the selfie remains.", + "references": [ + ".impeccable/build/crops/today.png", + ".impeccable/mocks/serious-studio.png" + ] +} diff --git a/public/img/plates/today.webp b/public/img/plates/today.webp new file mode 100644 index 0000000..135b2f8 Binary files /dev/null and b/public/img/plates/today.webp differ diff --git a/public/img/plates/today.webp.json b/public/img/plates/today.webp.json new file mode 100644 index 0000000..a1a2116 --- /dev/null +++ b/public/img/plates/today.webp.json @@ -0,0 +1,4 @@ +{ + "prompt": "WebP of public/img/plates/today.png, made by art/build-plates.sh with cwebp. See that PNG's embedded prompt and art/README.md for its origin.", + "createdAt": "2026-11-05T19:45:25.504Z" +} \ No newline at end of file diff --git a/public/img/plates/yesterday.png b/public/img/plates/yesterday.png new file mode 100644 index 0000000..2e94c64 Binary files /dev/null and b/public/img/plates/yesterday.png differ diff --git a/public/img/plates/yesterday.webp b/public/img/plates/yesterday.webp new file mode 100644 index 0000000..043c245 Binary files /dev/null and b/public/img/plates/yesterday.webp differ diff --git a/public/img/plates/yesterday.webp.json b/public/img/plates/yesterday.webp.json new file mode 100644 index 0000000..19f56f3 --- /dev/null +++ b/public/img/plates/yesterday.webp.json @@ -0,0 +1,4 @@ +{ + "prompt": "WebP of public/img/plates/yesterday.png, made by art/build-plates.sh with cwebp. See that PNG's embedded prompt and art/README.md for its origin.", + "createdAt": "2026-11-05T19:45:25.523Z" +} \ No newline at end of file diff --git a/public/index.html b/public/index.html index ace010f..0f8816d 100644 --- a/public/index.html +++ b/public/index.html @@ -3,60 +3,86 @@ - Selfie: Storybook testing your coding agent can afford - + Selfie: distributed Storybook testing + - - + + - - - + + + + + + + +
-
-
- selfie -

Storybook testing your coding agent can afford.

-

Putting renders inside the coding loop can multiply render counts by 100x to 1000x, which centralized services like Chromatic make wildly unaffordable. Selfie runs on your machine beside your agent, in CI, and on GitHub.

-
- Get started on GitHub - Subscribe for updates +
+

Distributed Storybook testing.

+

Putting renders inside the coding agent's loop can multiply render counts by 100x to 1000x.

+

The extra snapshots are wildly effective, but wildly unaffordable with a pay-per-snapshot service like Chromatic.

+

Selfie lets your agent take its own snapshots.

+

$0 per snapshot

+ Get started on GitHub +
+ +
+ +
+
+ +
    +
  • ~500 stories per minute on M4 MacBook Air
  • +
+ + +
+ Join the list + + +
-
-
124 stories
about 25 s
-
541 stories
about 70 s
-
Bill per image
$0
-
-

Local renders on an M4 MacBook Air.

- -
+ + + +
@@ -65,7 +91,7 @@

Watch it

-

A review gate for the agent's loop

+

The agent checks its own work

# JSON naming the diff images
 selfie review
 
@@ -77,10 +103,10 @@ 

A review gate for the agent's loop

selfie review
    -
  • Fits an agent's loop. selfie review prints one JSON document, and its exit code says whether anything blocks.
  • -
  • Says what kind of change it is. It separates what moved or gained spacing from what really changed, so you can approve the harmless ones together.
  • -
  • Lets you point at the problem. Write a note on an image, and your agent gets your words, the exact box, and a picture of what you saw.
  • -
  • Follows Git. An approval counts wherever history reaches it, so it isn't repeated after a commit, a rebase, or a merge.
  • +
  • One JSON document. selfie review names every changed image, and its exit code says whether anything blocks.
  • +
  • It knows what kind of change it is. What moved or gained spacing is kept apart from what really changed, so the harmless ones get approved together.
  • +
  • Point at the problem. Write a note on an image, and your agent gets your words, the exact box, and a picture of what you saw.
  • +
  • Approvals follow Git. An approval counts wherever history reaches it, so a commit, a rebase, or a merge never asks again.
@@ -88,13 +114,22 @@

A review gate for the agent's loop

-

Early days. Follow along.

-

Selfie is piloting with StorybookJS. The local loop, CI, and commit statuses are built and in use on its own repository. It isn't on npm yet, so setup starts from a checkout, and you'll need Node 26 or later, pnpm, and Docker. GitHub sign-in and private repositories aren't built yet.

+

It's early. Follow along.

+

Selfie is piloting with StorybookJS. The local loop, CI, and commit statuses are built, and in use on Selfie's own repository. It isn't on npm yet, so setup starts from a checkout: you'll need Node 26 or later, pnpm, and Docker. GitHub sign-in and private repositories aren't built yet.

See Selfie reviewing itself, no sign-in needed.

-
- Read the quickstart - Subscribe at nedshed.dev +
+
+ +
+ + +
+ + +

+
+ Or read the quickstart
diff --git a/public/join.js b/public/join.js new file mode 100644 index 0000000..1592b79 --- /dev/null +++ b/public/join.js @@ -0,0 +1,49 @@ +// Mailing list signup. Posts straight to MailerLite and shows the result in place, +// so the visitor never leaves the page. Without JavaScript the form still posts. +(() => { + const form = document.querySelector("form.join"); + if (!form) return; + const email = form.querySelector('input[type="email"]'); + const button = form.querySelector('button[type="submit"]'); + const status = form.querySelector(".join-status"); + + // The shutter is a link to #join: bring the form into view and put the cursor in it. + document.querySelectorAll('a[href="#join"]').forEach((link) => { + link.addEventListener("click", (e) => { + e.preventDefault(); + const calm = matchMedia("(prefers-reduced-motion: reduce)").matches; + form.scrollIntoView({ behavior: calm ? "auto" : "smooth", block: "center" }); + email.focus({ preventScroll: true }); + history.replaceState(null, "", "#join"); + }); + }); + + form.addEventListener("submit", async (e) => { + e.preventDefault(); + if (!email.checkValidity()) { + email.reportValidity(); + return; + } + button.disabled = true; + status.textContent = "Joining…"; + try { + const response = await fetch(form.action, { + method: "POST", + headers: { Accept: "application/json" }, + body: new URLSearchParams(new FormData(form)), + }); + const result = await response.json(); + if (result.success) { + form.classList.add("done"); + status.textContent = "Check your inbox to confirm. Then you're on the list."; + return; + } + const problem = result.errors && result.errors.fields && result.errors.fields.email; + status.textContent = problem ? problem[0] : "That didn't work. Try again in a moment."; + } catch { + status.textContent = "That didn't work. Check your connection and try again."; + } finally { + button.disabled = false; + } + }); +})(); diff --git a/public/logo-icon.svg b/public/logo-icon.svg deleted file mode 100644 index 594c107..0000000 --- a/public/logo-icon.svg +++ /dev/null @@ -1,186 +0,0 @@ - - diff --git a/public/style.css b/public/style.css index 8a70209..1efad5d 100644 --- a/public/style.css +++ b/public/style.css @@ -1,13 +1,18 @@ -@font-face { font-family: "Jost"; src: url("/fonts/Jost.woff2") format("woff2"); font-weight: 100 900; font-display: swap; } +@font-face { font-family: "Jost"; src: url("fonts/Jost.woff2") format("woff2"); font-weight: 100 900; font-display: swap; } +@font-face { font-family: "Jost"; src: url("fonts/Jost-Italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; } +@font-face { font-family: "Neucha"; src: url("fonts/Neucha.woff2") format("woff2"); font-weight: 400; font-display: swap; } :root { --ink: #1f2328; --muted: #4a525c; --sky: #bfd9f0; - --paper: #fffdf7; - --yellow: #ffdb5c; + --paper: #ffffff; + --yellow: #f9d535; --pink: #e8509b; --edge: 3px solid var(--ink); + --hot: #fd259a; + --cam: #ffd60a; + --u: calc(min(100vw, 150vh) / 1536); } * { box-sizing: border-box; } @@ -18,23 +23,102 @@ p { margin: 0 0 1em; } a { color: inherit; text-underline-offset: 0.15em; } a:hover { text-decoration-thickness: 2px; } :focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; } +::selection { background: var(--yellow); color: var(--ink); } +.icon-arrow { display: inline-block; width: 0.95em; height: 0.95em; margin-left: 0.15em; vertical-align: -0.12em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; } code { font: 0.86em ui-monospace, SFMono-Regular, Menlo, monospace; } h1, h2 { margin: 0; font-weight: 700; letter-spacing: -0.015em; line-height: 1.08; text-wrap: balance; } +h2 em { font-weight: 600; } h2 { font-size: clamp(2rem, 4vw, 2.75rem); } .wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; } -.strip { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0.25rem 1.25rem; padding: 0.7rem 1.25rem; background: var(--ink); color: #fff; font-size: 1.0625rem; } +.strip { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0.25rem 1.25rem; padding: 0.7rem 1.25rem; background: var(--ink); color: #fff; font-size: 1.0625rem; line-height: 1.5; } .strip p { margin: 0; } .strip a { color: var(--yellow); font-weight: 600; white-space: nowrap; } .brand { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 1.875rem; font-weight: 700; line-height: 1; letter-spacing: -0.01em; text-decoration: none; } -.hero { overflow: hidden; background: var(--sky); border-bottom: var(--edge); } -.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 2rem; align-items: end; } -.hero-copy { padding-block: 2rem 3.5rem; } -.hero h1 { margin: 2.75rem 0 1.25rem; font-size: clamp(2.75rem, 6.4vw, 4.75rem); } -.lede { max-width: 38em; font-size: 1.3125rem; line-height: 1.45; } -.mascot { width: 100%; margin-top: 1.5rem; margin-bottom: -2.5rem; } +/* First viewport: copy on the sky, and the robot's selfie on the right. Desktop sizes are comp pixels times --u. */ +.hero { position: relative; overflow: hidden; background: var(--sky); border-bottom: var(--edge); } +.hero-copy { position: relative; z-index: 2; padding: 2rem 1.25rem 0; } +.hero h1 { margin: 1.75rem 0 0; font-size: clamp(2.6rem, 9vw, 4.75rem); font-weight: 600; letter-spacing: -0.012em; line-height: 1.12; } +.hero h1 em { font-weight: 600; } +.hero h1 > span { display: block; } +.argument-lead { margin: 1.5rem 0 0; font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; text-wrap: pretty; } +.argument-lead strong { font-weight: 700; white-space: nowrap; background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%); } +.argument-rest { margin: 0.75rem 0 0; font-size: 1.1875rem; line-height: 1.45; text-wrap: pretty; } +.hero .lede { margin: 1.25rem 0 0; font-size: 1.1875rem; font-weight: 600; line-height: 1.35; } +.price { margin: 0.25rem 0 0; font-size: 2rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.1; } +.btn-hero { margin-top: 1.5rem; font-size: 1.25rem; } + +.shot { position: relative; width: min(100%, 560px); margin: 1.5rem 0 0 auto; aspect-ratio: 776 / 970; container-type: inline-size; } +.shot > * { position: absolute; } +.phone { left: 8.376%; top: 3.093%; width: 56.314%; height: 82.062%; background: #18181b; border: 0.55cqw solid var(--ink); border-radius: 6.6cqw; } +.screen { position: absolute; left: 4.577%; top: 2.01%; width: 91.075%; height: 96.48%; overflow: hidden; background: #0f0f11; border-radius: 5cqw; } +.screen > * { position: absolute; } +.screen > picture { display: contents; } +.readouts { left: 3.769%; top: 3.385%; width: 92.462%; height: 3.906%; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0; list-style: none; color: #f3f4f4; font-size: 1.95cqw; font-weight: 500; letter-spacing: 0.01em; line-height: 1; white-space: nowrap; } +.readouts li { display: flex; align-items: center; gap: 0.45em; } +.readouts li + li { padding-left: 0.7em; border-left: 1px solid rgb(255 255 255 / 0.35); } +.readouts svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; } +.today { position: absolute; left: 0; top: 8.464%; width: 100%; height: 62.24%; object-fit: cover; object-position: 50% 28.6%; } +.brackets { left: 12.814%; top: 15.104%; width: 74.372%; height: 32.813%; } +.brackets i { position: absolute; width: 14%; height: 15%; border: 0 solid var(--cam); } +.brackets i:nth-child(1) { left: 0; top: 0; border-width: 0.6cqw 0 0 0.6cqw; } +.brackets i:nth-child(2) { right: 0; top: 0; border-width: 0.6cqw 0.6cqw 0 0; } +.brackets i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 0.6cqw 0.6cqw; } +.brackets i:nth-child(4) { right: 0; bottom: 0; border-width: 0 0.6cqw 0.6cqw 0; } +.controls { left: 0; top: 70.703%; width: 100%; height: 29.297%; } +.controls > * { position: absolute; } +.shutter { left: 30.653%; top: 4.889%; width: 33.166%; aspect-ratio: 1; display: grid; place-items: center; background: #f7f7f7; border-radius: 50%; color: var(--ink); font-size: 2.15cqw; font-weight: 600; text-decoration: none; box-shadow: inset 0 0 0 0.75cqw #f7f7f7, inset 0 0 0 1.05cqw #151516; transition: transform 0.12s ease-out; } +.shutter span { pointer-events: none; } +.flash { inset: 0; z-index: 2; background: #fff; opacity: 0; pointer-events: none; } +.flash.on { animation: flash 0.32s ease-out; } +@keyframes flash { from { opacity: 0.85; } to { opacity: 0; } } +.shutter:hover { text-decoration: underline; text-decoration-thickness: 2px; } +.shutter:active, .shutter.pressed { transform: scale(0.95); } +.shutter:focus-visible { outline: 0.6cqw solid var(--hot); outline-offset: 0.6cqw; } +.last-photo { left: 3.769%; top: 54.222%; width: 15.578%; aspect-ratio: 1; background: url("img/plates/yesterday.webp") 50% 12% / 140% auto; border: 0.5cqw solid #fff; border-radius: 50%; } +.modes { left: 26.382%; top: 68.889%; width: 64.322%; height: 16.889%; display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 0 2%; list-style: none; color: #f2f3f3; font-size: 2.15cqw; font-weight: 500; letter-spacing: 0.02em; line-height: 1; } +.modes .on { position: relative; color: var(--cam); } +.modes .on::after { content: ""; position: absolute; left: -12%; right: -12%; bottom: -0.55em; height: 0.5cqw; background: var(--cam); border-radius: 1cqw; } + +.print { left: 66.753%; top: 16.082%; width: 28.608%; height: 31.134%; background: #f8f7f4; border: 0.45cqw solid var(--ink); border-radius: 0.6cqw; box-shadow: 0.6cqw 0.8cqw 1.6cqw rgb(31 35 40 / 0.18); transform: rotate(8deg); } +.print img { position: absolute; left: 6%; top: 5%; width: 88%; height: 70%; object-fit: cover; object-position: 50% 15%; } +.print span { position: absolute; left: 0; right: 0; bottom: 5%; color: var(--ink); font: 400 4.2cqw/1 "Neucha", "Jost", sans-serif; text-align: center; transform: rotate(4deg); } + +.arrow { left: 42.784%; top: 9.897%; width: 26.546%; height: 10.309%; overflow: visible; z-index: 3; fill: none; stroke: var(--hot); stroke-width: 4.6; stroke-linecap: round; stroke-linejoin: round; } +.note { left: 69.072%; top: 3.505%; width: 18.814%; margin: 0; color: var(--hot); font: 400 5.7cqw/0.92 "Neucha", "Jost", sans-serif; transform: translate(9%, 6%) rotate(-12deg) skewX(-10deg); transform-origin: 0 100%; } +.arrow path { stroke-dasharray: 1; stroke-dashoffset: 0; } +@media (prefers-reduced-motion: no-preference) { + .note { animation: note-in 0.35s 0.35s ease-out both; } + .arrow-line { animation: draw 0.6s 0.6s cubic-bezier(0.3, 0, 0.2, 1) both; } + .arrow-head { animation: draw 0.22s 1.15s ease-out both; } +} +@keyframes draw { from { stroke-dashoffset: 1; } } +@keyframes note-in { from { opacity: 0; } } + +.arm { left: 2.835%; top: 35.155%; width: 97.165%; height: 64.845%; z-index: 3; pointer-events: none; } +.arm img { position: absolute; } +.hand { inset: 0; width: 100%; height: 100%; } +.thumb-base, .thumb-tip { position: absolute; inset: 0; will-change: transform; } +.thumb-base { transform-origin: 69.92% 52.402%; } +.thumb-base > picture > img { left: 47.706%; top: 34.498%; width: 24.763%; height: 29.694%; } +.thumb-tip { transform-origin: 51.93% 44.541%; } +.thumb-tip img { left: 34.96%; top: 35.808%; width: 18.937%; height: 18.341%; } + +@media (min-width: 1100px) { + .strip { min-height: calc(54 * var(--u)); padding-block: calc(12 * var(--u)); gap: calc(4 * var(--u)) calc(28 * var(--u)); font-size: max(15px, calc(21.5 * var(--u))); } + .hero { height: calc(970 * var(--u)); } + .hero-copy { position: absolute; left: calc(112 * var(--u)); top: 50%; width: calc(700 * var(--u)); padding: 0; transform: translateY(-50%); } + .hero h1 { margin-top: 0; font-size: calc(82 * var(--u)); line-height: 1.06; } + .argument-lead { margin-top: calc(44 * var(--u)); font-size: calc(38 * var(--u)); } + .argument-rest { margin-top: calc(20 * var(--u)); font-size: calc(26 * var(--u)); } + .hero .lede { margin-top: calc(30 * var(--u)); font-size: calc(26 * var(--u)); } + .price { margin-top: calc(6 * var(--u)); font-size: calc(48 * var(--u)); } + .btn-hero { margin-top: calc(40 * var(--u)); padding: calc(16 * var(--u)) calc(50 * var(--u)); border-width: calc(6 * var(--u)); font-weight: 700; color: var(--ink); border-radius: calc(14 * var(--u)); box-shadow: calc(5 * var(--u)) calc(8 * var(--u)) 0 var(--ink); font-size: calc(33 * var(--u)); } + .btn-hero:hover { box-shadow: calc(6 * var(--u)) calc(9 * var(--u)) 0 var(--ink); } + .shot { position: absolute; right: 0; top: 0; width: calc(776 * var(--u)); margin: 0; } +} .actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.75rem; } .actions-stack { flex-direction: column; margin-top: 0; } @@ -44,33 +128,47 @@ h2 { font-size: clamp(2rem, 4vw, 2.75rem); } .btn-primary { background: var(--yellow); } .btn-dark { background: var(--ink); color: #fff; } -.stats { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; margin: 2.5rem 0 0; } -.stats dt { color: var(--muted); font-size: 1rem; } -.stats dd { margin: 0; font-size: 1.625rem; font-weight: 600; line-height: 1.2; } -.stats-note { margin: 0.5rem 0 0; color: var(--muted); font-size: 1rem; } - -.videos { padding-block: 4.5rem; } +.videos { padding-block: 5rem; } .video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; margin-top: 1.75rem; } .video { display: flex; flex-direction: column; gap: 0.25rem; text-decoration: none; } .video strong { margin-top: 0.75rem; font-size: 1.375rem; font-weight: 600; } .video:hover strong { text-decoration: underline; text-underline-offset: 0.15em; } .video > span:last-child { color: var(--muted); } -.thumb { position: relative; display: block; overflow: hidden; border: var(--edge); border-radius: 14px; box-shadow: 5px 5px 0 var(--ink); } +.thumb { position: relative; display: block; overflow: hidden; border: var(--edge); border-radius: 14px; } .play { position: absolute; left: 1rem; bottom: 1rem; width: 3.5rem; height: 3.5rem; background: var(--pink); border: var(--edge); border-radius: 50%; } .play::after { content: ""; position: absolute; left: 1.2rem; top: 0.85rem; border-style: solid; border-width: 0.75rem 0 0.75rem 1.2rem; border-color: transparent transparent transparent #fff; } -.loop { padding-block: 4.5rem; background: #fff; border-block: var(--edge); } +.loop { padding-block: 5rem; background: var(--ink); color: #fff; } +.loop code { color: var(--yellow); } .loop-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; align-items: start; } -.terminal { margin: 1.75rem 0 0; padding: 1.25rem 1.5rem; overflow-x: auto; background: var(--ink); color: #fff; border-radius: 14px; font-size: 1.125rem; line-height: 1.55; } +.terminal { margin: 1.75rem 0 0; padding: 1.25rem 1.5rem; overflow-x: auto; background: #0f0f11; color: #fff; border: 1px solid rgb(255 255 255 / 0.14); border-radius: 14px; font-size: 1.125rem; line-height: 1.55; } +.terminal code { color: inherit; } +.terminal { scrollbar-color: rgb(255 255 255 / 0.3) transparent; } +.loop ::selection { background: var(--yellow); color: var(--ink); } .terminal .c { color: #a9b4c0; } .features { display: grid; gap: 1.5rem; margin: 0; padding: 0; list-style: none; } .features strong { display: block; font-size: 1.25rem; font-weight: 600; } +.features li { color: #c9d1d9; } +.features li strong { color: #fff; } .early { padding-block: 4.5rem; background: var(--yellow); } .early-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3.5rem; align-items: center; } .early h2 { margin-bottom: 1.25rem; } .early p { max-width: 42em; } .early p:last-child { margin-bottom: 0; } +.join-box { display: grid; gap: 1rem; width: min(100%, 30rem); } +.join label { display: block; margin-bottom: 0.5rem; font-weight: 600; } +.join-row { display: flex; gap: 0.75rem; } +.join input[type=email] { flex: 1; min-width: 0; padding: 0.7rem 0.9rem; background: #fff; border: var(--edge); border-radius: 12px; color: var(--ink); font: inherit; } +.join input[type=email]:focus-visible { outline-offset: 2px; } +.join button { flex: none; cursor: pointer; font: inherit; font-weight: 600; } +.join button[disabled] { cursor: progress; opacity: 0.7; } +.join-status { min-height: 1.5em; margin: 0.5rem 0 0 !important; font-weight: 600; } +.join-status:empty { display: none; } +.join.done .join-row, .join.done label { display: none; } +.join.done .join-status { font-size: 1.25rem; } +.join-box .btn-dark { justify-self: start; } +@media (max-width: 480px) { .join-row { flex-direction: column; } } .footer { padding-block: 2.5rem; background: var(--ink); color: #fff; } .footer a { color: var(--yellow); } @@ -82,16 +180,18 @@ h2 { font-size: clamp(2rem, 4vw, 2.75rem); } .not-found h1 { margin: 2.5rem 0 0.75rem; font-size: clamp(2.75rem, 7vw, 4.75rem); } .not-found p { max-width: 42em; } +@media (max-width: 600px) { + .hero-copy { padding-top: 1.5rem; } + .hero h1 { font-size: 2.35rem; line-height: 1.05; } + .argument-lead { margin-top: 0.9rem; font-size: 1.2rem; } + .argument-rest { margin-top: 0.5rem; font-size: 1rem; line-height: 1.4; } + .hero .lede { margin-top: 0.75rem; font-size: 1rem; } + .price { font-size: 1.6rem; } + .btn-hero { margin-top: 0.9rem; font-size: 1.125rem; } + .shot { margin-top: 0.5rem; } +} + @media (max-width: 860px) { - .hero-grid { grid-template-columns: minmax(0, 1fr) 118px; gap: 0.5rem; align-items: start; } - .hero-copy { display: contents; } - .brand, .hero h1 { grid-column: 1; } - .brand { margin-top: 1.5rem; justify-self: start; } - .hero h1 { margin: 1.5rem 0 0; } - .mascot { grid-column: 2; grid-row: 1 / span 2; margin: 1rem 0 0; } - .hero .lede, .hero .actions, .hero .stats, .stats-note { grid-column: 1 / -1; } - .hero .lede { margin: 1.25rem 0 0; } - .stats-note { margin-bottom: 2.5rem; } .video-grid, .loop-grid, .early-grid { grid-template-columns: minmax(0, 1fr); } .videos, .loop, .early { padding-block: 3.25rem; } .terminal { padding: 1.125rem 1.25rem; font-size: 1rem; } @@ -99,5 +199,5 @@ h2 { font-size: clamp(2rem, 4vw, 2.75rem); } } @media (prefers-reduced-motion: reduce) { - .btn { transition: none; } + .btn, .shutter { transition: none; } } diff --git a/test/site.test.mjs b/test/site.test.mjs index 0982f91..df25bf5 100644 --- a/test/site.test.mjs +++ b/test/site.test.mjs @@ -70,7 +70,6 @@ test("the home page sends each audience to the right place", async () => { for (const href of [ "https://lib.selfie.dev", "https://github.com/diffplug/selfie-hackathon", - "https://nedshed.dev/subscribe", "https://youtu.be/8B3-v4DTwfU", "https://youtu.be/FiGuwfB13b0", ]) { @@ -79,6 +78,14 @@ test("the home page sends each audience to the right place", async () => { assert.match(html, NOTICE); }); +test("the signup form posts to the selfie.dev MailerLite form", async () => { + const html = await (await get("/")).text(); + assert.ok(html.includes('action="https://assets.mailerlite.com/jsonp/2772060/forms/203332822830679835/subscribe"'), "missing MailerLite form action"); + assert.match(html, /name="fields\[email\]"/); + assert.ok(html.includes('href="#join"'), "the shutter should lead to the signup form"); + assert.ok(!html.includes("nedshed.dev"), "nedshed.dev should no longer be linked"); +}); + test("an unknown path is a real 404 that points to the library", async () => { const res = await get("/no-such-page"); assert.equal(res.status, 404); @@ -88,11 +95,14 @@ test("an unknown path is a real 404 that points to the library", async () => { test("everything the home page loads from this site exists", async () => { const html = await (await get("/")).text(); const css = await (await get("/style.css")).text(); + // The home page and the stylesheet both sit at the site root, so a relative + // path resolves the same as one starting with "/". + const local = (path) => (path.startsWith("/") ? path : `/${path}`); const paths = [ - ...html.matchAll(/(?:src|href)="(\/[^"]+)"/g), - ...css.matchAll(/url\("(\/[^"]+)"\)/g), + ...html.matchAll(/(?:src|href|srcset)="(?!https?:|\/\/|#|mailto:)([^"]+)"/g), + ...css.matchAll(/url\("(?!https?:|data:)([^"]+)"\)/g), ...html.matchAll(/content="https:\/\/selfie\.dev(\/[^"]+\.png)"/g), - ].map((match) => match[1]); + ].map((match) => local(match[1])); assert.ok(paths.length > 5); for (const path of new Set(paths)) { assert.equal((await get(path)).status, 200, path);