Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |

Expand Down
12 changes: 12 additions & 0 deletions apps/landing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -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
Expand Down
23 changes: 22 additions & 1 deletion apps/landing/src/components/command.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;')
}

/** 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 ? `<span class="cmd-word">${escapeHtml(word)}</span>` : ''))
.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('/<wbr>')}`
}

// Built as one string: the command keeps its white space, so the markup must not add any.
const html = `${words(before)}<span class="cmd-dim">${breakable(url)}</span> <span class="cmd-seg">${words(after)}</span>`
---

<div class="cmd">
<span class="cmd-prompt" aria-hidden="true">$</span>
<code>{before}<span class="cmd-dim">{url}</span>{' '}<span class="cmd-seg">{after}</span></code>
<code set:html={html} />
<button
class="copy"
type="button"
Expand Down
10 changes: 9 additions & 1 deletion apps/landing/src/components/footer.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
import Moon from '@lucide/astro/icons/moon'
import Radar from '@lucide/astro/icons/radar'
import Sun from '@lucide/astro/icons/sun'
import { landingCopy } from '@/i18n/copy'
import { homePath, type Lang } from '@/lib/site'

Expand Down Expand Up @@ -30,6 +32,12 @@ const copy = landingCopy[lang].footer
</ul>
</nav>
</div>
<p class="footer-legal">{copy.legal}</p>
<div class="footer-end">
<p class="footer-legal">{copy.legal}</p>
<button class="tool" type="button" data-theme-toggle aria-label={landingCopy[lang].nav.themeLabel}>
<Moon class="theme-light-icon" aria-hidden="true" />
<Sun class="theme-dark-icon" aria-hidden="true" />
</button>
</div>
</div>
</footer>
2 changes: 1 addition & 1 deletion apps/landing/src/components/sections/dashboards.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
/>
</div>
<div class="wrap"><Points items={copy.points} /></div>
Expand Down
2 changes: 1 addition & 1 deletion apps/landing/src/components/sections/hero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/landing/src/components/sections/ip-quality.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const copy = landingCopy[lang].ipq
</div>
</div>
<div class="wrap">
<Shot name="ip-quality" lang={lang} sizes="min(100vw - 40px, 1240px)" mobile={{ zoom: 2.2, ratio: '1 / 1' }} />
<Shot name="ip-quality" lang={lang} sizes="min(100vw - 40px, 1240px)" mobile={{ zoom: 2.2, ratio: 1 }} />
<Points items={copy.points} />
</div>
</section>
29 changes: 23 additions & 6 deletions apps/landing/src/components/sections/more.astro
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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 }))
}
---

<section id="more" class="more">
Expand All @@ -19,14 +35,15 @@ const copy = landingCopy[lang].more
copy.groups.map((group) => (
<section class="more-group">
<h3>{group.t}</h3>
<dl>
<ul class="more-tiles">
{group.items.map((item) => (
<div>
<dt>{item.t}</dt>
<dd>{item.d}</dd>
</div>
<li class="more-tile">
<Sketch id={item.id} lang={lang} />
<h4>{item.t}</h4>
<p>{clauses(item.d).map(({ clause, whole }) => (whole ? <span class="clause">{clause}</span> : clause))}</p>
</li>
))}
</dl>
</ul>
</section>
))
}
Expand Down
84 changes: 52 additions & 32 deletions apps/landing/src/components/shot.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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<ImageMetadata>('../assets/shots/*.webp', { eager: true, import: 'default' })

Expand All @@ -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<Props['mobile']>): 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('; ')
}
---

<figure class:list={['shot', { 'shot-zoom': mobile }]} style={zoomStyle} data-regions={JSON.stringify(regions)}>
<picture>
{
picture.sources.map((source) => (
<source
type={source.type}
srcset={source.srcset}
sizes={sizes}
media={source.dark ? '(prefers-color-scheme: dark)' : undefined}
data-dark={source.dark ? '' : undefined}
/>
))
}
<img
src={picture.fallback.src}
srcset={picture.fallback.srcset}
sizes={sizes}
width={light.width}
height={light.height}
alt={landingCopy[lang].shots[name]}
loading={eager ? 'eager' : 'lazy'}
fetchpriority={eager ? 'high' : undefined}
decoding="async"
/>
</picture>
<figure
class:list={['shot', { 'shot-pan': mobile }]}
style={mobile ? pan(mobile) : undefined}
data-regions={JSON.stringify(regions)}
>
<div class="shot-frame">
<picture>
{
picture.sources.map((source) => (
<source
type={source.type}
srcset={source.srcset}
sizes={sizes}
media={source.dark ? '(prefers-color-scheme: dark)' : undefined}
data-dark={source.dark ? '' : undefined}
/>
))
}
<img
src={picture.fallback.src}
srcset={picture.fallback.srcset}
sizes={sizes}
width={light.width}
height={light.height}
alt={landingCopy[lang].shots[name]}
loading={eager ? 'eager' : 'lazy'}
fetchpriority={eager ? 'high' : undefined}
decoding="async"
/>
</picture>
</div>
</figure>
Loading
Loading