Skip to content

feat(website): rebuild the landing page on @codeui/styles - #814

Open
riccardoperra wants to merge 46 commits into
mainfrom
feat/v2-landing-redesign
Open

riccardoperra wants to merge 46 commits into
mainfrom
feat/v2-landing-redesign

Conversation

@riccardoperra

@riccardoperra riccardoperra commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Why

codeimage.dev needs a new landing page for the 2.0 launch: minimal, fast, with the product shown working, and built on CodeUI. The current site sells a 2022 product, drives its story with scroll-linked JavaScript, and ships CodeMirror and an animation library to do it.

What changes

  • apps/website is rebuilt. The previous site moves to apps/website-old (@codeimage/website-old, port 3001) for reference. CI and deploy still target @codeimage/website.
  • The page is styled with @codeui/styles: --cui-* tokens and the kit's control classes, light and dark, with a theme toggle that applies before first paint.
  • Code is static pre-tokenized markup. motion, solid-motionone, CodeMirror and @codeimage/highlight are no longer dependencies of the site.
  • Sections: hero with a live editor and a command menu (Cmd K), Animate, Looks, Annotate, Export, CLI, Agents, FAQ, CodeUI, open source.
  • Animate is a sticky scene driven by CSS scroll timelines, with an IntersectionObserver fallback and still figures under reduced motion. Its keyframes are generated at prerender from one story table. It adds 172 bytes of client JavaScript.
  • Agents is a short demonstration that plays once: a request becomes four WebMCP tool calls, and each one changes a code image. The tool names and arguments match agent-tools/tools.ts.

Brand kit (merged from #824 and #825)

  • Refined mark. Same shapes and position as the 2.0 mark. The lines go from 14 to 16 units thick, the spacing is even, and the gradient is used everywhere, the favicon included. The website header Logo uses the new lines.
  • App logo and watermark. CodeImageLogoV2, used in the editor and dashboard headers and as the export watermark, now draws the refined mark. The lines are still pre-transformed paths with the same ids and classes, so the light-theme rules and watermark placement are unchanged. The Node renderer gets the watermark from the DOM snapshot, so CLI exports follow with no code change. No render fixture contains the logo. New exports show the thicker lines.
  • assets/brand/, generated by pnpm brand:build:
    • SVG and PNG versions of the mark, the wordmark alone, and the logo (mark + wordmark), each for dark and light backgrounds and in black and white.
    • Favicon ICO and SVG, PNG icons from 16 to 1024 px, an apple-touch icon, and maskable icons.
    • Open Graph cards, a GitHub social preview, README banners and CLI banners.
  • Website: new favicon, apple-touch icon and manifest, with normal and maskable icons. og:image is now https://codeimage.dev/og.png, served from the site.
  • Editor app: new favicon, PWA icons and splash logo. og:image is now https://app.codeimage.dev/assets/og.png, with a large Twitter card.
  • README: a banner that follows the reader's dark or light setting.
  • Removed: the old icons and logos (favicon-192x192/512, logo192/512, root banner.png and codeimage-logo-*.png, assets/banner.png, assets/codeimage_card.png), the unused files in apps/codeimage/src/assets, and the unused CodeImageLogo component.
  • To do by hand: upload assets/brand/social/github-social-preview.png in the repository's Settings → Social preview.

Decisions for the reviewer

  • CLI name. The page says pnpm dlx codeimage-cli. @codeimage/cli and codeimage on npm belong to other people. codeimage-cli is not published yet, so the CLI sections are badged "Coming soon".
  • CodeUI is presented as beta.
  • The skill for agents is badged "Planned". It does not exist yet, and the section heading names it.
  • Solid version. The site stays on Solid 1.9. @codeui/styles has no framework dependency.
  • Kit patches. src/styles/codeui-patches.css holds the rules the kit needs when used without @codeui/solid (indicator position before measurement, option card input hiding). They should move upstream.

Verification

On a production build, before the rebase onto current main:

  • Typecheck, pnpm lint, and both site builds pass. After the rebase, pnpm lint and a frozen install pass.
  • No console errors and no hydration mismatch in light or dark. No horizontal overflow at 390, 768, 1024, 1280 and 1440.
  • Keyboard walk: 72 tab stops, a focus ring on each, no trap. The page reads with JavaScript disabled. Nothing autoplays under reduced motion.
  • Chromium, WebKit 26 and Firefox 159 load the page without errors.
  • Lighthouse mobile, local, median of 3 runs:
Score FCP LCP CLS Transfer
New 98 1.06 s 2.41 s 0 294 KB
Old 95 1.83 s 2.81 s 0.021 500 KB

Not verified: a physical phone, a screen reader, Safari before 26.

Brand kit: every generated image was checked at its real size: the favicon in browser tabs, the apple-touch icon under an iOS mask, the maskable icons under a circle mask, and all cards. The new CodeImageLogoV2 paths were overlaid on mark.svg in Chromium, and only anti-aliasing differs. Not checked: a live editor session or an export with the new watermark. check-structure passes. Locally, lint.mjs reports only three import(namespace) findings in packages/render and packages/cli, files this change doesn't touch.

Known gaps

  • The prerendered index.html is 51.5 KB gzip (8.8 KB before), because it carries every section's markup and Animate's inline CSS. Lighthouse flags 2,715 DOM elements.
  • Visiting /index.html shows the router's "Not Found" after hydration. / works.
  • Without JavaScript the CodeUI tabs have no indicator.
  • The website has no automated tests. The browser checks used during the build are not in the repository.

PR Type

[x] Feature

🤖 Generated with Claude Code

riccardoperra and others added 13 commits November 29, 2026 16:04
Move apps/website to apps/website-old so the redesigned landing page can
take its place without losing the old one. The old app is renamed
@codeimage/website-old, stays private, and runs its dev server on port
3001 so both sites can run side by side.

It stays in the pnpm workspace. The install and the root lint pass with
only its lint-baseline.json entries moved and its lockfile importer key
renamed. Every CI and deploy step filters @codeimage/website or
apps/website, so none of them builds or deploys the old site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start apps/website again from the previous app's TanStack Solid Start
setup: the same Vite config with prerender, the Lighthouse config, the
public icons, manifest, robots and sitemap, the Umami script and the
public asset helper. Solid stays on the next catalog.

The editor libraries, motion, the old components and the old landing
images are gone. The page loads @codeui/styles, with its theme first and
an app reset in a lower cascade layer, so kit rules win over the reset
and page CSS modules win over both.

The TanStack packages are pinned to the versions already in the
lockfile. With the old "latest" specifiers, pnpm re-resolved them and
bumped unrelated transitive packages. The lockfile gains only this
importer.

Mona Sans loads from one variable file in public/fonts, preloaded with
crossorigin so the preload is reused. The old site preloaded four
/fonts files while its @font-face pointed at hashed copies in assets, so
it downloaded both sets. A metric-matched Arial fallback keeps text
from reflowing when the font swaps in.

A small script in the head applies the stored light or dark choice
before the first paint. theme-color has a light and a dark value by
media query and follows the stored choice. The tsconfig now covers src
only, like apps/codeimage, because the shared Vercel build script does
not typecheck.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The later sections build on these, so their shapes come first.

Content is typed data in src/content. A Snippet is pre-tokenized lines
of {text, kind} tokens with a closed TokenKind union. Nothing is
highlighted at runtime. scripts/tokenize-snippet.mjs prints a Snippet
from a source file with the prototype's tokenizer, and gives the same
words, kinds and columns on the hero snippets. themes.ts holds the ten
editor themes the prototype shows, with the colours it took from
packages/highlight. SocialSize lists the four real export targets, and
copy.ts holds the page copy.

CodeWindow is the only place window chrome is drawn. It sizes
everything in em and places each token by line and column, so a window
of several steps morphs between them through transitions of two
registered number properties. A morph that is interrupted turns around
from where each token is.

Frame fits a window from container units and the window's em metrics,
in CSS. The server render and the hydrated page lay out the same, with
and without JavaScript. When its inputs change on purpose, it animates
the window from its previous visual box and transitions the clip-path
that draws the frame. Both pick up from the current state when
interrupted.

Button, Badge, SegmentedControl, CopyButton, Island and Section wrap
the @codeui/styles helpers. The page imports the theme and the eight
component stylesheets it uses. The built CSS is 99.3 KB raw and
14.1 KB gzip, against 190.8 KB and 25.9 KB with all.css; the bundler
already drops the rules the files share. codeui-patches.css holds three
rules for gaps in CSS-only use of the kit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page now has the nav, the hero with its live editor island, the
proof strip, the problem block, the closing call to action and the
footer. Named placeholders mark the nine sections that come next. Each
is a lazy component under src/sections/<Name> that renders its heading
and keeps its anchor.

The editor island keeps one store with a committed value and an
optional preview per control. Hovering or walking the theme cards or
the background list previews a value. A click or Enter commits it, and
Escape or leaving the list restores it. Play is a small state machine
over idle, forward, hold and back. A second click reverses the morph
from where it is.

The closing frame shows the snippet in the look picked in the hero.
GitHub stars are fetched at build time with the same fallback as before
and baked into the prerendered page.

The problem block and the footer render without hydration, so their
code never loads in the browser. CSS code splitting is off: the lazy
sections are server-rendered, and their styles must be in the one
stylesheet the head links, or they would paint unstyled until their
chunks arrive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page did not hydrate. sectionHeading() built a Badge element, and
every section spread its result into <Section>. A spread call becomes a
getter that runs the call again on each prop read, so each read of
eyebrow created a new Badge. The server and the client read the prop a
different number of times, the client created elements in a different
order than the server had rendered them, and hydration stopped without
logging an error. No control on the page responded.

sectionHeading() now returns plain data, and Section renders the badge
itself in a keyed Show. Section also resolves lead once with
children(), because Show read a JSX lead twice.

On a production build, the first FAQ question now opens and the CLI
preview follows hover, in light and dark, with no console message. Both
failed before this change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The section work copied pieces of CodeWindow or reached into its
internals. This moves those pieces into the shared components, so the
sections that follow use one implementation.

- themeVars() and tokenKinds move to CodeWindow/theme.ts.
- codeLine.module.css holds the token colours, the added, removed and
  highlight bands and the line numbers. CodeLines and the Animate scene
  apply these classes next to their own positioning, so both draw a line
  the same way.
- windowMetrics() takes {lineNumbers, statusBar}. The Animate scene
  draws an editor window without a status bar.
- A window with border "none" draws no ring, as in the app. The inner
  ring came from an ::after rule that only applied to "none", so the
  rule is gone. "hairline" draws its ring with box-shadow and is
  unchanged. CodeWindow loses its class prop, which only carried the
  Looks card's override of that rule.
- CodeWindow takes focus, a list of line numbers. The other lines dim.
  marks now only carries bands (BandMarks), so a line can be focused and
  highlighted at once.
- The --code-* colours are registered with @Property in
  CodeWindow.module.css. @Property is global, so the Agents stylesheet
  already registered them for the whole page. They now sit with the code
  that sets them. No rule reads them with a fallback or transitions
  them through "all", so nothing else renders differently.
- Frame takes an overlay, drawn over the visible frame and clipped to
  it. The CLI preview read Frame's --frame-width and --frame-height to
  place its signature. The Agents export flash used a 512 px negative
  inset to cover the frame, and WebKit counted that inset as page
  overflow: 305 px of horizontal scroll at 1440.
- FeatureCard, RichTextView, CommandText and ImageFileIcon move out of
  the section folders, since more than one section renders them. The
  RichText type moves to content/richText.ts.
- The CLI package name is codeimage-cli, in core/constants.ts. The npm
  names @codeimage/cli and codeimage belong to other people.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A scroll scene in four beats (steps, diff, focus, export) shows three
tabs of one getUser function becoming an animation. Shared code slides
to its new place, removed code fades out, new code fades in, marks
travel with the steps, and the scene ends on the MP4 and GIF tiles. The
Animate panel beside the frame follows the story: tab holds,
transitions with their easing, and the export dialog. The dialog offers
30 fps for MP4 and 25 fps for GIF, as the app does, and shows a size
meter without numbers.

The section renders on the server only. Every pose is computed at build
time from content/animate.ts into CSS keyframes, so the browser runs no
Solid code for it. An inline script picks one of three modes:

- timeline: scroll-driven animations where animation-timeline is
  supported.
- observer: the same keyframes driven by an IntersectionObserver per
  beat. After a fast scroll it plays toward the beat fast enough to
  arrive within 1.5 s.
- still: four static figures, for prefers-reduced-motion and for pages
  without JavaScript.

The beat links in the nav are real anchors. Everything inside the
pinned frame and the panel is aria-hidden and inert, so keyboard focus
skips it, and a visually hidden paragraph describes the scene.

The section's CSS modules are inlined through stylesheet.ts. Vite drops
a CSS module from the client stylesheet when the JavaScript that
imports it is tree-shaken, and here all of it is. The inline style is
35.0 KB raw and 6.0 KB gzip of the 51.5 KB gzip page. It sits in the
body after the hero, so it does not block the first paint. Moving it to
the head stylesheet would add those bytes to the render-blocking CSS.

The scene draws its window with the shared code line classes and
themeVars() from CodeWindow, and its sizes with windowMetrics() without
a status bar. The CLI command under the scene uses codeimage-cli.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Looks has two cards on one shared store. The window card switches
between Card, Editor and Terminal, Solid and Accent wash, and None and
Hairline. Its surface turns to Accent wash the first time the card is
in view, unless the visitor changed it first. The themes card previews a
theme on hover or with the arrow keys, Escape restores the committed
one, and a click or Enter commits it to both cards. Four short notes
cover languages, tabs, presets and saved snippets.

Annotate has six numbered cards. Line marks cycles diff, highlight and
focus marks on click or from the keyboard, with a reset. Focus mode
passes the focused lines to CodeWindow's focus prop. Alt text copies the
generated text. Sizes shows the four export targets. Signature shows
the Minimal, Pill and Card styles. Secrets flags the two values that
packages/secrets flags in the same snippet, with the app's wording in a
tooltip, and redacts or restores them in one click. The fake AWS key is
assembled from parts at runtime, so no scanner matches the source. The
old example key ended in EXAMPLE, which the detector allows. Each
flagged value keeps its visible text in its accessible name, so it
passes Lighthouse's label-in-name audit. Layout switches between
Sidebar and Dock and opens the command menu.

The command menu opens with Cmd K or Ctrl K, from the hero's Commands
button or from the Annotate layout card. It sets the hero snippet's
theme, window, size and background, plays or randomizes it, and links
to the editor, the repository and CodeUI. Its panel and the kit's
commandmenu.css load on first use. Holding the modifier key or hovering
a trigger prefetches them. The route mounts one menu, and Escape
returns focus to the control that opened it.

The signature colours join the shared tokens in styles/tokens.css.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ce sections

Export introduces Takumi. One line of code is drawn twice, once as
pixels and once as vector outlines, with a magnified letter for each.
Next to it are the export formats, the SVG outlines, the classic export
as a fallback, and a small diagram of Takumi feeding the web app and
the CLI. Nothing in it is interactive.

CLI lists five commands with copy buttons. Hovering or focusing a
command shows its output: the file name, the size, the format and a
preview drawn with CodeWindow. focused.png focuses lines 3 to 5 and
highlights line 4, as its command says. The social preview places its
signature with Frame's overlay. Every command runs codeimage-cli.

Agents is a self-playing demonstration in two modes. In the browser,
an agent calls the editor's WebMCP tools. In the terminal, it runs the
CLI. The transcript plays once when the demo scrolls into view, and it
can be paused, replayed or jumped through step by step. The image
recolours through the registered --code-* colours. With reduced motion,
the demo rests on its finished state. Three cards describe the editor
tools, the CLI and the planned agent skill. The mode labels are
created once, so the segmented control does not build new JSX on each
read.

FAQ is an accordion with four answers. Closed panels are inert, the
height animation is skipped for keyboard users and reduced motion, and
a noscript style opens every answer when JavaScript is off.

CodeUI shows the kit's components working: button, segmented control,
text field, select, checkbox, switch, kbd, tooltip, tabs and badge. It
also has the install command and the package list. The copy calls the
kit beta and says to expect changes before 1.0.

Open source is a static card with the contribution and sponsor links.

The badges agree across sections. The CLI and the agent's terminal mode
are Coming soon, the editor tools and Takumi are Experimental, the
agent skill is Planned, and CodeUI is Beta. Frame rates and formats
match the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Export and open source have no state and only plain links, so they now
render inside NoHydration, like the problem block and the footer. Their
code never runs in the browser. Their CSS stays in the page stylesheet
because their lazy chunks are still part of the client build. Animate
already rendered on the server only. The other sections have controls
and keep hydrating.

The head also carries the FAQPage structured data built from the same
entries as the FAQ section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page sets Mona Sans at 400, 500 and 600 only, measured over every
text node at 1440 and 390 after scrolling the whole page. The variable
font (130.6 KB) gave it widths and weights it never uses. The static
Regular, Medium and SemiBold files are copied from website-old and
total 46.1 KB.

All three weights appear above the fold at both widths, so all three
are preloaded. They keep font-display: swap. They cover the same 305
code points as the variable file and have the same ascent, descent and
line gap, so the measured fallback metrics still apply. Every section
keeps its height to the pixel at 1440, and CLS stays 0.

Phase 1 measured this swap at a Lighthouse mobile median of 97 with
LCP 2.64 s for the variable font, and 99 with LCP 2.04 s for the
static weights. Total transfer on the full page drops by 84.5 KB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The heading and the sub rose in from opacity 0, and Lighthouse
reported the nav's Open the editor button as the largest contentful
paint. The heading and the sub now paint in the first frame, with and
without reduced motion. The badge, the buttons and the note keep their
short entrance, which now starts sooner.

The LCP element is now the hero sub. In unthrottled traces, LCP equals
FCP in both builds (53 to 212 ms). The simulated mobile LCP did not
move by a measurable amount: median 2.62 s against 2.64 s over five
alternating runs each, with a run-to-run range of 2.41 to 3.34 s. The
machine had a load average of 5 to 8 during the runs. The simulation
counts every request that starts before the first paint, so the
limiter is bytes on a 1.6 Mbps link: the 51.5 KB gzip HTML, the
23.8 KB CSS, the 46.1 KB of fonts and the module scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b868a2e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…released

@codeimage-app/cli 0.3.0 is on npm and ships the skill, so the agents
section gains a prompt visitors can paste into their agent, with a copy
button. The skill, the terminal mode and the CLI section drop their
Planned and Coming soon badges, and the FAQ tells how to run the CLI.

The prompt was tested against the published package: skills prints the
skill, and the diff, size and theme it asks for render change.png.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"And now, animate them." comes in as four words, 90ms apart, with the
same blur, fade and rise. "Beautify your code screenshots." stays still.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The command now returns in 150ms and its output lines follow 60ms apart,
so the image appears almost at once instead of after about 1.7s. The run
ends with the CLI's own summary line, `codeimage: fix.png · 61556 B ·
136 ms`, and the file chip shows 136 ms. The numbers come from running
the same command with @codeimage-app/cli 0.4.0 on the same diff, warm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 136 ms in the CLI summary line and in the file chip now use the
success colour, so the speed reads at a glance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
riccardoperra and others added 2 commits November 30, 2026 11:30
The demo now opens on the chat alone, centred: your message, then
"Thinking" (a shimmer that settles into "Thought for 0.9s"), then the
skill. When the agent starts working (the CLI command, or the first
WebMCP tool in browser mode), the chat slides to the left and the stage
fades and scales in after it. On narrow screens and with reduced motion
the stage only fades in.

The slide uses a strong ease-in-out over 600ms, added as
--ci-ease-in-out and --ci-shift-duration in tokens.css; the stage uses
the kit's ease-out and rise duration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
riccardoperra and others added 3 commits November 30, 2026 19:04
riccardoperra and others added 8 commits November 30, 2026 19:10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…an the export tiles

- The pnpm/npm choice is saved in localStorage and restored before paint
  through a head script, like the colour scheme. The Animate CLI command
  (server-only) renders both runners and follows the root attribute.
- CodeUI has one success green for both themes; on light it is too pale
  for text, so --ci-success-ink uses CodeUI's success-active step there.
- The Animate export step fans MP4 and GIF diagonally at 0.66 scale so
  they fill the stage, with the use moved into each badge.
- The Animate scroll is shorter: 415 to 320 viewport heights.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fanned MP4 and GIF tiles read as clutter. The frame now shrinks a
little and a file row appears under it (format, file name, use, fps and
the scene's real 4.4 s length). It crossfades from MP4 to GIF on the
panel's own format switch, so stage and panel change together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hero only morphed after pressing Play. It now loops step 1 to step 2
and back while at least 40% of the studio is visible. It does not start
with reduced motion, and pressing Play hands control to the visitor and
stops the loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The loop waited a fixed 1.6 s after hydration. It now starts straight
into step 2 once the heading's word animations finish (Promise.allSettled
on the h1's animations). On a production build the first morph lands
5-10 ms after the last word settles, about 2.1 s after load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…back

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The neutral bubble did not catch the eye. It now uses CodeUI's brand
action colours, with the /codeimage command on a light inset chip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The request bubble now rises from its bottom-right corner with a light
spring overshoot when the demo starts or replays, and the You label
fades in just after. It stays hidden while the demo waits to autoplay.
data-sent is only set during the lead-in, so setting it restarts the
CSS animation without remounting (a keyed Show broke hydration). The
lead-in grows from 400 to 700 ms so the bubble settles before Thinking.
Reduced motion gets a plain fade.

This branch was successfully deployed

1 active deployment
Preview — b868a2e3 Deployed Nov 30, 2026 by riccardoperra via Deploy preview #2415
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant