Every analytics tool wants a subscription. And your data. I built Twiligent instead. YouTube stats. Instagram stats. One dashboard. Runs locally on your machine.
feat(site): apply the UX laws and WCAG 2.2 AA to the public site
spacesdrived4476b589e59
diff --git a/docs/architecture/cloudflare/PAGES.md b/docs/architecture/cloudflare/PAGES.mdindex d814e88..fa8a20d 100644--- a/docs/architecture/cloudflare/PAGES.md+++ b/docs/architecture/cloudflare/PAGES.md@@ -113,7 +113,7 @@ The marketing site and the docs are a second static SPA, built from the `site/``.github/workflows/deploy-site.yml` builds and uploads it with `wrangler pages deploy dist --project-name=twiligent-site` from `site/`; see `CI_CD.md`. Besides the Vite output, the build writes `sitemap.xml` and `llms.txt` into `site/dist`.-**Redirects.** `site/public/_redirects` sends the app's old paths on this domain (`/login`, `/accounts`, `/settings`, `/upload`, `/videos`, `/shorts`, `/reels`, `/tracked-content`, `/reddit-posts`, `/reddit-tracked`, `/channel/*`, `/instagram/*`, `/reddit/*`) to the same path on `https://app.twiligent.ujjwal.fyi` with a 301, so bookmarks from before the move still work. The file has no `/* /index.html 200` line: the build has no top-level `404.html`, so Pages treats the project as a single-page application and serves `index.html` for every other path, where the site's router shows its own not found page.+**Redirects.** `site/public/_redirects` sends the app's old paths on this domain (`/login`, `/accounts`, `/settings`, `/videos`, `/shorts`, `/tracked-content`, `/reddit-posts`, `/reddit-tracked`, `/channel/*`, `/instagram/*`, `/reddit/*`) to the same path on `https://app.twiligent.ujjwal.fyi` with a 301, so bookmarks from before the move still work; `/upload` and `/publish` go to the app's `/publish`, and `/reels` and `/instagram` to its `/instagram` (#132). The build copies `index.html` to `dist/404.html` (`site/build/notFoundPage.ts`), so Pages answers an unknown path with a real 404 status while the site's router still draws its not found page. Because a top-level `404.html` turns off Pages' single-page fallback, `_redirects` rewrites `/docs` and `/docs/*` to `/index.html` with a 200; a mistyped docs address therefore still answers 200, and a new top-level marketing page needs its own rewrite line.`site/public/robots.txt` allows every crawler and points at `https://twiligent.ujjwal.fyi/sitemap.xml`.diff --git a/docs/architecture/site/SITE.md b/docs/architecture/site/SITE.mdindex 108ca95..bc5f1e9 100644--- a/docs/architecture/site/SITE.md+++ b/docs/architecture/site/SITE.md@@ -28,13 +28,14 @@ The site does not use shadcn/ui, next-themes or Lucide; those belong to the app.site/index.html Meta tags, favicons, font preloads, the inline script that opens the app for a signed-in visitoron the home page, and the inline script that sets data-theme before paint- vite.config.ts MDX (before the React plugin), React, Tailwind, docsPlugin; @ alias to src/+ vite.config.ts MDX (before the React plugin), React, Tailwind, docsPlugin, notFoundPage; @ alias to src/build/docsPlugin.ts Vite plugin: search index as virtual:docs-search, sitemap.xml and llms.txt in closeBundlegenIcons.ts Writes src/components/icons.tsx from @iconify-json/solar (npm run icons --workspace site)+ notFoundPage.ts Vite plugin: copies dist/index.html to dist/404.html, so unknown paths get a real 404 statuscontent/docs/ One .mdx file per docs page; folders match the URL (self-host/redis.mdx is /docs/self-host/redis)public/- _redirects 301s from the app's old paths to app.twiligent.ujjwal.fyi+ _redirects 301s from the app's old paths to app.twiligent.ujjwal.fyi, and the docs routes rewritten to index.htmlrobots.txt Allows every crawler; points at the sitemapbrand/ Logos, favicon, app icons and the share image, copied from the brand kitfonts/ Latin woff2 files for the three brand families@@ -48,7 +49,7 @@ site/NotFound.tsx Marketing 404components/MarketingLayout.tsx Skip link, Navbar, page, Footer- Navbar.tsx, Footer.tsx, navLinks.ts, Pill.tsx, ThemeToggle.tsx, ScrollManager.tsx+ Navbar.tsx, Footer.tsx, navLinks.ts, Pill.tsx, ThemeToggle.tsx, MotionToggle.tsx, ScrollManager.tsxbrand.tsx Logo, Mark, RibbonCrop, FoldBand (the brand graphics)marks.tsx Hand-written SVG logos for YouTube, Instagram, Reddit and GitHubicons.tsx Generated Solar icons; never edited by hand@@ -67,13 +68,15 @@ site/mdx.tsx Heading, DocLink, CodeBlock, InlineCode, Callout, Steps, Step, Cards, Card, BadgemdxComponents.tsx MDX_COMPONENTS: maps Markdown elements and the custom tags to the components abovevirtual.d.ts Types the virtual:docs-search module- hooks/ useAutoplay, useElementSize, usePrefersReducedMotion+ hooks/ useAutoplay, useElementSize, useMediaQuery, usePrefersReducedMotion, useStillMotionlib/chart.ts Chart geometry: seriesRange, chartPoints, smoothPath (monotone cubic), areaPathformat.ts formatNumber(): 84,213, 18.4K, 5.2%links.ts App, GitHub, edit, issue, changelog, licence and privacy URLsseo.ts usePageMeta(): title, description, canonical URL, Open Graph and Twitter tagstheme.ts useTheme(): reads and toggles data-theme and saves the choice+ motion.ts useMotionPaused(): the Pause animations choice, kept in data-motion and localStorage+ motionPreference.ts isPausedValue(): reads the stored choice (pure, tested)cn.ts Class name joinertests/ Node tests in docs/ and lib/ (see Tests)```@@ -88,7 +91,7 @@ site/| `*` | `MarketingLayout` > `NotFound` | Lazy || `/docs`, `/docs/*` | `DocsLayout` > `DocPage` | Both lazy; `DocPage` reads the slug from the path. `/docs` itself needs the index child, because React Router 7 does not match an empty remainder to the `*` child |-Fallback: the build has no top-level `404.html`, so Cloudflare Pages serves `index.html` for any path that is not a file, and the router decides. A docs path with no content file shows a docs 404 inside the docs frame.+Fallback: `build/notFoundPage.ts` copies the built `index.html` to `dist/404.html`. Cloudflare Pages then answers any path that is not a file with that page and a real 404 status, instead of treating the site as a single-page application, and the router draws `NotFound`. Because of that, `public/_redirects` rewrites `/docs` and `/docs/*` to `/index.html` with status 200, so every docs page still loads with a 200. A new top-level marketing page needs the same rewrite line, or it would load with a 404 status. A docs path with no content file shows a docs 404 inside the docs frame (with a 200 status, since the rewrite cannot know which slugs exist).Links to the app use the constants in `src/lib/links.ts`: `SIGN_IN_URL` (`https://app.twiligent.ujjwal.fyi/login`) and `SIGN_UP_URL` (the same with `?mode=signup`, which shows the app's sign-up headline and Sign up with Google; an emailed code creates the account). Sign-up and sign-in only exist in the app.@@ -138,7 +141,22 @@ The site uses the Solar icon set (480 Design, CC BY 4.0, credited in `THIRD_PART2. Run `npm run icons --workspace site`.3. Import it from `@/components/icons`.-Each icon draws in `currentColor` at `1em`, so it takes its colour and size from the text beside it. Platform logos are not icons: they are hand-written SVG in `src/components/marks.tsx`.+Each icon draws in `currentColor` at `1em`, so it takes its colour and size from the text beside it.++## Accessibility++The site targets WCAG 2.2 AA. The rules a change must keep:++- **Landmarks and skip links:** each layout has a skip link (`#main`, `#doc-content`), one `h1` per page, and named navigation landmarks. Doc headings nest: a `<Steps>` block that follows a `##` heading takes `level={3}`, so its step titles render as `h3`.+- **Route changes:** `ScrollManager` scrolls to the top and, after the first page, focuses the new page's `h1` (given `tabindex="-1"`) so a screen reader announces where the reader landed. A link with a hash scrolls to its section instead.+- **Focus:** the global ring is the accent red; inside the fold and dusk bands (`FoldBand`, the footer band, both carry `on-band`) it is white, because red on red is invisible. `html` has `scroll-padding-top` (6rem, 7.5rem under the docs header) so a focused element is never hidden behind the fixed navbar.+- **Menus:** every navbar menu remembers the button that opened it and returns focus there on Escape or an outside click when focus was inside. The phone docs menu is a native modal `<dialog>` (`showModal()`), so focus moves in, stays in, Escape closes it and focus returns to the menu button.+- **Search:** the combobox owns an always-rendered listbox with ids from `useId()` (two search boxes exist), options are not focusable, and a polite status line reads the result count. The first Escape closes the results, the second clears the query.+- **Live messages:** the code copy button reports Copied, or the failure with what to do, in a status line.+- **Scroll boxes:** wide code blocks and docs tables scroll inside a focusable `role="region"` with a label, so the keyboard can scroll them.+- **New tabs:** every link that opens a new tab carries a visually hidden "(opens in a new tab)"; the brand bans diagonal arrows, so there is no visible icon.+- **Below `xl`:** the docs outline shows as a closed "On this page" disclosure under the page description.+- **Example figures:** numbers in the platform cards are labelled as examples. Platform logos are not icons: they are hand-written SVG in `src/components/marks.tsx`.## Adding a Docs Page@@ -159,13 +177,15 @@ When a page moves or is renamed, update links to it in other pages and in the apThe product previews are React components drawn with the site's tokens, never screenshots, and every number in them comes from `mockups/sample.ts` (one made-up creator, Northwind Kitchen) so the pictures agree with each other. Each preview is one `role="img"` with an `aria-label` that describes what it shows.-- **Loops:** `useAutoplay(ref, durations)` steps a preview through numbered phases while at least 35% of it is on screen, then loops. It returns `phase`, `loop` (finished loops, used as a `key` to restart typing, counting and charts) and `reduce`. Under reduced motion the preview shows its last phase and stays there.+- **Loops:** `useAutoplay(ref, durations)` steps a preview through numbered phases while at least 35% of it is on screen, then loops. It returns `phase`, `loop` (finished loops, used as a `key` to restart typing, counting and charts) and `reduce`. Under reduced motion, or after the reader presses Pause animations, the preview shows its last phase and stays there.- **Cursor:** `Cursor` glides between elements marked `data-cursor="<name>"` inside its stage (the element passed as `stage`, which must also be the cursor's positioned parent), and clicks when its `clicks` count goes up. Timings follow the Activepieces previews: a 0.72s glide on `cubic-bezier(.5,.02,.2,1)`, a 0.26s fade, a press to 0.82 scale and a ring that grows from 0.35 to 1.9 while fading over 0.48s. In a bento card, pass it as the `Frame`'s `overlay`.- **Charts:** `AreaChart` measures its box and draws at real pixels (no stretched SVG), with a monotone curve from `lib/chart.ts` that never overshoots its data, a gradient fill, a dot on the latest point, optional `focus` with a guide line and tooltip, and `anchors` (`data-cursor="point-<n>"`) for a cursor to move along the line. It animates in CSS only (`chart-play`, `chart-line`, `chart-fill`, `chart-dot` in `index.css`), so the hero uses it without loading motion.- **Text and numbers:** `Typed` types text with a blinking caret; `CountUp` counts a number up in fixed-width digits. Numbers never fade in blurred.- **Hero:** `OverviewWindow` uses CSS animations only (`rise-in`, `grow-x`, the chart classes) with `--delay` for the stagger, because the hero is in the first bundle and motion is not.- **Bento cards:** `bento/Frame` is a small app window that fills its panel and is cut off by the panel's lower edge. Its body is laid out on its own, so a long list never makes the grid row taller. Each card has one live detail (a row arriving, a log streaming, a run completing, a filter clicked).- **Reduced motion:** `HomeBelow` wraps the page in `MotionConfig reducedMotion="user"`; `useAutoplay` holds the last phase; the CSS animations switch off under `prefers-reduced-motion`; cursors stay hidden.+- **Pause control:** the previews loop for as long as they are on screen, so WCAG 2.2.2 needs a way to stop them on the page itself. `MotionToggle` (in the navbar from `sm`, and in the phone menu as Animations) flips `data-motion="paused"` on `<html>` and saves it in `localStorage` under `twiligent-motion`; `main.tsx` applies the saved choice before the first render. `useStillMotion()` is true under reduced motion or the pause, and `useAutoplay`, `Typed` and `CountUp` use it; `HomeBelow` switches `MotionConfig` to `always`; the CSS loops (`.ping-soft`, `.caret`) stop under `:root[data-motion='paused']`.+- **Story:** the pinned scroll story (`MovingStory`, 250vh) needs a window at least 1024 px wide and 701 px tall (`useMediaQuery`); smaller windows, landscape phones and zoomed pages get `StillStory`, so the closing words are never clipped.## Deploy@@ -174,11 +194,11 @@ The product previews are React components drawn with the site's tokens, never sc| Pages project | `twiligent-site` || Address | `https://twiligent.ujjwal.fyi` || Build | `npm run build --workspace site` (after `npm ci` at the root) |-| Output | `site/dist` (the Vite build plus `sitemap.xml` and `llms.txt`) |+| Output | `site/dist` (the Vite build plus `404.html`, `sitemap.xml` and `llms.txt`) || Secrets | None in the build; the workflow needs only `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` || Workflow | `.github/workflows/deploy-site.yml`, on pushes to `main` that touch `site/**`, `tsconfig.base.json`, the root `package.json` or `package-lock.json`, or the workflow itself |-`site/public/_redirects` sends the app's old paths on this domain (`/login`, `/accounts`, `/settings`, `/upload`, `/videos`, `/shorts`, `/reels`, `/tracked-content`, `/reddit-posts`, `/channel/*`, `/instagram/*`, `/reddit/*` and others) to the same path on `https://app.twiligent.ujjwal.fyi` with a 301. In the other direction, the app's `/docs/*` route sends old docs links to the same page here. See `docs/architecture/cloudflare/PAGES.md`, `docs/architecture/cloudflare/CI_CD.md` and `docs/workflows/DEPLOYMENT.md`.+`site/public/_redirects` sends the app's old paths on this domain (`/login`, `/accounts`, `/settings`, `/videos`, `/shorts`, `/tracked-content`, `/reddit-posts`, `/channel/*`, `/instagram/*`, `/reddit/*` and others) to the same path on `https://app.twiligent.ujjwal.fyi` with a 301; `/upload` and `/publish` go to the app's `/publish`, and `/reels` and `/instagram` to its `/instagram`. It also rewrites `/docs` and `/docs/*` to `/index.html` with a 200 (see Routing). In the other direction, the app's `/docs/*` route sends old docs links to the same page here. See `docs/architecture/cloudflare/PAGES.md`, `docs/architecture/cloudflare/CI_CD.md` and `docs/workflows/DEPLOYMENT.md`.## TypeScript and Lint@@ -196,7 +216,8 @@ The product previews are React components drawn with the site's tokens, never sc| Test | Checks ||---|---|| `tests/docs/content.test.ts` | Every page in `nav.ts` has a content file and every content file is in `nav.ts`; slugs are unique; every page starts with a `meta` export with a title and description; every `/docs/...` link points at a page that exists; no page uses an em or en dash |-| `tests/docs/searchShared.test.ts` | `slugify()` turns headings into anchor ids |+| `tests/docs/searchShared.test.ts` | `slugify()` turns headings into anchor ids; `resultCountText()` reads the result count for none, one and many |+| `tests/lib/motionPreference.test.ts` | Only the stored word `paused` pauses the previews || `tests/lib/chart.test.ts` | The value range is padded; points spread across the box; the smooth path passes through every point and never overshoots between two; the area closes to the baseline || `tests/lib/format.test.ts` | Full numbers get separators, short numbers use K and M and drop a zero decimal, rates keep one decimal || `tests/homeRedirect.test.ts` | Runs the signed-in script from `index.html`: the home page opens the app only with `twiligent_signed_in=1`, and docs and other paths never redirect |diff --git a/docs/brand-notes.md b/docs/brand-notes.mdindex e0df9b4..00f1ee7 100644--- a/docs/brand-notes.md+++ b/docs/brand-notes.md@@ -99,7 +99,7 @@ Semantic tokens (light / dark), each with its contrast note from `tokens.json`:- Sentence case; no exclamation marks, emoji or hype words ("revolutionary", "magic", "10x").- At most one light metaphor per screen (dusk, glow, fold, edge).- Errors say what happened and what to do.-- **Tagline:** "Intelligence, folded into everything." for the site hero, covers and social; never in product UI.+- **Tagline:** "Intelligence, folded into everything." for covers and social; never in product UI. Since 2026-11-04 the site's pages do not use it: the owner chose headlines and buttons that say plainly what the product does and what a button leads to ("YouTube, Instagram and Reddit analytics in one dashboard", "Create an account").- **Promise:** clarity from many sources, folded into one picture.- **Personality:** sharp, not cold; calm, not quiet; warm, not cute.- The project rules also ban em dashes, en dashes and diagonal arrows.diff --git a/site/build/genIcons.ts b/site/build/genIcons.tsindex 4033b64..417f435 100644--- a/site/build/genIcons.ts+++ b/site/build/genIcons.ts@@ -62,6 +62,8 @@ const ICONS: Record<string, string> = {List: 'list-linear',Add: 'add-linear',Hashtag: 'hashtag-linear',+ Pause: 'pause-linear',+ Play: 'play-linear',};interface IconSet {diff --git a/site/build/notFoundPage.ts b/site/build/notFoundPage.tsnew file mode 100644index 0000000..9a89edc--- /dev/null+++ b/site/build/notFoundPage.ts@@ -0,0 +1,19 @@+import { copyFileSync } from 'node:fs';+import { join } from 'node:path';+import type { Plugin, ResolvedConfig } from 'vite';++// Cloudflare Pages answers a path with no file with the top-level 404.html and a real 404 status; that page is the app+// itself, so the router still draws the not found page. The docs routes are rewritten to index.html in _redirects.+export function notFoundPage(): Plugin {+ let outDir = 'dist';+ return {+ name: 'twiligent-not-found-page',+ apply: 'build',+ configResolved(config: ResolvedConfig) {+ outDir = join(config.root, config.build.outDir);+ },+ closeBundle() {+ copyFileSync(join(outDir, 'index.html'), join(outDir, '404.html'));+ },+ };+}diff --git a/site/content/docs/reference/faq.mdx b/site/content/docs/reference/faq.mdxindex 7f5d571..3aa4135 100644--- a/site/content/docs/reference/faq.mdx+++ b/site/content/docs/reference/faq.mdx@@ -1,33 +1,33 @@export const meta = { title: 'FAQ', description: 'Short answers to the questions people ask most.' }-### Do I need GitHub to schedule posts?+## Do I need GitHub to schedule posts?No. Members never do. Administrators only need the deployed Worker; the GitHub workflow is an optional backup.-### Do I need my own Supabase project?+## Do I need my own Supabase project?Only if you run your own instance. Members of someone else's instance use theirs.-### Why can't I connect my Instagram account?+## Why can't I connect my Instagram account?It must be a Business or Creator account, and while the instance's Meta app is in development mode it must be added as a tester. See [Connect your accounts](/docs/use/connect-accounts).-### Can I connect a YouTube channel I do not own?+## Can I connect a YouTube channel I do not own?Yes. YouTube analytics use public data, so any public channel works.-### Does Twiligent publish to YouTube or Reddit?+## Does Twiligent publish to YouTube or Reddit?No. Publishing is Instagram only. YouTube and Reddit are analytics only.-### What does running an instance cost?+## What does running an instance cost?For a small team, nothing. Supabase, Cloudflare, Cloudinary and Upstash free plans cover typical use, and the YouTube and Instagram APIs are free.-### How fresh is the data?+## How fresh is the data?Data is fetched when you open a page or choose Refresh, and cached for a short time when Redis is set up. Instagram tokens are renewed nightly.-### Who do I contact for help?+## Who do I contact for help?The administrator of your instance: the person who gave you its link. The [Troubleshooting](/docs/use/troubleshooting) page lists what to tell them.diff --git a/site/content/docs/self-host/github.mdx b/site/content/docs/self-host/github.mdxindex e4c0a47..fe3df7c 100644--- a/site/content/docs/self-host/github.mdx+++ b/site/content/docs/self-host/github.mdx@@ -28,7 +28,7 @@ The workflow asks for a run every 15 minutes, at minutes 7, 22, 37 and 52 of eac</Callout>-<Steps>+<Steps level={3}><Step title="Add two secrets">`SUPABASE_URL` and `SUPABASE_SERVICE_KEY`, with the same values the Worker uses.diff --git a/site/content/docs/use/connect-accounts.mdx b/site/content/docs/use/connect-accounts.mdxindex 8c260a9..18acd28 100644--- a/site/content/docs/use/connect-accounts.mdx+++ b/site/content/docs/use/connect-accounts.mdx@@ -12,7 +12,7 @@ Instagram only connects **Business** or **Creator** accounts. You can switch a pMost instances run their Meta app in development mode. In that mode Instagram only lets accounts added as **testers** sign in. Without tester access, Instagram shows an error or a blank page.-<Steps>+<Steps level={3}><Step title="Ask the administrator">Email your administrator with your Instagram username. The administrator adds you in the Meta app dashboard.diff --git a/site/content/docs/use/publishing.mdx b/site/content/docs/use/publishing.mdxindex 45a2582..d04eebf 100644--- a/site/content/docs/use/publishing.mdx+++ b/site/content/docs/use/publishing.mdx@@ -2,7 +2,7 @@ export const meta = { title: 'Publish and schedule', description: 'Post photos,## Publish a single post-<Steps>+<Steps level={3}><Step title="Choose the type and file">Open **Publish**, pick **Photo**, **Reel** or **Story**, then choose the file. Photos must be JPEG; Reels must be MP4 or MOV in 9:16; Stories accept either.diff --git a/site/index.html b/site/index.htmlindex 1e4250c..34614a4 100644--- a/site/index.html+++ b/site/index.html@@ -10,8 +10,8 @@location.replace('https://app.twiligent.ujjwal.fyi/');}</script>- <title>Twiligent: every channel, folded into one clear picture</title>- <meta name="description" content="Twiligent puts your YouTube, Instagram and Reddit numbers side by side, publishes and schedules your Instagram posts, and runs on accounts you own." />+ <title>Twiligent: YouTube, Instagram and Reddit analytics in one dashboard</title>+ <meta name="description" content="Twiligent puts your YouTube, Instagram and Reddit numbers side by side, publishes and schedules your Instagram posts, answers Instagram comments with a private reply, and runs on accounts you own." /><link rel="icon" href="/brand/twiligent-favicon.svg" type="image/svg+xml" /><link rel="icon" href="/brand/twiligent-favicon-32.png" type="image/png" sizes="32x32" /><link rel="apple-touch-icon" href="/brand/twiligent-app-icon-dusk-180.png" />diff --git a/site/public/_redirects b/site/public/_redirectsindex 24b1390..c9cf8cc 100644--- a/site/public/_redirects+++ b/site/public/_redirects@@ -2,10 +2,12 @@/login https://app.twiligent.ujjwal.fyi/login 301/accounts https://app.twiligent.ujjwal.fyi/accounts 301/settings https://app.twiligent.ujjwal.fyi/settings 301-/upload https://app.twiligent.ujjwal.fyi/upload 301+/upload https://app.twiligent.ujjwal.fyi/publish 301+/publish https://app.twiligent.ujjwal.fyi/publish 301/videos https://app.twiligent.ujjwal.fyi/videos 301/shorts https://app.twiligent.ujjwal.fyi/shorts 301-/reels https://app.twiligent.ujjwal.fyi/reels 301+/reels https://app.twiligent.ujjwal.fyi/instagram 301+/instagram https://app.twiligent.ujjwal.fyi/instagram 301/tracked-content https://app.twiligent.ujjwal.fyi/tracked-content 301/tracked-content/* https://app.twiligent.ujjwal.fyi/tracked-content/:splat 301/reddit-posts https://app.twiligent.ujjwal.fyi/reddit-posts 301@@ -14,3 +16,7 @@/channel/* https://app.twiligent.ujjwal.fyi/channel/:splat 301/instagram/* https://app.twiligent.ujjwal.fyi/instagram/:splat 301/reddit/* https://app.twiligent.ujjwal.fyi/reddit/:splat 301++# every docs page is drawn by the router from index.html; any other unknown path gets 404.html with a 404 status+/docs /index.html 200+/docs/* /index.html 200diff --git a/site/src/components/Footer.tsx b/site/src/components/Footer.tsxindex b861a74..051e3c3 100644--- a/site/src/components/Footer.tsx+++ b/site/src/components/Footer.tsx@@ -15,6 +15,7 @@ const COLUMNS: { heading: string; links: FooterLink[] }[] = [links: [{ label: 'Analytics', href: '/#analytics' },{ label: 'Publishing', href: '/#publishing' },+ { label: 'Comment automation', href: '/docs/use/automations' },{ label: 'Tracked content', href: '/docs/use/tracked-content' },{ label: 'Libraries', href: '/docs/use/analytics' },],@@ -52,6 +53,7 @@ function FooterAnchor({ link }: { link: FooterLink }) {return (<a href={link.href} target="_blank" rel="noopener noreferrer" className={cls}>{link.label}+ <span className="sr-only"> (opens in a new tab)</span></a>);}@@ -59,21 +61,20 @@ function FooterAnchor({ link }: { link: FooterLink }) {export function Footer() {return (<footer className="mt-24">- <div className="relative isolate overflow-hidden bg-fold">+ <div className="on-band relative isolate overflow-hidden bg-fold"><RibbonCrop placement="bottom-left" size="w-[40rem]" className="-z-10" /><RibbonCrop placement="bottom-right" size="w-[30rem]" className="-z-10" /><div className="container-page flex flex-col items-center py-24 text-center text-white md:py-32">- <p className="eyebrow text-white/80">Intelligence, folded into everything</p>- <h2 className="display mt-4 max-w-[16ch] text-[40px] leading-[46px] md:text-[56px] md:leading-[62px]">+ <h2 className="display max-w-[16ch] text-[40px] leading-[46px] md:text-[56px] md:leading-[62px]">Bring every channel into view.</h2><p className="mt-4 max-w-xl text-lg leading-7 text-white/85">Start on our instance, or run your own.</p><div className="mt-8 flex w-full flex-col items-center justify-center gap-3 sm:w-auto sm:flex-row"><Pill href={SIGN_UP_URL} variant="dusk" size="lg" className="w-full sm:w-auto">- Get started+ Create an account</Pill><Pill href="/docs/self-host" variant="white" size="lg" className="w-full sm:w-auto">- Run your own+ Read the self-hosting guide</Pill></div><ul className="mt-6 flex flex-wrap justify-center gap-x-5 gap-y-2 text-sm text-white/85">diff --git a/site/src/components/MotionToggle.tsx b/site/src/components/MotionToggle.tsxnew file mode 100644index 0000000..cf706b0--- /dev/null+++ b/site/src/components/MotionToggle.tsx@@ -0,0 +1,23 @@+import { Pause, Play } from './icons';+import { useMotionPaused } from '@/lib/motion';+import { cn } from '@/lib/cn';++// the looping product pictures can be stopped from any page, not only through the system setting+export function MotionToggle({ className }: { className?: string }) {+ const [paused, toggle] = useMotionPaused();+ const label = paused ? 'Play animations' : 'Pause animations';+ return (+ <button+ type="button"+ onClick={toggle}+ aria-label={label}+ title={label}+ className={cn(+ 'flex size-10 items-center justify-center rounded-full text-ink-muted transition-colors hover:bg-surface-sunken hover:text-ink',+ className,+ )}+ >+ {paused ? <Play className="size-5" /> : <Pause className="size-5" />}+ </button>+ );+}diff --git a/site/src/components/Navbar.tsx b/site/src/components/Navbar.tsxindex c0140db..faed728 100644--- a/site/src/components/Navbar.tsx+++ b/site/src/components/Navbar.tsx@@ -10,6 +10,7 @@ import type { MenuColumn, MenuItem as MenuItemData } from './navLinks';import { Logo } from './brand';import { Pill } from './Pill';import { ThemeToggle } from './ThemeToggle';+import { MotionToggle } from './MotionToggle';const TRIGGER ='flex items-center gap-1 rounded-full px-3.5 py-2 text-[15px] font-medium text-ink transition-colors duration-150 hover:bg-surface-sunken';@@ -54,6 +55,7 @@ function MenuItem({ item, onDone, onHover }: MenuItemProps) {return (<a href={item.href} target="_blank" rel="noopener noreferrer" className={cls} onClick={onDone} {...events}>{body}+ <span className="sr-only"> (opens in a new tab)</span></a>);}@@ -135,24 +137,32 @@ export function Navbar() {const close = useCallback(() => setOpen(null), []);- // a menu opened from the keyboard takes focus to its first item, and Escape hands focus back to its button+ // every open remembers its button; a menu opened from the keyboard takes focus to its first item, and closing hands+ // focus back to the button whenever focus was inside the island, because the panel turns inert as it closesconst trigger = useRef<HTMLButtonElement | null>(null);- const openFromKeyboard = (id: string, button: HTMLButtonElement) => {+ const openMenu = (id: string, button: HTMLButtonElement, fromKeyboard: boolean) => {trigger.current = button;setOpen(id);- window.requestAnimationFrame(() => document.querySelector<HTMLElement>('#nav-panel a')?.focus());+ if (fromKeyboard) {+ window.requestAnimationFrame(() => document.querySelector<HTMLElement>('#nav-panel a')?.focus());+ }};useEffect(() => {if (!open) return;+ const closeAndRefocus = () => {+ const focusInPanel = document.getElementById('nav-panel')?.contains(document.activeElement) ?? false;+ setOpen(null);+ if (focusInPanel) trigger.current?.focus();+ };const onKey = (event: KeyboardEvent) => {if (event.key !== 'Escape') return;+ const focusInIsland = island.current?.contains(document.activeElement) ?? false;setOpen(null);- trigger.current?.focus();- trigger.current = null;+ if (focusInIsland) trigger.current?.focus();};const onDown = (event: globalThis.PointerEvent) => {- if (!island.current?.contains(event.target as Node)) setOpen(null);+ if (!island.current?.contains(event.target as Node)) closeAndRefocus();};document.addEventListener('keydown', onKey);document.addEventListener('pointerdown', onDown);@@ -207,7 +217,7 @@ export function Navbar() {aria-label="Main"className="flex h-16 items-center justify-between gap-3 px-4 md:h-[68px] md:px-6 lg:grid lg:grid-cols-[1fr_auto_1fr]">- <Link to="/" aria-label="Twiligent home" className="flex min-h-11 shrink-0 items-center justify-self-start">+ <Link to="/" aria-label="Twiligent home" className="flex min-h-11 min-w-0 items-center justify-self-start"><Logo className="h-6 md:h-7" /></Link>@@ -218,11 +228,14 @@ export function Navbar() {type="button"aria-expanded={open === m.id}aria-controls="nav-panel"- onPointerEnter={hoverOpen(m.id)}+ onPointerEnter={event => {+ trigger.current = event.currentTarget;+ hoverOpen(m.id)(event);+ }}onClick={event => {// detail is 0 when Enter or Space pressed the button rather than a pointer- if (event.detail === 0 && open !== m.id) openFromKeyboard(m.id, event.currentTarget);- else setOpen(current => (current === m.id ? null : m.id));+ if (open === m.id) setOpen(null);+ else openMenu(m.id, event.currentTarget, event.detail === 0);}}className={cn(TRIGGER, open === m.id && 'bg-surface-sunken')}>@@ -243,22 +256,29 @@ export function Navbar() {</ul><div className="flex items-center gap-2 justify-self-end">+ <MotionToggle className="hidden sm:flex" /><ThemeToggle className="hidden sm:flex" /><span className="hidden md:inline-flex"><Pill href={SIGN_IN_URL} variant="soft" size="sm">Sign in</Pill></span>- <Pill href={SIGN_UP_URL} size="sm" className="pr-3">- Get started- <AltArrowRight className="-mr-0.5 size-4 transition-transform group-hover:translate-x-0.5" />- </Pill>+ {/* below sm the bar has no room for it; the menu panel carries the same link */}+ <span className="hidden sm:inline-flex">+ <Pill href={SIGN_UP_URL} size="sm" className="pr-3">+ Create account+ <AltArrowRight className="-mr-0.5 size-4 transition-transform group-hover:translate-x-0.5" />+ </Pill>+ </span><buttontype="button"aria-expanded={open === 'mobile'}aria-controls="nav-panel"aria-label={open === 'mobile' ? 'Close menu' : 'Open menu'}- onClick={() => setOpen(current => (current === 'mobile' ? null : 'mobile'))}+ onClick={event => {+ if (open === 'mobile') setOpen(null);+ else openMenu('mobile', event.currentTarget, event.detail === 0);+ }}className="flex size-10 items-center justify-center rounded-full text-ink hover:bg-surface-sunken lg:hidden">{open === 'mobile' ? <CloseCircle className="size-6" /> : <HamburgerMenu className="size-6" />}@@ -296,7 +316,7 @@ export function Navbar() {))}<div className="mt-2 flex flex-col gap-2 sm:flex-row"><Pill href={SIGN_UP_URL} className="w-full sm:w-auto">- Get started+ Create an account</Pill><Pill href={SIGN_IN_URL} variant="soft" className="w-full sm:w-auto">Sign in@@ -306,6 +326,10 @@ export function Navbar() {Theme<ThemeToggle /></div>+ <div className="flex items-center justify-between px-3 text-sm text-ink-muted">+ Animations+ <MotionToggle />+ </div></div></div>) : (diff --git a/site/src/components/Pill.tsx b/site/src/components/Pill.tsxindex 44afcfd..2046a02 100644--- a/site/src/components/Pill.tsx+++ b/site/src/components/Pill.tsx@@ -53,6 +53,7 @@ export function Pill({ href, variant = 'accent', size = 'md', className, childre{...(external ? { target: '_blank', rel: 'noopener noreferrer' } : {})}>{children}+ {external && <span className="sr-only"> (opens in a new tab)</span>}</a>);}diff --git a/site/src/components/ScrollManager.tsx b/site/src/components/ScrollManager.tsxindex 9245e50..93f2b9c 100644--- a/site/src/components/ScrollManager.tsx+++ b/site/src/components/ScrollManager.tsx@@ -1,12 +1,33 @@import { useEffect } from 'react';import { useLocation } from 'react-router';+// the address the page was last on; module state survives the switch between the site and docs layouts+let lastPath: string | null = null;++// after moving to another page, focus its heading so a screen reader announces where the reader landed+function focusPageHeading() {+ let tries = 0;+ const find = () => {+ const heading = document.querySelector<HTMLElement>('main h1, #doc-content h1');+ if (!heading) {+ if (tries++ < 20) window.setTimeout(find, 50);+ return;+ }+ if (!heading.hasAttribute('tabindex')) heading.setAttribute('tabindex', '-1');+ heading.focus({ preventScroll: true });+ };+ find();+}+// a new page starts at the top; a link with #section lands on that section once it has renderedexport function ScrollManager() {const { pathname, hash } = useLocation();useEffect(() => {+ const moved = lastPath !== null && lastPath !== pathname;+ lastPath = pathname;if (!hash) {window.scrollTo({ top: 0 });+ if (moved) focusPageHeading();return;}const id = decodeURIComponent(hash.slice(1));diff --git a/site/src/components/brand.tsx b/site/src/components/brand.tsxindex a6e1227..a78091b 100644--- a/site/src/components/brand.tsx+++ b/site/src/components/brand.tsx@@ -9,10 +9,19 @@ export interface LogoProps {export function Logo({ className }: LogoProps) {return (<span className={cn('relative inline-flex items-center', className ?? 'h-7')}>- <img src="/brand/twiligent-lockup-horizontal.svg" alt="Twiligent" className="h-full w-auto dark:hidden" />+ {/* the intrinsic size reserves the logo's width before the file arrives, so the bar does not shift */}+ <img+ src="/brand/twiligent-lockup-horizontal.svg"+ alt="Twiligent"+ width={4090}+ height={1000}+ className="h-full w-auto dark:hidden"+ /><imgsrc="/brand/twiligent-lockup-horizontal-reversed.svg"alt="Twiligent"+ width={4090}+ height={1000}className="hidden h-full w-auto dark:block"/></span>@@ -20,7 +29,15 @@ export function Logo({ className }: LogoProps) {}export function Mark({ className }: LogoProps) {- return <img src="/brand/twiligent-mark-color.svg" alt="" className={cn('w-auto', className ?? 'h-10')} />;+ return (+ <img+ src="/brand/twiligent-mark-color.svg"+ alt=""+ width={1921}+ height={1663}+ className={cn('w-auto', className ?? 'h-10')}+ />+ );}export type RibbonPlacement = 'bottom-right' | 'top-right' | 'bottom-left' | 'top-left';@@ -68,7 +85,7 @@ export interface FoldBandProps {// a panel in the fold gradient or deep dusk with a ribbon crop; mockups sit on it the way Activepieces sets them on a painted sceneexport function FoldBand({ tone = 'fold', placement = 'bottom-right', className, children }: FoldBandProps) {return (- <div className={cn('relative isolate overflow-hidden', tone === 'fold' ? 'bg-fold' : 'bg-dusk-panel', className)}>+ <div className={cn('on-band relative isolate overflow-hidden', tone === 'fold' ? 'bg-fold' : 'bg-dusk-panel', className)}><RibbonCrop placement={placement} className="-z-10" />{children}</div>diff --git a/site/src/components/icons.tsx b/site/src/components/icons.tsxindex d766818..07b210d 100644--- a/site/src/components/icons.tsx+++ b/site/src/components/icons.tsx@@ -66,3 +66,5 @@ export const DangerTriangleLine = /* @__PURE__ */ solar("<g fill=\"none\" strokeexport const List = /* @__PURE__ */ solar("<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"M20 7L4 7\"/><path d=\"M15 12L4 12\"/><path d=\"M9 17H4\"/></g>");export const Add = /* @__PURE__ */ solar("<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"M4 12L20 12\"/><path d=\"M12.0204 4L12.0205 20.0003\"/></g>");export const Hashtag = /* @__PURE__ */ solar("<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M10 3L5 21\"/><path d=\"M19 3L14 21\"/><path d=\"M22 9H4\"/><path d=\"M20 16H2\"/></g>");+export const Pause = /* @__PURE__ */ solar("<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"M2 6C2 4.11438 2 3.17157 2.58579 2.58579C3.17157 2 4.11438 2 6 2C7.88562 2 8.82843 2 9.41421 2.58579C10 3.17157 10 4.11438 10 6V18C10 19.8856 10 20.8284 9.41421 21.4142C8.82843 22 7.88562 22 6 22C4.11438 22 3.17157 22 2.58579 21.4142C2 20.8284 2 19.8856 2 18V6Z\"/><path d=\"M14 6C14 4.11438 14 3.17157 14.5858 2.58579C15.1716 2 16.1144 2 18 2C19.8856 2 20.8284 2 21.4142 2.58579C22 3.17157 22 4.11438 22 6V18C22 19.8856 22 20.8284 21.4142 21.4142C20.8284 22 19.8856 22 18 22C16.1144 22 15.1716 22 14.5858 21.4142C14 20.8284 14 19.8856 14 18V6Z\"/></g>");+export const Play = /* @__PURE__ */ solar("<path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" d=\"M20.4086 9.35258C22.5305 10.5065 22.5305 13.4935 20.4086 14.6474L7.59662 21.6145C5.53435 22.736 3 21.2763 3 18.9671L3 5.0329C3 2.72368 5.53435 1.26402 7.59661 2.38548L20.4086 9.35258Z\"/>");diff --git a/site/src/components/mockups/CountUp.tsx b/site/src/components/mockups/CountUp.tsxindex 295905e..929392b 100644--- a/site/src/components/mockups/CountUp.tsx+++ b/site/src/components/mockups/CountUp.tsx@@ -1,5 +1,6 @@import { useEffect } from 'react';-import { animate, motion, useMotionValue, useReducedMotion, useTransform } from 'motion/react';+import { animate, motion, useMotionValue, useTransform } from 'motion/react';+import { useStillMotion } from '@/hooks/useStillMotion';import { cn } from '@/lib/cn';import { formatNumber } from '@/lib/format';import type { NumberStyle } from '@/lib/format';@@ -16,7 +17,7 @@ export interface CountUpProps {// a number that counts up to its value, in fixed-width digits so the text around it never shiftsexport function CountUp({ value, active, from = 0, style = 'number', duration = 1.4, className }: CountUpProps) {- const reduce = useReducedMotion();+ const reduce = useStillMotion();const current = useMotionValue(reduce ? value : from);const text = useTransform(current, v => formatNumber(v, style));diff --git a/site/src/components/mockups/Typed.tsx b/site/src/components/mockups/Typed.tsxindex e44c03e..a70a7d4 100644--- a/site/src/components/mockups/Typed.tsx+++ b/site/src/components/mockups/Typed.tsx@@ -1,6 +1,6 @@import { useEffect, useState } from 'react';import type { ReactNode } from 'react';-import { useReducedMotion } from 'motion/react';+import { useStillMotion } from '@/hooks/useStillMotion';export interface TypedProps {text: string;@@ -15,7 +15,7 @@ export interface TypedProps {// text typed out a few characters at a time, with a blinking caret while it typesexport function Typed({ text, active, speed = 18, caret = true, render }: TypedProps) {- const reduce = useReducedMotion();+ const reduce = useStillMotion();const [count, setCount] = useState(0);useEffect(() => {diff --git a/site/src/components/navLinks.ts b/site/src/components/navLinks.tsindex 0ba809e..f14496e 100644--- a/site/src/components/navLinks.ts+++ b/site/src/components/navLinks.ts@@ -1,4 +1,4 @@-import { Bookmark, Chart, Checklist, Layers, Library, Plane, Server, ShieldCheck, UsersGroup } from './icons';+import { Bookmark, Chart, ChatDots, Checklist, Layers, Library, Plane, Server, ShieldCheck, UsersGroup } from './icons';import type { Icon } from './icons';import { GitHubIcon } from './marks';import { GITHUB_URL } from '@/lib/links';@@ -60,6 +60,12 @@ export const MENUS: Menu[] = [href: '/docs/use/publishing',icon: Layers,},+ {+ title: 'Comment automation',+ description: 'Private replies to Instagram comments',+ href: '/docs/use/automations',+ icon: ChatDots,+ },],},{diff --git a/site/src/components/sections/Platforms.tsx b/site/src/components/sections/Platforms.tsxindex ffff561..d1d7139 100644--- a/site/src/components/sections/Platforms.tsx+++ b/site/src/components/sections/Platforms.tsx@@ -87,7 +87,7 @@ function PlatformCard({ read, index }: { read: Read; index: number }) {<div className="mt-auto rounded-md border border-line bg-surface-sunken/40 p-3.5"><div className="flex items-end justify-between gap-3"><div>- <p className="text-[11px] text-ink-muted">{read.metric}, last 12 weeks</p>+ <p className="text-[11px] text-ink-muted">Example: {read.metric.toLowerCase()}, last 12 weeks</p><p className="mt-0.5 font-display text-lg font-semibold text-ink tabular-nums">{formatNumber(latest)}</p></div><span className="font-mono text-[11px] text-success">+{formatNumber(latest - read.weeks[0])}</span>@@ -115,7 +115,7 @@ export function Platforms() {<SectionHeaderid="platforms-heading"title="Three platforms. One dashboard."- lead="YouTube and Reddit for analytics. Instagram for analytics and publishing."+ lead="YouTube and Reddit for analytics. Instagram for analytics, publishing and comment replies."/><FoldBand placement="bottom-left" className="rounded-[32px] p-4 sm:p-8 lg:p-12"><ul className="grid gap-4 lg:grid-cols-3">diff --git a/site/src/components/sections/Story.tsx b/site/src/components/sections/Story.tsxindex 4d6dacf..7aae50e 100644--- a/site/src/components/sections/Story.tsx+++ b/site/src/components/sections/Story.tsx@@ -7,6 +7,7 @@ import { Logo } from '@/components/brand';import { Bookmark, CalendarMark, Chart, Home, Library, Plane, Plug, UsersGroup } from '@/components/icons';import type { Icon } from '@/components/icons';import { PlatformMark } from '@/components/mockups/kit';+import { useMediaQuery } from '@/hooks/useMediaQuery';import {CalendarWindow,FilesWindow,@@ -486,7 +487,7 @@ function MovingStory() {const endY = useTransform(progress, [0.62, 0.66], [14, 0], { ease: easeOut });return (- <div ref={sectionRef} className="relative h-[420vh]">+ <div ref={sectionRef} className="relative h-[250vh]"><div className="sticky top-0 h-svh overflow-hidden"><Ring progress={progress} /><div aria-hidden="true">@@ -519,11 +520,15 @@ function MovingStory() {);}+// the pinned stage needs a wide, tall window; anything smaller would clip the closing words+const ROOM_FOR_STAGE = '(min-width: 1024px) and (min-height: 701px)';+export function Story() {const reduce = useReducedMotion();+ const roomy = useMediaQuery(ROOM_FOR_STAGE);return (<section id="story" aria-labelledby="story-heading" className="relative bg-surface">- {reduce ? <StillStory /> : <MovingStory />}+ {reduce || !roomy ? <StillStory /> : <MovingStory />}</section>);}diff --git a/site/src/docs/DocPage.tsx b/site/src/docs/DocPage.tsxindex 114603c..a66c6bf 100644--- a/site/src/docs/DocPage.tsx+++ b/site/src/docs/DocPage.tsx@@ -80,6 +80,7 @@ export default function DocPage() {) : (<div className="mt-3 h-7" aria-hidden="true" />)}+ <Toc article={article} pageKey={`${file}:${module ? 'ready' : 'loading'}`} variant="inline" /><div className="mt-8" aria-busy={!Content}>{Content ? (<MDXProvider components={MDX_COMPONENTS}>@@ -108,6 +109,7 @@ export default function DocPage() {><Pen className="size-4" />Suggest edits+ <span className="sr-only"> (opens GitHub in a new tab)</span></a><ahref={`${ISSUES_URL}?title=${encodeURIComponent(`Docs: ${entry?.title ?? slug}`)}`}@@ -117,6 +119,7 @@ export default function DocPage() {><DangerTriangleLine className="size-4" />Raise issue+ <span className="sr-only"> (opens GitHub in a new tab)</span></a></div>diff --git a/site/src/docs/DocsLayout.tsx b/site/src/docs/DocsLayout.tsxindex 2089dc9..23562b8 100644--- a/site/src/docs/DocsLayout.tsx+++ b/site/src/docs/DocsLayout.tsx@@ -1,4 +1,4 @@-import { useEffect, useState } from 'react';+import { useEffect, useRef, useState } from 'react';import { Link, Outlet, useLocation } from 'react-router';import { cn } from '@/lib/cn';import { GITHUB_URL, SIGN_UP_URL } from '@/lib/links';@@ -18,17 +18,26 @@ export default function DocsLayout() {const entry = docEntry(slugFromPath(pathname));const tab = entry?.tab ?? DOC_TABS[0];const [drawer, setDrawer] = useState(false);+ const dialog = useRef<HTMLDialogElement>(null);+ const menuButton = useRef<HTMLButtonElement>(null);- // the phone drawer closes on Escape like any dialog+ // a native modal dialog keeps focus inside the drawer, makes the page behind it inert and closes on EscapeuseEffect(() => {- if (!drawer) return;- const onKey = (event: KeyboardEvent) => event.key === 'Escape' && setDrawer(false);- document.addEventListener('keydown', onKey);- return () => document.removeEventListener('keydown', onKey);+ const node = dialog.current;+ if (!node) return;+ if (drawer && !node.open) node.showModal();+ if (!drawer && node.open) node.close();}, [drawer]);+ // focus goes back to the menu button, unless a link already moved it to the new page+ const onDialogClose = () => {+ setDrawer(false);+ const active = document.activeElement;+ if (!active || active === document.body || dialog.current?.contains(active)) menuButton.current?.focus();+ };+return (- <div className="min-h-svh bg-surface">+ <div data-docs-layout className="min-h-svh bg-surface"><ScrollManager /><ahref="#doc-content"@@ -63,7 +72,7 @@ export default function DocsLayout() {</Link><span className="ml-1 hidden sm:inline-flex"><Pill href={SIGN_UP_URL} size="sm" className="pr-3">- Get started+ Create account<AltArrowRight className="size-4" /></Pill></span>@@ -93,10 +102,12 @@ export default function DocsLayout() {</nav><div className="flex h-12 items-center gap-3 border-t border-line px-4 md:hidden"><button+ ref={menuButton}type="button"onClick={() => setDrawer(true)}aria-label="Open the docs menu"aria-expanded={drawer}+ aria-controls="docs-menu"className="flex size-9 items-center justify-center rounded-md text-ink hover:bg-surface-sunken"><HamburgerMenu className="size-5" />@@ -109,19 +120,22 @@ export default function DocsLayout() {</div></header>- {drawer && (- <div className="fixed inset-0 z-50 md:hidden" role="dialog" aria-modal="true" aria-label="Docs menu">- <button- type="button"- aria-label="Close the docs menu"- className="absolute inset-0 bg-dusk/60"- onClick={() => setDrawer(false)}- />- <div className="relative flex h-full w-[min(20rem,85vw)] flex-col gap-6 overflow-y-auto bg-surface px-3 py-4 shadow-lg">+ <dialog+ ref={dialog}+ id="docs-menu"+ aria-label="Docs menu"+ onClose={onDialogClose}+ // a click on the dimmed backdrop lands on the dialog itself, outside the drawer panel+ onClick={event => event.target === event.currentTarget && setDrawer(false)}+ className="m-0 h-dvh max-h-dvh w-[min(20rem,85vw)] max-w-none bg-surface p-0 text-ink shadow-lg backdrop:bg-dusk/60 md:hidden"+ >+ {drawer && (+ <div className="flex h-full flex-col gap-6 overflow-y-auto px-3 py-4"><div className="flex items-center justify-between px-3"><Logo className="h-6" /><buttontype="button"+ autoFocusonClick={() => setDrawer(false)}aria-label="Close the docs menu"className="flex size-9 items-center justify-center rounded-md text-ink hover:bg-surface-sunken"@@ -138,6 +152,7 @@ export default function DocsLayout() {key={t.id}to={first.slug ? `/docs/${first.slug}` : '/docs'}onClick={() => setDrawer(false)}+ aria-current={t.id === tab.id ? 'true' : undefined}className={cn('rounded-full px-3 py-1 text-sm',t.id === tab.id@@ -152,8 +167,8 @@ export default function DocsLayout() {</nav><DocsSidebar tab={tab} current={entry} onNavigate={() => setDrawer(false)} /></div>- </div>- )}+ )}+ </dialog><div className="mx-auto flex max-w-[1440px] gap-10 px-4 md:px-8"><aside className="sticky top-28 hidden h-[calc(100svh-7rem)] w-64 shrink-0 overflow-y-auto py-8 pr-2 md:block">diff --git a/site/src/docs/Search.tsx b/site/src/docs/Search.tsxindex 62a12d2..15cb96d 100644--- a/site/src/docs/Search.tsx+++ b/site/src/docs/Search.tsx@@ -1,9 +1,9 @@-import { useEffect, useRef, useState } from 'react';+import { useEffect, useId, useRef, useState } from 'react';import { useNavigate } from 'react-router';import MiniSearch from 'minisearch';import { cn } from '@/lib/cn';import { AltArrowRight, Hashtag, Magnifer } from '@/components/icons';-import { SEARCH_OPTIONS } from './searchShared';+import { SEARCH_OPTIONS, resultCountText } from './searchShared';import type { SearchDocument } from './searchShared';type Result = Pick<SearchDocument, 'href' | 'title' | 'page'> & { id: string };@@ -29,17 +29,23 @@ export interface SearchProps {export function Search({ className }: SearchProps) {const navigate = useNavigate();const input = useRef<HTMLInputElement>(null);+ // the header and the phone drawer each hold a search box, so every id is unique to its box+ const listId = useId();+ const optionId = (i: number) => `${listId}-option-${i}`;const [open, setOpen] = useState(false);const [query, setQuery] = useState('');const [results, setResults] = useState<Result[]>([]);+ const [searched, setSearched] = useState('');const [selected, setSelected] = useState(0);useEffect(() => {const onKey = (event: KeyboardEvent) => {if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'k') {+ // only the visible box answers, so the hidden one in the closed drawer does not take focus+ if (!input.current || input.current.offsetParent === null) return;event.preventDefault();setOpen(true);- input.current?.focus();+ input.current.focus();}};document.addEventListener('keydown', onKey);@@ -57,6 +63,7 @@ export function Search({ className }: SearchProps) {.slice(0, 8).map(r => ({ id: String(r.id), href: r.href as string, title: r.title as string, page: r.page as string })),);+ setSearched(query);setSelected(0);});return () => {@@ -75,6 +82,7 @@ export function Search({ className }: SearchProps) {function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {if (event.key === 'ArrowDown') {event.preventDefault();+ setOpen(true);setSelected(s => Math.min(s + 1, visible.length - 1));} else if (event.key === 'ArrowUp') {event.preventDefault();@@ -82,29 +90,34 @@ export function Search({ className }: SearchProps) {} else if (event.key === 'Enter') {go(visible[selected]);} else if (event.key === 'Escape') {- setOpen(false);- input.current?.blur();+ // the first Escape closes the results and keeps the place in the box; the second clears the query+ event.preventDefault();+ if (showResults) setOpen(false);+ else setQuery('');}}// an empty box shows nothing, whatever the last search foundconst showResults = open && query.trim().length > 0;- const visible = showResults ? results : [];+ const ready = showResults && searched === query;+ const visible = ready ? results : [];+ const status = ready ? resultCountText(visible.length) : '';return (<divclassName={cn('relative', className)}onBlur={event => !event.currentTarget.contains(event.relatedTarget) && setOpen(false)}>- <label className="flex h-9 items-center gap-2 rounded-md border border-line bg-surface-raised px-3 text-sm text-ink-muted transition-colors focus-within:border-line-strong">+ <label className="flex h-9 items-center gap-2 rounded-md border border-line bg-surface-raised px-3 text-sm text-ink-muted transition-colors focus-within:border-line-strong has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-(--focus-ring)"><Magnifer className="size-4 shrink-0" /><span className="sr-only">Search the docs</span><inputref={input}type="search"role="combobox"- aria-expanded={showResults}- aria-controls="docs-search-results"- aria-activedescendant={visible[selected] ? `result-${selected}` : undefined}+ aria-expanded={visible.length > 0}+ aria-controls={listId}+ aria-autocomplete="list"+ aria-activedescendant={visible[selected] ? optionId(selected) : undefined}value={query}onChange={event => {setQuery(event.target.value);@@ -119,48 +132,55 @@ export function Search({ className }: SearchProps) {{IS_MAC ? 'Cmd K' : 'Ctrl K'}</kbd></label>- {showResults && (- <div className="absolute inset-x-0 top-11 z-50 overflow-hidden rounded-lg border border-line bg-surface-raised shadow-lg">- {visible.length === 0 ? (- <p className="px-4 py-6 text-center text-sm text-ink-muted">- No pages match "{query}". Try a shorter word.- </p>- ) : (- <ul id="docs-search-results" role="listbox" className="max-h-[60vh] overflow-y-auto p-1.5">- {visible.map((result, i) => (- <li key={result.id} id={`result-${i}`} role="option" aria-selected={i === selected}>- <button- type="button"- onMouseEnter={() => setSelected(i)}- onClick={() => go(result)}- className={cn(- 'flex w-full items-start gap-3 rounded-md px-3 py-2.5 text-left',- i === selected && 'bg-surface-sunken',- )}- >- <Hashtag className="mt-0.5 size-4 shrink-0 text-ink-muted" />- <span className="flex min-w-0 flex-col">- <span className="truncate text-sm font-semibold text-ink">{result.title}</span>- {result.title !== result.page && (- <span className="flex items-center gap-1 truncate text-xs text-ink-muted">- {result.page}- <AltArrowRight className="size-3" />- {result.title}- </span>- )}- </span>- </button>- </li>- ))}- </ul>- )}- <p className="flex items-center gap-4 border-t border-line px-4 py-2 text-xs text-ink-muted">- <span>Up and down to select</span>- <span>Enter to open</span>- <span className="ml-auto">Esc to close</span>- </p>- </div>- )}+ <p role="status" aria-live="polite" className="sr-only">+ {status}+ </p>+ <div+ className={cn(+ 'absolute inset-x-0 top-11 z-50 overflow-hidden rounded-lg border border-line bg-surface-raised shadow-lg',+ !showResults && 'hidden',+ )}+ >+ {/* the list stays in the page while the box is in use, so aria-controls always points at it */}+ <ul id={listId} role="listbox" aria-label="Matching pages" className="max-h-[60vh] overflow-y-auto p-1.5 empty:hidden">+ {visible.map((result, i) => (+ <li+ key={result.id}+ id={optionId(i)}+ role="option"+ aria-selected={i === selected}+ // the input keeps focus while a result is clicked, so the list does not close before the click lands+ onMouseDown={event => event.preventDefault()}+ onMouseEnter={() => setSelected(i)}+ onClick={() => go(result)}+ className={cn(+ 'flex w-full cursor-pointer items-start gap-3 rounded-md px-3 py-2.5 text-left',+ i === selected && 'bg-surface-sunken',+ )}+ >+ <Hashtag className="mt-0.5 size-4 shrink-0 text-ink-muted" />+ <span className="flex min-w-0 flex-col">+ <span className="truncate text-sm font-semibold text-ink">{result.title}</span>+ {result.title !== result.page && (+ <span className="flex items-center gap-1 truncate text-xs text-ink-muted">+ {result.page}+ <AltArrowRight className="size-3" />+ {result.title}+ </span>+ )}+ </span>+ </li>+ ))}+ </ul>+ {ready && visible.length === 0 && (+ <p className="px-4 py-6 text-center text-sm text-ink-muted">No pages match "{query}". Try a shorter word.</p>+ )}+ <p className="flex items-center gap-4 border-t border-line px-4 py-2 text-xs text-ink-muted">+ <span>Up and down to select</span>+ <span>Enter to open</span>+ <span className="ml-auto">Esc to close</span>+ </p>+ </div></div>);}diff --git a/site/src/docs/Toc.tsx b/site/src/docs/Toc.tsxindex 84cb9fc..5c814e9 100644--- a/site/src/docs/Toc.tsx+++ b/site/src/docs/Toc.tsx@@ -13,10 +13,12 @@ export interface TocProps {article: HTMLElement | null;// changes with each page, so the list is read againpageKey: string;+ // the sticky side column on wide screens, or a closed disclosure under the page title on narrower ones+ variant?: 'aside' | 'inline';}// "On this page": the h2 and h3 headings, with the one being read lit as the reader scrolls-export function Toc({ article, pageKey }: TocProps) {+export function Toc({ article, pageKey, variant = 'aside' }: TocProps) {const [items, setItems] = useState<TocItem[]>([]);const [active, setActive] = useState('');@@ -39,17 +41,13 @@ export function Toc({ article, pageKey }: TocProps) {}, [article, pageKey]);if (items.length === 0) return null;- return (- <nav aria-label="On this page" className="flex flex-col gap-3">- <p className="flex items-center gap-2 text-sm font-semibold text-ink">- <List className="size-4" />- On this page- </p>- <ul className="flex flex-col gap-2.5 text-sm">+ const list = (+ <ul className="flex flex-col gap-2.5 text-sm">{items.map(item => (<li key={item.id} className={cn(item.level === 3 && 'pl-4')}><ahref={`#${item.id}`}+ aria-current={active === item.id ? 'location' : undefined}className={cn('transition-colors',active === item.id ? 'font-medium text-accent-text' : 'text-ink-muted hover:text-ink',@@ -59,7 +57,28 @@ export function Toc({ article, pageKey }: TocProps) {</a></li>))}- </ul>+ </ul>+ );+ if (variant === 'inline') {+ return (+ <nav aria-label="On this page" className="mt-6 xl:hidden">+ <details className="group rounded-lg border border-line bg-surface-raised">+ <summary className="flex min-h-11 cursor-pointer items-center gap-2 px-4 text-sm font-semibold text-ink">+ <List className="size-4" />+ On this page+ </summary>+ <div className="border-t border-line px-4 py-3">{list}</div>+ </details>+ </nav>+ );+ }+ return (+ <nav aria-label="On this page" className="flex flex-col gap-3">+ <p className="flex items-center gap-2 text-sm font-semibold text-ink">+ <List className="size-4" />+ On this page+ </p>+ {list}</nav>);}diff --git a/site/src/docs/mdx.tsx b/site/src/docs/mdx.tsxindex e73eeff..f07508f 100644--- a/site/src/docs/mdx.tsx+++ b/site/src/docs/mdx.tsx@@ -1,4 +1,4 @@-import { Children, isValidElement, useRef, useState } from 'react';+import { Children, createContext, isValidElement, useContext, useRef, useState } from 'react';import type { ComponentPropsWithoutRef, ReactNode } from 'react';import { Link } from 'react-router';import {@@ -66,6 +66,7 @@ export function DocLink({ href = '', children, ...props }: ComponentPropsWithoutreturn (<a href={href} target="_blank" rel="noopener noreferrer" className={cls} {...props}>{children}+ <span className="sr-only"> (opens in a new tab)</span></a>);}@@ -73,20 +74,24 @@ export function DocLink({ href = '', children, ...props }: ComponentPropsWithout// shiki's highlighted block with a copy button in its cornerexport function CodeBlock(props: ComponentPropsWithoutRef<'pre'>) {const ref = useRef<HTMLPreElement>(null);- const [copied, setCopied] = useState(false);- async function copy() {+ const [copy, setCopy] = useState<'idle' | 'copied' | 'failed'>('idle');+ async function copyCode() {try {await navigator.clipboard.writeText(ref.current?.textContent ?? '');- setCopied(true);- setTimeout(() => setCopied(false), 1500);+ setCopy('copied');+ setTimeout(() => setCopy('idle'), 1500);} catch {- setCopied(false);+ setCopy('failed');}}return (<div className="group relative my-6">+ {/* a wide block scrolls inside itself, so it takes keyboard focus for the arrow keys */}<preref={ref}+ tabIndex={0}+ role="region"+ aria-label="Code"{...props}className={cn(props.className,@@ -95,12 +100,16 @@ export function CodeBlock(props: ComponentPropsWithoutRef<'pre'>) {/><buttontype="button"- onClick={copy}- aria-label={copied ? 'Copied' : 'Copy code'}+ onClick={copyCode}+ aria-label="Copy code"className="absolute top-2.5 right-2.5 inline-flex size-8 items-center justify-center rounded-md border border-line bg-surface-raised text-ink-muted transition-colors hover:text-ink">- {copied ? <CheckCircle className="size-4 text-success" /> : <Copy className="size-4" />}+ {copy === 'copied' ? <CheckCircle className="size-4 text-success" /> : <Copy className="size-4" />}</button>+ <p role="status" className={cn(copy === 'failed' ? 'mt-2 text-sm text-ink-muted' : 'sr-only')}>+ {copy === 'copied' && 'Copied'}+ {copy === 'failed' && "Couldn't copy. Select the code and copy it by hand."}+ </p></div>);}@@ -157,8 +166,21 @@ export function Callout({ type = 'note', title, children }: CalloutProps) {);}-export function Steps({ children }: { children?: ReactNode }) {- return <ol className="my-8 flex flex-col [counter-reset:step]">{children}</ol>;+// a step heading sits one level below the heading the steps follow+const StepLevel = createContext<2 | 3>(2);++export interface StepsProps {+ // 3 when the steps sit under a ## heading, so the outline nests them there+ level?: 2 | 3;+ children?: ReactNode;+}++export function Steps({ level = 2, children }: StepsProps) {+ return (+ <StepLevel.Provider value={level}>+ <ol className="my-8 flex flex-col [counter-reset:step]">{children}</ol>+ </StepLevel.Provider>+ );}export interface StepProps {@@ -167,6 +189,8 @@ export interface StepProps {}export function Step({ title, children }: StepProps) {+ const level = useContext(StepLevel);+ const Tag = level === 2 ? 'h2' : 'h3';return (<li className="relative flex gap-4 pb-8 [counter-increment:step] before:absolute before:top-10 before:bottom-1 before:left-4 before:w-px before:bg-line last:pb-0 last:before:hidden"><span@@ -174,9 +198,9 @@ export function Step({ title, children }: StepProps) {className="flex size-8 shrink-0 items-center justify-center rounded-full border border-line bg-surface-raised font-mono text-sm font-medium text-ink before:content-[counter(step)]"/><div className="flex min-w-0 flex-1 flex-col pt-1">- <h2 id={slugify(title)} data-toc="2" className="display scroll-mt-32 text-[17px] leading-7 text-ink">+ <Tag id={slugify(title)} data-toc={level} className="display scroll-mt-32 text-[17px] leading-7 text-ink">{title}- </h2>+ </Tag><div className="text-base leading-7 text-ink-muted [&>*:first-child]:mt-2 [&_p]:my-3 [&_strong]:font-semibold [&_strong]:text-ink">{children}</div>diff --git a/site/src/docs/mdxComponents.tsx b/site/src/docs/mdxComponents.tsxindex a22e811..8eacb21 100644--- a/site/src/docs/mdxComponents.tsx+++ b/site/src/docs/mdxComponents.tsx@@ -26,7 +26,7 @@ export const MDX_COMPONENTS: MDXComponents = {code: InlineCode,hr: () => <hr className="my-10 border-line" />,table: props => (- <div className="my-6 overflow-x-auto rounded-lg border border-line">+ <div tabIndex={0} role="region" aria-label="Table" className="my-6 overflow-x-auto rounded-lg border border-line"><table className="w-full min-w-[34rem] text-left text-sm leading-6" {...props} /></div>),diff --git a/site/src/docs/searchShared.ts b/site/src/docs/searchShared.tsindex 3e93501..5ac6b6c 100644--- a/site/src/docs/searchShared.ts+++ b/site/src/docs/searchShared.ts@@ -25,3 +25,9 @@ export function slugify(text: string): string {.replace(/\s+/g, '-').replace(/-+/g, '-');}++// what a screen reader hears after each search, since the results appear without moving focus+export function resultCountText(count: number): string {+ if (count === 0) return 'No pages match';+ return count === 1 ? '1 result' : `${count} results`;+}diff --git a/site/src/hooks/useAutoplay.ts b/site/src/hooks/useAutoplay.tsindex 5a7d6ee..ff8fb52 100644--- a/site/src/hooks/useAutoplay.ts+++ b/site/src/hooks/useAutoplay.ts@@ -1,6 +1,7 @@import { useEffect, useState } from 'react';import type { RefObject } from 'react';-import { useInView, useReducedMotion } from 'motion/react';+import { useInView } from 'motion/react';+import { useStillMotion } from './useStillMotion';export interface Autoplay {phase: number;@@ -11,9 +12,10 @@ export interface Autoplay {}// steps a mockup through its phases while it is on screen: durations[n] is how long phase n holds, in seconds;-// the last phase holds, then the story loops; under reduced motion the mockup shows its last phase and stays there+// the last phase holds, then the story loops; under reduced motion or the site's pause control the mockup shows its+// last phase and stays thereexport function useAutoplay(ref: RefObject<Element | null>, durations: number[]): Autoplay {- const reduce = useReducedMotion() ?? false;+ const reduce = useStillMotion();const inView = useInView(ref, { amount: 0.35 });const last = durations.length - 1;const [state, setState] = useState({ phase: 0, loop: 0 });diff --git a/site/src/hooks/useMediaQuery.ts b/site/src/hooks/useMediaQuery.tsnew file mode 100644index 0000000..5b71e0a--- /dev/null+++ b/site/src/hooks/useMediaQuery.ts@@ -0,0 +1,18 @@+import { useCallback, useSyncExternalStore } from 'react';++// whether a media query matches now, kept in step as the window resizes or rotates+export function useMediaQuery(query: string): boolean {+ const subscribe = useCallback(+ (onChange: () => void) => {+ const media = window.matchMedia(query);+ media.addEventListener('change', onChange);+ return () => media.removeEventListener('change', onChange);+ },+ [query],+ );+ return useSyncExternalStore(+ subscribe,+ () => window.matchMedia(query).matches,+ () => false,+ );+}diff --git a/site/src/hooks/useStillMotion.ts b/site/src/hooks/useStillMotion.tsnew file mode 100644index 0000000..9c72b10--- /dev/null+++ b/site/src/hooks/useStillMotion.ts@@ -0,0 +1,9 @@+import { useReducedMotion } from 'motion/react';+import { useMotionPaused } from '@/lib/motion';++// true when the reader asked for less motion, in the system settings or with the site's pause control+export function useStillMotion(): boolean {+ const reduce = useReducedMotion() ?? false;+ const [paused] = useMotionPaused();+ return reduce || paused;+}diff --git a/site/src/index.css b/site/src/index.cssindex 9f97768..6ea7f39 100644--- a/site/src/index.css+++ b/site/src/index.css@@ -182,6 +182,16 @@html {background-color: var(--surface);-webkit-text-size-adjust: 100%;+ /* keeps a focused link or a jumped-to heading clear of the fixed navbar */+ scroll-padding-top: 6rem;+ }+ /* the docs header is taller: the top bar plus the row of tabs */+ html:has([data-docs-layout]) {+ scroll-padding-top: 7.5rem;+ }+ /* a page heading takes focus after a route change only so screen readers announce it; it is not a control */+ h1[tabindex='-1']:focus {+ outline: none;}body {margin: 0;@@ -197,6 +207,10 @@outline: 2px solid var(--focus-ring);outline-offset: 2px;}+ /* the accent ring vanishes on the red fold and the dark dusk panels, so focus inside a band is white */+ .on-band :focus-visible {+ outline-color: #fff;+ }::selection {background: var(--accent-soft);}@@ -363,6 +377,12 @@animation: caret-blink 1s step-end infinite;}+/* the site's pause control stops every loop the way the system setting does */+:root[data-motion='paused'] .ping-soft,+:root[data-motion='paused'] .caret {+ animation: none;+}+@media (prefers-reduced-motion: reduce) {.fold-in {animation: fade-in 220ms linear both;diff --git a/site/src/lib/motion.ts b/site/src/lib/motion.tsnew file mode 100644index 0000000..6693ad9--- /dev/null+++ b/site/src/lib/motion.ts@@ -0,0 +1,49 @@+import { useCallback, useSyncExternalStore } from 'react';+import { isPausedValue } from './motionPreference';++const STORAGE_KEY = 'twiligent-motion';+const listeners = new Set<() => void>();++function readStored(): boolean {+ try {+ return isPausedValue(localStorage.getItem(STORAGE_KEY));+ } catch {+ return false;+ }+}++function current(): boolean {+ return document.documentElement.dataset.motion === 'paused';+}++function apply(paused: boolean) {+ if (paused) document.documentElement.dataset.motion = 'paused';+ else delete document.documentElement.dataset.motion;+}++// main.tsx calls this before the first render, so a saved pause holds from the first frame+export function applyStoredMotion(): void {+ apply(readStored());+}++function subscribe(listener: () => void): () => void {+ listeners.add(listener);+ return () => listeners.delete(listener);+}++// the looping product pictures play until the reader pauses them; the choice is kept for the next visit+export function useMotionPaused(): [boolean, () => void] {+ const paused = useSyncExternalStore(subscribe, current, () => false);+ const toggle = useCallback(() => {+ const next = !current();+ apply(next);+ try {+ if (next) localStorage.setItem(STORAGE_KEY, 'paused');+ else localStorage.removeItem(STORAGE_KEY);+ } catch {+ // private windows can refuse storage; the pause still holds for this visit+ }+ listeners.forEach(listener => listener());+ }, []);+ return [paused, toggle];+}diff --git a/site/src/lib/motionPreference.ts b/site/src/lib/motionPreference.tsnew file mode 100644index 0000000..1520782--- /dev/null+++ b/site/src/lib/motionPreference.ts@@ -0,0 +1,4 @@+// the stored value is text anyone can edit, so only the exact word pauses+export function isPausedValue(value: string | null): boolean {+ return value === 'paused';+}diff --git a/site/src/main.tsx b/site/src/main.tsxindex 2901c13..a6ced6e 100644--- a/site/src/main.tsx+++ b/site/src/main.tsx@@ -2,8 +2,11 @@ import { StrictMode } from 'react';import { createRoot } from 'react-dom/client';import { RouterProvider } from 'react-router/dom';import { router } from './router';+import { applyStoredMotion } from './lib/motion';import './index.css';+applyStoredMotion();+const root = document.getElementById('root');if (!root) throw new Error('index.html has no #root element');diff --git a/site/src/pages/Home.tsx b/site/src/pages/Home.tsxindex 1b6612a..e835462 100644--- a/site/src/pages/Home.tsx+++ b/site/src/pages/Home.tsx@@ -18,24 +18,24 @@ function Hero() {return (<section aria-labelledby="hero-heading" className="relative overflow-hidden pt-32 md:pt-40"><div className="container-page flex flex-col items-center text-center">- <p className="eyebrow fold-in text-accent-text">YouTube, Instagram and Reddit, in one dashboard</p>+ <p className="eyebrow fold-in text-accent-text">Analytics, publishing and comment replies</p><h1id="hero-heading"className="display fold-in mt-5 max-w-[17ch] text-[40px] leading-[44px] tracking-[-0.03em] text-ink sm:text-[52px] sm:leading-[56px] lg:text-[64px] lg:leading-[68px]">- Every channel, folded into one clear picture.+ YouTube, Instagram and Reddit analytics in one dashboard.</h1><p className="fold-in mt-6 max-w-[40rem] text-lg leading-7 text-balance text-ink-muted">Twiligent puts your YouTube, Instagram and Reddit numbers side by side, publishes and schedules your Instagram- posts, and runs on accounts you own.+ posts, answers Instagram comments with a private reply, and runs on accounts you own.</p><div className="fold-in mt-9 flex w-full flex-col items-center justify-center gap-3 sm:w-auto sm:flex-row"><Pill href={SIGN_UP_URL} size="lg" className="w-full sm:w-auto">- Get started+ Create an account<AltArrowRight className="size-5 transition-transform group-hover:translate-x-0.5" /></Pill><Pill href="/docs/self-host" variant="soft" size="lg" className="w-full sm:w-auto">- Run your own+ Read the self-hosting guide</Pill></div><p className="mt-5 text-sm text-ink-muted">Free and open source under the MIT licence.</p>@@ -64,9 +64,9 @@ function Hero() {export default function Home() {usePageMeta({- title: 'Twiligent',+ title: 'YouTube, Instagram and Reddit analytics in one dashboard',description:- 'Twiligent puts your YouTube, Instagram and Reddit numbers side by side, publishes and schedules your Instagram posts, and runs on accounts you own.',+ 'Twiligent puts your YouTube, Instagram and Reddit numbers side by side, publishes and schedules your Instagram posts, answers Instagram comments with a private reply, and runs on accounts you own.',path: '/',});return (diff --git a/site/src/pages/HomeBelow.tsx b/site/src/pages/HomeBelow.tsxindex c6c9de2..b3ddb2d 100644--- a/site/src/pages/HomeBelow.tsx+++ b/site/src/pages/HomeBelow.tsx@@ -1,4 +1,5 @@import { MotionConfig } from 'motion/react';+import { useMotionPaused } from '@/lib/motion';import { GITHUB_URL, SIGN_UP_URL } from '@/lib/links';import { Story } from '@/components/sections/Story';import { BentoCard, CtaBand, FeatureSection, SectionHeader } from '@/components/sections/blocks';@@ -19,15 +20,16 @@ import { TrackedMock } from '@/components/mockups/bento/TrackedMock';// the home page below the hero, in the order of the Activepieces home pageexport default function HomeBelow() {+ const [paused] = useMotionPaused();return (- // every animation below follows the reader's reduced motion setting- <MotionConfig reducedMotion="user">+ // every animation below follows the reader's reduced motion setting and the site's pause control+ <MotionConfig reducedMotion={paused ? 'always' : 'user'}><Story /><CtaBandtitle="See every account in one place."text="Sign in with Google or email, add a channel link or connect Instagram. The Overview fills in within a minute or two."- primary={{ label: 'Get started', href: SIGN_UP_URL }}+ primary={{ label: 'Create an account', href: SIGN_UP_URL }}secondary={{ label: 'Read the docs', href: '/docs' }}/>@@ -53,7 +55,7 @@ export default function HomeBelow() {<FeatureSectionid="publishing"title="Post now, or at the hour you pick."- lead="Publish photos, Reels and Stories to Instagram, schedule them for later, or upload many files at once."+ lead="Publish photos, Reels and Stories to Instagram, schedule them for later, upload many files at once, and answer comments with a private reply."placement="bottom-left"tone="dusk"notes={[@@ -62,7 +64,10 @@ export default function HomeBelow() {text: 'The server publishes within 15 minutes of the time you pick, even with your browser closed.',},{ title: 'Bulk upload', text: 'Add many files, give each its own caption or share one, and space them out.' },- { title: 'Status you can read', text: 'Every post shows Pending, Published or Failed, with the reason.' },+ {+ title: 'Replies to comments',+ text: 'Someone comments a keyword such as GUIDE, and your link reaches them in a private message.',+ },]}><ScheduleCard />diff --git a/site/tests/docs/searchShared.test.ts b/site/tests/docs/searchShared.test.tsindex 11202c8..e083cb5 100644--- a/site/tests/docs/searchShared.test.ts+++ b/site/tests/docs/searchShared.test.ts@@ -1,6 +1,6 @@import { test } from 'node:test';import assert from 'node:assert/strict';-import { slugify } from '../../src/docs/searchShared.ts';+import { resultCountText, slugify } from '../../src/docs/searchShared.ts';test('slugify makes heading ids', () => {assert.equal(slugify('Why row level security, with no policies?'), 'why-row-level-security-with-no-policies');@@ -9,3 +9,9 @@ test('slugify makes heading ids', () => {test('slugify joins repeated spaces and hyphens into one hyphen', () => {assert.equal(slugify(' Step 2 - deploy '), 'step-2-deploy');});++test('the result count reads naturally for none, one and many', () => {+ assert.equal(resultCountText(0), 'No pages match');+ assert.equal(resultCountText(1), '1 result');+ assert.equal(resultCountText(8), '8 results');+});diff --git a/site/tests/lib/motionPreference.test.ts b/site/tests/lib/motionPreference.test.tsnew file mode 100644index 0000000..9fee62a--- /dev/null+++ b/site/tests/lib/motionPreference.test.ts@@ -0,0 +1,10 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import { isPausedValue } from '../../src/lib/motionPreference.ts';++test('only the stored word paused stops the previews', () => {+ assert.equal(isPausedValue('paused'), true);+ assert.equal(isPausedValue(null), false);+ assert.equal(isPausedValue(''), false);+ assert.equal(isPausedValue('PAUSED'), false);+});diff --git a/site/vite.config.ts b/site/vite.config.tsindex d8ac581..4dcb401 100644--- a/site/vite.config.ts+++ b/site/vite.config.ts@@ -6,6 +6,7 @@ import mdx from '@mdx-js/rollup';import remarkGfm from 'remark-gfm';import rehypeShiki from '@shikijs/rehype';import { docsPlugin } from './build/docsPlugin.ts';+import { notFoundPage } from './build/notFoundPage.ts';export default defineConfig({plugins: [@@ -22,6 +23,7 @@ export default defineConfig({react({ include: /\.(mdx|tsx|ts)$/ }),tailwindcss(),docsPlugin(path.resolve(__dirname, 'content/docs')),+ notFoundPage(),],resolve: {alias: { '@': path.resolve(__dirname, './src') },