-
{props.children}
+
props.canvasRef?.(element)}
+ class={props.class ? `${styles.canvas} ${props.class}` : styles.canvas}
+ data-grow={props.grow ? '' : undefined}
+ >
+
+ {props.children}
+
+ {props.overlay}
);
}
diff --git a/apps/website/src/components/Frame/Frame.module.css b/apps/website/src/components/Frame/Frame.module.css
new file mode 100644
index 000000000..c9143ef7a
--- /dev/null
+++ b/apps/website/src/components/Frame/Frame.module.css
@@ -0,0 +1,94 @@
+.frame {
+ --frame-pad: 4.2;
+}
+
+.frame[data-fit='contain'] {
+ position: absolute;
+ inset: 0;
+ container-type: size;
+}
+
+.frame[data-fit='width'] {
+ position: relative;
+ container-type: inline-size;
+}
+
+.layer {
+ display: grid;
+ place-items: center;
+ background: var(--frame-background);
+}
+
+[data-fit='contain'] > .layer {
+ --window-size: min(
+ calc(var(--frame-cap) * var(--ci-code-size)),
+ calc(100cqw / (var(--content-width) + 2 * var(--frame-pad))),
+ calc(100cqh / (var(--content-height) + 2 * var(--frame-pad)))
+ );
+ --frame-width: calc(
+ (var(--content-width) + 2 * var(--frame-pad)) * var(--window-size)
+ );
+ --frame-height: calc(
+ (var(--content-height) + 2 * var(--frame-pad)) * var(--window-size)
+ );
+ position: absolute;
+ inset: 0;
+ clip-path: inset(
+ calc((100% - var(--frame-height)) / 2) calc((100% - var(--frame-width)) / 2)
+ round var(--ci-frame-radius)
+ );
+}
+
+[data-fit='contain'] > .layer[data-ratio] {
+ --frame-width: min(100cqw, calc(100cqh * var(--frame-ratio)));
+ --frame-height: calc(var(--frame-width) / var(--frame-ratio));
+ --window-size: min(
+ calc(var(--frame-cap) * var(--ci-code-size)),
+ calc(var(--frame-width) * 0.82 / var(--content-width)),
+ calc(var(--frame-height) * 0.82 / var(--content-height))
+ );
+}
+
+[data-fit='contain'] > .layer[data-animating] {
+ transition: clip-path var(--cui-motion-duration-rise)
+ var(--cui-motion-ease-out);
+}
+
+[data-fit='width'] > .layer {
+ --frame-inset: min(var(--frame-padding), max(var(--cui-space-3), 6cqw));
+ --window-size: min(
+ calc(var(--frame-cap) * var(--ci-code-size)),
+ calc((100cqw - 2 * var(--frame-inset)) / var(--content-width))
+ );
+ position: relative;
+ padding: var(--frame-inset);
+ border-radius: var(--ci-frame-radius);
+ overflow: hidden;
+}
+
+.content {
+ font-size: var(--window-size);
+ transform-origin: 0 0;
+}
+
+.overlay {
+ position: absolute;
+ inset: 0;
+ width: var(--frame-width, auto);
+ height: var(--frame-height, auto);
+ margin: auto;
+ font-size: var(--window-size);
+ pointer-events: none;
+}
+
+@container (max-width: 759px) {
+ .layer {
+ --frame-pad: 3;
+ }
+}
+
+@container (max-width: 519px) {
+ .layer {
+ --frame-pad: 1.75;
+ }
+}
diff --git a/apps/website/src/components/Frame/Frame.tsx b/apps/website/src/components/Frame/Frame.tsx
new file mode 100644
index 000000000..44c9ee612
--- /dev/null
+++ b/apps/website/src/components/Frame/Frame.tsx
@@ -0,0 +1,146 @@
+import {
+ children,
+ createComputed,
+ createEffect,
+ type JSX,
+ on,
+ onCleanup,
+ Show,
+} from 'solid-js';
+import {cssDuration, cssValue} from '~/core/cssTokens';
+import {isKeyboardInput, prefersReducedMotion} from '~/core/inputModality';
+import type {SocialSize} from '~/content/sizes';
+import type {WindowMetrics} from '../CodeWindow/metrics';
+import styles from './Frame.module.css';
+
+export type FrameFit = 'contain' | 'width';
+
+export type FrameProps = {
+ background: string;
+ content: WindowMetrics;
+ size?: SocialSize;
+ fit?: FrameFit;
+ padding?: number;
+ maxScale?: number;
+ class?: string;
+ overlay?: JSX.Element;
+ children: JSX.Element;
+};
+
+function fontSize(element: HTMLElement) {
+ return parseFloat(getComputedStyle(element).fontSize);
+}
+
+function visualScale(element: HTMLElement) {
+ const transform = getComputedStyle(element).transform;
+ return transform === 'none' ? 1 : new DOMMatrixReadOnly(transform).a;
+}
+
+type Snapshot = {readonly rect: DOMRect; readonly size: number};
+
+function createFitMotion(
+ layer: () => HTMLElement | undefined,
+ content: () => HTMLElement | undefined,
+ changes: () => unknown,
+) {
+ let before: Snapshot | undefined;
+ let animation: Animation | undefined;
+ let clearAnimating: ReturnType
| undefined;
+ onCleanup(() => clearTimeout(clearAnimating));
+
+ createComputed(
+ on(
+ changes,
+ () => {
+ const surface = layer();
+ const element = content();
+ before = undefined;
+ if (!surface || !element) return;
+ if (prefersReducedMotion() || isKeyboardInput()) return;
+ before = {
+ rect: element.getBoundingClientRect(),
+ size: fontSize(element) * visualScale(element),
+ };
+ surface.dataset.animating = '';
+ clearTimeout(clearAnimating);
+ clearAnimating = setTimeout(() => {
+ delete surface.dataset.animating;
+ }, cssDuration('--cui-motion-duration-rise'));
+ },
+ {defer: true},
+ ),
+ );
+
+ createEffect(
+ on(
+ changes,
+ () => {
+ const element = content();
+ const start = before;
+ before = undefined;
+ animation?.cancel();
+ animation = undefined;
+ if (!element || !start) return;
+ const rect = element.getBoundingClientRect();
+ const scale = start.size / fontSize(element);
+ const x = start.rect.left - rect.left;
+ const y = start.rect.top - rect.top;
+ if (Math.abs(scale - 1) < 0.002 && Math.hypot(x, y) < 0.5) return;
+ animation = element.animate(
+ [
+ {transform: `translate(${x}px, ${y}px) scale(${scale})`},
+ {transform: 'none'},
+ ],
+ {
+ duration: cssDuration('--cui-motion-duration-rise'),
+ easing: cssValue('--cui-motion-ease-out'),
+ },
+ );
+ },
+ {defer: true},
+ ),
+ );
+}
+
+export function Frame(props: FrameProps) {
+ let layer: HTMLDivElement | undefined;
+ let content: HTMLDivElement | undefined;
+ const fit = () => props.fit ?? 'contain';
+ const overlay = children(() => props.overlay);
+
+ createFitMotion(
+ () => (fit() === 'contain' ? layer : undefined),
+ () => content,
+ () => [props.size, props.content.width, props.content.height],
+ );
+
+ return (
+
+
+
+ {props.children}
+
+
+ {overlay()}
+
+
+
+ );
+}
diff --git a/apps/website/src/components/Icon/icons.module.css b/apps/website/src/components/Icon/icons.module.css
new file mode 100644
index 000000000..7505e4d46
--- /dev/null
+++ b/apps/website/src/components/Icon/icons.module.css
@@ -0,0 +1,5 @@
+.icon {
+ flex: none;
+ width: var(--cui-space-4);
+ height: var(--cui-space-4);
+}
diff --git a/apps/website/src/components/Icon/icons.tsx b/apps/website/src/components/Icon/icons.tsx
new file mode 100644
index 000000000..bcd73a803
--- /dev/null
+++ b/apps/website/src/components/Icon/icons.tsx
@@ -0,0 +1,128 @@
+import type {JSX} from 'solid-js';
+import styles from './icons.module.css';
+
+type IconProps = {class?: string};
+
+function Icon(props: IconProps & {viewBox?: string; children: JSX.Element}) {
+ return (
+
+ );
+}
+
+export const GitHubIcon = (props: IconProps) => (
+
+
+
+);
+
+export const SunIcon = (props: IconProps) => (
+
+
+
+
+);
+
+export const MoonIcon = (props: IconProps) => (
+
+
+
+);
+
+export const PlayIcon = (props: IconProps) => (
+
+
+
+);
+
+export const ArrowDownIcon = (props: IconProps) => (
+
+
+
+);
+
+export const ExternalIcon = (props: IconProps) => (
+
+
+
+);
+
+export const ChevronDownIcon = (props: IconProps) => (
+
+
+
+);
+
+export const CheckIcon = (props: IconProps) => (
+
+
+
+);
+
+export const CopyIcon = (props: IconProps) => (
+
+
+
+
+);
+
+export const StarIcon = (props: IconProps) => (
+
+
+
+);
+
+export const LicenseIcon = (props: IconProps) => (
+
+
+
+);
+
+export const CalendarIcon = (props: IconProps) => (
+
+
+
+
+);
+
+export const CodeIcon = (props: IconProps) => (
+
+
+
+);
+
+export function ImageFileIcon(props: IconProps) {
+ return (
+
+ );
+}
diff --git a/apps/website/src/components/Island/Island.module.css b/apps/website/src/components/Island/Island.module.css
new file mode 100644
index 000000000..7acdc4884
--- /dev/null
+++ b/apps/website/src/components/Island/Island.module.css
@@ -0,0 +1,12 @@
+.island {
+ border-radius: var(--cui-radius-dialog);
+ background: var(--cui-surface-panel);
+ padding: var(--cui-space-8);
+}
+
+@media (max-width: 767px) {
+ .island {
+ padding: var(--cui-space-5);
+ border-radius: var(--cui-radius-command);
+ }
+}
diff --git a/apps/website/src/components/Island/Island.tsx b/apps/website/src/components/Island/Island.tsx
new file mode 100644
index 000000000..32c3ae862
--- /dev/null
+++ b/apps/website/src/components/Island/Island.tsx
@@ -0,0 +1,22 @@
+import {type JSX, splitProps} from 'solid-js';
+import {Dynamic} from 'solid-js/web';
+import styles from './Island.module.css';
+
+export type IslandProps = {
+ as?: 'div' | 'article' | 'figure' | 'aside';
+ class?: string;
+ children: JSX.Element;
+} & Omit, 'class' | 'children'>;
+
+export function Island(props: IslandProps) {
+ const [own, rest] = splitProps(props, ['as', 'class', 'children']);
+ return (
+
+ {own.children}
+
+ );
+}
diff --git a/apps/website/src/components/Logo/Logo.module.css b/apps/website/src/components/Logo/Logo.module.css
new file mode 100644
index 000000000..52d2d2a3d
--- /dev/null
+++ b/apps/website/src/components/Logo/Logo.module.css
@@ -0,0 +1,10 @@
+.logo {
+ width: auto;
+ height: 28px;
+}
+
+@media (max-width: 767px) {
+ .logo {
+ height: 24px;
+ }
+}
diff --git a/apps/website/src/components/Logo/Logo.tsx b/apps/website/src/components/Logo/Logo.tsx
new file mode 100644
index 000000000..de0aa8713
--- /dev/null
+++ b/apps/website/src/components/Logo/Logo.tsx
@@ -0,0 +1,65 @@
+import {For} from 'solid-js';
+import styles from './Logo.module.css';
+
+const wordmark = [
+ 'M255.94,133.71c-7.04-3.75-12.52-9.22-16.45-16.38-3.93-7.17-5.89-15.79-5.89-25.86s1.96-18.67,5.89-25.79c3.92-7.12,9.41-12.56,16.45-16.32,7.04-3.75,15.21-5.63,24.51-5.63,8.02,0,15.15,1.39,21.38,4.16,6.23,2.77,11.26,6.66,15.1,11.65,3.84,4.99,6.19,10.82,7.04,17.47h-20.22c-1.11-4.78-3.73-8.68-7.87-11.71-4.14-3.03-9.28-4.54-15.42-4.54-8.02,0-14.4,2.56-19.14,7.68-4.74,5.12-7.1,12.8-7.1,23.04s2.37,18.05,7.1,23.17c4.74,5.12,11.11,7.68,19.14,7.68,5.97,0,11.09-1.49,15.36-4.48,4.27-2.99,6.91-6.95,7.94-11.9h20.22c-.77,6.66-3.12,12.5-7.04,17.54-3.93,5.04-9.02,8.94-15.3,11.71-6.27,2.77-13.33,4.16-21.18,4.16-9.3,0-17.47-1.88-24.51-5.63Z',
+ 'M348.04,135.12c-5.21-2.82-9.24-6.87-12.1-12.16-2.86-5.29-4.29-11.65-4.29-19.07s1.36-13.29,4.1-18.62c2.73-5.33,6.66-9.49,11.78-12.48,5.12-2.99,11.31-4.48,18.56-4.48,6.83,0,12.82,1.41,17.98,4.22,5.16,2.82,9.17,6.89,12.03,12.22,2.86,5.33,4.29,11.71,4.29,19.14s-1.37,13.29-4.1,18.62c-2.73,5.33-6.64,9.47-11.71,12.42-5.08,2.94-11.24,4.42-18.5,4.42-6.83,0-12.84-1.41-18.05-4.22Zm29.06-16c2.82-3.33,4.22-8.4,4.22-15.23s-1.37-11.9-4.1-15.23c-2.73-3.33-6.44-4.99-11.14-4.99s-8.45,1.66-11.26,4.99c-2.82,3.33-4.22,8.41-4.22,15.23s1.39,11.8,4.16,15.17c2.77,3.37,6.51,5.06,11.2,5.06s8.32-1.66,11.14-4.99Z',
+ 'M415.88,130.45c-5.04-5.93-7.55-14.78-7.55-26.56s2.52-20.76,7.55-26.69c5.03-5.93,11.65-8.9,19.84-8.9,5.29,0,9.83,1.2,13.63,3.58,3.8,2.39,6.51,5.59,8.13,9.6h1.02V44.88h18.82v93.31h-18.18l-.64-12.03h-1.02c-1.62,3.93-4.33,7.1-8.13,9.54-3.8,2.43-8.34,3.65-13.63,3.65-8.19,0-14.81-2.96-19.84-8.9Zm35.65-8.77c2.26-1.62,3.95-3.73,5.06-6.34,1.11-2.6,1.66-5.35,1.66-8.26v-6.53c0-2.99-.56-5.76-1.66-8.32-1.11-2.56-2.8-4.65-5.06-6.27-2.26-1.62-5.14-2.43-8.64-2.43-4.61,0-8.32,1.64-11.14,4.93-2.82,3.29-4.22,8.43-4.22,15.42s1.41,12.01,4.22,15.3c2.82,3.29,6.53,4.93,11.14,4.93,3.5,0,6.38-.81,8.64-2.43Z',
+ 'M503.88,134.99c-5.08-2.9-8.98-6.98-11.71-12.22-2.73-5.25-4.1-11.37-4.1-18.37,0-7.42,1.39-13.82,4.16-19.2,2.77-5.38,6.68-9.54,11.71-12.48,5.03-2.94,10.92-4.42,17.66-4.42,7.94,0,14.46,1.73,19.58,5.18s8.79,8.19,11.01,14.21c2.22,6.02,2.94,12.82,2.18,20.42h-47.74c-.09,5.46,1.32,9.66,4.22,12.61,2.9,2.94,6.7,4.42,11.39,4.42,3.58,0,6.63-.79,9.15-2.37,2.52-1.58,4.12-3.69,4.8-6.34h17.79c-.6,4.61-2.33,8.62-5.18,12.03-2.86,3.41-6.55,6.08-11.07,8-4.52,1.92-9.69,2.88-15.49,2.88-7.17,0-13.29-1.45-18.37-4.35Zm7.36-48.83c-2.65,2.43-4.14,5.74-4.48,9.92h29.18c-.26-4.61-1.73-8.02-4.42-10.24-2.69-2.22-6-3.33-9.92-3.33-4.27,0-7.72,1.22-10.37,3.65Z',
+ 'M567.43,44.88h19.97v93.31h-19.97V44.88Z',
+ 'M604.16,69.58h18.18l.64,12.42h.77c1.71-4.52,4.48-7.94,8.32-10.24,3.84-2.3,8.06-3.46,12.67-3.46s9.13,1.15,13.06,3.46c3.92,2.3,6.83,6.27,8.7,11.9h1.02c1.62-5.12,4.5-8.96,8.64-11.52,4.14-2.56,8.81-3.84,14.02-3.84,4.44,0,8.4,.94,11.9,2.82,3.5,1.88,6.29,4.89,8.38,9.02,2.09,4.14,3.14,9.66,3.14,16.58v41.47h-18.82v-37.38c0-5.8-.96-10.11-2.88-12.93-1.92-2.82-5.01-4.22-9.28-4.22-4.52,0-8.04,1.64-10.56,4.93-2.52,3.29-3.78,7.1-3.78,11.46v38.14h-18.82v-37.38c0-5.8-.96-10.11-2.88-12.93-1.92-2.82-5.01-4.22-9.28-4.22-4.61,0-8.15,1.64-10.62,4.93-2.48,3.29-3.71,7.1-3.71,11.46v38.14h-18.82V69.58Z',
+ 'M729.02,133.97c-4.14-3.58-6.21-8.28-6.21-14.08,0-5.2,1.22-9.41,3.65-12.61,2.43-3.2,5.76-5.55,9.98-7.04,4.22-1.49,8.94-2.24,14.14-2.24h16v-4.74c0-3.16-.94-5.67-2.82-7.55-1.88-1.88-4.82-2.82-8.83-2.82s-7.04,.85-9.09,2.56c-2.05,1.71-3.07,3.93-3.07,6.66h-17.54c0-7.25,2.73-13.03,8.19-17.34,5.46-4.31,13.06-6.46,22.78-6.46,9.13,0,16.28,2.07,21.44,6.21,5.16,4.14,7.74,10.65,7.74,19.52v30.21c0,1.62,.04,3.39,.13,5.31,.08,1.92,.21,3.67,.38,5.25,.17,1.58,.38,2.71,.64,3.39h-17.79c-.68-2.05-1.11-5.63-1.28-10.75h-.77c-1.11,3.58-3.63,6.46-7.55,8.64-3.93,2.18-8.53,3.26-13.82,3.26-6.74,0-12.18-1.79-16.32-5.38Zm33.86-11.71c2.47-2.09,3.71-4.97,3.71-8.64v-4.86h-12.42c-8.28,0-12.42,2.77-12.42,8.32,0,2.65,.96,4.69,2.88,6.14,1.92,1.45,4.63,2.18,8.13,2.18,4.27,0,7.64-1.04,10.11-3.14Z',
+ 'M806.34,155.15c-5.25-3.8-8.13-8.85-8.64-15.17h18.05c.43,2.3,1.75,4.14,3.97,5.5,2.22,1.36,5.03,2.05,8.45,2.05,5.55,0,9.51-1.17,11.9-3.52,2.39-2.35,3.58-5.87,3.58-10.56v-11.78h-1.02c-1.54,3.67-4.14,6.66-7.81,8.96-3.67,2.3-7.98,3.46-12.93,3.46-8.19,0-14.74-2.77-19.65-8.32-4.91-5.55-7.36-13.74-7.36-24.58s2.5-19.03,7.49-24.58c4.99-5.55,11.54-8.32,19.65-8.32,4.95,0,9.24,1.11,12.86,3.33,3.63,2.22,6.21,5.21,7.74,8.96h1.02l.51-11.01h18.3v60.42c0,7.6-1.45,13.65-4.35,18.18-2.9,4.52-6.96,7.76-12.16,9.73-5.21,1.96-11.26,2.94-18.18,2.94-9.05,0-16.19-1.9-21.44-5.7Zm33.34-40c2.47-2.99,3.8-6.31,3.97-9.98l-.13-8.19c-.09-2.39-.68-4.67-1.79-6.85-1.11-2.18-2.73-3.95-4.86-5.31-2.13-1.36-4.78-2.05-7.94-2.05-4.52,0-8.13,1.52-10.82,4.54-2.69,3.03-4.03,7.66-4.03,13.89s1.34,10.86,4.03,13.89c2.69,3.03,6.25,4.54,10.69,4.54,4.78,0,8.4-1.49,10.88-4.48Z',
+ 'M887.36,134.99c-5.08-2.9-8.98-6.98-11.71-12.22-2.73-5.25-4.1-11.37-4.1-18.37,0-7.42,1.39-13.82,4.16-19.2,2.77-5.38,6.68-9.54,11.71-12.48,5.03-2.94,10.92-4.42,17.66-4.42,7.94,0,14.46,1.73,19.58,5.18s8.79,8.19,11.01,14.21c2.22,6.02,2.94,12.82,2.18,20.42h-47.74c-.09,5.46,1.32,9.66,4.22,12.61,2.9,2.94,6.7,4.42,11.39,4.42,3.58,0,6.63-.79,9.15-2.37,2.52-1.58,4.12-3.69,4.8-6.34h17.79c-.6,4.61-2.33,8.62-5.18,12.03-2.86,3.41-6.55,6.08-11.07,8-4.52,1.92-9.69,2.88-15.49,2.88-7.17,0-13.29-1.45-18.37-4.35Zm7.36-48.83c-2.65,2.43-4.14,5.74-4.48,9.92h29.18c-.26-4.61-1.73-8.02-4.42-10.24-2.69-2.22-6-3.33-9.92-3.33-4.27,0-7.72,1.22-10.37,3.65Z',
+];
+
+const lines = [
+ {x: -18.7, y: -60, width: 53},
+ {x: -36.5, y: -34, width: 88.6},
+ {x: -52.1, y: -8, width: 73.6},
+ {x: -36.5, y: 18, width: 88.6},
+ {x: -18.7, y: 44, width: 53},
+];
+
+export function Logo(props: {label: string}) {
+ return (
+
+ );
+}
diff --git a/apps/website/src/components/Overlay/createOverlay.ts b/apps/website/src/components/Overlay/createOverlay.ts
new file mode 100644
index 000000000..7ea70e878
--- /dev/null
+++ b/apps/website/src/components/Overlay/createOverlay.ts
@@ -0,0 +1,70 @@
+import {createEffect, createSignal, onCleanup} from 'solid-js';
+
+export type Overlay = {
+ open: () => boolean;
+ mounted: () => boolean;
+ show: (instant: boolean) => void;
+ hide: (instant: boolean) => void;
+ attributes: () => {
+ 'data-expanded': '' | undefined;
+ 'data-motion': 'none' | undefined;
+ };
+ onAnimationEnd: () => void;
+};
+
+export type OverlayOptions = {
+ ownedBy: () => readonly (Element | undefined)[];
+ onHide: () => void;
+};
+
+export function createOverlay(options: OverlayOptions): Overlay {
+ const [open, setOpen] = createSignal(false);
+ const [mounted, setMounted] = createSignal(false);
+ const [instant, setInstant] = createSignal(false);
+ let fallback: ReturnType | undefined;
+
+ const unmount = () => {
+ clearTimeout(fallback);
+ if (!open()) setMounted(false);
+ };
+
+ const hide = (now: boolean) => {
+ if (!open()) return;
+ setInstant(now);
+ setOpen(false);
+ options.onHide();
+ if (now) return unmount();
+ clearTimeout(fallback);
+ fallback = setTimeout(unmount, 400);
+ };
+
+ createEffect(() => {
+ if (!open()) return;
+ const onPointerDown = (event: PointerEvent) => {
+ const target = event.target;
+ if (!(target instanceof Node)) return;
+ if (options.ownedBy().some(element => element?.contains(target))) return;
+ hide(false);
+ };
+ document.addEventListener('pointerdown', onPointerDown);
+ onCleanup(() => document.removeEventListener('pointerdown', onPointerDown));
+ });
+ onCleanup(() => clearTimeout(fallback));
+
+ return {
+ open,
+ mounted,
+ show: now => {
+ clearTimeout(fallback);
+ setInstant(now);
+ setMounted(true);
+ setOpen(true);
+ },
+ hide,
+ attributes: () => ({
+ 'data-expanded': open() ? '' : undefined,
+ 'data-motion': instant() ? 'none' : undefined,
+ }),
+ onAnimationEnd: unmount,
+ };
+}
diff --git a/apps/website/src/components/PackageManagerSwitch/PackageManagerSwitch.tsx b/apps/website/src/components/PackageManagerSwitch/PackageManagerSwitch.tsx
new file mode 100644
index 000000000..5ad270c6a
--- /dev/null
+++ b/apps/website/src/components/PackageManagerSwitch/PackageManagerSwitch.tsx
@@ -0,0 +1,26 @@
+import {onMount} from 'solid-js';
+import {SegmentedControl} from '~/components/SegmentedControl/SegmentedControl';
+import {packageManagerCopy} from '~/content/copy';
+import {
+ choosePackageManager,
+ packageManager,
+ packageManagers,
+ restorePackageManager,
+} from '~/core/packageManager';
+
+const options = packageManagers.map(value => ({value, label: value}));
+
+export function PackageManagerSwitch(props: {class?: string}) {
+ onMount(restorePackageManager);
+
+ return (
+
+ );
+}
diff --git a/apps/website/src/components/RichTextView/RichTextView.tsx b/apps/website/src/components/RichTextView/RichTextView.tsx
new file mode 100644
index 000000000..d13debde0
--- /dev/null
+++ b/apps/website/src/components/RichTextView/RichTextView.tsx
@@ -0,0 +1,16 @@
+import {For} from 'solid-js';
+import type {RichText} from '~/content/richText';
+
+export function RichTextView(props: {text: RichText; codeClass?: string}) {
+ return (
+
+ {part =>
+ typeof part === 'string' ? (
+ part
+ ) : (
+ {part.code}
+ )
+ }
+
+ );
+}
diff --git a/apps/website/src/components/Section/Section.module.css b/apps/website/src/components/Section/Section.module.css
new file mode 100644
index 000000000..96ec5046a
--- /dev/null
+++ b/apps/website/src/components/Section/Section.module.css
@@ -0,0 +1,55 @@
+.section {
+ padding-top: var(--cui-space-24);
+}
+
+.head {
+ display: grid;
+ grid-template-columns: repeat(12, minmax(0, 1fr));
+ column-gap: var(--cui-space-4);
+ row-gap: var(--cui-space-5);
+ margin-bottom: var(--cui-space-8);
+}
+
+.eyebrow {
+ grid-column: 1 / -1;
+ justify-self: start;
+}
+
+.heading {
+ grid-column: 1 / span 7;
+ font-size: var(--ci-heading-size);
+ line-height: var(--ci-heading-line-height);
+ letter-spacing: var(--ci-heading-tracking);
+ font-weight: var(--cui-font-weight-semibold);
+ text-wrap: balance;
+}
+
+.heading[data-size='xl'] {
+ font-size: var(--ci-heading-xl-size);
+ line-height: var(--ci-display-line-height);
+ letter-spacing: var(--ci-display-tracking);
+}
+
+.lead {
+ grid-column: 8 / -1;
+ align-self: end;
+ max-width: 44ch;
+ text-wrap: pretty;
+}
+
+@media (max-width: 1023px) {
+ .heading,
+ .lead {
+ grid-column: 1 / -1;
+ }
+}
+
+@media (max-width: 767px) {
+ .section {
+ padding-top: var(--cui-space-16);
+ }
+
+ .head {
+ margin-bottom: var(--cui-space-6);
+ }
+}
diff --git a/apps/website/src/components/Section/Section.tsx b/apps/website/src/components/Section/Section.tsx
new file mode 100644
index 000000000..32b61f052
--- /dev/null
+++ b/apps/website/src/components/Section/Section.tsx
@@ -0,0 +1,67 @@
+import {textStyleProps} from '@codeui/styles/text';
+import {children, type JSX, Show} from 'solid-js';
+import type {SectionCopy} from '~/content/copy';
+import layout from '~/styles/layout.module.css';
+import {Badge} from '../Badge/Badge';
+import styles from './Section.module.css';
+
+export type SectionProps = {
+ id: string;
+ heading: JSX.Element;
+ eyebrow?: SectionCopy['eyebrow'];
+ lead?: JSX.Element;
+ size?: 'default' | 'xl';
+ class?: string;
+ children?: JSX.Element;
+};
+
+export function Section(props: SectionProps) {
+ const headingId = () => `${props.id}-title`;
+ const lead = children(() => props.lead);
+ return (
+
+
+
+
+ {eyebrow => (
+
+
+ {eyebrow.label}
+
+
+ )}
+
+
+ {props.heading}
+
+
+
+ {lead()}
+
+
+
+ {props.children}
+
+
+ );
+}
+
+export function sectionHeading(
+ copy: SectionCopy,
+): Pick {
+ return {id: copy.anchor, heading: copy.heading, eyebrow: copy.eyebrow};
+}
diff --git a/apps/website/src/components/SegmentedControl/SegmentedControl.module.css b/apps/website/src/components/SegmentedControl/SegmentedControl.module.css
new file mode 100644
index 000000000..4b8fbbb62
--- /dev/null
+++ b/apps/website/src/components/SegmentedControl/SegmentedControl.module.css
@@ -0,0 +1,3 @@
+.indicator[data-instant] {
+ transition: none;
+}
diff --git a/apps/website/src/components/SegmentedControl/SegmentedControl.tsx b/apps/website/src/components/SegmentedControl/SegmentedControl.tsx
new file mode 100644
index 000000000..ac1130383
--- /dev/null
+++ b/apps/website/src/components/SegmentedControl/SegmentedControl.tsx
@@ -0,0 +1,145 @@
+import {
+ indicator as indicatorClass,
+ list as listClass,
+ segment as segmentClass,
+ segmentedControlStyleProps,
+ type SegmentedControlStyleOptions,
+} from '@codeui/styles/segmentedcontrol';
+import {
+ createEffect,
+ createSignal,
+ For,
+ type JSX,
+ on,
+ onCleanup,
+ onMount,
+ Show,
+} from 'solid-js';
+import styles from './SegmentedControl.module.css';
+
+export type SegmentedOption = {
+ readonly value: V;
+ readonly label: JSX.Element;
+};
+
+export type SegmentedControlProps = {
+ options: readonly SegmentedOption[];
+ value: V;
+ onChange: (value: V) => void;
+ label?: string;
+ labelledBy?: string;
+ size?: SegmentedControlStyleOptions['size'];
+ fluid?: boolean;
+ class?: string;
+};
+
+const stepByKey: Readonly> = {
+ ArrowRight: 1,
+ ArrowDown: 1,
+ ArrowLeft: -1,
+ ArrowUp: -1,
+};
+
+function targetIndex(key: string, current: number, last: number) {
+ if (key === 'Home') return 0;
+ if (key === 'End') return last;
+ const step = stepByKey[key];
+ return step === undefined ? undefined : current + step;
+}
+
+export function SegmentedControl(
+ props: SegmentedControlProps,
+) {
+ const segments = new Map();
+ const [geometry, setGeometry] = createSignal<{left: number; width: number}>();
+ const [instant, setInstant] = createSignal(true);
+
+ const place = (animate: boolean) => {
+ const segment = segments.get(props.value);
+ if (!segment?.offsetWidth) return;
+ setInstant(!animate);
+ setGeometry({left: segment.offsetLeft, width: segment.offsetWidth});
+ };
+
+ onMount(() => {
+ place(false);
+ const observer = new ResizeObserver(() => place(false));
+ for (const segment of segments.values()) observer.observe(segment);
+ onCleanup(() => observer.disconnect());
+ });
+
+ createEffect(
+ on(
+ () => props.value,
+ () => place(true),
+ {defer: true},
+ ),
+ );
+
+ const select = (index: number) => {
+ const count = props.options.length;
+ const option = props.options[(index + count) % count];
+ props.onChange(option.value);
+ segments.get(option.value)?.focus();
+ };
+
+ const onKeyDown = (event: KeyboardEvent) => {
+ const current = props.options.findIndex(o => o.value === props.value);
+ const target = targetIndex(event.key, current, props.options.length - 1);
+ if (target === undefined) return;
+ event.preventDefault();
+ select(target);
+ };
+
+ return (
+
+
+
+ {placed => (
+
+ )}
+
+
+ {option => {
+ const selected = () => option.value === props.value;
+ return (
+
+ );
+ }}
+
+
+
+ );
+}
diff --git a/apps/website/src/components/Umami/UmamiScript.tsx b/apps/website/src/components/Umami/UmamiScript.tsx
index 89dd870a4..efa804908 100644
--- a/apps/website/src/components/Umami/UmamiScript.tsx
+++ b/apps/website/src/components/Umami/UmamiScript.tsx
@@ -1,14 +1,15 @@
+import {Show} from 'solid-js';
import {NoHydration} from 'solid-js/web';
export function UmamiScript() {
const websiteId = import.meta.env.VITE_UMAMI_WEBSITE_ID;
const scriptSrc = import.meta.env.VITE_UMAMI_SCRIPT_SRC;
- if (!websiteId || !scriptSrc) return null;
-
return (
-
-
-
+
+
+
+
+
);
}
diff --git a/apps/website/src/content/agents.ts b/apps/website/src/content/agents.ts
new file mode 100644
index 000000000..d8452e291
--- /dev/null
+++ b/apps/website/src/content/agents.ts
@@ -0,0 +1,108 @@
+import {cliPackage, skillSource} from '~/core/constants';
+import {type PackageManager, runPackage} from '~/core/packageManager';
+import type {BadgeTone} from './copy';
+import type {RichText} from './richText';
+
+export type AgentMode = 'agent' | 'browser';
+
+export type AgentFact = {
+ readonly title: string;
+ readonly body: RichText;
+ readonly link?: {readonly label: string};
+};
+
+export type AgentPrompt = 'image' | 'animation';
+
+export const agentModes: readonly AgentMode[] = ['agent', 'browser'];
+
+export const agentsCopy = {
+ lead: 'Ask your coding agent for an image or a video of the change it just made. With the skill it runs the CLI, and in Chrome it can drive the web editor.',
+ demo: 'An agent makes a code image',
+ requests: {
+ agent:
+ '/codeimage make an image of the fix I just made, in Dracula, sized for X.',
+ browser: 'Make an image of the fix I just made, in Dracula, sized for X.',
+ } satisfies Record,
+ you: 'You',
+ agent: 'Agent',
+ modesLabel: 'How the agent reaches CodeImage',
+ modes: {
+ agent: {label: 'In your agent', badge: 'new', via: 'skill + CLI'},
+ browser: {label: 'In the browser', badge: 'experimental', via: 'WebMCP'},
+ } satisfies Record,
+ steps: {agent: 'Skill, command and output', browser: 'Tool calls'},
+ skill: 'Skill',
+ thinking: 'Thinking',
+ thought: (ms: number) => `Thought for ${(ms / 1000).toFixed(1)}s`,
+ control: {play: 'Play', pause: 'Pause', replay: 'Replay'},
+ status: {running: 'running', done: 'done', pending: 'not run yet'},
+ exit: (code: number) => `exit ${code}`,
+ downloaded: 'Downloaded',
+ pixels: (width: number, height: number) => `${width} × ${height}`,
+ duration: (ms: number) => `${ms} ms`,
+ noImage: 'No image yet',
+ image: (name: string, theme: string, size: string) =>
+ `Code image of ${name} in ${theme}, ${size}`,
+ freeSize: 'free size',
+ facts: [
+ {
+ title: 'Tools in the editor.',
+ body: [
+ 'The web editor registers its tools with the browser’s agent through WebMCP, a W3C draft that Chrome is previewing.',
+ ],
+ },
+ {
+ title: 'A CLI built for scripts.',
+ body: [
+ 'Paths on stdout, progress on stderr, exit codes 0, 1 or 2. ',
+ {code: '--offline'},
+ ' disables all network access, and secrets are redacted by default.',
+ ],
+ link: {label: 'Read the CLI docs'},
+ },
+ ] satisfies readonly AgentFact[],
+ setup: {
+ title: 'Set up your agent.',
+ hint: 'The CLI ships a skill that teaches Claude Code, Codex, Cursor and other agents when and how to call it. Pick one way.',
+ note: 'Swap ./app.ts for any file in your project. MP4 needs ffmpeg; ask for a GIF without it.',
+ install: {
+ title: 'Install the skill',
+ body: [
+ 'It asks which agents to set up, and whether to install in this project or for every project. Add ',
+ {code: '-g'},
+ ' to skip straight to every project.',
+ ] satisfies RichText,
+ command: (manager: PackageManager) =>
+ `${runPackage(manager, 'skills')} add ${skillSource}`,
+ copy: 'Copy the install command',
+ followUp: [
+ 'Then ask for an image or a video, or type ',
+ {code: '/codeimage'},
+ ' in Claude Code.',
+ ] satisfies RichText,
+ },
+ ask: {
+ title: 'Or just ask',
+ body: [
+ 'Nothing to install. The prompt has your agent read the skill first.',
+ ] satisfies RichText,
+ label: 'Prompt',
+ },
+ prompts: [
+ {
+ id: 'image',
+ label: 'Image',
+ text: (manager: PackageManager) =>
+ `Run \`${runPackage(manager, cliPackage)} skills\` and follow it. Then make an image of ./app.ts in the VSCode Dark 2026 theme, sized for X.`,
+ copy: 'Copy the image prompt',
+ },
+ {
+ id: 'animation',
+ label: 'Animation',
+ text: (manager: PackageManager) =>
+ `Run \`${runPackage(manager, cliPackage)} skills\` and follow it. Then make an MP4 that refactors ./app.ts in 4 steps.`,
+ copy: 'Copy the animation prompt',
+ },
+ ],
+ },
+} as const;
diff --git a/apps/website/src/content/animate.ts b/apps/website/src/content/animate.ts
new file mode 100644
index 000000000..5ed8153ec
--- /dev/null
+++ b/apps/website/src/content/animate.ts
@@ -0,0 +1,232 @@
+import {cliPackage} from '~/core/constants';
+import {type PackageManager, runPackage} from '~/core/packageManager';
+import type {LineMarks, Snippet} from './code';
+
+export type BeatId = 'steps' | 'diff' | 'focus' | 'export';
+
+export type EasingName = 'smooth' | 'snappy' | 'strong' | 'linear';
+
+export type HeaderMode = 'tab' | 'tabs';
+
+export type ExportFormat = 'mp4' | 'gif';
+
+export type Selection = `hold-${number}` | `transition-${number}`;
+
+export type PanelState = {
+ readonly header: HeaderMode;
+ readonly selected: Selection;
+ readonly exporting: boolean;
+ readonly format: ExportFormat;
+};
+
+export type StoryBeat = {
+ readonly id: BeatId;
+ readonly label: string;
+ readonly caption: string;
+ readonly length: number;
+};
+
+type StoryTransition = {
+ readonly beat: BeatId;
+ readonly ms: number;
+ readonly easing: EasingName;
+};
+
+export type StoryStep = {
+ readonly snippet: Snippet;
+ readonly holdMs: number;
+ readonly marks?: LineMarks;
+ readonly enter?: StoryTransition;
+};
+
+type PanelCue = {
+ readonly beat: BeatId;
+ readonly at: number;
+ readonly set: Partial;
+};
+
+type BeatSpan = readonly [start: number, end: number];
+
+export type AnimateStory = {
+ readonly beats: readonly StoryBeat[];
+ readonly tail: number;
+ readonly morph: BeatSpan;
+ readonly firstHold: number;
+ readonly steps: readonly StoryStep[];
+ readonly initial: PanelState;
+ readonly cues: readonly PanelCue[];
+ readonly flight: BeatSpan;
+ readonly file: BeatSpan;
+};
+
+export const easingCurves: Readonly<
+ Record
+> = {
+ smooth: [0.65, 0, 0.35, 1],
+ snappy: [0.2, 0, 0, 1],
+ strong: [0.77, 0, 0.175, 1],
+ linear: [0, 0, 1, 1],
+};
+
+const fetchStep: Snippet = {
+ name: 'fetch.ts',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: 'function', kind: 'keyword'}, {text: ' getUser', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'id', kind: 'plain'}, {text: ')', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' res', kind: 'plain'}, {text: ' =', kind: 'punctuation'}, {text: ' fetch', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '`/users/${id}`', kind: 'string'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' return', kind: 'keyword'}, {text: ' res', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'then', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'r', kind: 'plain'}, {text: ' =>', kind: 'punctuation'}, {text: ' r', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'json', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: '}', kind: 'punctuation'}],
+ ],
+};
+
+const awaitStep: Snippet = {
+ name: 'await.ts',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: 'async', kind: 'keyword'}, {text: ' function', kind: 'keyword'}, {text: ' getUser', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'id', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' string', kind: 'type'}, {text: ')', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' res', kind: 'plain'}, {text: ' =', kind: 'punctuation'}, {text: ' await', kind: 'keyword'}, {text: ' fetch', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '`/users/${id}`', kind: 'string'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' return', kind: 'keyword'}, {text: ' res', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'then', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'r', kind: 'plain'}, {text: ' =>', kind: 'punctuation'}, {text: ' r', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'json', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' return', kind: 'keyword'}, {text: ' res', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'json', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: '}', kind: 'punctuation'}],
+ ],
+};
+
+const typesStep: Snippet = {
+ name: 'types.ts',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: 'async', kind: 'keyword'}, {text: ' function', kind: 'keyword'}, {text: ' getUser', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'id', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' string', kind: 'type'}, {text: ')', kind: 'punctuation'}, {text: ':', kind: 'punctuation'}, {text: ' Promise', kind: 'type'}, {text: '<', kind: 'punctuation'}, {text: 'User', kind: 'type'}, {text: '>', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' res', kind: 'plain'}, {text: ' =', kind: 'punctuation'}, {text: ' await', kind: 'keyword'}, {text: ' fetch', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '`/users/${id}`', kind: 'string'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' return', kind: 'keyword'}, {text: ' res', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'json', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: '}', kind: 'punctuation'}],
+ ],
+};
+
+export const animateStory: AnimateStory = {
+ beats: [
+ {
+ id: 'steps',
+ label: 'Steps',
+ caption: 'Each tab is a step. Set how long each one holds.',
+ length: 50,
+ },
+ {
+ id: 'diff',
+ label: 'Diff',
+ caption:
+ 'Code that both steps keep slides to its new position. Removed code fades out. New code fades in.',
+ length: 80,
+ },
+ {
+ id: 'focus',
+ label: 'Focus',
+ caption:
+ 'Marks travel with the steps. Each transition has its own duration and easing.',
+ length: 80,
+ },
+ {
+ id: 'export',
+ label: 'Export',
+ caption:
+ 'MP4 for social, GIF for a README, from the browser, with a file size estimate before you export.',
+ length: 90,
+ },
+ ],
+ tail: 20,
+ morph: [0.1, 0.62],
+ firstHold: 0.45,
+ steps: [
+ {snippet: fetchStep, holdMs: 800},
+ {
+ snippet: awaitStep,
+ holdMs: 1200,
+ marks: {3: 'removed', 4: 'added'},
+ enter: {beat: 'diff', ms: 700, easing: 'smooth'},
+ },
+ {
+ snippet: typesStep,
+ holdMs: 1000,
+ marks: {1: 'focus'},
+ enter: {beat: 'focus', ms: 700, easing: 'snappy'},
+ },
+ ],
+ initial: {
+ header: 'tab',
+ selected: 'hold-0',
+ exporting: false,
+ format: 'mp4',
+ },
+ cues: [
+ {beat: 'steps', at: 0.12, set: {header: 'tabs'}},
+ {beat: 'diff', at: 0.06, set: {selected: 'transition-1'}},
+ {beat: 'diff', at: 0.68, set: {selected: 'hold-1'}},
+ {beat: 'focus', at: 0.06, set: {selected: 'transition-2'}},
+ {beat: 'focus', at: 0.68, set: {selected: 'hold-2'}},
+ {beat: 'export', at: 0.03, set: {exporting: true}},
+ {beat: 'export', at: 0.58, set: {format: 'gif'}},
+ ],
+ flight: [0.08, 0.42],
+ file: [0.3, 0.48],
+};
+
+export const animateCopy = {
+ lead: 'Each tab is a step. CodeImage works out what stayed, what went and what is new, and moves each piece of code to its place.',
+ description:
+ 'A scroll scene in four parts. Three tabs of the same getUser function become three steps. Code that two steps share slides to its new place, removed code fades out and new code fades in. The second step marks one line as removed and one as added. The third step adds a return type and focuses that line, so the rest dims. Beside the frame, the Animate panel lists the tabs with how long each one holds, and the transitions with their duration and easing. The frame then becomes an MP4 for social and a GIF for a README.',
+ beatsLabel: 'Animate scene',
+ cta: 'Animate a snippet',
+ cliLabel: 'Two files, one animation.',
+ cliCommand: (manager: PackageManager) =>
+ `${runPackage(manager, cliPackage)} before.ts after.ts --animate -o change.gif`,
+ stillLabel: (index: number, label: string) => `${index} · ${label}`,
+ uses: {mp4: 'For social', gif: 'For your README'},
+ fileName: (extension: string) => `get-user.${extension}`,
+ fileMeta: (fps: number, ms: number) =>
+ `${fps} fps · ${(ms / 1000).toFixed(1)} s`,
+} as const;
+
+export const animatePanelCopy = {
+ header: 'Header',
+ headerModes: {
+ tab: 'Current tab',
+ tabs: 'All tabs',
+ } satisfies Record,
+ lines: (count: number) => `${count} lines`,
+ addTab: '+ New tab',
+ addStep: '+ Step',
+ tabNumber: (n: number) => `Tab ${n}`,
+ hold: 'Hold (ms)',
+ applyAll: 'Apply to all',
+ transition: 'Transition (ms)',
+ easings: {
+ smooth: 'Smooth',
+ snappy: 'Snappy',
+ strong: 'Strong',
+ linear: 'Linear',
+ } satisfies Record,
+ custom: 'Custom',
+ playTransition: 'Play transition',
+ exportTitle: 'Export animation',
+ exportDescription: (format: string) =>
+ `${format} animation, rendered on your device.`,
+ format: 'Format',
+ fps: 'Frame rate',
+ fpsValue: (fps: number) => `${fps} fps`,
+ outputSize: 'Output size',
+ currentSize: 'Current frame',
+ scale: 'Scale',
+ scaleValue: '2×',
+ estimate: 'Estimated size',
+ close: 'Close',
+ start: (format: string) => `Export ${format}`,
+} as const;
+
+export const exportFormats: Readonly<
+ Record
+> = {
+ mp4: {label: 'MP4', fps: 30},
+ gif: {label: 'GIF', fps: 25},
+};
diff --git a/apps/website/src/content/annotate.ts b/apps/website/src/content/annotate.ts
new file mode 100644
index 000000000..b923d0c2e
--- /dev/null
+++ b/apps/website/src/content/annotate.ts
@@ -0,0 +1,253 @@
+import type {CodeLine, LineMark, LineMarks, Snippet} from './code';
+import {socialSizes, type SocialSizeId} from './sizes';
+
+export type MarkMode = 'diff' | 'highlight' | 'focus';
+
+export type MarkModeSpec = {
+ readonly label: string;
+ readonly cycle: readonly LineMark[];
+ readonly preset: LineMarks;
+ readonly hint: string;
+};
+
+export const markModes: Readonly> = {
+ diff: {
+ label: 'Diff',
+ cycle: ['added', 'removed'],
+ preset: {4: 'removed', 5: 'added'},
+ hint: 'Click a line to mark it added or removed',
+ },
+ highlight: {
+ label: 'Highlight',
+ cycle: ['highlight'],
+ preset: {8: 'highlight'},
+ hint: 'Click a line to highlight it',
+ },
+ focus: {
+ label: 'Focus',
+ cycle: ['focus'],
+ preset: {8: 'focus', 9: 'focus', 10: 'focus'},
+ hint: 'Click a line to keep it in focus',
+ },
+};
+
+export const markModeOrder: readonly MarkMode[] = [
+ 'diff',
+ 'highlight',
+ 'focus',
+];
+
+const markNames: Readonly> = {
+ none: 'no mark',
+ added: 'marked as added',
+ removed: 'marked as removed',
+ highlight: 'highlighted',
+ focus: 'focused',
+};
+
+export type SecretRule = 'connection-url-password' | 'aws-access-token';
+
+export const secretRules: Readonly<
+ Record
+> = {
+ 'connection-url-password': {
+ kind: 'a password in a connection URL',
+ keepPrefix: 0,
+ },
+ 'aws-access-token': {kind: 'an AWS access key', keepPrefix: 4},
+};
+
+export type SignatureStyle = 'minimal' | 'pill' | 'card';
+
+export type EditorLayout = 'sidebar' | 'dock';
+
+export const annotateCopy = {
+ marks: {
+ title: 'Point at the line that matters.',
+ body: 'Mark lines as added or removed, highlight them, or focus on them so the rest of the snippet dims. Paste a unified diff or Shiki annotations and the marks come with the code.',
+ modeLabel: 'Mark type',
+ linesLabel: 'Lines of counter.tsx',
+ reset: 'Reset',
+ line: (line: number, mark: LineMark | undefined) =>
+ `Line ${line}, ${markNames[mark ?? 'none']}. Activate to change the mark.`,
+ },
+ alt: {
+ title: 'Alt text, already written.',
+ body: 'One button copies the language, file name, line range and the code itself.',
+ badge: 'ALT',
+ label: 'Alt text',
+ copy: 'Copy alt text',
+ copied: 'Copied',
+ fallback: (modifier: string) => `Press ${modifier} C`,
+ },
+ sizes: {
+ title: 'Sized for the feed.',
+ body: 'Pick X, LinkedIn, Square or Open Graph. The whole window is fitted inside that exact size, so nothing is cropped when you post.',
+ },
+ signature: {
+ title: 'Sign your work.',
+ body: 'Put your handle on the image as Minimal, Pill or Card. It is saved with your presets.',
+ stylesLabel: 'Signature styles',
+ sample: {initials: 'RP', handle: '@riccardoperra'},
+ example: {initials: 'Y', handle: '@you'},
+ styles: {
+ minimal: 'Minimal',
+ pill: 'Pill',
+ card: 'Card',
+ } satisfies Record,
+ },
+ secrets: {
+ title: 'Secrets check.',
+ body: 'API keys and tokens are flagged before you export, and redacted in one click.',
+ warning: (kind: string) => `Looks like ${kind}`,
+ redacted: 'Redacted',
+ visible: (count: number) =>
+ count === 1
+ ? '1 possible secret visible'
+ : `${count} possible secrets visible`,
+ done: 'Redacted. The image shows dots.',
+ redactAll: 'Redact all',
+ undo: 'Undo',
+ undoLabel: 'Undo the redaction',
+ },
+ layout: {
+ title: 'Sidebar or Dock.',
+ body: ['Two editor layouts, and', 'for every action.'],
+ label: 'Layout',
+ layouts: {sidebar: 'Sidebar', dock: 'Dock'} satisfies Record<
+ EditorLayout,
+ string
+ >,
+ commandMenu: 'Command menu',
+ },
+} as const;
+
+export const signatureStyles: readonly SignatureStyle[] = [
+ 'minimal',
+ 'pill',
+ 'card',
+];
+
+export const editorLayouts: readonly EditorLayout[] = ['sidebar', 'dock'];
+
+export const feedSizes: readonly SocialSizeId[] = [
+ 'x',
+ 'linkedin',
+ 'square',
+ 'og',
+];
+
+export function sizeLabel(id: SocialSizeId): string {
+ const size = socialSizes[id];
+ return `${size.width} × ${size.height}`;
+}
+
+export function lineText(line: CodeLine): string {
+ return line.map(token => token.text).join('');
+}
+
+export function snippetText(snippet: Snippet): string {
+ return snippet.lines.map(lineText).join('\n');
+}
+
+export function altText(snippet: Snippet): {head: string; code: string} {
+ const count = snippet.lines.length;
+ const range = count === 1 ? 'line 1' : `lines 1 to ${count}`;
+ return {
+ head: `${snippet.language} code, ${snippet.name}, ${range}`,
+ code: snippetText(snippet),
+ };
+}
+
+export function altTextValue(snippet: Snippet): string {
+ const {head, code} = altText(snippet);
+ return `${head}\n\n${code}`;
+}
+
+export const marksSnippet: Snippet = {
+ name: 'counter.tsx',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: 'import', kind: 'keyword'}, {text: ' {', kind: 'punctuation'}, {text: 'createSignal', kind: 'plain'}, {text: '}', kind: 'punctuation'}, {text: ' from', kind: 'keyword'}, {text: " 'solid-js'", kind: 'string'}, {text: ';', kind: 'punctuation'}],
+ [],
+ [{text: 'export', kind: 'keyword'}, {text: ' function', kind: 'keyword'}, {text: ' Counter', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' [', kind: 'punctuation'}, {text: 'count', kind: 'plain'}, {text: ',', kind: 'punctuation'}, {text: ' setCount', kind: 'plain'}, {text: ']', kind: 'punctuation'}, {text: ' =', kind: 'punctuation'}, {text: ' createSignal', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '0', kind: 'number'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' [', kind: 'punctuation'}, {text: 'count', kind: 'plain'}, {text: ',', kind: 'punctuation'}, {text: ' setCount', kind: 'plain'}, {text: ']', kind: 'punctuation'}, {text: ' =', kind: 'punctuation'}, {text: ' createSignal', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '1', kind: 'number'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [],
+ [{text: ' return', kind: 'keyword'}, {text: ' (', kind: 'punctuation'}],
+ [{text: ' <', kind: 'punctuation'}, {text: 'button', kind: 'tag'}, {text: ' onClick', kind: 'attribute'}, {text: '=', kind: 'punctuation'}, {text: '{', kind: 'punctuation'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' =>', kind: 'punctuation'}, {text: ' setCount', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'c', kind: 'plain'}, {text: ' =>', kind: 'punctuation'}, {text: ' c', kind: 'plain'}, {text: ' +', kind: 'punctuation'}, {text: ' 1', kind: 'number'}, {text: ')', kind: 'punctuation'}, {text: '}', kind: 'punctuation'}, {text: '>', kind: 'punctuation'}],
+ [{text: ' Clicked', kind: 'plain'}, {text: ' {', kind: 'punctuation'}, {text: 'count', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: '}', kind: 'punctuation'}, {text: ' times', kind: 'plain'}],
+ [{text: ' <', kind: 'punctuation'}, {text: '/button>', kind: 'plain'}],
+ [{text: ' );', kind: 'plain'}],
+ [{text: '}', kind: 'plain'}],
+ ],
+};
+
+export const sizesSnippet: Snippet = {
+ name: 'clamp.ts',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: 'export', kind: 'keyword'}, {text: ' function', kind: 'keyword'}, {text: ' clamp', kind: 'function'}, {text: '(', kind: 'punctuation'}],
+ [{text: ' n', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' number', kind: 'type'}, {text: ',', kind: 'punctuation'}, {text: ' lo', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' number', kind: 'type'}, {text: ',', kind: 'punctuation'}, {text: ' hi', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' number', kind: 'type'}, {text: ',', kind: 'punctuation'}],
+ [{text: ')', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}],
+ [{text: ' return', kind: 'keyword'}, {text: ' Math', kind: 'type'}, {text: '.', kind: 'punctuation'}, {text: 'min', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'Math', kind: 'type'}, {text: '.', kind: 'punctuation'}, {text: 'max', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'n', kind: 'plain'}, {text: ',', kind: 'punctuation'}, {text: ' lo', kind: 'plain'}, {text: ')', kind: 'punctuation'}, {text: ',', kind: 'punctuation'}, {text: ' hi', kind: 'plain'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: '}', kind: 'punctuation'}],
+ ],
+};
+
+export const signatureSnippet: Snippet = {
+ name: 'greet.ts',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: 'export', kind: 'keyword'}, {text: ' function', kind: 'keyword'}, {text: ' greet', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'name', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' string', kind: 'type'}, {text: ')', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}],
+ [{text: ' return', kind: 'keyword'}, {text: ' `Hello,', kind: 'string'}, {text: ' ${name}!`', kind: 'string'}, {text: ';', kind: 'punctuation'}],
+ [{text: '}', kind: 'punctuation'}],
+ [],
+ [{text: 'greet', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: "'CodeImage'", kind: 'string'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ ],
+};
+
+export const secretsSnippet: Snippet = {
+ name: 's3.ts',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: 'import', kind: 'keyword'}, {text: ' {', kind: 'punctuation'}, {text: 'S3Client', kind: 'type'}, {text: '}', kind: 'punctuation'}, {text: ' from', kind: 'keyword'}, {text: " '@aws-sdk/client-s3'", kind: 'string'}, {text: ';', kind: 'punctuation'}],
+ [],
+ [{text: 'const', kind: 'keyword'}, {text: ' db', kind: 'plain'}, {text: ' =', kind: 'punctuation'}, {text: ' sql', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: "'postgres://app:", kind: 'string'}, {text: 'hunter2', kind: 'string'}, {text: "@db/app'", kind: 'string'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [],
+ [{text: 'export', kind: 'keyword'}, {text: ' const', kind: 'keyword'}, {text: ' s3', kind: 'plain'}, {text: ' =', kind: 'punctuation'}, {text: ' new', kind: 'keyword'}, {text: ' S3Client', kind: 'type'}, {text: '(', kind: 'punctuation'}, {text: '{', kind: 'punctuation'}],
+ [{text: ' region', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: " 'eu-west-1'", kind: 'string'}, {text: ',', kind: 'punctuation'}],
+ [{text: ' credentials', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}],
+ [{text: ' accessKeyId', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: " 'AKIA", kind: 'string'}, {text: "NOTAREALKEY23456'", kind: 'string'}, {text: ',', kind: 'punctuation'}],
+ [{text: ' secretAccessKey', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' env', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'AWS_SECRET_KEY', kind: 'number'}, {text: ',', kind: 'punctuation'}],
+ [{text: ' }', kind: 'punctuation'}, {text: ',', kind: 'punctuation'}],
+ [{text: '}', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ ],
+};
+
+export type FlaggedSecret = {
+ readonly line: number;
+ readonly column: number;
+ readonly length: number;
+ readonly rule: SecretRule;
+};
+
+function flagSecret(
+ line: number,
+ parts: readonly string[],
+ rule: SecretRule,
+): FlaggedSecret {
+ const value = parts.join('');
+ const column = lineText(secretsSnippet.lines[line]).indexOf(value);
+ if (column < 0) throw new Error(`No secret on line ${line + 1}`);
+ return {line, column, length: value.length, rule};
+}
+
+export const flaggedSecrets: readonly FlaggedSecret[] = [
+ flagSecret(2, ['hun', 'ter2'], 'connection-url-password'),
+ flagSecret(7, ['AKIA', 'NOTAREALKEY', '23456'], 'aws-access-token'),
+];
diff --git a/apps/website/src/content/backgrounds.ts b/apps/website/src/content/backgrounds.ts
new file mode 100644
index 000000000..2dccb4aaa
--- /dev/null
+++ b/apps/website/src/content/backgrounds.ts
@@ -0,0 +1,54 @@
+import type {EditorTheme} from './themes';
+
+export type BackgroundId =
+ | 'theme'
+ | 'sunset'
+ | 'ocean'
+ | 'mint'
+ | 'peach'
+ | 'blue'
+ | 'graphite';
+
+export type Background = {
+ readonly id: BackgroundId;
+ readonly name: string;
+ readonly gradient: string | null;
+};
+
+export const backgrounds: Readonly> = {
+ theme: {id: 'theme', name: 'Theme background', gradient: null},
+ sunset: {
+ id: 'sunset',
+ name: 'Sunset',
+ gradient: 'linear-gradient(135deg, #ff9a5a 0%, #ff5e8a 50%, #8a4dff 100%)',
+ },
+ ocean: {
+ id: 'ocean',
+ name: 'Ocean',
+ gradient: 'linear-gradient(135deg, #2bd2ff 0%, #2b7bff 55%, #4a2bff 100%)',
+ },
+ mint: {
+ id: 'mint',
+ name: 'Mint',
+ gradient: 'linear-gradient(135deg, #b6f492 0%, #338b93 100%)',
+ },
+ peach: {
+ id: 'peach',
+ name: 'Peach',
+ gradient: 'linear-gradient(135deg, #ffd3a5 0%, #fd6585 100%)',
+ },
+ blue: {
+ id: 'blue',
+ name: 'CodeImage blue',
+ gradient: 'linear-gradient(135deg, #3b94ff 0%, #0066cc 100%)',
+ },
+ graphite: {
+ id: 'graphite',
+ name: 'Graphite',
+ gradient: 'linear-gradient(140deg, #3a3a3e 0%, #1b1b1e 100%)',
+ },
+};
+
+export function backgroundFill(id: BackgroundId, theme: EditorTheme): string {
+ return backgrounds[id].gradient ?? theme.frame;
+}
diff --git a/apps/website/src/content/cli.ts b/apps/website/src/content/cli.ts
new file mode 100644
index 000000000..9f19eccda
--- /dev/null
+++ b/apps/website/src/content/cli.ts
@@ -0,0 +1,160 @@
+import {cliPackage} from '~/core/constants';
+import {type PackageManager, runPackage} from '~/core/packageManager';
+import type {BandMarks, Snippet, WindowStyle} from './code';
+import type {RichText} from './richText';
+import type {SocialSizeId} from './sizes';
+import type {EditorThemeId} from './themes';
+
+export const exampleSnippet: Snippet = {
+ name: 'example.ts',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: 'export', kind: 'keyword'}, {text: ' function', kind: 'keyword'}, {text: ' readingTime', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'text', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' string', kind: 'type'}, {text: ')', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' words', kind: 'plain'}, {text: ' =', kind: 'punctuation'}, {text: ' text', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'trim', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: '.', kind: 'punctuation'}, {text: 'split', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '/\\s+/', kind: 'string'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' minutes', kind: 'plain'}, {text: ' =', kind: 'punctuation'}, {text: ' words', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'length', kind: 'plain'}, {text: ' /', kind: 'punctuation'}, {text: ' 200', kind: 'number'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' return', kind: 'keyword'}, {text: ' Math', kind: 'type'}, {text: '.', kind: 'punctuation'}, {text: 'max', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '1', kind: 'number'}, {text: ',', kind: 'punctuation'}, {text: ' Math', kind: 'type'}, {text: '.', kind: 'punctuation'}, {text: 'ceil', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'minutes', kind: 'plain'}, {text: ')', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: '}', kind: 'punctuation'}],
+ ],
+};
+
+export const changesSnippet: Snippet = {
+ name: 'example.ts',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: 'export', kind: 'keyword'}, {text: ' function', kind: 'keyword'}, {text: ' readingTime', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'text', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' string', kind: 'type'}, {text: ')', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' words', kind: 'plain'}, {text: ' =', kind: 'punctuation'}, {text: ' text', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'split', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: "' '", kind: 'string'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' words', kind: 'plain'}, {text: ' =', kind: 'punctuation'}, {text: ' text', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'trim', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: '.', kind: 'punctuation'}, {text: 'split', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '/\\s+/', kind: 'string'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' minutes', kind: 'plain'}, {text: ' =', kind: 'punctuation'}, {text: ' words', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'length', kind: 'plain'}, {text: ' /', kind: 'punctuation'}, {text: ' 200', kind: 'number'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' return', kind: 'keyword'}, {text: ' Math', kind: 'type'}, {text: '.', kind: 'punctuation'}, {text: 'max', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '1', kind: 'number'}, {text: ',', kind: 'punctuation'}, {text: ' Math', kind: 'type'}, {text: '.', kind: 'punctuation'}, {text: 'ceil', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'minutes', kind: 'plain'}, {text: ')', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: '}', kind: 'punctuation'}],
+ ],
+};
+
+export const afterSnippet: Snippet = {
+ name: 'after.ts',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: 'async', kind: 'keyword'}, {text: ' function', kind: 'keyword'}, {text: ' getUser', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'id', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' string', kind: 'type'}, {text: ')', kind: 'punctuation'}, {text: ':', kind: 'punctuation'}, {text: ' Promise', kind: 'type'}, {text: '<', kind: 'punctuation'}, {text: 'User', kind: 'type'}, {text: '>', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' res', kind: 'plain'}, {text: ' =', kind: 'punctuation'}, {text: ' await', kind: 'keyword'}, {text: ' fetch', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '`/users/${id}`', kind: 'string'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' return', kind: 'keyword'}, {text: ' res', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'json', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: '}', kind: 'punctuation'}],
+ ],
+};
+
+export type CliOutput = {
+ readonly file: string;
+ readonly format: 'PNG' | 'GIF';
+ readonly snippet: Snippet;
+ readonly windowStyle: WindowStyle;
+ readonly marks?: BandMarks;
+ readonly focus?: readonly number[];
+ readonly size?: SocialSizeId;
+ readonly signature?: string;
+ readonly steps?: readonly [string, string, string];
+};
+
+export type CliCommand = {
+ readonly id: string;
+ readonly label: string;
+ readonly args: string;
+ readonly pipe?: string;
+ readonly output: CliOutput;
+};
+
+export const cliTheme: EditorThemeId = 'fleetDark';
+
+export const cliSnippets: readonly Snippet[] = [
+ exampleSnippet,
+ changesSnippet,
+ afterSnippet,
+];
+
+export const cliCommands: readonly CliCommand[] = [
+ {
+ id: 'file',
+ label: 'A file to an image.',
+ args: 'src/example.ts -o example.png',
+ output: {
+ file: 'example.png',
+ format: 'PNG',
+ snippet: exampleSnippet,
+ windowStyle: 'card',
+ },
+ },
+ {
+ id: 'diff',
+ label: 'Your diff, marked.',
+ pipe: 'git diff |',
+ args: '--diff -o changes.png',
+ output: {
+ file: 'changes.png',
+ format: 'PNG',
+ snippet: changesSnippet,
+ windowStyle: 'editor',
+ marks: {2: 'removed', 3: 'added'},
+ },
+ },
+ {
+ id: 'focus',
+ label: 'Focus and highlight.',
+ args: 'src/example.ts --focus 3-5 --highlight 4 -o focused.png',
+ output: {
+ file: 'focused.png',
+ format: 'PNG',
+ snippet: exampleSnippet,
+ windowStyle: 'card',
+ focus: [3, 4, 5],
+ marks: {4: 'highlight'},
+ },
+ },
+ {
+ id: 'social',
+ label: 'Sized and signed for X.',
+ args: 'src/example.ts --size x-landscape --signature @you -o social.png',
+ output: {
+ file: 'social.png',
+ format: 'PNG',
+ snippet: exampleSnippet,
+ windowStyle: 'card',
+ size: 'x',
+ signature: '@you',
+ },
+ },
+ {
+ id: 'animate',
+ label: 'Two files, one animation.',
+ args: 'before.ts after.ts --animate -o change.gif',
+ output: {
+ file: 'change.gif',
+ format: 'GIF',
+ snippet: afterSnippet,
+ windowStyle: 'editor',
+ steps: ['before.ts', 'Smooth', 'after.ts'],
+ },
+ },
+];
+
+export const initialCliCommand = 3;
+
+export const commandLine = (entry: CliCommand, manager: PackageManager) =>
+ [entry.pipe, runPackage(manager, cliPackage), entry.args]
+ .filter(Boolean)
+ .join(' ');
+
+export const cliCopy = {
+ lead: [
+ {code: 'codeimage'},
+ ' renders in Node 24 with no browser, using the presets you saved in the web app. Secrets are redacted by default.',
+ ] satisfies RichText,
+ terminal: 'Terminal',
+ shell: 'zsh',
+ commands: 'Commands',
+ foot: 'Use it in CI, docs builds and scripts.',
+ copy: (label: string) => `Copy the command: ${label}`,
+ output: 'Output',
+ preview: (file: string) => `Preview of ${file}`,
+ pixels: (width: number, height: number) => `${width} × ${height}`,
+} as const;
diff --git a/apps/website/src/content/code.ts b/apps/website/src/content/code.ts
new file mode 100644
index 000000000..4e424c00e
--- /dev/null
+++ b/apps/website/src/content/code.ts
@@ -0,0 +1,36 @@
+export type TokenKind =
+ | 'keyword'
+ | 'string'
+ | 'number'
+ | 'function'
+ | 'type'
+ | 'tag'
+ | 'attribute'
+ | 'property'
+ | 'comment'
+ | 'punctuation'
+ | 'plain';
+
+export type Token = {readonly text: string; readonly kind: TokenKind};
+
+export type CodeLine = readonly Token[];
+
+export type Snippet = {
+ readonly name: string;
+ readonly language: string;
+ readonly lines: readonly CodeLine[];
+};
+
+export type LineMark = 'added' | 'removed' | 'highlight' | 'focus';
+
+export type LineMarks = Readonly>>;
+
+export type BandMark = Exclude;
+
+export type BandMarks = Readonly>>;
+
+export type WindowStyle = 'card' | 'editor' | 'terminal';
+
+export type Surface = 'solid' | 'wash';
+
+export type Border = 'none' | 'hairline';
diff --git a/apps/website/src/content/codeui.ts b/apps/website/src/content/codeui.ts
new file mode 100644
index 000000000..21af098d6
--- /dev/null
+++ b/apps/website/src/content/codeui.ts
@@ -0,0 +1,88 @@
+import type {RichText} from './richText';
+
+export type KitBadge = {
+ readonly label: string;
+ readonly tone: 'info' | 'warning' | 'success' | 'danger';
+ readonly variant: 'soft' | 'outline';
+};
+
+export type KitTab = {
+ readonly id: string;
+ readonly label: string;
+ readonly body: string;
+};
+
+export const codeUiCopy = {
+ lead: [
+ 'CodeUI is the component library CodeImage is built on, now open source and in beta. ',
+ {code: '@codeui/solid'},
+ ' has the components for Solid 2. ',
+ {code: '@codeui/styles'},
+ ' is the same design as plain CSS, for any framework. Expect changes before 1.0.',
+ ] satisfies RichText,
+ packages: [
+ {name: '@codeui/solid', tag: 'Solid 2'},
+ {name: '@codeui/styles', tag: 'Plain CSS'},
+ ],
+ install: 'pnpm add @codeui/solid',
+ copyInstall: 'Copy the install command',
+ componentsLabel: 'Components',
+ components: [
+ 'Button',
+ 'Segmented control',
+ 'Text field',
+ 'Select',
+ 'Checkbox',
+ 'Switch',
+ 'Kbd',
+ 'Tooltip',
+ 'Tabs',
+ 'Badge',
+ ],
+ proof: [
+ 'This page is styled with ',
+ {code: '@codeui/styles'},
+ '.',
+ ] satisfies RichText,
+ github: 'CodeUI on GitHub',
+ specimen: {
+ label: 'CodeUI components',
+ buttons: {primary: 'Export', secondary: 'Copy'},
+ filter: {
+ label: 'Theme filter',
+ options: [
+ {value: 'all', label: 'All'},
+ {value: 'dark', label: 'Dark'},
+ {value: 'light', label: 'Light'},
+ ],
+ },
+ search: {label: 'Search themes', placeholder: 'Search themes…'},
+ font: {
+ label: 'Font',
+ options: ['JetBrains Mono', 'Fira Code', 'Source Code Pro'],
+ },
+ lineNumbers: 'Line numbers',
+ signature: 'Signature',
+ shortcut: {mac: '⌘', other: 'Ctrl', key: 'K'},
+ tooltip: {
+ idle: 'Copy',
+ done: 'Copied',
+ label: 'Copy pnpm add @codeui/styles',
+ text: 'pnpm add @codeui/styles',
+ },
+ tabs: {
+ label: 'Sections',
+ items: [
+ {id: 'frame', label: 'Frame', body: 'Background, padding and size.'},
+ {id: 'window', label: 'Window', body: 'Style, accent and border.'},
+ {id: 'code', label: 'Code', body: 'Theme, font and line numbers.'},
+ ] satisfies readonly KitTab[],
+ },
+ badges: [
+ {label: 'New', tone: 'info', variant: 'soft'},
+ {label: 'Beta', tone: 'warning', variant: 'outline'},
+ {label: 'Added', tone: 'success', variant: 'soft'},
+ {label: 'Removed', tone: 'danger', variant: 'soft'},
+ ] satisfies readonly KitBadge[],
+ },
+} as const;
diff --git a/apps/website/src/content/commands.ts b/apps/website/src/content/commands.ts
new file mode 100644
index 000000000..26e6e1bb4
--- /dev/null
+++ b/apps/website/src/content/commands.ts
@@ -0,0 +1,127 @@
+import {
+ heroBackgroundIds,
+ heroSizes,
+ heroThemeIds,
+ heroWindowStyles,
+ type HeroControl,
+ type HeroControls,
+} from '~/sections/Hero/heroEditor';
+import {backgrounds} from './backgrounds';
+import {studioCopy} from './copy';
+import {socialSizes} from './sizes';
+import {editorThemes} from './themes';
+import {codeUiUrl, editorUrl, repositoryUrl} from '~/core/constants';
+
+export type ControlCommand = {
+ [K in HeroControl]: {
+ readonly kind: 'control';
+ readonly control: K;
+ readonly value: HeroControls[K];
+ readonly label: string;
+ readonly detail?: string;
+ };
+}[HeroControl];
+
+export type CommandAction = 'play' | 'randomize';
+
+export type ActionCommand = {
+ readonly kind: 'action';
+ readonly action: CommandAction;
+ readonly label: string;
+};
+
+export type LinkCommand = {
+ readonly kind: 'link';
+ readonly href: string;
+ readonly label: string;
+ readonly detail?: string;
+};
+
+export type Command = ControlCommand | ActionCommand | LinkCommand;
+
+export type CommandGroup = {
+ readonly label: string;
+ readonly commands: readonly Command[];
+};
+
+export const previewedControls: ReadonlySet = new Set([
+ 'theme',
+ 'windowStyle',
+ 'background',
+]);
+
+export const commandMenuCopy = {
+ title: 'Command menu',
+ search: 'Search commands',
+ placeholder: 'Search themes, windows, sizes, actions…',
+ hint: '↑↓ preview · ↵ apply · esc cancel',
+ list: 'Commands',
+ empty: 'No matching command',
+ current: 'Current',
+} as const;
+
+export const commandGroups: readonly CommandGroup[] = [
+ {
+ label: 'Theme',
+ commands: heroThemeIds.map(value => ({
+ kind: 'control',
+ control: 'theme',
+ value,
+ label: editorThemes[value].name,
+ })),
+ },
+ {
+ label: 'Window',
+ commands: heroWindowStyles.map(value => ({
+ kind: 'control',
+ control: 'windowStyle',
+ value,
+ label: studioCopy.windowStyles[value],
+ })),
+ },
+ {
+ label: 'Size',
+ commands: heroSizes.map(value => {
+ if (value === 'auto') {
+ return {kind: 'control', control: 'size', value, label: 'Auto'};
+ }
+ const size = socialSizes[value];
+ return {
+ kind: 'control',
+ control: 'size',
+ value,
+ label: size.label,
+ detail: `${size.width} × ${size.height}`,
+ };
+ }),
+ },
+ {
+ label: 'Background',
+ commands: heroBackgroundIds.map(value => ({
+ kind: 'control',
+ control: 'background',
+ value,
+ label: backgrounds[value].name,
+ })),
+ },
+ {
+ label: 'Actions',
+ commands: [
+ {kind: 'action', action: 'play', label: 'Play the snippet'},
+ {kind: 'action', action: 'randomize', label: 'Randomize'},
+ ],
+ },
+ {
+ label: 'Links',
+ commands: [
+ {
+ kind: 'link',
+ href: editorUrl,
+ label: 'Open the editor',
+ detail: 'app.codeimage.dev',
+ },
+ {kind: 'link', href: repositoryUrl, label: 'Star on GitHub'},
+ {kind: 'link', href: codeUiUrl, label: 'CodeUI on GitHub'},
+ ],
+ },
+];
diff --git a/apps/website/src/content/copy.ts b/apps/website/src/content/copy.ts
new file mode 100644
index 000000000..c6effa5ed
--- /dev/null
+++ b/apps/website/src/content/copy.ts
@@ -0,0 +1,175 @@
+import type {WindowStyle} from './code';
+import type {SocialSizeId} from './sizes';
+
+export type BadgeTone =
+ | 'new'
+ | 'beta'
+ | 'experimental'
+ | 'comingSoon'
+ | 'planned'
+ | 'neutral';
+
+export type SectionId =
+ | 'animate'
+ | 'looks'
+ | 'annotate'
+ | 'export'
+ | 'cli'
+ | 'agents'
+ | 'faq'
+ | 'codeUi'
+ | 'openSource';
+
+export type SectionCopy = {
+ readonly anchor: string;
+ readonly heading: string;
+ readonly eyebrow?: {readonly tone: BadgeTone; readonly label?: string};
+};
+
+export const badgeLabels: Readonly<
+ Record, string>
+> = {
+ new: 'New',
+ beta: 'Beta',
+ experimental: 'Experimental',
+ comingSoon: 'Coming soon',
+ planned: 'Planned',
+};
+
+export const metaCopy = {
+ siteName: 'CodeImage',
+ title: 'CodeImage · Beautify your code screenshots, and animate them',
+ description:
+ 'Paste a snippet. Pick a theme, mark the lines that matter, and export an image or a video at the size X, LinkedIn and your README expect. Free and open source.',
+} as const;
+
+export const navCopy = {
+ label: 'Primary',
+ skip: 'Skip to content',
+ home: 'CodeImage, back to top',
+ github: 'CodeImage on GitHub',
+ openEditor: 'Open the editor',
+ links: [
+ {label: 'Animate', href: '#animate'},
+ {label: 'Agents', href: '#agents'},
+ {label: 'Features', href: '#features'},
+ {label: 'Export', href: '#export'},
+ {label: 'CLI', href: '#cli'},
+ {label: 'CodeUI', href: '#codeui'},
+ ],
+ githubLink: 'GitHub',
+ switchTheme: 'Switch theme',
+ switchTo: {light: 'Switch to light theme', dark: 'Switch to dark theme'},
+} as const;
+
+export const heroCopy = {
+ release: 'New: code animations',
+ headline: {
+ first: 'Beautify your code screenshots.',
+ second: 'And now, ',
+ accent: 'animate them.',
+ },
+ sub: 'Paste a snippet. Pick a theme, mark the lines that matter, and export an image or a video at the size X, LinkedIn and your README expect.',
+ primary: 'Open the editor',
+ secondary: 'Star on GitHub',
+ note: 'Free and open source. No account needed.',
+} as const;
+
+export const studioCopy = {
+ label: 'Live editor',
+ commands: 'Commands',
+ preview: 'Preview of the snippet image',
+ controls: 'Snippet settings',
+ openInEditor: 'Open in the editor',
+ play: {idle: 'Play', forward: 'Step 2', back: 'Step 1'},
+ playDescription:
+ 'Morphs the snippet to a second step with one added line, then back',
+ theme: 'Theme',
+ background: 'Background',
+ window: 'Window',
+ size: 'Size',
+ windowStyles: {
+ card: 'Card',
+ editor: 'Editor',
+ terminal: 'Terminal',
+ } satisfies Record,
+ sizes: {
+ auto: 'Auto',
+ x: 'X',
+ linkedin: 'LinkedIn',
+ square: 'Square',
+ } satisfies Partial>,
+ autoReadout: 'Auto · fits the window',
+ sizeReadout: (label: string, width: number, height: number) =>
+ `${label} · ${width} × ${height}`,
+} as const;
+
+export const proofCopy = {
+ label: 'CodeImage at a glance',
+ stars: (stars: string) => `${stars} stars on GitHub`,
+ starsUnknown: 'Stars on GitHub',
+ license: 'MIT licensed',
+ since: 'Open source since 2022',
+ builtWith: 'Built with SolidJS',
+} as const;
+
+export const sectionCopy: Readonly> = {
+ animate: {
+ anchor: 'animate',
+ heading: 'Explain a change in motion.',
+ eyebrow: {tone: 'new'},
+ },
+ looks: {anchor: 'features', heading: 'Make it look like yours.'},
+ annotate: {anchor: 'annotate', heading: 'Annotate and share.'},
+ export: {
+ anchor: 'export',
+ heading: 'One renderer, in the browser and in your agent.',
+ eyebrow: {tone: 'experimental'},
+ },
+ cli: {
+ anchor: 'cli',
+ heading: 'The same image, from your terminal.',
+ eyebrow: {tone: 'new'},
+ },
+ agents: {
+ anchor: 'agents',
+ heading: 'Ready for agents, with WebMCP and skills.',
+ eyebrow: {tone: 'neutral', label: 'For agents'},
+ },
+ faq: {anchor: 'faq', heading: 'Questions.'},
+ codeUi: {
+ anchor: 'codeui',
+ heading: 'The editor’s UI kit is yours too.',
+ eyebrow: {tone: 'neutral', label: 'For developers'},
+ },
+ openSource: {anchor: 'open-source', heading: 'Built in the open since 2022.'},
+};
+
+export const closingCopy = {
+ heading: 'Your next snippet is one paste away.',
+ cta: 'Open the editor',
+ note: 'Free and open source. No account needed.',
+} as const;
+
+export const footerCopy = {
+ copyright: '© 2026 Riccardo Perra',
+ label: 'Footer',
+ github: 'GitHub',
+ issues: 'Issues and feedback',
+ releases: 'Releases',
+ betterComments: 'Better Comments for GitHub',
+} as const;
+
+export const windowCopy = {
+ prompt: (file: string) => `cat ${file}`,
+ lines: (count: number) => `${count} lines`,
+} as const;
+
+export const packageManagerCopy = {
+ label: 'Package manager',
+} as const;
+
+export const copyButtonCopy = {
+ copy: 'Copy',
+ copied: 'Copied',
+} as const;
diff --git a/apps/website/src/content/export.ts b/apps/website/src/content/export.ts
new file mode 100644
index 000000000..ae0bf5d38
--- /dev/null
+++ b/apps/website/src/content/export.ts
@@ -0,0 +1,36 @@
+export const exportCopy = {
+ lead: {
+ before: '2.0 adds ',
+ link: 'Takumi',
+ after:
+ ', a new export engine. The same engine draws the image in the web app and in the CLI, so a preset gives the same picture in both places.',
+ },
+ linkHint: 'opens in a new tab',
+ figure:
+ 'The line return res.json(); twice. Once as pixels, as in a PNG. Once as vector outlines, as in the SVG export. Beside each line, the letter o magnified: a staircase of pixels, and a smooth outline with its anchor points and handles.',
+ rows: {pixels: 'PNG', outlines: 'SVG'},
+ points: [
+ {
+ title: 'PNG, JPEG, WebP or SVG.',
+ body: 'Or copy the image straight to the clipboard.',
+ },
+ {
+ title: 'SVG with real outlines.',
+ body: 'Text is exported as vector paths, so the file opens in Figma, Illustrator or Keynote with no missing fonts and scales to any size.',
+ },
+ {
+ title: 'A safety net.',
+ body: 'If Takumi cannot draw a snippet, the classic export takes over.',
+ },
+ ],
+ formats: {
+ label: 'Export formats',
+ files: ['PNG', 'JPEG', 'WebP', 'SVG'],
+ clipboard: 'Clipboard',
+ },
+ engine: {
+ label: 'Takumi draws the image for both the web app and the CLI',
+ source: 'Takumi',
+ targets: ['Web app', 'CLI'],
+ },
+} as const;
diff --git a/apps/website/src/content/faq.ts b/apps/website/src/content/faq.ts
new file mode 100644
index 000000000..a18839101
--- /dev/null
+++ b/apps/website/src/content/faq.ts
@@ -0,0 +1,57 @@
+import {cliPackage, skillSource} from '~/core/constants';
+import type {RichText} from './richText';
+
+export type FaqEntry = {
+ readonly id: string;
+ readonly question: string;
+ readonly answer: RichText;
+};
+
+export const faqEntries: readonly FaqEntry[] = [
+ {
+ id: 'free',
+ question: 'Is it free?',
+ answer: ['Yes. CodeImage is MIT licensed and free to use.'],
+ },
+ {
+ id: 'account',
+ question: 'Do I need an account?',
+ answer: [
+ 'No. You can edit and export without one. An account only adds saved snippets.',
+ ],
+ },
+ {
+ id: 'export',
+ question: 'What can I export?',
+ answer: ['PNG, JPEG, WebP and SVG images, and GIF or MP4 animations.'],
+ },
+ {
+ id: 'automate',
+ question: 'Can I automate it?',
+ answer: [
+ 'The ',
+ {code: 'codeimage'},
+ ' command renders the same images and videos in Node, for CI, docs builds and coding agents. Run it with ',
+ {code: `pnpm dlx ${cliPackage}`},
+ ', or give your agent the skill with ',
+ {code: `pnpm dlx skills add ${skillSource}`},
+ '.',
+ ],
+ },
+];
+
+export function plainText(text: RichText): string {
+ return text
+ .map(part => (typeof part === 'string' ? part : part.code))
+ .join('');
+}
+
+export const faqJsonLd = {
+ '@context': 'https://schema.org',
+ '@type': 'FAQPage',
+ mainEntity: faqEntries.map(entry => ({
+ '@type': 'Question',
+ name: entry.question,
+ acceptedAnswer: {'@type': 'Answer', text: plainText(entry.answer)},
+ })),
+} as const;
diff --git a/apps/website/src/content/looks.ts b/apps/website/src/content/looks.ts
new file mode 100644
index 000000000..bb84fee49
--- /dev/null
+++ b/apps/website/src/content/looks.ts
@@ -0,0 +1,92 @@
+import type {Border, Snippet, Surface, WindowStyle} from './code';
+import type {EditorThemeId} from './themes';
+
+export const looksCopy = {
+ windows: {
+ title: 'Three windows.',
+ body: 'Card, Editor or Terminal. The new Accent wash surface and Hairline border take their colour from the theme.',
+ window: 'Window',
+ surface: 'Surface',
+ border: 'Border',
+ preview: 'Preview of the window',
+ windowStyles: {
+ card: 'Card',
+ editor: 'Editor',
+ terminal: 'Terminal',
+ } satisfies Record,
+ surfaces: {solid: 'Solid', wash: 'Accent wash'} satisfies Record<
+ Surface,
+ string
+ >,
+ borders: {none: 'None', hairline: 'Hairline'} satisfies Record<
+ Border,
+ string
+ >,
+ },
+ themes: {
+ title: '30 editor themes.',
+ body: 'Hover a theme to preview it. The one you pick also colours the window.',
+ schemes: {dark: 'Dark', light: 'Light'},
+ },
+ notes: [
+ {
+ title: '30 languages.',
+ body: 'TypeScript, Python, Rust, Go, SQL and 25 more.',
+ },
+ {title: 'Several files in one image.', body: 'Tabs, as in your editor.'},
+ {title: 'Presets.', body: 'Save a look and apply it to the next snippet.'},
+ {
+ title: 'Your snippets, saved.',
+ body: 'Sign in to keep projects and open them from any device.',
+ },
+ ],
+} as const;
+
+export const looksThemeIds: readonly EditorThemeId[] = [
+ 'dracula',
+ 'nightOwlTheme',
+ 'githubLight',
+ 'synthwave84',
+ 'poimandres',
+ 'vsCodeDark2026',
+ 'xCodeLight',
+ 'materialOcean',
+];
+
+export const looksWindowStyles: readonly WindowStyle[] = [
+ 'card',
+ 'editor',
+ 'terminal',
+];
+
+export const looksSurfaces: readonly Surface[] = ['solid', 'wash'];
+
+export const looksBorders: readonly Border[] = ['none', 'hairline'];
+
+export const windowSnippet: Snippet = {
+ name: 'todos.ts',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: 'import', kind: 'keyword'}, {text: ' {', kind: 'punctuation'}, {text: 'useQuery', kind: 'plain'}, {text: '}', kind: 'punctuation'}, {text: ' from', kind: 'keyword'}, {text: " '@tanstack/solid-query'", kind: 'string'}, {text: ';', kind: 'punctuation'}],
+ [],
+ [{text: 'export', kind: 'keyword'}, {text: ' const', kind: 'keyword'}, {text: ' useTodos', kind: 'function'}, {text: ' =', kind: 'punctuation'}, {text: ' (', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' =>', kind: 'punctuation'}],
+ [{text: ' useQuery', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' =>', kind: 'punctuation'}, {text: ' (', kind: 'punctuation'}, {text: '{', kind: 'punctuation'}],
+ [{text: ' queryKey', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' [', kind: 'punctuation'}, {text: "'todos'", kind: 'string'}, {text: ']', kind: 'punctuation'}, {text: ',', kind: 'punctuation'}],
+ [{text: ' queryFn', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' fetchTodos', kind: 'plain'}, {text: ',', kind: 'punctuation'}],
+ [{text: ' }', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ ],
+};
+
+export const themeSnippet: Snippet = {
+ name: 'badge.tsx',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: '//', kind: 'comment'}, {text: ' The', kind: 'comment'}, {text: ' same', kind: 'comment'}, {text: ' snippet,', kind: 'comment'}, {text: ' in', kind: 'comment'}, {text: ' every', kind: 'comment'}, {text: ' theme.', kind: 'comment'}],
+ [{text: 'export', kind: 'keyword'}, {text: ' function', kind: 'keyword'}, {text: ' Badge', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '{', kind: 'punctuation'}, {text: 'label', kind: 'plain'}, {text: '}', kind: 'punctuation'}, {text: ':', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}, {text: 'label', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' string', kind: 'type'}, {text: '}', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' size', kind: 'plain'}, {text: ' =', kind: 'punctuation'}, {text: ' 12', kind: 'number'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' return', kind: 'keyword'}, {text: ' <', kind: 'punctuation'}, {text: 'span', kind: 'plain'}, {text: ' class', kind: 'keyword'}, {text: '=', kind: 'punctuation'}, {text: '"badge"', kind: 'string'}, {text: '>', kind: 'punctuation'}, {text: '{', kind: 'punctuation'}, {text: 'label', kind: 'plain'}, {text: '}', kind: 'punctuation'}, {text: '', kind: 'punctuation'}, {text: 'span', kind: 'tag'}, {text: '>', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: '}', kind: 'punctuation'}],
+ ],
+};
diff --git a/apps/website/src/content/openSource.ts b/apps/website/src/content/openSource.ts
new file mode 100644
index 000000000..25abc401a
--- /dev/null
+++ b/apps/website/src/content/openSource.ts
@@ -0,0 +1,5 @@
+export const openSourceCopy = {
+ body: 'MIT licensed. Fix a bug, add a theme, or propose a feature.',
+ contribute: 'Become a contributor',
+ sponsor: 'Sponsor on Open Collective',
+} as const;
diff --git a/apps/website/src/content/richText.ts b/apps/website/src/content/richText.ts
new file mode 100644
index 000000000..f981c8dcd
--- /dev/null
+++ b/apps/website/src/content/richText.ts
@@ -0,0 +1 @@
+export type RichText = readonly (string | {readonly code: string})[];
diff --git a/apps/website/src/content/sizes.ts b/apps/website/src/content/sizes.ts
new file mode 100644
index 000000000..cb34b37e8
--- /dev/null
+++ b/apps/website/src/content/sizes.ts
@@ -0,0 +1,20 @@
+export type SocialSizeId = 'x' | 'linkedin' | 'square' | 'og';
+
+export type SocialSize = {
+ readonly id: SocialSizeId;
+ readonly label: string;
+ readonly width: number;
+ readonly height: number;
+};
+
+export const socialSizes: Readonly> = {
+ x: {id: 'x', label: 'X landscape', width: 1600, height: 900},
+ linkedin: {
+ id: 'linkedin',
+ label: 'LinkedIn portrait',
+ width: 1080,
+ height: 1350,
+ },
+ square: {id: 'square', label: 'Square', width: 1080, height: 1080},
+ og: {id: 'og', label: 'Open Graph', width: 1200, height: 630},
+};
diff --git a/apps/website/src/content/snippets.ts b/apps/website/src/content/snippets.ts
new file mode 100644
index 000000000..51655bc3a
--- /dev/null
+++ b/apps/website/src/content/snippets.ts
@@ -0,0 +1,46 @@
+import type {Snippet} from './code';
+
+export const heroSnippet: Snippet = {
+ name: 'snippet.tsx',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: 'import', kind: 'keyword'}, {text: ' {', kind: 'punctuation'}, {text: 'createSignal', kind: 'plain'}, {text: '}', kind: 'punctuation'}, {text: ' from', kind: 'keyword'}, {text: " 'solid-js'", kind: 'string'}, {text: ';', kind: 'punctuation'}],
+ [],
+ [{text: 'export', kind: 'keyword'}, {text: ' function', kind: 'keyword'}, {text: ' Snippet', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'props', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}, {text: 'code', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' string', kind: 'type'}, {text: '}', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' [', kind: 'punctuation'}, {text: 'copied', kind: 'plain'}, {text: ',', kind: 'punctuation'}, {text: ' setCopied', kind: 'plain'}, {text: ']', kind: 'punctuation'}, {text: ' =', kind: 'punctuation'}, {text: ' createSignal', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'false', kind: 'number'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' copy', kind: 'function'}, {text: ' =', kind: 'punctuation'}, {text: ' (', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' =>', kind: 'punctuation'}, {text: ' navigator', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'clipboard', kind: 'plain'}],
+ [{text: ' .', kind: 'punctuation'}, {text: 'writeText', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'props', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'code', kind: 'plain'}, {text: ')', kind: 'punctuation'}],
+ [{text: ' .', kind: 'punctuation'}, {text: 'then', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' =>', kind: 'punctuation'}, {text: ' setCopied', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'true', kind: 'number'}, {text: ')', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [],
+ [{text: ' return', kind: 'keyword'}, {text: ' (', kind: 'punctuation'}],
+ [{text: ' <', kind: 'punctuation'}, {text: 'button', kind: 'tag'}, {text: ' onClick', kind: 'attribute'}, {text: '=', kind: 'punctuation'}, {text: '{', kind: 'punctuation'}, {text: 'copy', kind: 'plain'}, {text: '}', kind: 'punctuation'}, {text: '>', kind: 'punctuation'}],
+ [{text: ' {', kind: 'punctuation'}, {text: 'copied', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' ?', kind: 'punctuation'}, {text: " 'Copied'", kind: 'string'}, {text: ' :', kind: 'punctuation'}, {text: " 'Copy", kind: 'string'}, {text: " code'", kind: 'string'}, {text: '}', kind: 'punctuation'}],
+ [{text: ' ', kind: 'punctuation'}, {text: 'button', kind: 'tag'}, {text: '>', kind: 'punctuation'}],
+ [{text: ' )', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: '}', kind: 'punctuation'}],
+ ],
+};
+
+export const heroSnippetWithCatch: Snippet = {
+ name: 'snippet.tsx',
+ language: 'TypeScript',
+ // oxfmt-ignore
+ lines: [
+ [{text: 'import', kind: 'keyword'}, {text: ' {', kind: 'punctuation'}, {text: 'createSignal', kind: 'plain'}, {text: '}', kind: 'punctuation'}, {text: ' from', kind: 'keyword'}, {text: " 'solid-js'", kind: 'string'}, {text: ';', kind: 'punctuation'}],
+ [],
+ [{text: 'export', kind: 'keyword'}, {text: ' function', kind: 'keyword'}, {text: ' Snippet', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'props', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}, {text: 'code', kind: 'property'}, {text: ':', kind: 'punctuation'}, {text: ' string', kind: 'type'}, {text: '}', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' {', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' [', kind: 'punctuation'}, {text: 'copied', kind: 'plain'}, {text: ',', kind: 'punctuation'}, {text: ' setCopied', kind: 'plain'}, {text: ']', kind: 'punctuation'}, {text: ' =', kind: 'punctuation'}, {text: ' createSignal', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'false', kind: 'number'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: ' const', kind: 'keyword'}, {text: ' copy', kind: 'function'}, {text: ' =', kind: 'punctuation'}, {text: ' (', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' =>', kind: 'punctuation'}, {text: ' navigator', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'clipboard', kind: 'plain'}],
+ [{text: ' .', kind: 'punctuation'}, {text: 'writeText', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'props', kind: 'plain'}, {text: '.', kind: 'punctuation'}, {text: 'code', kind: 'plain'}, {text: ')', kind: 'punctuation'}],
+ [{text: ' .', kind: 'punctuation'}, {text: 'then', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' =>', kind: 'punctuation'}, {text: ' setCopied', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'true', kind: 'number'}, {text: ')', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}],
+ [{text: ' .', kind: 'punctuation'}, {text: 'catch', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' =>', kind: 'punctuation'}, {text: ' setCopied', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: 'false', kind: 'number'}, {text: ')', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [],
+ [{text: ' return', kind: 'keyword'}, {text: ' (', kind: 'punctuation'}],
+ [{text: ' <', kind: 'punctuation'}, {text: 'button', kind: 'tag'}, {text: ' onClick', kind: 'attribute'}, {text: '=', kind: 'punctuation'}, {text: '{', kind: 'punctuation'}, {text: 'copy', kind: 'plain'}, {text: '}', kind: 'punctuation'}, {text: '>', kind: 'punctuation'}],
+ [{text: ' {', kind: 'punctuation'}, {text: 'copied', kind: 'function'}, {text: '(', kind: 'punctuation'}, {text: ')', kind: 'punctuation'}, {text: ' ?', kind: 'punctuation'}, {text: " 'Copied'", kind: 'string'}, {text: ' :', kind: 'punctuation'}, {text: " 'Copy", kind: 'string'}, {text: " code'", kind: 'string'}, {text: '}', kind: 'punctuation'}],
+ [{text: ' ', kind: 'punctuation'}, {text: 'button', kind: 'tag'}, {text: '>', kind: 'punctuation'}],
+ [{text: ' )', kind: 'punctuation'}, {text: ';', kind: 'punctuation'}],
+ [{text: '}', kind: 'punctuation'}],
+ ],
+};
diff --git a/apps/website/src/content/themes.ts b/apps/website/src/content/themes.ts
new file mode 100644
index 000000000..f7f12efc6
--- /dev/null
+++ b/apps/website/src/content/themes.ts
@@ -0,0 +1,254 @@
+import type {TokenKind} from './code';
+
+export type EditorThemeId =
+ | 'dracula'
+ | 'fleetDark'
+ | 'githubLight'
+ | 'materialOcean'
+ | 'nightOwlTheme'
+ | 'poimandres'
+ | 'synthwave84'
+ | 'vsCodeDark2026'
+ | 'vsCodeLight2026'
+ | 'xCodeLight';
+
+export type EditorTheme = {
+ readonly id: EditorThemeId;
+ readonly name: string;
+ readonly scheme: 'dark' | 'light';
+ readonly background: string;
+ readonly foreground: string;
+ readonly accent: string;
+ readonly frame: string;
+ readonly syntax: Readonly>;
+};
+
+export const editorThemes: Readonly> = {
+ dracula: {
+ id: 'dracula',
+ name: 'Dracula',
+ scheme: 'dark',
+ background: '#282a36',
+ foreground: '#f8f8f2',
+ accent: '#FF79C6',
+ frame:
+ 'linear-gradient(135deg, rgba(171,73,222,1) 0%,rgba(73,84,222,1) 100%)',
+ syntax: {
+ keyword: '#FF79C6',
+ string: '#f1fa8c',
+ number: '#BD93F9',
+ function: '#50FA7B',
+ type: '#8BE9FD',
+ tag: '#50FA7B',
+ attribute: '#8BE9FD',
+ property: '#66d9ef',
+ comment: '#BD93F9',
+ punctuation: '#8BE9FD',
+ plain: '#f8f8f2',
+ },
+ },
+ fleetDark: {
+ id: 'fleetDark',
+ name: 'Fleet Dark',
+ scheme: 'dark',
+ background: '#181818',
+ foreground: '#d1d1d1',
+ accent: '#82d2ce',
+ frame:
+ 'linear-gradient(152deg, rgb(87% 61% 43%) 0%, rgb(49% 14% 95%) 100%)',
+ syntax: {
+ keyword: '#82d2ce',
+ string: '#E394DC',
+ number: '#EBC88D',
+ function: '#EBC88D',
+ type: '#82d2ce',
+ tag: '#87c3ff',
+ attribute: '#AF9CFF',
+ property: '#AF9CFF',
+ comment: '#898989',
+ punctuation: '#d1d1d1',
+ plain: '#d1d1d1',
+ },
+ },
+ githubLight: {
+ id: 'githubLight',
+ name: 'GitHub Light',
+ scheme: 'light',
+ background: '#ffffff',
+ foreground: '#1F2328',
+ accent: '#cf222e',
+ frame:
+ 'linear-gradient(-45deg, rgba(73,84,222,1) 0%,rgba(73,221,216,1) 100%)',
+ syntax: {
+ keyword: '#cf222e',
+ string: '#0a3069',
+ number: '#0a3069',
+ function: '#6639ba',
+ type: '#0550ae',
+ tag: '#116329',
+ attribute: '#0550ae',
+ property: '#0a3069',
+ comment: '#57606a',
+ punctuation: '#bf8700',
+ plain: '#1F2328',
+ },
+ },
+ materialOcean: {
+ id: 'materialOcean',
+ name: 'Material Ocean',
+ scheme: 'dark',
+ background: '#212d33',
+ foreground: '#ffffff',
+ accent: '#C792EA',
+ frame:
+ 'linear-gradient(to right bottom, #2be7b5, #1edea2, #16d58f, #13cb7c, #16c268, #0db866, #04ae64, #00a462, #00976c, #008971, #007b72, #006d6d)',
+ syntax: {
+ keyword: '#C792EA',
+ string: '#C3E88D',
+ number: '#F78C6C',
+ function: '#82AAFF',
+ type: '#f07178',
+ tag: '#C3E88D',
+ attribute: '#C792EA',
+ property: '#82AAFF',
+ comment: '#546E7A',
+ punctuation: '#89DDFF',
+ plain: '#ffffff',
+ },
+ },
+ nightOwlTheme: {
+ id: 'nightOwlTheme',
+ name: 'Night Owl',
+ scheme: 'dark',
+ background: '#041c31',
+ foreground: '#D0D8E5',
+ accent: '#c792ea',
+ frame:
+ 'linear-gradient(140deg, rgb(9, 171, 241), rgb(5, 105, 148), rgb(4, 84, 118), rgb(6, 119, 167))',
+ syntax: {
+ keyword: '#c792ea',
+ string: '#ffcb8b',
+ number: '#F78C6C',
+ function: '#82AAFF',
+ type: '#c5e478',
+ tag: '#caece6',
+ attribute: '#D0D8E5',
+ property: '#82AAFF',
+ comment: '#637777',
+ punctuation: '#5f7e97',
+ plain: '#D0D8E5',
+ },
+ },
+ poimandres: {
+ id: 'poimandres',
+ name: 'Poimandres',
+ scheme: 'dark',
+ background: '#1b1e28',
+ foreground: '#e4f0fb',
+ accent: '#5DE4c7',
+ frame: 'linear-gradient(140deg, rgb(165, 142, 251), rgb(65, 206, 189))',
+ syntax: {
+ keyword: '#5DE4c7',
+ string: '#5DE4c7',
+ number: '#5DE4c7',
+ function: '#c0cad5',
+ type: '#767c9d',
+ tag: '#5DE4c7',
+ attribute: '#91B4D5',
+ property: '#ADD7FF',
+ comment: '#767c9d',
+ punctuation: '#a6accd',
+ plain: '#e4f0fb',
+ },
+ },
+ synthwave84: {
+ id: 'synthwave84',
+ name: 'SynthWave ’84',
+ scheme: 'dark',
+ background: '#261f3e',
+ foreground: '#ff7edb',
+ accent: '#fede5d',
+ frame:
+ 'linear-gradient(to right top, #7f469d, #8242aa, #833db7, #8338c4, #8233d2, #8a35da, #9336e2, #9b38ea, #af41ee, #c24af2, #d554f7, #e65ffb)',
+ syntax: {
+ keyword: '#fede5d',
+ string: '#ff8b39',
+ number: '#ff8b39',
+ function: '#36f9f6',
+ type: '#fe4450',
+ tag: '#fe4450',
+ attribute: '#ff7edb',
+ property: '#ff7edb',
+ comment: '#848bbd',
+ punctuation: '#ff8b39',
+ plain: '#ff7edb',
+ },
+ },
+ vsCodeDark2026: {
+ id: 'vsCodeDark2026',
+ name: 'VSCode Dark 2026',
+ scheme: 'dark',
+ background: '#121314',
+ foreground: '#BBBEBF',
+ accent: '#ff7b72',
+ frame: 'linear-gradient(135deg, #3994BC 0%, #d2a8ff 100%)',
+ syntax: {
+ keyword: '#ff7b72',
+ string: '#a5d6ff',
+ number: '#b5cea8',
+ function: '#d2a8ff',
+ type: '#4EC9B0',
+ tag: '#7ee787',
+ attribute: '#9cdcfe',
+ property: '#c9d1d9',
+ comment: '#8b949e',
+ punctuation: '#BBBEBF',
+ plain: '#BBBEBF',
+ },
+ },
+ vsCodeLight2026: {
+ id: 'vsCodeLight2026',
+ name: 'VSCode Light 2026',
+ scheme: 'light',
+ background: '#FFFFFF',
+ foreground: '#202020',
+ accent: '#cf222e',
+ frame: 'linear-gradient(135deg, #0069CC 0%, #8250df 100%)',
+ syntax: {
+ keyword: '#cf222e',
+ string: '#0a3069',
+ number: '#098658',
+ function: '#8250df',
+ type: '#267f99',
+ tag: '#116329',
+ attribute: '#e50000',
+ property: '#1f2328',
+ comment: '#6e7781',
+ punctuation: '#202020',
+ plain: '#202020',
+ },
+ },
+ xCodeLight: {
+ id: 'xCodeLight',
+ name: 'Xcode Light',
+ scheme: 'light',
+ background: '#FFF',
+ foreground: '#191919',
+ accent: '#c541ad',
+ frame:
+ 'linear-gradient(to right bottom, #ffcc99, #f6bd83, #edad6e, #e49e59, #da8f44)',
+ syntax: {
+ keyword: '#c541ad',
+ string: '#D23423',
+ number: '#322397',
+ function: '#9157ea',
+ type: '#1E566A',
+ tag: '#9157ea',
+ attribute: '#59458B',
+ property: '#1E566A',
+ comment: '#7F8C98',
+ punctuation: '#1F1F24',
+ plain: '#191919',
+ },
+ },
+};
diff --git a/apps/website/src/core/colorScheme.ts b/apps/website/src/core/colorScheme.ts
new file mode 100644
index 000000000..ae03d5908
--- /dev/null
+++ b/apps/website/src/core/colorScheme.ts
@@ -0,0 +1,63 @@
+export type ColorScheme = 'light' | 'dark';
+
+export const colorSchemeStorageKey = 'codeimage:landing-color-scheme';
+
+export const themeColors: Readonly> = {
+ light: '#f1f1f1',
+ dark: '#111111',
+};
+
+function isColorScheme(value: unknown): value is ColorScheme {
+ return value === 'light' || value === 'dark';
+}
+
+function applyStoredColorScheme(
+ key: string,
+ colors: Readonly>,
+) {
+ let stored: string | null = null;
+ try {
+ stored = localStorage.getItem(key);
+ } catch {
+ return;
+ }
+ if (stored !== 'light' && stored !== 'dark') return;
+ const scheme = stored;
+ document.documentElement.dataset.cuiTheme = scheme;
+ document.addEventListener('DOMContentLoaded', () => {
+ for (const meta of document.querySelectorAll('meta[name="theme-color"]')) {
+ meta.setAttribute('content', colors[scheme]);
+ }
+ });
+}
+
+export const colorSchemeScript = `(${applyStoredColorScheme.toString()})(${JSON.stringify(colorSchemeStorageKey)},${JSON.stringify(themeColors)})`;
+
+export function systemColorScheme(): ColorScheme {
+ return matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
+}
+
+export function effectiveColorScheme(): ColorScheme {
+ const chosen = document.documentElement.dataset.cuiTheme;
+ return isColorScheme(chosen) ? chosen : systemColorScheme();
+}
+
+export function hasChosenColorScheme() {
+ return isColorScheme(document.documentElement.dataset.cuiTheme);
+}
+
+export function paintThemeColor(scheme: ColorScheme) {
+ for (const meta of document.querySelectorAll('meta[name="theme-color"]')) {
+ meta.setAttribute('content', themeColors[scheme]);
+ }
+}
+
+export function chooseColorScheme(scheme: ColorScheme) {
+ document.documentElement.dataset.cuiTheme = scheme;
+ paintThemeColor(scheme);
+ try {
+ localStorage.setItem(colorSchemeStorageKey, scheme);
+ } catch {
+ return;
+ }
+}
diff --git a/apps/website/src/core/constants.ts b/apps/website/src/core/constants.ts
index 88fb8ba3d..927255c6d 100644
--- a/apps/website/src/core/constants.ts
+++ b/apps/website/src/core/constants.ts
@@ -1,11 +1,17 @@
-export const mainWebsiteLink = 'https://app.codeimage.dev';
-export const betterCommentsForGitHubLink =
- 'https://better-comments-for-github.netlify.app';
export const websiteUrl = 'https://codeimage.dev';
-export const websiteTitle =
- 'CodeImage - Manage and beautify your code screenshots';
-export const websiteDescription =
- 'CodeImage is the newest tool to help developers to manage their snippets and create beautiful screenshots of their source code';
-export const websiteThemeColor = '#111111';
-export const ogImageUrl =
- 'https://github.com/riccardoperra/codeimage/blob/main/assets/codeimage_card.png?raw=true';
+export const editorUrl = 'https://app.codeimage.dev';
+export const repositoryUrl = 'https://github.com/riccardoperra/codeimage';
+export const issuesUrl = `${repositoryUrl}/issues`;
+export const releasesUrl = `${repositoryUrl}/releases`;
+export const contributingUrl = `${repositoryUrl}/blob/main/CONTRIBUTING.md`;
+export const cliPackage = '@codeimage-app/cli';
+export const skillSource = 'riccardoperra/codeimage';
+export const cliDocsUrl = `${repositoryUrl}/tree/main/packages/cli`;
+export const codeUiUrl = 'https://github.com/riccardoperra/codeui';
+export const openCollectiveUrl = 'https://opencollective.com/codeimage';
+export const takumiUrl = 'https://takumi.kane.tw/';
+export const betterCommentsForGitHubUrl =
+ 'https://better-comments-for-github.netlify.app';
+export const ogImageUrl = `${websiteUrl}/og.png`;
+export const repositoryStatsUrl =
+ 'https://ungh.cc/repos/riccardoperra/codeimage';
diff --git a/apps/website/src/core/cssTokens.ts b/apps/website/src/core/cssTokens.ts
new file mode 100644
index 000000000..0e053a795
--- /dev/null
+++ b/apps/website/src/core/cssTokens.ts
@@ -0,0 +1,12 @@
+export function cssValue(name: string): string {
+ return getComputedStyle(document.documentElement)
+ .getPropertyValue(name)
+ .trim();
+}
+
+export function cssDuration(name: string): number {
+ const value = cssValue(name);
+ if (value.endsWith('ms')) return parseFloat(value);
+ if (value.endsWith('s')) return parseFloat(value) * 1000;
+ return 0;
+}
diff --git a/apps/website/src/core/inputModality.ts b/apps/website/src/core/inputModality.ts
new file mode 100644
index 000000000..aa1566f20
--- /dev/null
+++ b/apps/website/src/core/inputModality.ts
@@ -0,0 +1,24 @@
+export function trackInputModality() {
+ const root = document.documentElement;
+ const onKeyDown = (event: KeyboardEvent) => {
+ if (event.metaKey || event.ctrlKey || event.altKey) return;
+ root.dataset.cuiInput = 'keyboard';
+ };
+ const onPointerDown = () => {
+ root.dataset.cuiInput = 'pointer';
+ };
+ addEventListener('keydown', onKeyDown, true);
+ addEventListener('pointerdown', onPointerDown, true);
+ return () => {
+ removeEventListener('keydown', onKeyDown, true);
+ removeEventListener('pointerdown', onPointerDown, true);
+ };
+}
+
+export function isKeyboardInput() {
+ return document.documentElement.dataset.cuiInput === 'keyboard';
+}
+
+export function prefersReducedMotion() {
+ return matchMedia('(prefers-reduced-motion: reduce)').matches;
+}
diff --git a/apps/website/src/core/packageManager.ts b/apps/website/src/core/packageManager.ts
new file mode 100644
index 000000000..0722ef510
--- /dev/null
+++ b/apps/website/src/core/packageManager.ts
@@ -0,0 +1,51 @@
+import {createSignal} from 'solid-js';
+
+export type PackageManager = 'pnpm' | 'npm';
+
+export const packageManagers: readonly PackageManager[] = ['pnpm', 'npm'];
+
+export const packageManagerStorageKey = 'codeimage:landing-package-manager';
+
+const runners: Readonly> = {
+ pnpm: 'pnpm dlx',
+ npm: 'npx',
+};
+
+const isPackageManager = (value: unknown): value is PackageManager =>
+ value === 'pnpm' || value === 'npm';
+
+const [packageManager, setPackageManager] =
+ createSignal('pnpm');
+
+export {packageManager};
+
+function applyStoredPackageManager(key: string) {
+ try {
+ const stored = localStorage.getItem(key);
+ if (stored === 'pnpm' || stored === 'npm') {
+ document.documentElement.dataset.packageManager = stored;
+ }
+ } catch {
+ return;
+ }
+}
+
+export const packageManagerScript = `(${applyStoredPackageManager.toString()})(${JSON.stringify(packageManagerStorageKey)})`;
+
+export function restorePackageManager() {
+ const stored = document.documentElement.dataset.packageManager;
+ if (isPackageManager(stored)) setPackageManager(stored);
+}
+
+export function choosePackageManager(manager: PackageManager) {
+ setPackageManager(manager);
+ document.documentElement.dataset.packageManager = manager;
+ try {
+ localStorage.setItem(packageManagerStorageKey, manager);
+ } catch {
+ return;
+ }
+}
+
+export const runPackage = (manager: PackageManager, name: string) =>
+ `${runners[manager]} ${name}`;
diff --git a/apps/website/src/core/repositoryStats.ts b/apps/website/src/core/repositoryStats.ts
new file mode 100644
index 000000000..e3581d497
--- /dev/null
+++ b/apps/website/src/core/repositoryStats.ts
@@ -0,0 +1,26 @@
+import {repositoryStatsUrl} from './constants';
+
+export type RepositoryStars = number | '?';
+
+function parseStars(body: unknown): RepositoryStars {
+ if (typeof body !== 'object' || body === null || !('repo' in body))
+ return '?';
+ const repo = body.repo;
+ if (typeof repo !== 'object' || repo === null || !('stars' in repo))
+ return '?';
+ return typeof repo.stars === 'number' ? repo.stars : '?';
+}
+
+export async function loadRepositoryStars(): Promise {
+ try {
+ const response = await fetch(repositoryStatsUrl);
+ return parseStars(await response.json());
+ } catch {
+ return '?';
+ }
+}
+
+export function formatStars(stars: number): string {
+ if (stars < 1000) return String(stars);
+ return `${Math.floor(stars / 1000)}k+`;
+}
diff --git a/apps/website/src/routeTree.gen.ts b/apps/website/src/routeTree.gen.ts
index 4776246e1..f134a222b 100644
--- a/apps/website/src/routeTree.gen.ts
+++ b/apps/website/src/routeTree.gen.ts
@@ -8,61 +8,61 @@
// You should NOT make any changes in this file as it will be overwritten.
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
-import { Route as rootRouteImport } from './routes/__root'
-import { Route as IndexRouteImport } from './routes/index'
+import {Route as rootRouteImport} from './routes/__root';
+import {Route as IndexRouteImport} from './routes/index';
const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => rootRouteImport,
-} as any)
+} as any);
export interface FileRoutesByFullPath {
- '/': typeof IndexRoute
+ '/': typeof IndexRoute;
}
export interface FileRoutesByTo {
- '/': typeof IndexRoute
+ '/': typeof IndexRoute;
}
export interface FileRoutesById {
- __root__: typeof rootRouteImport
- '/': typeof IndexRoute
+ __root__: typeof rootRouteImport;
+ '/': typeof IndexRoute;
}
export interface FileRouteTypes {
- fileRoutesByFullPath: FileRoutesByFullPath
- fullPaths: '/'
- fileRoutesByTo: FileRoutesByTo
- to: '/'
- id: '__root__' | '/'
- fileRoutesById: FileRoutesById
+ fileRoutesByFullPath: FileRoutesByFullPath;
+ fullPaths: '/';
+ fileRoutesByTo: FileRoutesByTo;
+ to: '/';
+ id: '__root__' | '/';
+ fileRoutesById: FileRoutesById;
}
export interface RootRouteChildren {
- IndexRoute: typeof IndexRoute
+ IndexRoute: typeof IndexRoute;
}
declare module '@tanstack/solid-router' {
interface FileRoutesByPath {
'/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
- parentRoute: typeof rootRouteImport
- }
+ id: '/';
+ path: '/';
+ fullPath: '/';
+ preLoaderRoute: typeof IndexRouteImport;
+ parentRoute: typeof rootRouteImport;
+ };
}
}
const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
-}
+};
export const routeTree = rootRouteImport
._addFileChildren(rootRouteChildren)
- ._addFileTypes()
+ ._addFileTypes();
-import type { getRouter } from './router.tsx'
-import type { createStart } from '@tanstack/solid-start'
+import type {getRouter} from './router.tsx';
+import type {createStart} from '@tanstack/solid-start';
declare module '@tanstack/solid-start' {
interface Register {
- ssr: true
- router: Awaited>
+ ssr: true;
+ router: Awaited>;
}
}
diff --git a/apps/website/src/routes/__root.tsx b/apps/website/src/routes/__root.tsx
index 2acf7af22..e682f8248 100644
--- a/apps/website/src/routes/__root.tsx
+++ b/apps/website/src/routes/__root.tsx
@@ -4,71 +4,83 @@ import {
Outlet,
Scripts,
} from '@tanstack/solid-router';
-import {TanStackRouterDevtools} from '@tanstack/solid-router-devtools';
-import {Suspense} from 'solid-js';
-
+import {onCleanup, onMount, Suspense} from 'solid-js';
import {HydrationScript} from 'solid-js/web';
-import {UmamiScript} from '~/components/Umami/UmamiScript.tsx';
-
-import {websiteThemeColor} from '~/core/constants';
+import '~/styles/global.css';
+import '@codeui/styles/theme.css';
+import '@codeui/styles/text.css';
+import '@codeui/styles/button.css';
+import '@codeui/styles/iconbutton.css';
+import '@codeui/styles/badge.css';
+import '@codeui/styles/segmentedcontrol.css';
+import '@codeui/styles/select.css';
+import '@codeui/styles/popover.css';
+import '@codeui/styles/optioncard.css';
+import '~/styles/tokens.css';
+import '~/styles/codeui-patches.css';
+import {UmamiScript} from '~/components/Umami/UmamiScript';
+import {colorSchemeScript, themeColors} from '~/core/colorScheme';
+import {packageManagerScript} from '~/core/packageManager';
+import {trackInputModality} from '~/core/inputModality';
import {publicAsset} from '~/core/publicAsset';
-import styleCss from '../styles.css?url';
+const aboveTheFoldFonts = [
+ 'Mona-Sans-Regular.woff2',
+ 'Mona-Sans-Medium.woff2',
+ 'Mona-Sans-SemiBold.woff2',
+];
+
+const fontPreload = (file: string) =>
+ ({
+ rel: 'preload',
+ href: publicAsset(`fonts/${file}`),
+ as: 'font',
+ type: 'font/woff2',
+ crossOrigin: 'anonymous',
+ }) as const;
export const Route = createRootRouteWithContext()({
head: () => ({
meta: [
{charSet: 'utf-8'},
{name: 'viewport', content: 'width=device-width, initial-scale=1'},
- {name: 'theme-color', content: websiteThemeColor},
+ {name: 'color-scheme', content: 'light dark'},
],
links: [
- {rel: 'stylesheet', href: styleCss},
+ ...aboveTheFoldFonts.map(fontPreload),
{rel: 'apple-touch-icon', href: publicAsset('apple-touch-icon.png')},
{rel: 'manifest', href: publicAsset('manifest.webmanifest')},
{rel: 'icon', type: 'image/svg+xml', href: publicAsset('favicon.svg')},
{rel: 'icon', href: publicAsset('favicon.ico')},
- {
- rel: 'preload',
- href: publicAsset('fonts/Mona-Sans-Bold.woff2'),
- as: 'font',
- type: 'font/woff2',
- },
- {
- rel: 'preload',
- href: publicAsset('fonts/Mona-Sans-Medium.woff2'),
- as: 'font',
- type: 'font/woff2',
- },
- {
- rel: 'preload',
- href: publicAsset('fonts/Mona-Sans-Regular.woff2'),
- as: 'font',
- type: 'font/woff2',
- },
- {
- rel: 'preload',
- href: publicAsset('fonts/Mona-Sans-SemiBold.woff2'),
- as: 'font',
- type: 'font/woff2',
- },
],
+ scripts: [{children: colorSchemeScript}, {children: packageManagerScript}],
}),
shellComponent: RootComponent,
});
function RootComponent() {
+ onMount(() => onCleanup(trackInputModality()));
+
return (
+
+
-
diff --git a/apps/website/src/routes/index.tsx b/apps/website/src/routes/index.tsx
index 4d6c1d1aa..823c04cec 100644
--- a/apps/website/src/routes/index.tsx
+++ b/apps/website/src/routes/index.tsx
@@ -1,77 +1,107 @@
import {createFileRoute} from '@tanstack/solid-router';
import {lazy} from 'solid-js';
-import MainPage from '~/components/Main/MainPage';
-import {
- ogImageUrl,
- websiteDescription,
- websiteTitle,
- websiteUrl,
-} from '~/core/constants';
-import {publicAsset} from '~/core/publicAsset';
-import {breakpoints} from '~/theme/breakpoints';
-import {loadMainData} from '../components/Main/MainData.tsx';
+import {NoHydration} from 'solid-js/web';
+import {CommandMenu} from '~/components/CommandMenu/CommandMenu';
+import {CommandMenuTrigger} from '~/components/CommandMenu/CommandMenuTrigger';
+import {createCommandMenu} from '~/components/CommandMenu/createCommandMenu';
+import {metaCopy, studioCopy} from '~/content/copy';
+import {faqJsonLd} from '~/content/faq';
+import {ogImageUrl, websiteUrl} from '~/core/constants';
+import {loadRepositoryStars} from '~/core/repositoryStats';
+import {createHeroEditor} from '~/sections/Hero/heroEditor';
+import {Hero} from '~/sections/Hero/Hero';
+import {Nav} from '~/sections/Nav/Nav';
-const EditorSteps = lazy(
- () => import('../components/Landing/EditorSteps/EditorSteps'),
-);
+const Animate = lazy(() => import('~/sections/Animate/Animate'));
+const Looks = lazy(() => import('~/sections/Looks/Looks'));
+const Annotate = lazy(() => import('~/sections/Annotate/Annotate'));
+const Export = lazy(() => import('~/sections/Export/Export'));
+const Cli = lazy(() => import('~/sections/Cli/Cli'));
+const Agents = lazy(() => import('~/sections/Agents/Agents'));
+const Faq = lazy(() => import('~/sections/Faq/Faq'));
+const CodeUi = lazy(() => import('~/sections/CodeUi/CodeUi'));
+const OpenSource = lazy(() => import('~/sections/OpenSource/OpenSource'));
+const Closing = lazy(() => import('~/sections/Closing/Closing'));
+const Footer = lazy(() => import('~/sections/Footer/Footer'));
-const OpenSource = lazy(
- () => import('../components/Landing/OpenSource/OpenSource'),
-);
-
-const Showcase = lazy(() => import('../components/Landing/Showcase/Showcase'));
-
-const Footer = lazy(() => import('../components/Footer/Footer'));
+const softwareApplication = {
+ '@context': 'https://schema.org',
+ '@type': 'SoftwareApplication',
+ name: metaCopy.siteName,
+ url: websiteUrl,
+ applicationCategory: 'DeveloperApplication',
+ operatingSystem: 'Web',
+ offers: {'@type': 'Offer', price: '0', priceCurrency: 'USD'},
+ license: 'https://opensource.org/licenses/MIT',
+};
export const Route = createFileRoute('/')({
head: () => ({
meta: [
- {title: websiteTitle},
- {name: 'title', content: 'CodeImage'},
- {name: 'description', content: websiteDescription},
+ {title: metaCopy.title},
+ {name: 'description', content: metaCopy.description},
{property: 'og:type', content: 'website'},
+ {property: 'og:site_name', content: metaCopy.siteName},
{property: 'og:url', content: websiteUrl},
- {property: 'og:title', content: websiteTitle},
- {property: 'og:description', content: websiteDescription},
+ {property: 'og:title', content: metaCopy.title},
+ {property: 'og:description', content: metaCopy.description},
{property: 'og:image', content: ogImageUrl},
{name: 'twitter:card', content: 'summary_large_image'},
- {property: 'twitter:url', content: websiteUrl},
- {property: 'twitter:title', content: websiteTitle},
- {property: 'twitter:description', content: websiteDescription},
- {property: 'twitter:image', content: ogImageUrl},
- ],
- links: [
- {rel: 'canonical', href: websiteUrl},
- {
- rel: 'preload',
- href: publicAsset('landing/codeimage_preview_mobile.webp'),
- as: 'image',
- media: `(min-width: ${breakpoints.tablet}px) and (max-width: ${
- breakpoints.desktop - 1
- }px)`,
- },
- {
- rel: 'preload',
- href: publicAsset('landing/codeimage_preview_desktop.webp'),
- as: 'image',
- media: `(min-width: ${breakpoints.desktop}px)`,
- },
+ {name: 'twitter:title', content: metaCopy.title},
+ {name: 'twitter:description', content: metaCopy.description},
+ {name: 'twitter:image', content: ogImageUrl},
+ {'script:ld+json': softwareApplication},
+ {'script:ld+json': faqJsonLd},
],
+ links: [{rel: 'canonical', href: websiteUrl}],
}),
- loader: () => loadMainData(),
+ loader: async () => ({stars: await loadRepositoryStars()}),
component: Home,
});
-export default function Home() {
+function Home() {
const data = Route.useLoaderData();
+ const editor = createHeroEditor();
+ const commandMenu = createCommandMenu();
return (
-
-
-
-
-
-
-
+ <>
+
+
+
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ scrollTo({top: 0})}
+ />
+ >
);
}
diff --git a/apps/website/src/sections/Agents/Agents.module.css b/apps/website/src/sections/Agents/Agents.module.css
new file mode 100644
index 000000000..baa68fc27
--- /dev/null
+++ b/apps/website/src/sections/Agents/Agents.module.css
@@ -0,0 +1,98 @@
+.demo {
+ display: flex;
+ flex-direction: column;
+ gap: var(--cui-space-2);
+ padding: var(--cui-space-2);
+}
+
+.bar {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--cui-space-3);
+ min-height: var(--cui-control-height-md);
+ padding: var(--cui-space-1) var(--cui-space-1) 0 var(--cui-space-1);
+}
+
+.mode {
+ display: inline-flex;
+ align-items: center;
+ gap: var(--cui-space-2);
+}
+
+.modeBadge {
+ pointer-events: none;
+}
+
+.modeStatus {
+ display: none;
+}
+
+.control {
+ flex: none;
+ margin-left: auto;
+}
+
+.body {
+ display: grid;
+ grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
+ gap: var(--cui-space-2);
+}
+
+@media (max-width: 1023px) {
+ .body {
+ grid-template-columns: minmax(0, 1fr);
+ }
+}
+
+.body > * {
+ transition:
+ translate var(--ci-shift-duration) var(--ci-ease-in-out),
+ opacity var(--cui-motion-duration-rise) var(--cui-motion-ease-out),
+ scale var(--cui-motion-duration-rise) var(--cui-motion-ease-out);
+}
+
+.body:not([data-revealed]) > :last-child {
+ opacity: 0;
+ scale: 0.97;
+ transition-duration: var(--cui-motion-duration-panel);
+}
+
+.body[data-revealed] > :last-child {
+ transition-delay: calc(var(--ci-shift-duration) / 2);
+}
+
+@media (min-width: 1024px) {
+ .body:not([data-revealed]) > :first-child {
+ translate: 70% 0;
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .body > * {
+ transition-property: opacity;
+ }
+
+ .body:not([data-revealed]) > :first-child {
+ translate: none;
+ }
+}
+
+@media (max-width: 767px) {
+ .bar {
+ flex-wrap: wrap;
+ }
+
+ .modes {
+ display: flex;
+ width: 100%;
+ }
+
+ .modeBadge {
+ display: none;
+ }
+
+ .modeStatus {
+ display: inline-flex;
+ }
+}
diff --git a/apps/website/src/sections/Agents/Agents.tsx b/apps/website/src/sections/Agents/Agents.tsx
new file mode 100644
index 000000000..02f0dcc6e
--- /dev/null
+++ b/apps/website/src/sections/Agents/Agents.tsx
@@ -0,0 +1,151 @@
+import {createSignal, type JSX, onCleanup, onMount, Show} from 'solid-js';
+import {Badge} from '~/components/Badge/Badge';
+import {Button} from '~/components/Button/Button';
+import {PlayIcon} from '~/components/Icon/icons';
+import {Island} from '~/components/Island/Island';
+import {Section, sectionHeading} from '~/components/Section/Section';
+import {SegmentedControl} from '~/components/SegmentedControl/SegmentedControl';
+import {type AgentMode, agentModes, agentsCopy} from '~/content/agents';
+import {sectionCopy} from '~/content/copy';
+import {prefersReducedMotion} from '~/core/inputModality';
+import styles from './Agents.module.css';
+import {Facts} from './Facts';
+import {Setup} from './Setup';
+import {PauseIcon, ReplayIcon} from './icons';
+import {createPlayer, type Player, type Playback} from './player';
+import {timelines} from './scripts';
+import {Stage} from './Stage';
+import {Transcript} from './Transcript';
+
+const controls: Readonly<
+ Record<
+ Playback,
+ {label: keyof typeof agentsCopy.control; icon: () => JSX.Element}
+ >
+> = {
+ armed: {label: 'play', icon: () => },
+ playing: {label: 'pause', icon: PauseIcon},
+ paused: {label: 'play', icon: () => },
+ finished: {label: 'replay', icon: ReplayIcon},
+};
+
+function autoplayOnce(player: Player, target: Element) {
+ let first = true;
+ const observer = new IntersectionObserver(
+ ([entry]) => {
+ if (first) {
+ first = false;
+ if (entry.isIntersecting) return observer.disconnect();
+ return player.arm();
+ }
+ if (!entry.isIntersecting || player.state.playback !== 'armed') return;
+ observer.disconnect();
+ player.play();
+ },
+ {threshold: 0.35},
+ );
+ observer.observe(target);
+ return () => observer.disconnect();
+}
+
+function ModeLabel(props: {mode: AgentMode}) {
+ const mode = () => agentsCopy.modes[props.mode];
+ return (
+
+ {mode().label}
+
+
+ );
+}
+
+export default function Agents() {
+ const [mode, setMode] = createSignal('agent');
+ const [animated, setAnimated] = createSignal(false);
+ const timeline = () => timelines[mode()];
+ const player = createPlayer({
+ length: () => timeline().steps.length,
+ timing: index => timeline().steps[index - 1],
+ leadIn: () => timeline().leadIn,
+ });
+ const frames = () => timeline().frames;
+ const revealed = () => player.state.cursor.index >= timeline().revealAt;
+ const frame = () =>
+ frames()[Math.min(player.state.cursor.index, frames().length - 1)];
+ const control = () => controls[player.state.playback];
+ const modeOptions = agentModes.map(value => ({
+ value,
+ label: ,
+ }));
+ let demo: HTMLDivElement | undefined;
+
+ onMount(() => {
+ if (prefersReducedMotion() || !demo) return;
+ setAnimated(true);
+ onCleanup(autoplayOnce(player, demo));
+ });
+
+ const changeMode = (next: AgentMode) => {
+ setMode(next);
+ if (animated()) player.replay();
+ else player.finish();
+ };
+
+ return (
+
+
+
+
+
+
+
+
+
+
+ player.jump(index)}
+ />
+
+
+
+
+
+
+ );
+}
diff --git a/apps/website/src/sections/Agents/Facts.module.css b/apps/website/src/sections/Agents/Facts.module.css
new file mode 100644
index 000000000..1fe6cf1cb
--- /dev/null
+++ b/apps/website/src/sections/Agents/Facts.module.css
@@ -0,0 +1,71 @@
+.facts {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: var(--cui-space-4) var(--cui-space-8);
+ margin-top: var(--cui-space-8);
+ padding: 0 var(--cui-space-6);
+}
+
+.fact {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ gap: var(--cui-space-2);
+}
+
+.title {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: var(--cui-space-2);
+ font-size: var(--cui-font-size-md);
+ font-weight: var(--cui-font-weight-semibold);
+ line-height: var(--cui-font-line-height-snug);
+}
+
+.body {
+ text-wrap: pretty;
+}
+
+.code {
+ font-size: 0.92em;
+ white-space: nowrap;
+ color: var(--cui-text-default);
+}
+
+.link {
+ gap: var(--cui-space-1);
+ margin-top: auto;
+ padding-top: var(--cui-space-1);
+ font-size: var(--cui-font-size-sm);
+ color: var(--cui-text-default);
+ text-decoration: underline;
+ text-decoration-color: var(--cui-text-tertiary);
+ text-underline-offset: 0.2em;
+ border-radius: var(--cui-radius-xs);
+ transition: text-decoration-color var(--cui-motion-duration-fast)
+ var(--cui-motion-ease-out);
+}
+
+@media (hover: hover) and (pointer: fine) {
+ .link:hover {
+ text-decoration-color: currentColor;
+ }
+}
+
+.link:focus-visible {
+ outline: var(--cui-focus-width) solid var(--cui-focus-color);
+ outline-offset: var(--cui-focus-offset);
+}
+
+.linkIcon {
+ width: var(--cui-space-3);
+ height: var(--cui-space-3);
+ color: var(--cui-text-hint);
+}
+
+@media (max-width: 767px) {
+ .facts {
+ grid-template-columns: minmax(0, 1fr);
+ }
+}
diff --git a/apps/website/src/sections/Agents/Facts.tsx b/apps/website/src/sections/Agents/Facts.tsx
new file mode 100644
index 000000000..d3dd3d896
--- /dev/null
+++ b/apps/website/src/sections/Agents/Facts.tsx
@@ -0,0 +1,48 @@
+import '@codeui/styles/link.css';
+import {linkStyleProps} from '@codeui/styles/link';
+import {textStyleProps} from '@codeui/styles/text';
+import {For, Show} from 'solid-js';
+import {ExternalIcon} from '~/components/Icon/icons';
+import {agentsCopy} from '~/content/agents';
+import {cliDocsUrl} from '~/core/constants';
+import {RichTextView} from '~/components/RichTextView/RichTextView';
+import styles from './Facts.module.css';
+
+export function Facts() {
+ return (
+
+ );
+}
diff --git a/apps/website/src/sections/Agents/Setup.module.css b/apps/website/src/sections/Agents/Setup.module.css
new file mode 100644
index 000000000..3429a3abc
--- /dev/null
+++ b/apps/website/src/sections/Agents/Setup.module.css
@@ -0,0 +1,140 @@
+.setup {
+ display: flex;
+ flex-direction: column;
+ gap: var(--cui-space-5);
+ margin-top: var(--cui-space-4);
+ padding: var(--cui-space-6);
+}
+
+.head {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: var(--cui-space-4);
+}
+
+.intro {
+ display: flex;
+ flex-direction: column;
+ gap: var(--cui-space-2);
+ max-width: 60ch;
+}
+
+.title {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: var(--cui-space-2);
+ font-size: var(--cui-font-size-lg);
+ font-weight: var(--cui-font-weight-semibold);
+ line-height: var(--cui-font-line-height-snug);
+}
+
+.manager {
+ flex: none;
+}
+
+.ways {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: var(--cui-space-4);
+}
+
+.way {
+ display: flex;
+ flex-direction: column;
+ align-items: stretch;
+ gap: var(--cui-space-3);
+ min-width: 0;
+ padding-top: var(--cui-space-4);
+ border-top: var(--cui-border-width) solid var(--cui-border-divider);
+}
+
+.wayTitle {
+ display: flex;
+ align-items: center;
+ gap: var(--cui-space-2);
+ font-size: var(--cui-font-size-md);
+ font-weight: var(--cui-font-weight-semibold);
+}
+
+.wayIndex {
+ display: inline-grid;
+ place-items: center;
+ width: var(--cui-space-5);
+ height: var(--cui-space-5);
+ border-radius: var(--cui-radius-full);
+ background: var(--cui-surface-input);
+ font-size: var(--cui-font-size-caption);
+ font-variant-numeric: tabular-nums;
+ color: var(--cui-text-muted);
+}
+
+.body {
+ text-wrap: pretty;
+}
+
+.inline {
+ font-size: 0.92em;
+ white-space: nowrap;
+ color: var(--cui-text-default);
+}
+
+.promptSwitch {
+ align-self: flex-start;
+}
+
+.box {
+ display: flex;
+ align-items: flex-start;
+ gap: var(--cui-space-3);
+ padding: var(--cui-space-3) var(--cui-space-2) var(--cui-space-3)
+ var(--cui-space-4);
+ background: var(--cui-surface-input);
+ border-radius: var(--cui-radius-md);
+ font-family: var(--cui-font-family-mono);
+ font-size: var(--cui-font-size-sm);
+ line-height: var(--cui-font-line-height-normal);
+}
+
+.dollar {
+ flex: none;
+ padding-top: var(--cui-space-1);
+ color: var(--cui-text-tertiary);
+ user-select: none;
+}
+
+.code,
+.prompt {
+ flex: 1;
+ min-width: 0;
+ padding-top: var(--cui-space-1);
+ font-size: inherit;
+}
+
+.code span {
+ white-space: normal;
+ overflow-wrap: anywhere;
+}
+
+.prompt {
+ color: var(--cui-text-default);
+ text-wrap: pretty;
+ overflow-wrap: anywhere;
+}
+
+@media (max-width: 1023px) {
+ .ways {
+ grid-template-columns: minmax(0, 1fr);
+ }
+}
+
+@media (max-width: 767px) {
+ .setup {
+ padding: var(--cui-space-5);
+ }
+
+ .head {
+ flex-direction: column;
+ }
+}
diff --git a/apps/website/src/sections/Agents/Setup.tsx b/apps/website/src/sections/Agents/Setup.tsx
new file mode 100644
index 000000000..fd3eb3c5b
--- /dev/null
+++ b/apps/website/src/sections/Agents/Setup.tsx
@@ -0,0 +1,105 @@
+import {textStyleProps} from '@codeui/styles/text';
+import {createSignal, type JSX} from 'solid-js';
+import {Badge} from '~/components/Badge/Badge';
+import {CommandText} from '~/components/CommandText/CommandText';
+import {CopyButton} from '~/components/CopyButton/CopyButton';
+import {Island} from '~/components/Island/Island';
+import {PackageManagerSwitch} from '~/components/PackageManagerSwitch/PackageManagerSwitch';
+import {SegmentedControl} from '~/components/SegmentedControl/SegmentedControl';
+import {type AgentPrompt, agentsCopy} from '~/content/agents';
+import {RichTextView} from '~/components/RichTextView/RichTextView';
+import type {RichText} from '~/content/richText';
+import {packageManager} from '~/core/packageManager';
+import styles from './Setup.module.css';
+
+const copy = agentsCopy.setup;
+
+const promptOptions = copy.prompts.map(prompt => ({
+ value: prompt.id,
+ label: prompt.label,
+}));
+
+function Way(props: {
+ index: number;
+ title: string;
+ body: RichText;
+ children: JSX.Element;
+}) {
+ return (
+
+
+
+ {props.index}
+
+ {props.title}
+
+
+
+
+ {props.children}
+
+ );
+}
+
+function InstallWay() {
+ const command = () => copy.install.command(packageManager());
+ return (
+
+
+
+ $
+
+
+
+
+
+
+
+
+ );
+}
+
+function AskWay() {
+ const [selected, setSelected] = createSignal('animation');
+ const prompt = () =>
+ copy.prompts.find(entry => entry.id === selected()) ?? copy.prompts[0];
+ const text = () => prompt().text(packageManager());
+ return (
+
+
+
+
+ );
+}
+
+export function Setup() {
+ return (
+
+
+
+
+ {copy.title}
+
+
+
{copy.hint}
+
+
+
+
+
+
+
+ {copy.note}
+
+ );
+}
diff --git a/apps/website/src/sections/Agents/Stage.module.css b/apps/website/src/sections/Agents/Stage.module.css
new file mode 100644
index 000000000..1041c8600
--- /dev/null
+++ b/apps/website/src/sections/Agents/Stage.module.css
@@ -0,0 +1,207 @@
+@property --agents-fill-angle {
+ syntax: '';
+ inherits: true;
+ initial-value: 135deg;
+}
+
+@property --agents-fill-from {
+ syntax: '';
+ inherits: true;
+ initial-value: transparent;
+}
+
+@property --agents-fill-to {
+ syntax: '';
+ inherits: true;
+ initial-value: transparent;
+}
+
+.stage {
+ --recolor: calc(var(--cui-motion-duration-rise) * 1.25);
+ --line-stagger: calc(var(--cui-motion-duration-fast) / 3);
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+ border-radius: var(--cui-radius-xl);
+ background: var(--cui-surface-canvas);
+}
+
+.canvas {
+ position: relative;
+ height: clamp(
+ calc(var(--cui-space-64) + var(--cui-space-12)),
+ 32vw,
+ calc(var(--cui-space-64) + var(--cui-space-48))
+ );
+ margin: var(--cui-space-6) var(--cui-space-6) 0;
+ container-type: size;
+}
+
+.image {
+ position: absolute;
+ inset: 0;
+ transition-property:
+ --agents-fill-angle, --agents-fill-from, --agents-fill-to;
+ transition-duration: var(--recolor);
+ transition-timing-function: var(--cui-motion-ease-out);
+}
+
+.image [data-window-style] {
+ transition-property:
+ --code-background, --code-foreground, --code-accent, --code-keyword,
+ --code-string, --code-number, --code-function, --code-type, --code-tag,
+ --code-attribute, --code-property, --code-comment, --code-punctuation,
+ --code-plain;
+ transition-duration: var(--recolor);
+ transition-timing-function: var(--cui-motion-ease-out);
+}
+
+.image [data-kind][data-shown] {
+ transition-delay:
+ 0s, 0s,
+ calc(var(--ci-morph-duration) * 0.4 + var(--token-y) * var(--line-stagger));
+}
+
+.slot {
+ position: absolute;
+ inset: 0;
+ display: grid;
+ place-items: center;
+ width: min(100cqw, calc(100cqh * var(--slot-ratio)));
+ height: auto;
+ aspect-ratio: var(--slot-ratio);
+ margin: auto;
+ border-radius: var(--ci-frame-radius);
+ background: color-mix(in srgb, var(--cui-surface-input) 55%, transparent);
+ font-family: var(--cui-font-family-mono);
+ font-size: var(--cui-font-size-caption);
+ color: var(--cui-text-hint);
+}
+
+.flash {
+ position: absolute;
+ inset: 0;
+ z-index: 3;
+ background: var(--ci-agents-flash);
+ opacity: 0;
+ pointer-events: none;
+}
+
+.dock {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ min-height: calc(var(--cui-space-16) + var(--cui-space-2));
+ padding: var(--cui-space-3) var(--cui-space-4);
+}
+
+.chip {
+ display: inline-flex;
+ align-items: center;
+ gap: var(--cui-space-2);
+ min-height: var(--cui-control-height-md);
+ padding: 0 var(--cui-space-3) 0 var(--cui-space-2-5);
+ border-radius: var(--cui-radius-full);
+ background: var(--cui-surface-menu);
+ box-shadow: var(--cui-shadow-menu);
+ font-size: var(--cui-font-size-sm);
+ white-space: nowrap;
+}
+
+.chipIcon {
+ color: var(--cui-text-hint);
+}
+
+.chipName {
+ font-family: var(--cui-font-family-mono);
+ font-weight: var(--cui-font-weight-medium);
+ color: var(--cui-text-default);
+}
+
+.chipMeta {
+ font-variant-numeric: tabular-nums;
+ color: var(--cui-text-muted);
+}
+
+.chipFast {
+ font-variant-numeric: tabular-nums;
+ font-weight: var(--cui-font-weight-medium);
+ color: var(--ci-success-ink);
+}
+
+.chipDone {
+ display: inline-flex;
+ align-items: center;
+ gap: var(--cui-space-1);
+ color: var(--cui-text-muted);
+}
+
+.chipCheck {
+ width: calc(var(--cui-space-3) + var(--cui-space-0-5));
+ height: calc(var(--cui-space-3) + var(--cui-space-0-5));
+ color: var(--ci-success-ink);
+}
+
+@media (prefers-reduced-motion: no-preference) {
+ .flash {
+ animation: flash calc(var(--cui-motion-duration-rise) * 1.25) ease-out;
+ }
+
+ .chip {
+ animation: drop var(--cui-motion-duration-rise) var(--cui-motion-ease-out)
+ calc(var(--cui-motion-duration-fast)) both;
+ }
+
+ .image {
+ animation: settle var(--cui-motion-duration-rise) var(--cui-motion-ease-out)
+ both;
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .chip {
+ animation: fade var(--cui-motion-duration-normal) ease-out both;
+ }
+}
+
+@keyframes flash {
+ 20% {
+ opacity: 1;
+ }
+}
+
+@keyframes drop {
+ from {
+ opacity: 0;
+ transform: translateY(calc(-1 * var(--cui-space-3))) scale(0.96);
+ }
+}
+
+@keyframes settle {
+ from {
+ opacity: 0;
+ transform: scale(0.98);
+ }
+}
+
+@keyframes fade {
+ from {
+ opacity: 0;
+ }
+}
+
+@media (max-width: 767px) {
+ .canvas {
+ height: clamp(
+ calc(var(--cui-space-48) + var(--cui-space-4)),
+ 62vw,
+ calc(var(--cui-space-64) + var(--cui-space-16))
+ );
+ margin: var(--cui-space-3) var(--cui-space-3) 0;
+ }
+
+ .dock {
+ min-height: calc(var(--cui-space-12) + var(--cui-space-2));
+ padding: var(--cui-space-2);
+ }
+}
diff --git a/apps/website/src/sections/Agents/Stage.tsx b/apps/website/src/sections/Agents/Stage.tsx
new file mode 100644
index 000000000..fee3495ef
--- /dev/null
+++ b/apps/website/src/sections/Agents/Stage.tsx
@@ -0,0 +1,148 @@
+import {createMemo, type JSX, Show, untrack} from 'solid-js';
+import {CodeWindow} from '~/components/CodeWindow/CodeWindow';
+import {windowMetrics} from '~/components/CodeWindow/metrics';
+import {Frame} from '~/components/Frame/Frame';
+import {CheckIcon} from '~/components/Icon/icons';
+import {agentsCopy} from '~/content/agents';
+import type {Snippet} from '~/content/code';
+import {socialSizes} from '~/content/sizes';
+import {editorThemes} from '~/content/themes';
+import {ImageFileIcon} from '~/components/Icon/icons';
+import type {DemoState, ImageState, SavedFile} from './model';
+import styles from './Stage.module.css';
+
+const twoStops =
+ /^linear-gradient\(\s*(-?[\d.]+deg)\s*,\s*(.+?)\s+0%\s*,\s*(.+?)\s+100%\s*\)$/;
+
+const interpolatedFill =
+ 'linear-gradient(var(--agents-fill-angle), var(--agents-fill-from), var(--agents-fill-to))';
+
+function fillVars(frame: string): JSX.CSSProperties | undefined {
+ const match = twoStops.exec(frame);
+ if (!match) return undefined;
+ return {
+ '--agents-fill-angle': match[1],
+ '--agents-fill-from': match[2],
+ '--agents-fill-to': match[3],
+ };
+}
+
+type ImageViewProps = {
+ image: ImageState;
+ snippets: readonly Snippet[];
+ exported: boolean;
+};
+
+function ImageView(props: ImageViewProps) {
+ const flashes = untrack(() => !props.exported);
+ const theme = () => editorThemes[props.image.theme];
+ const fill = () => fillVars(theme().frame);
+ const size = () =>
+ props.image.size ? socialSizes[props.image.size] : undefined;
+ const metrics = createMemo(() =>
+ windowMetrics(props.image.snippet, props.image.windowStyle),
+ );
+ const label = () =>
+ agentsCopy.image(
+ props.image.snippet.name,
+ theme().name,
+ size()?.label ?? agentsCopy.freeSize,
+ );
+
+ return (
+
+
+
+
+ }
+ >
+
+
+
+ );
+}
+
+function FileChip(props: {file: SavedFile}) {
+ const size = () => socialSizes[props.file.size];
+ return (
+
+
+
+ {props.file.name ?? props.file.format}
+
+
+ {agentsCopy.pixels(size().width, size().height)}
+
+
+ {ms => {agentsCopy.duration(ms())}}
+
+
+
+
+ {agentsCopy.downloaded}
+
+
+
+ );
+}
+
+export type StageProps = {
+ state: DemoState;
+ final: DemoState;
+ snippets: readonly Snippet[];
+ run: number;
+};
+
+export function Stage(props: StageProps) {
+ const slot = () => {
+ const size = props.final.image?.size;
+ return size ? socialSizes[size] : socialSizes.x;
+ };
+
+ return (
+
+
+
+
+ {agentsCopy.noImage}
+
+ }
+ >
+ {image => (
+
+ )}
+
+
+
+
+
+ {file => }
+
+
+
+ );
+}
diff --git a/apps/website/src/sections/Agents/Transcript.module.css b/apps/website/src/sections/Agents/Transcript.module.css
new file mode 100644
index 000000000..a26f3a7e9
--- /dev/null
+++ b/apps/website/src/sections/Agents/Transcript.module.css
@@ -0,0 +1,339 @@
+.transcript {
+ display: flex;
+ flex-direction: column;
+ gap: var(--cui-space-8);
+ min-width: 0;
+ padding: var(--cui-space-6) var(--cui-space-4) var(--cui-space-6)
+ var(--cui-space-6);
+}
+
+.turn {
+ display: flex;
+ flex-direction: column;
+ gap: var(--cui-space-2);
+ min-width: 0;
+}
+
+.who {
+ display: flex;
+ align-items: center;
+ gap: var(--cui-space-2);
+ font-size: var(--cui-font-size-caption);
+ font-weight: var(--cui-font-weight-medium);
+ line-height: var(--cui-font-line-height-caption);
+ color: var(--cui-text-hint);
+}
+
+.via {
+ padding: 0 var(--cui-space-1-5);
+ border-radius: var(--cui-radius-badge);
+ background: var(--cui-surface-input);
+ font-family: var(--cui-font-family-mono);
+ font-size: var(--cui-font-size-badge);
+ font-weight: var(--cui-font-weight-normal);
+ color: var(--cui-text-muted);
+}
+
+.turn[data-who='you'] {
+ align-items: flex-end;
+}
+
+.turn[data-who='you'] .request {
+ transform-origin: 100% 100%;
+}
+
+.turn[data-waiting] {
+ opacity: 0;
+}
+
+.turn[data-sent] .request {
+ animation:
+ bubble-send 560ms var(--ci-spring-bubble) both,
+ bubble-show var(--cui-motion-duration-fast) var(--cui-motion-ease-out) both;
+}
+
+.turn[data-sent] .who {
+ animation: bubble-show var(--cui-motion-duration-normal)
+ var(--cui-motion-ease-out) 180ms both;
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .turn[data-sent] .request {
+ animation: bubble-show var(--cui-motion-duration-normal) ease both;
+ }
+}
+
+@keyframes bubble-send {
+ from {
+ transform: translateY(0.75rem) scale(0.6);
+ }
+}
+
+@keyframes bubble-show {
+ from {
+ opacity: 0;
+ }
+}
+
+.request {
+ max-width: 34ch;
+ padding: var(--cui-space-3) var(--cui-space-4);
+ border-radius: var(--cui-radius-xl) var(--cui-radius-xl) var(--cui-radius-xs)
+ var(--cui-radius-xl);
+ background: var(--cui-action-brand-base);
+ color: var(--cui-action-brand-text);
+ font-size: var(--cui-font-size-lg);
+ font-weight: var(--cui-font-weight-medium);
+ line-height: var(--cui-font-line-height-snug);
+ text-wrap: pretty;
+}
+
+.slash {
+ font-family: var(--cui-font-family-mono);
+ font-size: 0.9em;
+ padding: 0.05em 0.35em;
+ border-radius: var(--cui-radius-xs);
+ background: color-mix(in srgb, var(--cui-action-brand-text) 18%, transparent);
+}
+
+.rows {
+ display: flex;
+ flex-direction: column;
+ gap: var(--cui-space-0-5);
+ margin-inline: calc(-1 * var(--cui-space-2));
+}
+
+.item {
+ transition:
+ opacity var(--cui-motion-duration-slow) var(--cui-motion-ease-out),
+ translate var(--cui-motion-duration-slow) var(--cui-motion-ease-out),
+ visibility 0s;
+}
+
+.item[data-status='hidden'] {
+ visibility: hidden;
+ opacity: 0;
+ translate: 0 var(--cui-space-1);
+ transition-duration: 0s;
+}
+
+.row {
+ display: flex;
+ align-items: center;
+ gap: var(--cui-space-3);
+ width: 100%;
+ min-height: var(--cui-control-height-md);
+ padding: var(--cui-space-1-5) var(--cui-space-2);
+ border: 0;
+ border-radius: var(--cui-radius-lg);
+ background: none;
+ font-family: var(--cui-font-family-mono);
+ font-size: var(--cui-font-size-sm);
+ line-height: var(--cui-font-line-height-normal);
+ text-align: left;
+ color: var(--cui-text-default);
+ cursor: pointer;
+ transition:
+ background-color var(--cui-motion-duration-fast) var(--cui-motion-ease-out),
+ color var(--cui-motion-duration-normal) var(--cui-motion-ease-out);
+}
+
+@media (hover: hover) and (pointer: fine) {
+ .row:hover {
+ background: var(--cui-surface-input);
+ }
+}
+
+.row:active,
+.row[data-current] {
+ background: var(--cui-surface-input);
+}
+
+.row[data-kind='command'] {
+ align-items: flex-start;
+}
+
+.row[data-kind='output'],
+.row[data-kind='exit'] {
+ min-height: var(--cui-control-height-sm);
+ padding-block: var(--cui-space-0-5);
+ padding-left: calc(
+ var(--cui-space-2) + var(--cui-space-4) + var(--cui-space-3)
+ );
+}
+
+.item[data-status='pending'] .row {
+ color: var(--cui-text-hint);
+}
+
+.mark {
+ position: relative;
+ flex: none;
+ display: grid;
+ place-items: center;
+ width: var(--cui-space-4);
+ height: var(--cui-space-4);
+ border-radius: var(--cui-radius-full);
+ color: var(--ci-success-ink);
+}
+
+.row[data-kind='command'] .mark {
+ margin-top: var(--cui-space-0-5);
+}
+
+.mark::before {
+ content: '';
+ position: absolute;
+ inset: var(--cui-space-0-5);
+ border-radius: inherit;
+ border: var(--cui-border-width-strong) solid var(--cui-text-tertiary);
+ transition: opacity var(--cui-motion-duration-normal)
+ var(--cui-motion-ease-out);
+}
+
+.item[data-status='running'] .mark::before {
+ border-color: var(--cui-action-brand-base);
+ border-right-color: transparent;
+}
+
+.item[data-status='done'] .mark::before {
+ opacity: 0;
+}
+
+.check {
+ width: var(--cui-space-4);
+ height: var(--cui-space-4);
+ opacity: 0;
+ scale: 0.6;
+ transition:
+ opacity var(--cui-motion-duration-normal) var(--cui-motion-ease-out),
+ scale var(--cui-motion-duration-slow) var(--cui-motion-ease-out);
+}
+
+.item[data-status='done'] .check {
+ opacity: 1;
+ scale: 1;
+}
+
+.tool {
+ flex: none;
+ color: var(--cui-action-brand-soft-text);
+}
+
+.item[data-status='pending'] .tool {
+ color: inherit;
+}
+
+.args {
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ color: var(--cui-text-muted);
+}
+
+.item[data-status='pending'] .args {
+ color: inherit;
+}
+
+.command {
+ flex: 1;
+ font-size: inherit;
+}
+
+.output {
+ min-width: 0;
+ overflow-wrap: anywhere;
+ font-size: inherit;
+}
+
+.output[data-stream='stderr'] {
+ color: var(--cui-text-muted);
+}
+
+.thinking {
+ color: var(--cui-text-muted);
+ font-family: var(--cui-font-family-sans);
+}
+
+.thinking[data-running] {
+ background: linear-gradient(
+ 90deg,
+ var(--cui-text-hint) 0%,
+ var(--cui-text-default) 50%,
+ var(--cui-text-hint) 100%
+ )
+ 0 0 / 200% 100%;
+ background-clip: text;
+ color: transparent;
+}
+
+@media (prefers-reduced-motion: no-preference) {
+ .thinking[data-running] {
+ animation: thinking-shimmer 1.2s linear infinite;
+ }
+}
+
+@keyframes thinking-shimmer {
+ to {
+ background-position: -200% 0;
+ }
+}
+
+.fast {
+ font-weight: var(--cui-font-weight-medium);
+ color: var(--ci-success-ink);
+}
+
+.stream {
+ flex: none;
+ font-size: var(--cui-font-size-caption);
+ color: var(--cui-text-tertiary);
+}
+
+.exit {
+ padding: 0 var(--cui-space-1-5);
+ border-radius: var(--cui-radius-badge);
+ background: var(--cui-surface-input);
+ font-size: var(--cui-font-size-caption);
+ color: var(--cui-text-muted);
+}
+
+@media (prefers-reduced-motion: no-preference) {
+ .item[data-status='running'] .mark::before {
+ animation: spin calc(var(--cui-motion-duration-rise) * 2) linear infinite;
+ }
+
+ .rows[data-paused] .mark::before {
+ animation-play-state: paused;
+ }
+}
+
+@keyframes spin {
+ to {
+ rotate: 1turn;
+ }
+}
+
+@media (max-width: 767px) {
+ .transcript {
+ gap: var(--cui-space-5);
+ padding: var(--cui-space-4) var(--cui-space-3);
+ }
+
+ .request {
+ font-size: var(--cui-font-size-lg);
+ }
+
+ .row {
+ gap: var(--cui-space-2);
+ font-size: var(--cui-font-size-caption);
+ }
+
+ .row[data-kind='output'],
+ .row[data-kind='exit'] {
+ padding-left: calc(
+ var(--cui-space-2) + var(--cui-space-4) + var(--cui-space-2)
+ );
+ }
+}
diff --git a/apps/website/src/sections/Agents/Transcript.tsx b/apps/website/src/sections/Agents/Transcript.tsx
new file mode 100644
index 000000000..234c97298
--- /dev/null
+++ b/apps/website/src/sections/Agents/Transcript.tsx
@@ -0,0 +1,192 @@
+import {For, type JSX, Show} from 'solid-js';
+import {CheckIcon} from '~/components/Icon/icons';
+import {type AgentMode, agentsCopy} from '~/content/agents';
+import {CommandText} from '~/components/CommandText/CommandText';
+import {
+ argsPreview,
+ type Cursor,
+ type RowStatus,
+ rowStatus,
+ type Step,
+} from './model';
+import styles from './Transcript.module.css';
+
+function rowContent(step: Step, status: RowStatus): JSX.Element {
+ switch (step.kind) {
+ case 'thinking':
+ return (
+