diff --git a/apps/docs/README.md b/apps/docs/README.md index 24790fd2..4965af95 100644 --- a/apps/docs/README.md +++ b/apps/docs/README.md @@ -77,6 +77,7 @@ deployment decision. | Surface | Account pointer and purpose | | --- | --- | | Docs | [Vercel `serverbee-docs`](https://vercel.com/zingerlittlebees-projects/serverbee-docs), serving `docs.serverbee.app`; app root `apps/docs` | +| Landing page | [Vercel `serverbee-landing`](https://vercel.com/zingerlittlebees-projects/serverbee-landing), serving `serverbee.app` since 2026-11-22; app root `apps/landing` | | DNS | Cloudflare manages `serverbee.app` DNS. DNS ownership does not identify the application's runtime host. | | Monitoring backend | Railway runs the Rust Server used by `demo.serverbee.app`. Its GitHub deployment statuses do not identify the deployed docs revision. | diff --git a/apps/landing/README.md b/apps/landing/README.md index ea3f6d92..438c1b07 100644 --- a/apps/landing/README.md +++ b/apps/landing/README.md @@ -16,6 +16,7 @@ every link from this page to the documentation is absolute. | Where a scene finds things inside a screenshot | [Capture regions](src/assets/shots/regions.json), written by the web capture script | | Head tags, fonts, canonical origin | [Layout](src/layouts/base.astro), [Astro configuration](astro.config.ts) | | Product screenshots | [Web captures](scripts/capture.ts), [iOS captures](scripts/capture-ios.ts), [link previews](scripts/capture-og.ts) | +| The drawings in the kit section | [Sketches](src/components/sketch.astro), their words under `more.sketch` in the [copy](src/i18n/copy.ts), their runtime in [kit.ts](src/scripts/motion/kit.ts) | | Contracts with the rest of the repository | [Contract checker](scripts/check-contracts.ts), [Landing CI](../../.github/workflows/landing.yml) | ## Stack @@ -27,6 +28,9 @@ every link from this page to the documentation is absolute. - Latin fonts are self-hosted through Astro's fonts API. Chinese text uses the reader's system fonts. - Screenshots are real captures of the product, kept lossless in `src/assets`. The build resizes them to AVIF, with WebP as the fallback, and each one has a light and a dark variant that follows the theme. +- The kit section draws each feature instead of capturing it: a sketch is markup and CSS around sample data, in + the product's own terms. Change a number there only together with the rule it shows, such as an alert firing on + 7 of 10 samples. - English is served at `/` and Simplified Chinese at `/zh/`. Both locales render the same components from one copy file, and TypeScript requires every string in both. @@ -43,6 +47,8 @@ script times. - A scene animates a real screenshot. It lays a layer over the capture, covers a region with the color sampled beside it, and moves a copy of that region. The regions come from `regions.json`, which the capture script reads from the product's own DOM, so a scene stays aligned when its capture is retaken. +- A sketch in the kit section starts empty and draws itself once, when it is in view. Its transitions live on the + finished state, and the runtime's `data-empty` mark holds the first frame, so removing the mark plays it. - With reduced motion the hero's routes are drawn and still, the page rail follows the scroll, and nothing else mounts. @@ -70,6 +76,12 @@ server. The build reads `Cargo.toml` and `apps/ios/project.yml`, so build from a Set `SITE_URL` when the page is served from an origin other than `https://serverbee.app`. Canonical links, `hreflang` alternates, link preview images, the sitemap and `robots.txt` all use it. +Production is the Vercel project +[`serverbee-landing`](https://vercel.com/zingerlittlebees-projects/serverbee-landing): root directory `apps/landing`, +the Astro preset, Node 24.x, no environment variables. It serves `serverbee.app`, redirects `www.serverbee.app` to +it, and deploys every push to `main`. This was the state on 2026-11-22. Project settings and domain assignments are +external state: check them live before a deployment decision. + ## Checks ```bash diff --git a/apps/landing/src/components/command.astro b/apps/landing/src/components/command.astro index e373c570..50247aed 100644 --- a/apps/landing/src/components/command.astro +++ b/apps/landing/src/components/command.astro @@ -14,11 +14,32 @@ const copy = landingCopy[lang].hero // The installer URL is the longest and least interesting part of a command, so it is dimmed. const url = /https:\/\/\S+/.exec(command)?.[0] ?? '' const [before, after = ''] = url ? command.split(`${url} `, 2) : [command] + +function escapeHtml(text: string): string { + return text.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>') +} + +/** Each argument in one piece: a line that breaks after a hyphen of `--server-url` reads as another argument. */ +function words(text: string): string { + return text + .split(' ') + .map((word) => (word ? `${escapeHtml(word)}` : '')) + .join(' ') +} + +/** A narrow screen breaks the URL after a slash of its path rather than in the middle of a name. */ +function breakable(address: string): string { + const [scheme, rest = ''] = address.split('://') + return `${escapeHtml(scheme)}://${rest.split('/').map(escapeHtml).join('/')}` +} + +// Built as one string: the command keeps its white space, so the markup must not add any. +const html = `${words(before)}${breakable(url)} ${words(after)}` ---
- {before}{url}{' '}{after} +
- + diff --git a/apps/landing/src/components/sections/dashboards.astro b/apps/landing/src/components/sections/dashboards.astro index 30611c48..38ca61aa 100644 --- a/apps/landing/src/components/sections/dashboards.astro +++ b/apps/landing/src/components/sections/dashboards.astro @@ -25,7 +25,7 @@ const copy = landingCopy[lang].dash name="dashboard" lang={lang} sizes="(max-width: 900px) calc(100vw - 40px), min(64vw, 800px)" - mobile={{ zoom: 1.9, ratio: '1 / 1' }} + mobile={{ zoom: 1.9, ratio: 1 }} />
diff --git a/apps/landing/src/components/sections/hero.astro b/apps/landing/src/components/sections/hero.astro index efaf98a1..a507bd80 100644 --- a/apps/landing/src/components/sections/hero.astro +++ b/apps/landing/src/components/sections/hero.astro @@ -52,7 +52,7 @@ const headline = [hero.h1a, hero.h1b].join(lang === 'zh' ? '' : ' ') name="fleet" lang={lang} sizes="min(100vw - 40px, 1240px)" - mobile={{ zoom: 2.3, shiftX: 0.185, ratio: '5 / 6' }} + mobile={{ zoom: 2.3, shiftX: 0.185, ratio: 5 / 6 }} eager /> diff --git a/apps/landing/src/components/sections/ip-quality.astro b/apps/landing/src/components/sections/ip-quality.astro index a6d20a74..5995d695 100644 --- a/apps/landing/src/components/sections/ip-quality.astro +++ b/apps/landing/src/components/sections/ip-quality.astro @@ -23,7 +23,7 @@ const copy = landingCopy[lang].ipq
- +
diff --git a/apps/landing/src/components/sections/more.astro b/apps/landing/src/components/sections/more.astro index 1ec5da47..078eb80c 100644 --- a/apps/landing/src/components/sections/more.astro +++ b/apps/landing/src/components/sections/more.astro @@ -1,5 +1,6 @@ --- import Heading from '@/components/heading.astro' +import Sketch from '@/components/sketch.astro' import { landingCopy } from '@/i18n/copy' import type { Lang } from '@/lib/site' @@ -9,6 +10,21 @@ interface Props { const { lang } = Astro.props const copy = landingCopy[lang].more + +const AFTER_COMMA = /(?<=,)/ +/** How many Chinese characters fit on one line of a tile at its narrowest, on a phone. */ +const LINE = 16 +/** A clause's width in Chinese characters. Latin letters, digits and spaces take about half of one. */ +const width = (text: string): number => [...text].reduce((sum, char) => sum + (char > '\u2e7f' ? 1 : 0.55), 0) + +/** + * A Chinese caption wraps after a comma before it wraps inside a clause, as the headings do, so a line does not end + * mid-word. A clause too long for one line is left to wrap where it must. + */ +function clauses(text: string): { clause: string; whole: boolean }[] { + const parts = text.split(AFTER_COMMA) + return parts.map((clause) => ({ clause, whole: parts.length > 1 && width(clause) <= LINE })) +} ---
@@ -19,14 +35,15 @@ const copy = landingCopy[lang].more copy.groups.map((group) => (

{group.t}

-
+
    {group.items.map((item) => ( -
    -
    {item.t}
    -
    {item.d}
    -
    +
  • + +

    {item.t}

    +

    {clauses(item.d).map(({ clause, whole }) => (whole ? {clause} : clause))}

    +
  • ))} -
+
)) } diff --git a/apps/landing/src/components/shot.astro b/apps/landing/src/components/shot.astro index 1e5f52b4..397a650b 100644 --- a/apps/landing/src/components/shot.astro +++ b/apps/landing/src/components/shot.astro @@ -10,15 +10,19 @@ interface Props { eager?: boolean lang: Lang /** - * How a narrow screen shows the capture: `zoom` times larger than fitted, starting `shiftX` of its width in from - * the left, in a frame of `ratio` (width / height) or as tall as the enlarged capture. + * How a narrow screen shows the capture: `zoom` times the width of the column, so it runs off the right of the + * screen and pans sideways. It starts `shiftX` of its width in from the left. With `ratio`, its frame is cut to + * the height of a box as wide as the column with that width over height; without, it is as tall as the capture. */ - mobile?: { ratio?: string; shiftX?: number; zoom: number } + mobile?: { ratio?: number; shiftX?: number; zoom: number } name: ShotName /** The frame's layout width as a `sizes` value. */ sizes: string } +/** The widest column a capture is enlarged against: past a phone's width it has grown enough to read. */ +const PAN_COLUMN = 400 + const { eager = false, lang, mobile, name } = Astro.props const files = import.meta.glob('../assets/shots/*.webp', { eager: true, import: 'default' }) @@ -41,36 +45,52 @@ const widths = [640, 960, 1440, 1920].filter((width) => width < light.width) const picture = await themedPicture(light, file('dark'), [...widths, light.width]) // On a narrow screen an enlarged capture is laid out wider than the viewport, so it needs a larger source. const sizes = mobile - ? `(max-width: 640px) calc(${mobile.zoom} * (100vw - 40px)), ${Astro.props.sizes}` + ? `(max-width: 640px) calc(${mobile.zoom} * min(100vw - 40px, ${PAN_COLUMN}px)), ${Astro.props.sizes}` : Astro.props.sizes -const zoomStyle = mobile - ? `--zoom: ${mobile.zoom}; --shift-x: ${mobile.shiftX ?? 0}; --ratio: ${mobile.ratio ?? 'auto'}` - : undefined + +/** The narrow layout as the stylesheet takes it: the frame against the column, the capture against the frame. */ +function pan({ ratio, shiftX = 0, zoom }: NonNullable): string { + const kept = 1 - shiftX + const round = (value: number): number => Math.round(value * 1000) / 1000 + return [ + `--pan-scale: ${round(zoom * kept)}`, + `--pan-column: ${PAN_COLUMN}px`, + `--pan-capture: ${round(100 / kept)}%`, + `--pan-shift: ${round((-100 * shiftX) / kept)}%`, + `--pan-aspect: ${ratio ? round(zoom * kept * ratio) : 'auto'}` + ].join('; ') +} --- -
- - { - picture.sources.map((source) => ( - - )) - } - {landingCopy[lang].shots[name]} - +
+
+ + { + picture.sources.map((source) => ( + + )) + } + {landingCopy[lang].shots[name]} + +
diff --git a/apps/landing/src/components/sketch.astro b/apps/landing/src/components/sketch.astro new file mode 100644 index 00000000..1348f13a --- /dev/null +++ b/apps/landing/src/components/sketch.astro @@ -0,0 +1,268 @@ +--- +import Check from '@lucide/astro/icons/check' +import FileText from '@lucide/astro/icons/file-text' +import Lock from '@lucide/astro/icons/lock' +import { type KitId, landingCopy } from '@/i18n/copy' +import type { Lang } from '@/lib/site' + +/* + * A feature of the kit section, drawn small: what its screen in the panel shows, with sample data. Not a capture. + * The numbers follow the product's rules (an alert fires on 7 of 10 samples, an upgrade has five stages, a failed + * login is recorded as "anonymous"), and the addresses are documentation ranges. + */ + +interface Props { + id: KitId + lang: Lang +} + +const { id, lang } = Astro.props +const copy = landingCopy[lang].more.sketch + +/** CPU samples of the last ten minutes, in percent, against a rule that fires above 80. */ +const SAMPLES = [58, 86, 91, 64, 88, 93, 84, 72, 90, 87] +const THRESHOLD = 80 +/** The uptime bar's cells, oldest first, and the one day that was degraded. */ +const DAYS = 60 +const DEGRADED = 37 +const CHECKS = ['SSL', 'DNS', 'HTTP', 'TCP', 'WHOIS'] +/** Traffic in TB: used so far, forecast for the end of the cycle, the quota, and where the meter ends. */ +const USED = 1.42 +const FORECAST = 2.3 +const QUOTA = 2 +const METER = 2.5 +const share = (traffic: number): string => `${((traffic / METER) * 100).toFixed(1)}%` +/** Running containers and their share of a core, in percent. */ +const CONTAINERS: [name: string, cpu: number][] = [ + ['caddy', 12], + ['postgres', 46], + ['app', 24] +] +/** One mark per stage of an agent upgrade: downloading, verifying, pre-flight, installing, restarting. */ +const STAGES = 5 +const SIGN_INS = ['GitHub', 'Google', 'OIDC', 'Tailscale', 'TOTP 2FA', 'API keys'] +const LOG: [time: string, action: string, user: string][] = [ + ['12:30', 'login', 'admin'], + ['12:31', 'terminal_opened', 'admin'], + ['12:42', 'file_write', 'admin'], + ['13:07', 'login_failed', 'anonymous'] +] +--- + +