v1.1: Harbor UI refresh, Contact page, feed guard, CHANGELOG 1.1.0 (#25)

- docs: CHANGELOG for 1.1.0; README and CLAUDE.md caught up
- fix(sonar): Number.NaN over the global NaN (S7773)
- feat(gate): an icon tile on each step of the legal gate
- feat(build): check-feed — assert the emitted RSS that notify.py trusts
- feat(contact): /contact and /vi/contact — one address per purpose (D27)
- feat(ui): "Harbor" refresh — tokens, header, home, cards, detail, footer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
poli0981andClaude Opus 5.5 authored and GitHub committed 2026-10-21 23:13:40 +07:00
1 parent 0c6e5bc85d
commit 2c40baf5c0
39 files changed
+1868 -416

No files matched your search

+94
View File
@@ -0,0 +1,94 @@
# Changelog
All notable changes to SoftHarbor. The site is continuously deployed; a
version marks a release announced in the repository (docs/13). Dates are
UTC.
## [1.1.0] — 2026-10-21
A full review of the site after launch: security advisories closed, real
production bugs fixed, a new look, and two Cloudflare services added with a
privacy policy rewritten to match.
### Privacy — read this if you read nothing else
v1.0 said "no analytics". That changed, deliberately and narrowly:
- **Cloudflare Web Analytics** (cookieless, nothing stored in your browser)
now counts page views. It does **not load at all** if your browser sends
**Global Privacy Control**, and never on preview or local hosts.
- **Cloudflare Turnstile** runs once in the legal gate, **only after** you
accept the terms, to tell people from bots. It usually needs no click. A
pass is remembered for 48 hours. If it cannot run — blocked, offline, or our
endpoint down — you are let in anyway.
- The [Privacy Policy](https://softharbor.net/legal/privacy) was rewritten to
say exactly what each of these sees and what we keep (nothing identifying),
and the legal version was bumped, so everyone is asked to accept once more.
### Added
- **A new look ("Harbor")**: cool chart-paper light theme and a navy night
theme, hairline rules, soft shadows, a frosted header, a home page with a
live "manifest" of the catalogue and a category grid, redesigned app cards
and detail pages, a five-column footer, and Lucide icons that move a little
on hover or focus — and not at all if you ask for reduced motion.
- **Display menu**: theme (system/light/dark), scrollbar (default, thin or
hidden — scrolling still works), and motion (system or reduced). Applied
before the first paint, so nothing flashes.
- **Contact page** (`/contact`, `/vi/contact`) with one address per purpose:
security, privacy, legal, copyright (DMCA), listing takedowns, licensing,
Code of Conduct, press and collaboration — all `@poli0981.dev`.
- **Shareable search**: the query, filters and sort are kept in the URL; a
"Best match" order while searching; Vietnamese searches ignore diacritics.
- **Installable app**: the PWA manifest is linked, with proper icons; the
offline page now comes with its styles.
- **Third-party notices** now list every package the site is built from,
generated at build time.
- **More "in this category"** on every app page, and a panel explaining what
the security status does and does not mean.
### Fixed
- Hashed assets were served with two contradictory `Cache-Control` values,
so browsers revalidated them on every visit; the JSON feeds were never
cached. Each now gets exactly one.
- The legal gate could be dismissed with Esc in Chromium; its exemptions
missed the real 404 and offline pages; its links looked like plain text.
- Search: a late result could filter the grid after the box was cleared;
"Clear all" left the search text in place; a Czech-locale browser sorted 81
of the 326 apps differently; the page announced the count twice per key.
- Small type (14 px and 12.5 px) was rendering at 16 px across the site.
- The language switcher marked English as current on Vietnamese pages and
linked VI to the home page; its accessible name now keeps the visible code.
- Theme flicker on navigation, a growing pile of CSP tags and a sort menu that
disagreed with the grid — all from the old soft-navigation router, now
replaced by native page transitions.
- Pages no longer overflow sideways on phones.
- Error, 404 and offline pages are bilingual; "1 apps" is "1 app".
### Security & maintenance
- Every open Dependabot advisory closed (including a critical Astro RCE);
dependencies refreshed; GitHub Actions pinned to commit SHAs; Dependabot
configured (Renovate had never run).
- A tiny Worker (`worker/`, `POST /api/verify`) is the only server code; every
page is still served as a static asset.
- The CSP now covers every script in the page head, and the build fails on
anything the policy would silently refuse.
- Data rules enforced at build time: official links only (download portals,
tracking parameters, look-alike hosts and invisible characters rejected),
real dates, evidence required for a security status.
- Tests: 340+ unit, component, build-script and Worker tests (≈95 % coverage of
shipped code, enforced), plus a Playwright + axe suite that loads every page
type in both languages and both themes on desktop and mobile, and fails on
any console error, CSP violation, accessibility violation or sideways
overflow.
## [1.0.0] — 2026-07-30
First public release: 326 apps in 12 categories, English and Vietnamese,
official links only, dated security statuses with their scans linked. See the
[release notes](https://github.com/poli0981/softharbor/releases/tag/v1.0.0).
[1.1.0]: https://github.com/poli0981/softharbor/releases/tag/v1.1.0
[1.0.0]: https://github.com/poli0981/softharbor/releases/tag/v1.0.0
+1 -1
View File
@@ -2,7 +2,7 @@
> Root instruction file for AI-assisted development (Claude Code). > Root instruction file for AI-assisted development (Claude Code).
> Read this first. Detailed specs live in `docs/00–16`. > Read this first. Detailed specs live in `docs/00–16`.
> Suite version: 1.2 (2026-07-27) · Author: poli0981 / SkullMute > Suite version: 1.3 (2026-10-21, site v1.1) · Author: poli0981 / SkullMute
## What this project is ## What this project is
+10 -3
View File
@@ -28,11 +28,18 @@ explaining it away. The scan is linked either way — judge it yourself.
## How it is built ## How it is built
Fully static. No server, no database, no backend, no tracking, and no Static. No database, no accounts, no cookies; fonts, icons and scripts are
third-party request at runtime — fonts, icons and scripts are all self-hosted. self-hosted. The exceptions are deliberate and small: one tiny Worker endpoint
that checks the legal gate's Cloudflare Turnstile token (`worker/`, and the
gate lets you in even if the check cannot run), and cookieless Cloudflare Web
Analytics, which does not load at all when your browser sends Global Privacy
Control. The [Privacy Policy](https://softharbor.net/legal/privacy) has the
details.
Astro 7 (static) · Svelte 5 islands · Tailwind CSS 4 · TypeScript strict · Astro 7 (static) · Svelte 5 islands · Tailwind CSS 4 · TypeScript strict ·
Node 24 · pnpm 10 · deployed to Cloudflare Workers Static Assets. Node 24 · pnpm 11 · Cloudflare Workers Static Assets (+ one Worker route).
Tested with Vitest (unit, islands, build scripts, the Worker) and Playwright +
axe on the built site.
```bash ```bash
pnpm install pnpm install
+17
View File
@@ -81,6 +81,23 @@ export async function waitForIsland(page: Page, name: string): Promise<void> {
}, name); }, name);
} }
/**
* Resolves once every finite animation on the page has finished. The pages
* rise into place on load (global.css `sh-rise`); axe measures colour
* contrast with the element's CURRENT opacity, so scanning mid-fade reports
* contrast failures that no settled page has.
*/
export async function settled(page: Page): Promise<void> {
await page.evaluate(() =>
Promise.all(
document
.getAnimations()
.filter((a) => a.effect?.getComputedTiming().iterations !== Infinity)
.map((a) => a.finished.catch(() => undefined)),
),
);
}
/** /**
* Pre-accept the legal gate (the current version) AND its human check, before * Pre-accept the legal gate (the current version) AND its human check, before
* the page loads — for tests about something other than the gate. * the page loads — for tests about something other than the gate.
+11 -1
View File
@@ -5,7 +5,7 @@
// errors, no CSP violations (fixture), and no serious/critical axe findings. // errors, no CSP violations (fixture), and no serious/critical axe findings.
import AxeBuilder from '@axe-core/playwright'; import AxeBuilder from '@axe-core/playwright';
import { acceptGate, expect, test } from './fixtures'; import { acceptGate, expect, settled, test } from './fixtures';
const PAGES = [ const PAGES = [
'/', '/',
@@ -21,6 +21,8 @@ const PAGES = [
'/vi/categories/security-privacy', '/vi/categories/security-privacy',
'/vi/legal/disclaimer', '/vi/legal/disclaimer',
'/offline', '/offline',
'/contact',
'/vi/contact',
]; ];
for (const path of PAGES) { for (const path of PAGES) {
@@ -31,6 +33,13 @@ for (const path of PAGES) {
await expect(page.locator('h1').first()).toBeVisible(); await expect(page.locator('h1').first()).toBeVisible();
// The pre-paint script ran: a theme is always resolved. // The pre-paint script ran: a theme is always resolved.
await expect(page.locator('html')).toHaveAttribute('data-theme', /^(light|dark)$/); await expect(page.locator('html')).toHaveAttribute('data-theme', /^(light|dark)$/);
// Nothing pokes past the right edge. On a phone that is not a scrollbar
// but a zoomed-out page (the layout viewport widens to fit), and it
// happened twice in v1.1 — a grid sized by min-content, then decoration.
const overflow = await page.evaluate(
() => document.documentElement.scrollWidth - document.documentElement.clientWidth,
);
expect(overflow, 'horizontal overflow in px').toBeLessThanOrEqual(0);
}); });
} }
@@ -52,6 +61,7 @@ for (const scheme of ['light', 'dark'] as const) {
await page.emulateMedia({ colorScheme: scheme }); await page.emulateMedia({ colorScheme: scheme });
await acceptGate(page); await acceptGate(page);
await page.goto(path); await page.goto(path);
await settled(page);
const results = await new AxeBuilder({ page }) const results = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa', 'wcag22aa']) .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa', 'wcag22aa'])
.analyze(); .analyze();
+2 -1
View File
@@ -73,8 +73,9 @@ export default tseslint.config(
// the monochrome theming docs/04 §2 and docs/14 §3d require. // the monochrome theming docs/04 §2 and docs/14 §3d require.
files: [ files: [
'src/components/ShAppCard.astro', 'src/components/ShAppCard.astro',
// The single UI-icon component (src/lib/icon.ts behind it).
'src/components/ShIcon.astro',
'src/components/pages/AppDetailPage.astro', 'src/components/pages/AppDetailPage.astro',
'src/components/pages/CategoriesPage.astro',
// ShJsonLd emits JSON.stringify() of an object it builds itself into a // ShJsonLd emits JSON.stringify() of an object it builds itself into a
// <script type="application/ld+json">. That is a DATA block, not // <script type="application/ld+json">. That is a DATA block, not
// executable script (docs/09 §4), and Astro's normal escaping would // executable script (docs/09 §4), and Astro's normal escaping would
+3 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "softharbor", "name": "softharbor",
"version": "0.1.0", "version": "1.1.0",
"private": true, "private": true,
"type": "module", "type": "module",
"description": "Bilingual (EN/VI) directory of free and buy-once desktop software", "description": "Bilingual (EN/VI) directory of free and buy-once desktop software",
@@ -12,11 +12,12 @@
}, },
"//": "Dependency build-script policy lives in pnpm-workspace.yaml (allowBuilds) — pnpm 11 ignores a \"pnpm\" field here.", "//": "Dependency build-script policy lives in pnpm-workspace.yaml (allowBuilds) — pnpm 11 ignores a \"pnpm\" field here.",
"scripts": { "scripts": {
"build": "pnpm run validate:data && pnpm run i18n:check && astro build && pnpm run postbuild:html && pnpm run check:csp && pnpm run check:assets && pnpm run check:sw", "build": "pnpm run validate:data && pnpm run i18n:check && astro build && pnpm run postbuild:html && pnpm run check:csp && pnpm run check:assets && pnpm run check:sw && pnpm run check:feed",
"build:site": "astro build", "build:site": "astro build",
"check": "astro check", "check": "astro check",
"check:assets": "node scripts/check-assets.mjs", "check:assets": "node scripts/check-assets.mjs",
"check:csp": "node scripts/check-csp.mjs", "check:csp": "node scripts/check-csp.mjs",
"check:feed": "node scripts/check-feed.mjs",
"check:sw": "node scripts/check-service-worker.mjs", "check:sw": "node scripts/check-service-worker.mjs",
"coverage": "vitest run --coverage", "coverage": "vitest run --coverage",
"deploy": "pnpm run build && wrangler deploy", "deploy": "pnpm run build && wrangler deploy",
+85
View File
@@ -0,0 +1,85 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 (SkullMute)
/**
* Build guard: dist/rss.xml must be the feed notify.py can trust.
*
* WHY THIS EXISTS. A cross-poster (notify.py) reads /rss.xml on a schedule
* and announces every <guid> it has not seen before — to Telegram, Discord,
* Bluesky, Mastodon, X and Facebook. So the feed's failure modes are public
* and irreversible: a GUID that changes shape (a URL instead of the slug, a
* slug with a different case) re-announces the whole window, and a GUID that
* names no app announces a dead link. src/lib/feed.ts builds the items and is
* unit-tested; this asserts what actually got EMITTED, because @astrojs/rss
* has no guid option and the slug guid is injected through customData
* (src/pages/rss.xml.ts) — exactly the kind of seam a dependency update
* breaks with every test still green.
*
* Checks: 1–50 items; every item has exactly one <guid isPermaLink="false">
* holding a slug of an app in src/data/apps; guids are unique; <link> is
* that app's page; <pubDate> parses and items run newest first.
*/
import { existsSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
const FEED = join(process.cwd(), 'dist/rss.xml');
const APPS_DIR = join(process.cwd(), 'src/data/apps');
const SITE = 'https://softharbor.net';
const LIMIT = 50;
const SLUG_RE = /^[a-z0-9]+(-[a-z0-9]+)*$/;
const problems = [];
let items = [];
if (existsSync(FEED)) {
const xml = readFileSync(FEED, 'utf8');
items = [...xml.matchAll(/<item>([\s\S]*?)<\/item>/g)].map((m) => m[1]);
if (items.length === 0) problems.push('the feed has no <item>');
if (items.length > LIMIT) problems.push(`${items.length} items — the window is ${LIMIT}`);
const seen = new Set();
let previous = Infinity;
for (const [i, item] of items.entries()) {
const where = `item ${i + 1}`;
const guids = [...item.matchAll(/<guid\b([^>]*)>([^<]*)<\/guid>/g)];
if (guids.length !== 1) {
problems.push(`${where}: ${guids.length} <guid> elements (want exactly 1)`);
continue;
}
const [, attrs, slug] = guids[0];
if (!/\bisPermaLink="false"/.test(attrs)) {
problems.push(
`${where}: <guid> is not isPermaLink="false" — a URL guid changes with the URL`,
);
}
if (!SLUG_RE.test(slug)) {
problems.push(`${where}: guid "${slug}" is not a slug`);
} else if (!existsSync(join(APPS_DIR, `${slug}.json`))) {
problems.push(`${where}: guid "${slug}" names no app in src/data/apps`);
}
if (seen.has(slug)) problems.push(`${where}: duplicate guid "${slug}"`);
seen.add(slug);
const link = /<link>([^<]*)<\/link>/.exec(item)?.[1];
if (link !== `${SITE}/apps/${slug}`) {
problems.push(`${where}: <link> ${link ?? '(none)'} is not ${SITE}/apps/${slug}`);
}
const when = Date.parse(/<pubDate>([^<]*)<\/pubDate>/.exec(item)?.[1] ?? '');
if (Number.isNaN(when)) problems.push(`${where}: missing or unparseable <pubDate>`);
else if (when > previous) problems.push(`${where}: newer than the item before it`);
else previous = when;
}
} else {
problems.push('dist/rss.xml does not exist — run `astro build` first');
}
if (problems.length > 0) {
console.error(`check-feed — ${problems.length} problem(s):`);
for (const p of problems.slice(0, 20)) console.error(` ✗ ${p}`);
console.error(
'\n notify.py announces every new guid; see docs/05 §A4 before changing the feed.',
);
process.exitCode = 1;
} else {
console.log(`check-feed — OK (${items.length} items, slug guids, newest first)`);
}
+84
View File
@@ -0,0 +1,84 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 (SkullMute)
import { describe, expect, it } from 'vitest';
import { project, run } from './fixture';
const item = (slug: string, date = 'Tue, 28 Jul 2026 00:00:00 GMT', guid?: string) =>
`<item><title>${slug}</title><link>https://softharbor.net/apps/${slug}</link>` +
`${guid ?? `<guid isPermaLink="false">${slug}</guid>`}<pubDate>${date}</pubDate></item>`;
const feed = (...items: string[]) =>
`<?xml version="1.0"?><rss version="2.0"><channel><title>t</title>${items.join('')}</channel></rss>`;
const apps = (...slugs: string[]) =>
Object.fromEntries(slugs.map((s) => [`src/data/apps/${s}.json`, '{}']));
describe('check-feed', () => {
it('passes the shape notify.py relies on', () => {
const root = project({
...apps('gimp', 'vlc'),
'dist/rss.xml': feed(item('vlc', 'Wed, 29 Jul 2026 00:00:00 GMT'), item('gimp')),
});
const r = run('check-feed.mjs', root);
expect(r.code).toBe(0);
expect(r.out).toContain('OK (2 items');
});
it.each([
[
'a URL guid',
item('vlc', undefined, '<guid>https://softharbor.net/apps/vlc</guid>'),
'isPermaLink',
],
['a guid naming no app', item('ghost'), 'names no app'],
['no guid at all', item('vlc', undefined, ''), '0 <guid> elements'],
[
'a capitalised guid',
item('vlc', undefined, '<guid isPermaLink="false">VLC</guid>'),
'is not a slug',
],
['an unparseable date', item('vlc', 'yesterday'), 'unparseable <pubDate>'],
])('fails on %s', (_name, bad, message) => {
const r = run('check-feed.mjs', project({ ...apps('vlc'), 'dist/rss.xml': feed(bad) }));
expect(r.code).toBe(1);
expect(r.out).toContain(message);
});
it('fails on duplicates, older-before-newer, a wrong link and an empty feed', () => {
const dup = run(
'check-feed.mjs',
project({ ...apps('vlc'), 'dist/rss.xml': feed(item('vlc'), item('vlc')) }),
);
expect(dup.out).toContain('duplicate guid "vlc"');
const order = run(
'check-feed.mjs',
project({
...apps('vlc', 'gimp'),
'dist/rss.xml': feed(item('vlc'), item('gimp', 'Wed, 29 Jul 2026 00:00:00 GMT')),
}),
);
expect(order.out).toContain('newer than the item before it');
const link = run(
'check-feed.mjs',
project({
...apps('vlc'),
'dist/rss.xml': feed(item('vlc').replace('/apps/vlc', '/apps/vlc-player')),
}),
);
expect(link.out).toContain('is not https://softharbor.net/apps/vlc');
const empty = run('check-feed.mjs', project({ 'dist/rss.xml': feed() }));
expect(empty.code).toBe(1);
expect(empty.out).toContain('no <item>');
});
it('fails when the window grows past 50', () => {
const slugs = Array.from({ length: 51 }, (_, i) => `app-${i}`);
const r = run(
'check-feed.mjs',
project({ ...apps(...slugs), 'dist/rss.xml': feed(...slugs.map((s) => item(s))) }),
);
expect(r.out).toContain('51 items');
});
});
+66 -57
View File
@@ -1,8 +1,11 @@
--- ---
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 (SkullMute) // Copyright (C) 2026 poli0981 (SkullMute)
// docs/06 §6 — card anatomy. // docs/06 §6 — card anatomy: logo tile, name and developer, the price in its
// own colour, licence and platforms, two lines of summary, then the dated
// status and the categories along a ruled foot.
import { getCollection, type CollectionEntry } from 'astro:content'; import { getCollection, type CollectionEntry } from 'astro:content';
import ShIcon from './ShIcon.astro';
import { logoSvg } from '../lib/logo'; import { logoSvg } from '../lib/logo';
import { localePath, t, type Locale } from '../i18n'; import { localePath, t, type Locale } from '../i18n';
@@ -35,10 +38,17 @@ const fmt = (iso: string) => dateFmt.format(new Date(`${iso}T00:00:00Z`));
// Each string renders the date field it actually NAMES — the dated-honesty // Each string renders the date field it actually NAMES — the dated-honesty
// claim is the product (hard rule 4, docs/06 §6). // claim is the product (hard rule 4, docs/06 §6).
const security = const clean = d.security.status === 'clean';
d.security.status === 'clean' const security = clean
? `${t(locale, 'card.security.clean')} · ${t(locale, 'card.checked', { date: fmt(d.security.checkedAt) })}` ? `${t(locale, 'card.security.clean')} · ${t(locale, 'card.checked', { date: fmt(d.security.checkedAt) })}`
: `${t(locale, 'card.security.unverified')} · ${t(locale, 'card.listed', { date: fmt(d.addedAt) })}`; : `${t(locale, 'card.security.unverified')} · ${t(locale, 'card.listed', { date: fmt(d.addedAt) })}`;
/** Free reads green, free-with-a-paid-tier blue, buy-once amber. */
const priceTone = {
free: 'sh-tone-ok',
'free-onetime': 'sh-tone-accent',
onetime: 'sh-tone-warn',
}[d.pricing];
--- ---
<!-- <!--
@@ -52,7 +62,7 @@ const security =
keep working if search is never used. keep working if search is never used.
--> -->
<article <article
class="sh-panel sh-lift sh-card relative flex flex-col gap-3 p-5" class="sh-panel sh-lift sh-anim sh-card relative flex flex-col gap-3 p-5"
data-slug={app.id} data-slug={app.id}
data-categories={d.categories.map((c) => c.id).join(' ')} data-categories={d.categories.map((c) => c.id).join(' ')}
data-platforms={d.platforms.join(' ')} data-platforms={d.platforms.join(' ')}
@@ -61,68 +71,67 @@ const security =
data-name={d.name} data-name={d.name}
> >
<div class="flex items-start gap-3"> <div class="flex items-start gap-3">
{/* Build-time SVG from a vendored icon set, a vendored asset, or a <span class="sh-tile size-12">
generated monogram — never user input. The set:html carve-out is {/* Build-time SVG from a vendored icon set, a vendored asset, or a
scoped to this file in eslint.config.js. */} generated monogram — never user input. The set:html carve-out is
<Fragment scoped to this file in eslint.config.js. */}
set:html={logoSvg(d.logo, d.name, { <Fragment
class: 'mt-0.5 size-10 shrink-0', set:html={logoSvg(d.logo, d.name, {
'aria-hidden': 'true', class: 'size-7 sh-pop',
fill: 'currentColor', 'aria-hidden': 'true',
})} fill: 'currentColor',
/> })}
<div class="min-w-0"> />
<Heading class="sh-card-title text-[17px] leading-tight font-semibold"> </span>
<a href={localePath(locale, `/apps/${app.id}`)}>{d.name}</a> <div class="min-w-0 flex-1">
<Heading class="text-[1.0625rem] leading-snug font-semibold">
<a href={localePath(locale, `/apps/${app.id}`)} class="sh-stretch">
{d.name}
</a>
</Heading> </Heading>
<p class="text-sh-muted truncate text-small">{d.developer}</p> <p class="text-sh-muted truncate text-small">{d.developer}</p>
</div> </div>
</div> <span class:list={['sh-pill shrink-0', priceTone]}>{t(locale, `pricing.${d.pricing}`)}</span>
<div class="flex flex-wrap items-center gap-2">
<span class="sh-pill">{t(locale, `pricing.${d.pricing}`)}</span>
{d.license && <span class="sh-pill">{d.license}</span>}
<span class="text-sh-muted font-mono text-badge">
{d.platforms.map((p) => t(locale, `platform.${p}`)).join(' · ')}
</span>
</div> </div>
<p class="text-sh-muted line-clamp-2 text-small">{d.summary[locale]}</p> <p class="text-sh-muted line-clamp-2 text-small">{d.summary[locale]}</p>
<hr class="border-sh-border opacity-35" /> <div class="flex flex-wrap items-center gap-x-3 gap-y-1.5">
{d.license && <span class="sh-pill">{d.license}</span>}
<p class="text-sh-muted font-mono text-badge"> <span class="text-sh-muted inline-flex items-center gap-1.5 font-mono text-badge">
{/* Conditional CLASS, not a conditional style attribute — CSP style-src <ShIcon name="monitor" class="size-3.5" />
drops inline style attributes silently (docs/09 §4). */} {d.platforms.map((p) => t(locale, `platform.${p}`)).join(' · ')}
<span aria-hidden="true" class={d.security.status === 'clean' ? 'text-sh-ok' : 'text-sh-warn'}>
●
</span> </span>
{security} </div>
</p>
<p class="flex flex-wrap gap-2 text-badge"> <div class="border-sh-border mt-auto flex flex-col gap-2 border-t border-dashed pt-3">
{d.categories.map((c) => ( <p class="text-sh-muted flex items-center gap-1.5 font-mono text-badge">
<a {/* Shape AND colour: a shield with a tick or a question mark, so the
href={localePath(locale, `/categories/${c.id}`)} status never rests on colour alone (WCAG 1.4.1). */}
class="sh-chip text-sh-accent hover:underline" <ShIcon
> name={clean ? 'shield-check' : 'shield-question'}
{categoryLabels.get(c.id) ?? c.id} class={`size-4 shrink-0 ${clean ? 'text-sh-ok' : 'text-sh-warn'}`}
</a> />
))} {security}
</p> </p>
<p class="flex flex-wrap gap-x-3 gap-y-1 text-badge">
{d.categories.map((c) => (
<a
href={localePath(locale, `/categories/${c.id}`)}
class="text-sh-accent relative z-1 font-medium hover:underline"
>
{categoryLabels.get(c.id) ?? c.id}
</a>
))}
</p>
</div>
</article> </article>
<style> <style>
/* The overlay that makes the whole card clickable while keeping exactly one /* 326 cards on /apps: let the browser skip layout and paint for the ones
link in the accessibility tree. */ off screen. The intrinsic size keeps the scrollbar honest meanwhile. */
.sh-card-title a::after { .sh-card {
content: ''; content-visibility: auto;
position: absolute; contain-intrinsic-size: auto 15rem;
inset: 0;
}
/* Chips must sit above that overlay to stay independently clickable. */
.sh-chip {
position: relative;
z-index: 1;
} }
</style> </style>
+94 -25
View File
@@ -1,7 +1,9 @@
--- ---
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 (SkullMute) // Copyright (C) 2026 poli0981 (SkullMute)
// docs/06 §4 — footer. ShBugReport lands in M5 (docs/02 §5). // docs/06 §4 — footer: the site in one line, then four short columns —
// browse, open data, legal, project.
import ShIcon from './ShIcon.astro';
import ShBugReport from './islands/ShBugReport.svelte'; import ShBugReport from './islands/ShBugReport.svelte';
import { localePath, t, type Locale } from '../i18n'; import { localePath, t, type Locale } from '../i18n';
@@ -9,6 +11,7 @@ interface Props {
locale: Locale; locale: Locale;
} }
const { locale } = Astro.props; const { locale } = Astro.props;
const REPO = 'https://github.com/poli0981/softharbor';
const legal = [ const legal = [
['/legal/disclaimer', 'footer.legal.disclaimer'], ['/legal/disclaimer', 'footer.legal.disclaimer'],
@@ -27,36 +30,102 @@ const built = new Intl.DateTimeFormat(locale === 'vi' ? 'vi-VN' : 'en-GB', {
}).format(new Date()); }).format(new Date());
--- ---
<footer class="border-sh-border mt-16 border-t-2"> <footer class="border-sh-border bg-sh-surface mt-24 border-t">
<div class="mx-auto flex max-w-[1360px] flex-col gap-4 px-4 py-8 md:flex-row md:justify-between md:px-6"> <div class="mx-auto grid max-w-[1360px] grid-cols-2 gap-10 px-4 py-12 md:grid-cols-[1.4fr_repeat(4,1fr)] md:px-6">
<nav aria-label={t(locale, 'footer.legal.heading')} class="flex flex-wrap gap-x-4 gap-y-2"> <div class="col-span-2 flex flex-col gap-3 md:col-span-1">
<a href={localePath(locale, '/')} class="sh-anim flex w-fit items-center gap-2.5">
<span class="sh-tile bg-sh-accent text-sh-accent-ink size-8 border-transparent">
<ShIcon name="anchor" class="size-[18px]" motion="pop" />
</span>
<span class="font-display text-[1.1875rem] font-semibold">{t(locale, 'site.name')}</span>
</a>
<p class="text-sh-muted max-w-xs text-small">{t(locale, 'site.tagline')}</p>
<p class="sh-eyebrow mt-auto">{t(locale, 'footer.license')}</p>
<p class="sh-eyebrow">{t(locale, 'footer.builtAt', { date: built })}</p>
</div>
<nav aria-labelledby="sh-foot-browse" class="sh-foot">
<h2 id="sh-foot-browse" class="sh-eyebrow">
{t(locale, 'footer.browse')}
</h2>
<a href={localePath(locale, '/apps')}>{t(locale, 'nav.apps')}</a>
<a href={localePath(locale, '/categories')}>{t(locale, 'nav.categories')}</a>
<a href={`${localePath(locale, '/apps')}#search`}>{t(locale, 'search.label')}</a>
</nav>
<nav aria-labelledby="sh-foot-data" class="sh-foot">
<h2 id="sh-foot-data" class="sh-eyebrow">
{t(locale, 'footer.data')}
</h2>
<a href="/api/apps.json" class="sh-anim">
<ShIcon name="braces" class="size-4" motion="pop" />
{t(locale, 'footer.api')}
</a>
<a href="/rss.xml" class="sh-anim">
<ShIcon name="rss" class="size-4" motion="pop" />
{t(locale, 'footer.rss')}
</a>
<a href={`${REPO}/blob/main/LICENSE-DATA.md`} rel="noopener">
CC BY-SA 4.0
</a>
</nav>
<nav aria-labelledby="sh-foot-legal" class="sh-foot">
<h2 id="sh-foot-legal" class="sh-eyebrow">
{t(locale, 'footer.legal.heading')}
</h2>
{legal.map(([path, key]) => ( {legal.map(([path, key]) => (
<a href={localePath(locale, path)} class="hover:underline"> <a href={localePath(locale, path)}>{t(locale, key)}</a>
{t(locale, key)}
</a>
))} ))}
</nav> </nav>
<div class="text-sh-muted flex flex-col gap-1 md:items-end"> <nav aria-labelledby="sh-foot-project" class="sh-foot">
<span class="font-mono text-badge">{t(locale, 'footer.license')}</span> <h2 id="sh-foot-project" class="sh-eyebrow">
<a {t(locale, 'footer.project')}
href="https://github.com/poli0981/softharbor" </h2>
rel="noopener" <a href={localePath(locale, '/contact')}>{t(locale, 'footer.contact')}</a>
class="font-mono text-badge hover:underline" <a href={REPO} rel="noopener" class="sh-anim">
>
{t(locale, 'footer.github')} {t(locale, 'footer.github')}
<ShIcon name="arrow-up-right" class="size-3.5" motion="nudge-diag" />
</a>
<a href={`${REPO}/releases`} rel="noopener" class="sh-anim">
{t(locale, 'footer.releases')}
<ShIcon name="arrow-up-right" class="size-3.5" motion="nudge-diag" />
</a> </a>
{/* client:visible — it lives at the bottom and nothing depends on it {/* client:visible — it lives at the bottom and nothing depends on it
until seen. The ring buffer it reads is filled from /errors.js, which until seen. The ring buffer it reads is filled by errors.js, which
loads early, so scrolling late does not lose errors (docs/05 §A5). */} loads first, so scrolling late does not lose errors (docs/05 §A5). */}
<span class="font-mono text-badge"> <ShBugReport
<ShBugReport client:visible
client:visible label={t(locale, 'bug.report')}
label={t(locale, 'bug.report')} countLabel={t(locale, 'bug.errorCount')}
countLabel={t(locale, 'bug.errorCount')} />
/> </nav>
</span>
<span class="font-mono text-badge">{t(locale, 'footer.builtAt', { date: built })}</span>
</div>
</div> </div>
</footer> </footer>
<style>
.sh-foot {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 0.55rem;
font-size: var(--text-small);
}
.sh-foot h2 {
font-family: var(--font-mono);
margin-bottom: 0.25rem;
}
.sh-foot :global(a) {
display: inline-flex;
align-items: center;
gap: 0.35rem;
color: var(--sh-ink);
text-decoration: none;
text-underline-offset: 0.2em;
}
.sh-foot :global(a:hover) {
color: var(--sh-accent);
text-decoration: underline;
}
</style>
+100 -21
View File
@@ -1,7 +1,9 @@
--- ---
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 (SkullMute) // Copyright (C) 2026 poli0981 (SkullMute)
// docs/06 §4 — sticky header. // docs/06 §4 — sticky header: frosted glass over the page, the anchor mark,
// two sections, a search shortcut, then language and display settings.
import ShIcon from './ShIcon.astro';
import ShLangSwitch from './islands/ShLangSwitch.svelte'; import ShLangSwitch from './islands/ShLangSwitch.svelte';
import ShPrefs from './islands/ShPrefs.svelte'; import ShPrefs from './islands/ShPrefs.svelte';
import { localePath, t, type Locale } from '../i18n'; import { localePath, t, type Locale } from '../i18n';
@@ -22,37 +24,64 @@ const section = here.startsWith('/apps')
? 'categories' ? 'categories'
: null; : null;
const apps = localePath(locale, '/apps'); const apps = localePath(locale, '/apps');
const nav = [
{ key: 'apps', href: apps, icon: 'layout-grid', label: t(locale, 'nav.apps') },
{
key: 'categories',
href: localePath(locale, '/categories'),
icon: 'shapes',
label: t(locale, 'nav.categories'),
},
] as const;
--- ---
<header class="bg-sh-bg border-sh-border sticky top-0 z-30 border-b-2"> <header class="sh-glass sticky top-0 z-30">
<div class="mx-auto flex max-w-[1360px] flex-wrap items-center gap-4 px-4 py-3 md:px-6"> <div class="mx-auto flex max-w-[1360px] items-center gap-2 px-4 py-2.5 md:gap-4 md:px-6">
<a href={home} class="font-display text-[1.375rem] font-semibold tracking-tight"> <a
{t(locale, 'site.name')} href={home}
class="sh-anim group flex items-center gap-2.5 rounded-[var(--radius-btn)] py-1 pr-2"
>
<span class="sh-tile bg-sh-accent text-sh-accent-ink size-9 border-transparent">
<ShIcon name="anchor" class="size-5" motion="pop" />
</span>
<span class="font-display hidden text-[1.3125rem] font-semibold tracking-tight sm:inline">
{t(locale, 'site.name')}
</span>
<span class="sr-only sm:hidden">{t(locale, 'site.name')}</span>
</a> </a>
<nav aria-label={t(locale, 'nav.main')} class="flex items-center gap-4"> <nav aria-label={t(locale, 'nav.main')} class="flex items-center gap-1">
<a href={apps} class="hover:underline" aria-current={section === 'apps' ? 'page' : undefined}> {nav.map((item) => (
{t(locale, 'nav.apps')} <a
</a> href={item.href}
<a class="sh-nav sh-anim"
href={localePath(locale, '/categories')} aria-current={section === item.key ? 'page' : undefined}
class="hover:underline" >
aria-current={section === 'categories' ? 'page' : undefined} <ShIcon name={item.icon} class="hidden size-[18px] sm:block" motion="pop" />
> {item.label}
{t(locale, 'nav.categories')} </a>
</a> ))}
</nav> </nav>
<span class="sh-pill text-sh-muted border-sh-muted ml-auto hidden lg:inline-block"> {/* A real link, so it works before any island hydrates and with JS off;
{t(locale, 'search.hint')} ShPrefs/ShSearch add the "/" shortcut on top (docs/06 §9). */}
</span> <a
href={`${apps}#search`}
class="sh-searchlink sh-anim ml-auto hidden items-center gap-2 lg:inline-flex"
>
<ShIcon name="search" class="size-4" motion="pop" />
<span>{t(locale, 'search.label')}</span>
<kbd class="sh-kbd ml-6" aria-hidden="true">
/
</kbd>
</a>
{/* {/*
client:idle — both are preferences, not gates: the page is fully usable client:idle — both are preferences, not gates: the page is fully usable
before they hydrate, and /theme.js has already applied the right theme before they hydrate, and theme.js has already applied the right theme
pre-paint (docs/02 §5, docs/05 §A8). pre-paint (docs/02 §5, docs/05 §A8).
*/} */}
<div class="ml-auto flex items-center gap-3 lg:ml-0"> <div class="ml-auto flex items-center gap-2 lg:ml-0">
{/* {/*
The suggestion banner is resolved with t('vi', …) regardless of page The suggestion banner is resolved with t('vi', …) regardless of page
locale — deliberately. It only ever renders to someone whose browser is locale — deliberately. It only ever renders to someone whose browser is
@@ -94,3 +123,53 @@ const apps = localePath(locale, '/apps');
</div> </div>
</div> </div>
</header> </header>
<style>
.sh-nav {
display: inline-flex;
align-items: center;
gap: 0.4rem;
min-height: 2.5rem;
padding: 0 0.7rem;
border-radius: var(--radius-btn);
color: var(--sh-muted);
font-weight: 500;
white-space: nowrap;
text-decoration: none;
transition:
color var(--duration-fast) var(--ease-sh),
background-color var(--duration-fast) var(--ease-sh);
}
.sh-nav:hover {
color: var(--sh-ink);
background: var(--sh-surface-2);
}
/* The current section: ink text over a short accent rule, so it is not
colour alone (WCAG 1.4.1). */
.sh-nav[aria-current='page'] {
color: var(--sh-ink);
box-shadow: inset 0 -2px 0 var(--sh-accent);
border-end-start-radius: 0;
border-end-end-radius: 0;
}
.sh-searchlink {
min-height: 2.5rem;
padding: 0 0.5rem 0 0.75rem;
border: 1px solid var(--sh-control);
border-radius: var(--radius-btn);
background: var(--sh-surface);
color: var(--sh-muted);
font-size: var(--text-small);
text-decoration: none;
transition: border-color var(--duration-fast) var(--ease-sh);
}
.sh-searchlink:hover {
border-color: var(--sh-accent);
color: var(--sh-ink);
}
@media (width < 30rem) {
.sh-nav {
padding: 0 0.5rem;
}
}
</style>
+30
View File
@@ -0,0 +1,30 @@
---
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 (SkullMute)
//
// A Lucide icon, inlined at build time (src/lib/icon.ts) — the one place UI
// icons are rendered, so the set:html carve-out (eslint.config.js) covers a
// single component rather than every page. Decorative by default; pass
// `label` when the icon is the only thing naming a control.
//
// `motion` names one of the hover/focus effects in global.css (it reacts to
// the nearest `.sh-anim` ancestor): nudge-x for "go there", nudge-diag for
// "leaves the site", pop for tiles, draw for a stroke-by-stroke redraw.
import { iconSvg } from '../lib/icon';
interface Props {
/** Lucide name without the set prefix, e.g. `arrow-right`. */
name: string;
class?: string;
label?: string;
motion?: 'nudge-x' | 'nudge-diag' | 'pop' | 'draw';
}
const { name, class: cls = 'size-5', label, motion } = Astro.props;
const svg = iconSvg(`lucide:${name}`, {
class: [cls, motion && `sh-${motion}`].filter(Boolean).join(' '),
...(label ? { role: 'img', 'aria-label': label } : { 'aria-hidden': 'true' }),
focusable: 'false',
});
---
<Fragment set:html={svg} />
+10 -11
View File
@@ -4,6 +4,7 @@
<dialog> so focus trapping and Esc come from the platform (docs/06 §9). --> <dialog> so focus trapping and Esc come from the platform (docs/06 §9). -->
<script lang="ts"> <script lang="ts">
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import IconFilter from '~icons/lucide/sliders-horizontal';
// Imported without the `$` prefix — Svelte reserves it, and `$name` below is // Imported without the `$` prefix — Svelte reserves it, and `$name` below is
// what auto-subscribes to these atoms (see src/lib/stores.ts). // what auto-subscribes to these atoms (see src/lib/stores.ts).
import { import {
@@ -71,13 +72,16 @@
<button <button
type="button" type="button"
class="bg-sh-surface border-sh-border rounded-[var(--radius-card)] border px-4 py-3" class="bg-sh-surface border-sh-control shadow-sh-1 inline-flex items-center gap-2 rounded-[var(--radius-card)] border px-4 py-3"
aria-haspopup="dialog" aria-haspopup="dialog"
onclick={() => dialog?.showModal()} onclick={() => dialog?.showModal()}
> >
<IconFilter aria-hidden="true" class="size-[18px]" />
{openLabel} {openLabel}
{#if $activeFilterCount > 0} {#if $activeFilterCount > 0}
<span class="sh-pill bg-sh-accent text-sh-accent-ink ml-2">{$activeFilterCount}</span> <span class="sh-pill bg-sh-accent text-sh-accent-ink border-transparent"
>{$activeFilterCount}</span
>
{/if} {/if}
</button> </button>
@@ -107,19 +111,13 @@
{/each} {/each}
<footer class="mt-auto flex gap-3 pt-4"> <footer class="mt-auto flex gap-3 pt-4">
<button <button type="button" class="sh-btn" disabled={!$hasActiveFilters} onclick={clearAll}
type="button" >{clearLabel}</button
class="border-sh-border rounded-[var(--radius-card)] border px-4 py-2"
disabled={!$hasActiveFilters}
onclick={clearAll}>{clearLabel}</button
> >
<!-- The visible text IS the accessible name ("Show 42 apps"). It used to <!-- The visible text IS the accessible name ("Show 42 apps"). It used to
carry aria-label="Close filters", which hid the count from screen carry aria-label="Close filters", which hid the count from screen
readers and broke WCAG 2.5.3 Label in Name for voice control. --> readers and broke WCAG 2.5.3 Label in Name for voice control. -->
<button <button type="submit" class="sh-btn sh-btn-primary ml-auto">
type="submit"
class="bg-sh-accent text-sh-accent-ink border-sh-border ml-auto rounded-[var(--radius-card)] border px-4 py-2 font-medium"
>
{showText} {showText}
</button> </button>
</footer> </footer>
@@ -136,6 +134,7 @@
border: 1px solid var(--sh-border); border: 1px solid var(--sh-border);
background: var(--sh-surface); background: var(--sh-surface);
color: var(--sh-ink); color: var(--sh-ink);
box-shadow: var(--sh-shadow-3);
padding: 1.5rem; padding: 1.5rem;
overflow-y: auto; overflow-y: auto;
} }
+11 -17
View File
@@ -92,18 +92,10 @@
data-testid="sh-lang-suggest" data-testid="sh-lang-suggest"
> >
<p class="min-w-0 flex-1">{suggestText}</p> <p class="min-w-0 flex-1">{suggestText}</p>
<a <a href={hrefFor('vi')} onclick={() => choose('vi')} class="sh-btn sh-btn-primary"
href={hrefFor('vi')}
onclick={() => choose('vi')}
class="bg-sh-accent text-sh-accent-ink border-sh-border rounded-[var(--radius-pill)] border px-3 py-2"
>{suggestAccept}</a >{suggestAccept}</a
> >
<button <button type="button" onclick={dismiss} class="sh-btn">{suggestDismiss}</button>
type="button"
onclick={dismiss}
class="border-sh-border rounded-[var(--radius-pill)] border px-3 py-2"
>{suggestDismiss}</button
>
</div> </div>
{/if} {/if}
@@ -111,8 +103,9 @@
/* Segmented EN | VI control: the current language is the filled segment. */ /* Segmented EN | VI control: the current language is the filled segment. */
.sh-lang { .sh-lang {
display: inline-flex; display: inline-flex;
border: 1px solid var(--sh-border); border: 1px solid var(--sh-control);
border-radius: var(--radius-pill); border-radius: var(--radius-btn);
background: var(--sh-surface);
overflow: hidden; overflow: hidden;
font-family: var(--font-mono); font-family: var(--font-mono);
font-size: var(--text-badge); font-size: var(--text-badge);
@@ -120,15 +113,16 @@
.sh-lang > * { .sh-lang > * {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
min-height: 2.25rem; min-height: 2.375rem;
padding: 0 0.75rem; padding: 0 0.7rem;
} }
.sh-lang > [aria-current='true'] { .sh-lang > [aria-current='true'] {
background: var(--sh-ink); background: var(--sh-accent);
color: var(--sh-bg); color: var(--sh-accent-ink);
font-weight: 600;
} }
.sh-lang > a:hover { .sh-lang > a:hover {
background: var(--sh-surface); background: var(--sh-surface-2);
} }
/* The endonym is read after the visible code ("VI — Tiếng Việt"), so the /* The endonym is read after the visible code ("VI — Tiếng Việt"), so the
visible text stays part of the accessible name (WCAG 2.5.3). Its leading visible text stays part of the accessible name (WCAG 2.5.3). Its leading
+28 -7
View File
@@ -3,6 +3,8 @@
docs/14 Part 2 — first-visit legal gate; docs/09 §4a — its human check. --> docs/14 Part 2 — first-visit legal gate; docs/09 §4a — its human check. -->
<script lang="ts"> <script lang="ts">
import { onMount, tick } from 'svelte'; import { onMount, tick } from 'svelte';
import IconScale from '~icons/lucide/scale';
import IconShield from '~icons/lucide/shield-check';
import { acceptLegal, isAccepted } from '../../lib/legal'; import { acceptLegal, isAccepted } from '../../lib/legal';
import { isHuman, PASS_TTL_MS, rememberHuman, UNVERIFIED_TTL_MS } from '../../lib/human'; import { isHuman, PASS_TTL_MS, rememberHuman, UNVERIFIED_TTL_MS } from '../../lib/human';
import { runHumanCheck, sitekeyFor } from '../../lib/turnstile'; import { runHumanCheck, sitekeyFor } from '../../lib/turnstile';
@@ -135,6 +137,7 @@
<!-- Focus lands on the heading, not on the first link or the accept button: <!-- Focus lands on the heading, not on the first link or the accept button:
a screen reader then reads the notice before any control. Autofocus is a screen reader then reads the notice before any control. Autofocus is
the dialog's own focusing step here, not a page-load focus grab. --> the dialog's own focusing step here, not a page-load focus grab. -->
<span class="sh-gate-icon" aria-hidden="true"><IconScale /></span>
<h2 id="sh-gate-title" tabindex="-1" autofocus>{strings.title}</h2> <h2 id="sh-gate-title" tabindex="-1" autofocus>{strings.title}</h2>
<p id="sh-gate-body"> <p id="sh-gate-body">
{strings.body} {strings.body}
@@ -147,6 +150,7 @@
{strings.accept} {strings.accept}
</button> </button>
{:else} {:else}
<span class="sh-gate-icon" aria-hidden="true"><IconShield /></span>
<h2 id="sh-gate-title" tabindex="-1" bind:this={verifyHeading}>{strings.verifyTitle}</h2> <h2 id="sh-gate-title" tabindex="-1" bind:this={verifyHeading}>{strings.verifyTitle}</h2>
<!-- A live region: the "skipped" note replaces the explanation in place. --> <!-- A live region: the "skipped" note replaces the explanation in place. -->
<p id="sh-gate-body" role="status" data-testid="sh-gate-status"> <p id="sh-gate-body" role="status" data-testid="sh-gate-status">
@@ -174,10 +178,23 @@
border-radius: var(--radius-card); border-radius: var(--radius-card);
background: var(--sh-surface); background: var(--sh-surface);
color: var(--sh-ink); color: var(--sh-ink);
padding: 1.5rem; box-shadow: var(--sh-shadow-3);
padding: 1.75rem;
} }
.sh-gate::backdrop { .sh-gate::backdrop {
background: rgb(0 0 0 / 0.55); background: oklch(0.17 0.03 255 / 0.6);
backdrop-filter: blur(3px);
}
.sh-gate-icon {
display: inline-grid;
place-items: center;
inline-size: 2.75rem;
block-size: 2.75rem;
margin-block-end: 0.75rem;
border-radius: var(--radius-tile);
background: var(--sh-accent-soft);
color: var(--sh-accent);
font-size: 1.375rem;
} }
h2 { h2 {
font-family: var(--font-display); font-family: var(--font-display);
@@ -194,14 +211,18 @@
text-underline-offset: 0.15em; text-underline-offset: 0.15em;
} }
button { button {
margin-top: 1rem; margin-top: 1.25rem;
border: 1px solid var(--sh-border); border: 1px solid var(--sh-accent);
border-radius: var(--radius-pill); border-radius: var(--radius-btn);
background: var(--sh-accent); background: var(--sh-accent);
color: var(--sh-accent-ink); color: var(--sh-accent-ink);
font-weight: 500; font-weight: 600;
padding: 0.5rem 1.25rem; padding: 0.55rem 1.25rem;
min-height: 44px; min-height: 44px;
box-shadow: var(--sh-shadow-1);
}
button:hover {
background: color-mix(in oklch, var(--sh-accent) 88%, var(--sh-ink));
} }
.sh-gate-widget:not(:empty) { .sh-gate-widget:not(:empty) {
margin-top: 1rem; margin-top: 1rem;
+14 -10
View File
@@ -211,14 +211,17 @@
.sh-prefs-button { .sh-prefs-button {
display: inline-grid; display: inline-grid;
place-items: center; place-items: center;
inline-size: 2.75rem; inline-size: 2.5rem;
block-size: 2.75rem; block-size: 2.5rem;
border: 1px solid var(--sh-border); border: 1px solid var(--sh-control);
border-radius: var(--radius-pill); border-radius: var(--radius-btn);
background: var(--sh-surface);
color: var(--sh-ink); color: var(--sh-ink);
transition: border-color var(--duration-fast) var(--ease-sh);
} }
.sh-prefs-button:hover { .sh-prefs-button:hover {
background: var(--sh-surface); border-color: var(--sh-accent);
background: var(--sh-surface-2);
} }
/* A popover is in the top layer and starts as a centred box with margin /* A popover is in the top layer and starts as a centred box with margin
@@ -233,7 +236,7 @@
border-radius: var(--radius-card); border-radius: var(--radius-card);
background: var(--sh-surface); background: var(--sh-surface);
color: var(--sh-ink); color: var(--sh-ink);
box-shadow: 0 12px 32px rgb(0 0 0 / 0.18); box-shadow: var(--sh-shadow-3);
} }
.sh-prefs-title { .sh-prefs-title {
font-family: var(--font-display); font-family: var(--font-display);
@@ -253,8 +256,8 @@
behaviour (arrow keys), one tab stop per group, form semantics for free. */ behaviour (arrow keys), one tab stop per group, form semantics for free. */
.sh-seg { .sh-seg {
display: flex; display: flex;
border: 1px solid var(--sh-border); border: 1px solid var(--sh-control);
border-radius: var(--radius-pill); border-radius: var(--radius-btn);
overflow: hidden; overflow: hidden;
} }
.sh-seg label { .sh-seg label {
@@ -280,8 +283,9 @@
border-inline-start: 1px solid var(--sh-border); border-inline-start: 1px solid var(--sh-border);
} }
.sh-seg input:checked + span { .sh-seg input:checked + span {
background: var(--sh-ink); background: var(--sh-accent);
color: var(--sh-bg); color: var(--sh-accent-ink);
font-weight: 600;
} }
.sh-seg input:focus-visible + span { .sh-seg input:focus-visible + span {
outline: 2px solid var(--sh-accent); outline: 2px solid var(--sh-accent);
+7 -2
View File
@@ -3,6 +3,7 @@
docs/05 §A2/§A3, docs/06 §5 — search input + grid controller. --> docs/05 §A2/§A3, docs/06 §5 — search input + grid controller. -->
<script lang="ts"> <script lang="ts">
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import IconSearch from '~icons/lucide/search';
import { mountGrid, type GridHandle } from '../../lib/grid'; import { mountGrid, type GridHandle } from '../../lib/grid';
import { loadSearchIndex } from '../../lib/searchIndex'; import { loadSearchIndex } from '../../lib/searchIndex';
import { categories, platforms, pricing, query, sort, type SortOrder } from '../../lib/stores'; import { categories, platforms, pricing, query, sort, type SortOrder } from '../../lib/stores';
@@ -186,6 +187,10 @@
<div class="flex flex-wrap items-center gap-3"> <div class="flex flex-wrap items-center gap-3">
<div class="relative min-w-0 flex-1"> <div class="relative min-w-0 flex-1">
<label class="sr-only" for="sh-search">{label}</label> <label class="sr-only" for="sh-search">{label}</label>
<IconSearch
aria-hidden="true"
class="text-sh-muted pointer-events-none absolute top-1/2 left-3.5 size-5 -translate-y-1/2"
/>
<input <input
id="sh-search" id="sh-search"
bind:this={input} bind:this={input}
@@ -194,7 +199,7 @@
autocomplete="off" autocomplete="off"
spellcheck="false" spellcheck="false"
enterkeyhint="search" enterkeyhint="search"
class="bg-sh-surface border-sh-border w-full rounded-[var(--radius-card)] border px-4 py-3" class="bg-sh-surface border-sh-control shadow-sh-1 w-full rounded-[var(--radius-card)] border py-3 pr-4 pl-11"
{value} {value}
oninput={onInput} oninput={onInput}
onkeydown={onKeydown} onkeydown={onKeydown}
@@ -212,7 +217,7 @@
<label class="sr-only" for="sh-sort">{sortLabel}</label> <label class="sr-only" for="sh-sort">{sortLabel}</label>
<select <select
id="sh-sort" id="sh-sort"
class="bg-sh-surface border-sh-border rounded-[var(--radius-card)] border px-3 py-3" class="bg-sh-surface border-sh-control shadow-sh-1 rounded-[var(--radius-card)] border px-3 py-3"
value={$sort} value={$sort}
onchange={onSortChange} onchange={onSortChange}
> >
+188 -83
View File
@@ -2,10 +2,16 @@
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 (SkullMute) // Copyright (C) 2026 poli0981 (SkullMute)
// docs/06 §5 — detail page. Shared by /apps/[slug] and /vi/apps/[slug]. // docs/06 §5 — detail page. Shared by /apps/[slug] and /vi/apps/[slug].
// Hero (logo, name, price, summary) → the official links, Download loudest →
// the facts in a ruled ledger → what the security line means → neighbours
// from the same category.
import type { CollectionEntry } from 'astro:content'; import type { CollectionEntry } from 'astro:content';
import { getEntry } from 'astro:content'; import { getCollection, getEntry } from 'astro:content';
import Base from '../../layouts/Base.astro'; import Base from '../../layouts/Base.astro';
import ShAppCard from '../ShAppCard.astro';
import ShIcon from '../ShIcon.astro';
import ShJsonLd from '../ShJsonLd.astro'; import ShJsonLd from '../ShJsonLd.astro';
import { compareNames } from '../../lib/filter';
import { logoSvg } from '../../lib/logo'; import { logoSvg } from '../../lib/logo';
import { localePath, t, type Locale } from '../../i18n'; import { localePath, t, type Locale } from '../../i18n';
@@ -21,18 +27,33 @@ const d = app.data;
const [primaryRef] = d.categories; const [primaryRef] = d.categories;
const primary = primaryRef ? await getEntry('categories', primaryRef.id) : undefined; const primary = primaryRef ? await getEntry('categories', primaryRef.id) : undefined;
const RELATED = 4;
const related = primary
? (await getCollection('apps'))
.filter((a) => a.id !== app.id && a.data.categories.some((c) => c.id === primary.id))
.sort((a, b) => compareNames(a.data.name, b.data.name))
.slice(0, RELATED)
: [];
const dateFmt = new Intl.DateTimeFormat(locale === 'vi' ? 'vi-VN' : 'en-GB', { const dateFmt = new Intl.DateTimeFormat(locale === 'vi' ? 'vi-VN' : 'en-GB', {
dateStyle: 'medium', dateStyle: 'medium',
timeZone: 'UTC', timeZone: 'UTC',
}); });
const fmt = (iso: string) => dateFmt.format(new Date(`${iso}T00:00:00Z`)); const fmt = (iso: string) => dateFmt.format(new Date(`${iso}T00:00:00Z`));
const security = const clean = d.security.status === 'clean';
d.security.status === 'clean' const security = clean
? `${t(locale, 'card.security.clean')} · ${t(locale, 'card.checked', { date: fmt(d.security.checkedAt) })}` ? `${t(locale, 'card.security.clean')} · ${t(locale, 'card.checked', { date: fmt(d.security.checkedAt) })}`
: `${t(locale, 'card.security.unverified')} · ${t(locale, 'card.listed', { date: fmt(d.addedAt) })}`; : `${t(locale, 'card.security.unverified')} · ${t(locale, 'card.listed', { date: fmt(d.addedAt) })}`;
const priceTone = {
free: 'sh-tone-ok',
'free-onetime': 'sh-tone-accent',
onetime: 'sh-tone-warn',
}[d.pricing];
interface MetaRow { interface MetaRow {
icon: string;
label: string; label: string;
value: string; value: string;
/** Outbound link for the row. Only the security row uses it, to reach the /** Outbound link for the row. Only the security row uses it, to reach the
@@ -43,18 +64,26 @@ interface MetaRow {
} }
const meta: MetaRow[] = [ const meta: MetaRow[] = [
{ icon: 'user-round', label: t(locale, 'detail.developer'), value: d.developer },
{ {
icon: 'monitor',
label: t(locale, 'detail.platforms'), label: t(locale, 'detail.platforms'),
value: d.platforms.map((p) => t(locale, `platform.${p}`)).join(' · '), value: d.platforms.map((p) => t(locale, `platform.${p}`)).join(' · '),
}, },
...(d.tags.length ? [{ label: t(locale, 'detail.tags'), value: d.tags.join(' · ') }] : []), ...(d.license ? [{ icon: 'scale', label: t(locale, 'detail.license'), value: d.license }] : []),
...(d.tags.length
? [{ icon: 'tags', label: t(locale, 'detail.tags'), value: d.tags.join(' · ') }]
: []),
{ {
icon: clean ? 'shield-check' : 'shield-question',
label: t(locale, 'detail.security'), label: t(locale, 'detail.security'),
value: security, value: security,
...(d.security.evidence ? { href: d.security.evidence } : {}), ...(d.security.evidence ? { href: d.security.evidence } : {}),
}, },
{ label: t(locale, 'detail.added'), value: fmt(d.addedAt) }, { icon: 'calendar-plus', label: t(locale, 'detail.added'), value: fmt(d.addedAt) },
...(d.updatedAt ? [{ label: t(locale, 'detail.updated'), value: fmt(d.updatedAt) }] : []), ...(d.updatedAt
? [{ icon: 'calendar-clock', label: t(locale, 'detail.updated'), value: fmt(d.updatedAt) }]
: []),
]; ];
--- ---
@@ -66,91 +95,167 @@ const meta: MetaRow[] = [
categoryLabelEn={primary?.data.label.en} categoryLabelEn={primary?.data.label.en}
/> />
<nav aria-label={t(locale, 'nav.breadcrumb')} class="text-sh-muted text-small"> <nav aria-label={t(locale, 'nav.breadcrumb')} class="text-sh-muted text-small">
<a href={localePath(locale, '/apps')} class="hover:underline"> <ol class="flex flex-wrap items-center gap-1.5">
{t(locale, 'apps.title')} <li>
</a> <a href={localePath(locale, '/apps')} class="hover:underline">
<span aria-hidden="true"> / </span> {t(locale, 'apps.title')}
{primary && ( </a>
<a href={localePath(locale, `/categories/${primary.id}`)} class="hover:underline"> </li>
{primary.data.label[locale]} {primary && (
</a> <li class="flex items-center gap-1.5">
)} <ShIcon name="chevron-right" class="size-3.5" />
<a href={localePath(locale, `/categories/${primary.id}`)} class="hover:underline">
{primary.data.label[locale]}
</a>
</li>
)}
<li class="flex items-center gap-1.5" aria-current="page">
<ShIcon name="chevron-right" class="size-3.5" />
<span class="text-sh-ink">{d.name}</span>
</li>
</ol>
</nav> </nav>
{/* No `transition:name` here. Astro generates a per-slug <style> for it and {/* No `transition:name` here. Astro generates a per-slug <style> for it and
does not add that style's hash to the page's own CSP, so the browser does not add that style's hash to the page's own CSP, so the browser
refused it on every hard load and every ClientRouter swap — the one refused it on every load — see docs/06 §7. */}
console error left after D20. Nothing was lost by removing it: a morph <section class="sh-panel sh-rise mt-5 p-6 md:p-8">
needs the same name on both sides and ShAppCard never carried one, so it <div class="flex flex-wrap items-start gap-5">
had never animated. See docs/06 §7. */} <span class="sh-tile size-20">
<header class="mt-4 flex items-start gap-4"> <Fragment
<Fragment set:html={logoSvg(d.logo, d.name, {
set:html={logoSvg(d.logo, d.name, { class: 'size-12',
class: 'size-16 shrink-0', 'aria-hidden': 'true',
'aria-hidden': 'true', fill: 'currentColor',
fill: 'currentColor', })}
})} />
/> </span>
<div> <div class="min-w-0 flex-1">
<h1 class="text-[length:var(--text-h1)] font-semibold">{d.name}</h1> <h1 class="text-[length:var(--text-h1)] font-semibold">{d.name}</h1>
<p class="text-sh-muted"> <p class="text-sh-muted mt-1">{d.developer}</p>
<span class="font-mono text-badge">{t(locale, 'detail.developer')}:</span> <p class="mt-3 flex flex-wrap gap-2">
{d.developer} <span class:list={['sh-pill', priceTone]}>{t(locale, `pricing.${d.pricing}`)}</span>
</p> {d.license && <span class="sh-pill">{d.license}</span>}
<p class="mt-2 flex flex-wrap gap-2"> </p>
<span class="sh-pill">{t(locale, `pricing.${d.pricing}`)}</span> </div>
{d.license && <span class="sh-pill">{d.license}</span>}
</p>
</div> </div>
</header>
<p class="mt-6 max-w-2xl text-[length:var(--text-h3)]">{d.summary[locale]}</p> <p class="mt-6 max-w-3xl text-[length:var(--text-h3)] leading-relaxed">{d.summary[locale]}</p>
{/* Link rail — Download is the page's one loud element (docs/06 §5). */} {/* Link rail — Download is the page's one loud element (docs/06 §5). */}
<div class="mt-8 flex flex-wrap gap-3"> <div class="mt-7 flex flex-wrap gap-3">
<a <a href={d.links.download} rel="noopener" class="sh-btn sh-btn-primary sh-anim">
href={d.links.homepage} <ShIcon name="download" class="size-[18px]" motion="pop" />
rel="noopener" {t(locale, 'detail.download')}
class="sh-lift border-sh-border rounded-[var(--radius-card)] border-2 px-4 py-3" <ShIcon name="arrow-up-right" class="size-4" motion="nudge-diag" />
>
{t(locale, 'detail.homepage')} ↗
</a>
{d.links.repo && (
<a
href={d.links.repo}
rel="noopener"
class="sh-lift border-sh-border rounded-[var(--radius-card)] border-2 px-4 py-3"
>
{t(locale, 'detail.repo')} ↗
</a> </a>
)} <a href={d.links.homepage} rel="noopener" class="sh-btn sh-anim">
<a <ShIcon name="globe" class="size-[18px]" motion="pop" />
href={d.links.download} {t(locale, 'detail.homepage')}
rel="noopener" <ShIcon name="arrow-up-right" class="size-4" motion="nudge-diag" />
class="sh-lift bg-sh-accent text-sh-accent-ink border-sh-border rounded-[var(--radius-card)] border-2 px-4 py-3 font-medium" </a>
{d.links.repo && (
<a href={d.links.repo} rel="noopener" class="sh-btn sh-anim">
<ShIcon name="code-xml" class="size-[18px]" motion="pop" />
{t(locale, 'detail.repo')}
<ShIcon name="arrow-up-right" class="size-4" motion="nudge-diag" />
</a>
)}
</div>
<p class="text-sh-muted mt-4 flex items-center gap-1.5 text-small">
<ShIcon name="badge-check" class="text-sh-accent size-4 shrink-0" />
{t(locale, 'detail.officialNote')}
</p>
</section>
<div class="mt-6 grid grid-cols-1 gap-6 lg:grid-cols-[1.4fr_1fr]">
<section class="sh-panel p-6" aria-labelledby="sh-facts">
<h2 id="sh-facts" class="sh-eyebrow">
{t(locale, 'detail.facts')}
</h2>
<dl class="mt-3">
{meta.map((row) => (
<div class="sh-fact">
<dt class="text-sh-muted flex items-center gap-2">
<ShIcon name={row.icon} class="size-4 shrink-0" />
{row.label}
</dt>
<dd class="font-mono text-small">
{row.value}
{row.href && (
<>
{' · '}
<a
href={row.href}
rel="noopener"
class="sh-anim text-sh-accent inline-flex items-center gap-0.5 underline"
>
{t(locale, 'detail.evidence')}
<ShIcon name="arrow-up-right" class="size-3.5" motion="nudge-diag" />
</a>
</>
)}
</dd>
</div>
))}
</dl>
</section>
<aside
class:list={[
'sh-panel p-6',
clean ? 'bg-sh-ok-soft border-transparent' : 'bg-sh-warn-soft border-transparent',
]}
aria-labelledby="sh-status"
> >
{t(locale, 'detail.download')} ↗ <h2 id="sh-status" class="flex items-center gap-2 font-semibold">
</a> <ShIcon
name={clean ? 'shield-check' : 'shield-question'}
class={`size-5 ${clean ? 'text-sh-ok' : 'text-sh-warn'}`}
/>
{t(locale, 'detail.securityNote.title')}
</h2>
<p class="mt-3 text-small leading-relaxed">
{t(locale, clean ? 'detail.securityNote.clean' : 'detail.securityNote.unverified')}
</p>
<a
href={localePath(locale, '/legal/disclaimer')}
class="sh-anim mt-4 inline-flex items-center gap-1 text-small font-medium underline"
>
{t(locale, 'detail.disclaimerLink')}
<ShIcon name="arrow-right" class="size-4" motion="nudge-x" />
</a>
</aside>
</div> </div>
<dl class="sh-panel mt-8 grid max-w-2xl gap-2 p-5 font-mono text-badge"> {primary && related.length > 0 && (
{meta.map((row) => ( <section class="mt-14" aria-labelledby="sh-related">
<div class="flex flex-wrap gap-x-3"> <h2 id="sh-related" class="text-[length:var(--text-h2)] font-semibold">
<dt class="text-sh-muted min-w-28">{row.label}</dt> {t(locale, 'detail.related', { category: primary.data.label[locale] })}
<dd> </h2>
{row.value} <div class="mt-5 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
{row.href && ( {related.map((r) => (
<> <ShAppCard app={r} {locale} headingLevel={3} />
{' · '} ))}
<a href={row.href} rel="noopener" class="underline">
{t(locale, 'detail.evidence')} ↗
</a>
</>
)}
</dd>
</div> </div>
))} </section>
</dl> )}
<p class="text-sh-muted mt-6 max-w-2xl text-small">{t(locale, 'detail.officialNote')}</p>
</Base> </Base>
<style>
.sh-fact {
display: grid;
grid-template-columns: minmax(8rem, 11rem) 1fr;
gap: 0.25rem 1rem;
padding: 0.65rem 0;
border-bottom: 1px dashed var(--sh-border);
}
.sh-fact:last-child {
border-bottom: 0;
}
@media (width < 30rem) {
.sh-fact {
grid-template-columns: 1fr;
}
}
</style>
+10 -10
View File
@@ -10,7 +10,7 @@ import ShAppCard from '../ShAppCard.astro';
import ShSearch from '../islands/ShSearch.svelte'; import ShSearch from '../islands/ShSearch.svelte';
import ShFilterSheet from '../islands/ShFilterSheet.svelte'; import ShFilterSheet from '../islands/ShFilterSheet.svelte';
import { sortCards } from '../../lib/filter'; import { sortCards } from '../../lib/filter';
import { t, type Locale } from '../../i18n'; import { appCount, t, type Locale } from '../../i18n';
interface Props { interface Props {
locale: Locale; locale: Locale;
@@ -36,11 +36,7 @@ const apps = sortCards(
).flatMap((c) => bySlug.get(c.slug) ?? []); ).flatMap((c) => bySlug.get(c.slug) ?? []);
const categories = (await getCollection('categories')).sort((a, b) => a.data.order - b.data.order); const categories = (await getCollection('categories')).sort((a, b) => a.data.order - b.data.order);
const lang = locale === 'vi' ? 'vi-VN' : 'en-GB'; const nf = new Intl.NumberFormat(locale === 'vi' ? 'vi-VN' : 'en-GB');
const nf = new Intl.NumberFormat(lang);
const plural = new Intl.PluralRules(lang);
const countText = (n: number) =>
t(locale, plural.select(n) === 'one' ? 'apps.count.one' : 'apps.count', { n: nf.format(n) });
const facetOptions = { const facetOptions = {
categories: categories.map((c) => ({ value: c.id, label: c.data.label[locale] })), categories: categories.map((c) => ({ value: c.id, label: c.data.label[locale] })),
@@ -60,13 +56,14 @@ const facetOptions = {
description={t(locale, 'meta.apps', { n: nf.format(apps.length) })} description={t(locale, 'meta.apps', { n: nf.format(apps.length) })}
{locale} {locale}
> >
<h1 class="text-[length:var(--text-h1)] font-semibold">{t(locale, 'apps.title')}</h1> <p class="sh-eyebrow">{t(locale, 'welcome.manifest')}</p>
<h1 class="mt-2 text-[length:var(--text-h1)] font-semibold">{t(locale, 'apps.title')}</h1>
<p class="text-sh-muted mt-2 max-w-2xl">{t(locale, 'apps.intro')}</p> <p class="text-sh-muted mt-2 max-w-2xl">{t(locale, 'apps.intro')}</p>
{/* client:idle — the grid is readable without either island (docs/02 §5). {/* client:idle — the grid is readable without either island (docs/02 §5).
#search is where the welcome page's search field points. */} #search is where the welcome page's search field points. */}
<div id="search" class="mt-6 flex scroll-mt-24 flex-wrap items-center gap-3"> <div id="search" class="mt-6 flex scroll-mt-24 flex-wrap items-center gap-3">
<div class="min-w-0 flex-1"> <div class="min-w-0 flex-1 basis-full sm:basis-0">
<ShSearch <ShSearch
client:idle client:idle
placeholder={t(locale, 'search.placeholder')} placeholder={t(locale, 'search.placeholder')}
@@ -106,10 +103,13 @@ const facetOptions = {
data-count-one={t(locale, 'apps.count.one', { n: '{n}' })} data-count-one={t(locale, 'apps.count.one', { n: '{n}' })}
data-count-other={t(locale, 'apps.count', { n: '{n}' })} data-count-other={t(locale, 'apps.count', { n: '{n}' })}
> >
{countText(apps.length)} {appCount(locale, apps.length)}
</p> </p>
<div id="sh-grid" class="mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"> <div
id="sh-grid"
class="mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"
>
{apps.map((app) => ( {apps.map((app) => (
<ShAppCard {app} {locale} /> <ShAppCard {app} {locale} />
))} ))}
+49 -36
View File
@@ -1,12 +1,13 @@
--- ---
// SPDX-License-Identifier: GPL-3.0-only // SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 (SkullMute) // Copyright (C) 2026 poli0981 (SkullMute)
// Category index. The header has always linked here (docs/06 §4); until M2 the // Category index — one tile per category: its icon, its name, how many apps,
// link 404'd. // and the first few names, so the tile says what is inside before a click.
import { getCollection } from 'astro:content'; import { getCollection } from 'astro:content';
import Base from '../../layouts/Base.astro'; import Base from '../../layouts/Base.astro';
import { iconSvg } from '../../lib/icon'; import ShIcon from '../ShIcon.astro';
import { localePath, t, type Locale } from '../../i18n'; import { compareNames } from '../../lib/filter';
import { appCount, localePath, t, type Locale } from '../../i18n';
interface Props { interface Props {
locale: Locale; locale: Locale;
@@ -15,8 +16,11 @@ const { locale } = Astro.props;
const categories = (await getCollection('categories')).sort((a, b) => a.data.order - b.data.order); const categories = (await getCollection('categories')).sort((a, b) => a.data.order - b.data.order);
const apps = await getCollection('apps'); const apps = await getCollection('apps');
const countFor = (id: string) => const inCategory = (id: string) =>
apps.filter((a) => a.data.categories.some((c) => c.id === id)).length; apps
.filter((a) => a.data.categories.some((c) => c.id === id))
.sort((a, b) => compareNames(a.data.name, b.data.name));
const SAMPLE = 3;
--- ---
<Base <Base
@@ -24,37 +28,46 @@ const countFor = (id: string) =>
description={t(locale, 'meta.categories')} description={t(locale, 'meta.categories')}
{locale} {locale}
> >
<h1 class="text-[length:var(--text-h1)] font-semibold">{t(locale, 'categories.title')}</h1> <p class="sh-eyebrow">{t(locale, 'welcome.manifest')}</p>
<h1 class="mt-2 text-[length:var(--text-h1)] font-semibold">{t(locale, 'categories.title')}</h1>
<p class="text-sh-muted mt-2 max-w-2xl">{t(locale, 'categories.intro')}</p> <p class="text-sh-muted mt-2 max-w-2xl">{t(locale, 'categories.intro')}</p>
<ul class="mt-8 grid gap-4 sm:grid-cols-2 lg:grid-cols-3"> <ul class="sh-stagger mt-8 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
{categories.map((c) => ( {categories.map((c) => {
<li class="sh-panel sh-lift relative p-5"> const members = inCategory(c.id);
<div class="flex items-center gap-3"> return (
<Fragment <li class="sh-panel sh-lift sh-anim relative flex flex-col gap-4 p-5">
set:html={iconSvg(`lucide:${c.data.icon}`, { <div class="flex items-center gap-4">
class: 'size-6 shrink-0', <span class="sh-tile text-sh-accent size-12">
'aria-hidden': 'true', <ShIcon name={c.data.icon} class="size-6" motion="pop" />
})} </span>
/> <div class="min-w-0">
<h2 class="text-[length:var(--text-h3)] font-semibold"> <h2 class="text-[length:var(--text-h3)] font-semibold">
<a href={localePath(locale, `/categories/${c.id}`)} class="sh-stretch"> <a href={localePath(locale, `/categories/${c.id}`)} class="sh-stretch">
{c.data.label[locale]} {c.data.label[locale]}
</a> </a>
</h2> </h2>
</div> <p class="sh-eyebrow mt-0.5 normal-case tracking-normal">
<p class="text-sh-muted mt-2 font-mono text-badge"> {appCount(locale, members.length)}
{t(locale, 'apps.count', { n: countFor(c.id) })} </p>
</p> </div>
</li> <ShIcon
))} name="arrow-right"
class="text-sh-muted ml-auto size-4 shrink-0"
motion="nudge-x"
/>
</div>
{members.length > 0 && (
<p class="text-sh-muted border-sh-border border-t border-dashed pt-3 text-small">
{members
.slice(0, SAMPLE)
.map((a) => a.data.name)
.join(' · ')}
{members.length > SAMPLE && ' …'}
</p>
)}
</li>
);
})}
</ul> </ul>
</Base> </Base>
<style>
.sh-stretch::after {
content: '';
position: absolute;
inset: 0;
}
</style>
+17 -5
View File
@@ -7,7 +7,8 @@ import { getCollection } from 'astro:content';
import Base from '../../layouts/Base.astro'; import Base from '../../layouts/Base.astro';
import ShAppCard from '../ShAppCard.astro'; import ShAppCard from '../ShAppCard.astro';
import { byAddedDesc } from '../../lib/paths'; import { byAddedDesc } from '../../lib/paths';
import { localePath, t, type Locale } from '../../i18n'; import ShIcon from '../ShIcon.astro';
import { appCount, localePath, t, type Locale } from '../../i18n';
interface Props { interface Props {
category: CollectionEntry<'categories'>; category: CollectionEntry<'categories'>;
@@ -29,18 +30,29 @@ const count = new Intl.NumberFormat(locale === 'vi' ? 'vi-VN' : 'en-GB').format(
{locale} {locale}
> >
<nav aria-label={t(locale, 'nav.breadcrumb')} class="text-sh-muted text-small"> <nav aria-label={t(locale, 'nav.breadcrumb')} class="text-sh-muted text-small">
<a href={localePath(locale, '/categories')} class="hover:underline"> <a
href={localePath(locale, '/categories')}
class="sh-anim inline-flex items-center gap-1 hover:underline"
>
<ShIcon name="arrow-left" class="size-4" />
{t(locale, 'categories.title')} {t(locale, 'categories.title')}
</a> </a>
</nav> </nav>
<h1 class="mt-4 text-[length:var(--text-h1)] font-semibold">{label}</h1> <div class="mt-5 flex items-center gap-4">
<p class="text-sh-muted mt-2 font-mono text-badge">{t(locale, 'apps.count', { n: count })}</p> <span class="sh-tile bg-sh-accent-soft text-sh-accent size-14 border-transparent">
<ShIcon name={category.data.icon} class="size-7" />
</span>
<div>
<h1 class="text-[length:var(--text-h1)] font-semibold">{label}</h1>
<p class="sh-eyebrow mt-1 normal-case tracking-normal">{appCount(locale, apps.length)}</p>
</div>
</div>
{apps.length === 0 ? ( {apps.length === 0 ? (
<p class="sh-panel text-sh-muted mt-8 p-6">{t(locale, 'categories.empty')}</p> <p class="sh-panel text-sh-muted mt-8 p-6">{t(locale, 'categories.empty')}</p>
) : ( ) : (
<div class="mt-8 grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"> <div class="mt-8 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
{apps.map((app) => ( {apps.map((app) => (
<ShAppCard {app} {locale} /> <ShAppCard {app} {locale} />
))} ))}
+86
View File
@@ -0,0 +1,86 @@
---
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 (SkullMute)
//
// /contact and /vi/contact (D27): one address per purpose, all reaching the
// one maintainer. Exempt from the legal gate — a copyright or security notice
// must never wait behind "I understand and accept".
import Base from '../../layouts/Base.astro';
import ShIcon from '../ShIcon.astro';
import { CONTACTS } from '../../lib/contacts';
import { localePath, t, type Locale } from '../../i18n';
interface Props {
locale: Locale;
}
const { locale } = Astro.props;
const ISSUES = 'https://github.com/poli0981/softharbor/issues/new/choose';
/** Order is urgency: what can hurt someone first, press and collaboration last. */
const rows = [
{ key: 'security', icon: 'shield-alert' },
{ key: 'privacy', icon: 'eye-off' },
{ key: 'dmca', icon: 'copyright', more: '/legal/terms#copyright' },
{ key: 'takedown', icon: 'flag' },
{ key: 'legal', icon: 'scale' },
{ key: 'copyright', icon: 'scroll-text' },
{ key: 'conduct', icon: 'handshake' },
{ key: 'press', icon: 'newspaper' },
{ key: 'collab', icon: 'sparkles' },
] as const;
---
<Base
title={`${t(locale, 'contact.title')} — ${t(locale, 'site.name')}`}
description={t(locale, 'meta.contact')}
{locale}
gateExempt
>
<p class="sh-eyebrow">{t(locale, 'site.name')}</p>
<h1 class="mt-2 text-[length:var(--text-h1)] font-semibold">{t(locale, 'contact.title')}</h1>
<p class="text-sh-muted mt-3 max-w-2xl">{t(locale, 'contact.intro')}</p>
<ul class="sh-stagger mt-8 grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-3">
{rows.map((row) => {
const address = CONTACTS[row.key];
return (
<li class="sh-panel flex gap-4 p-5">
<span class="sh-tile text-sh-accent size-11">
<ShIcon name={row.icon} class="size-5" />
</span>
<div class="min-w-0">
<p class="font-medium">{t(locale, `contact.${row.key}`)}</p>
<a
href={`mailto:${address}`}
class="text-sh-accent mt-1 inline-block font-mono text-small break-all underline"
>
{address}
</a>
{'more' in row && (
<a
href={localePath(locale, row.more)}
class="sh-anim text-sh-muted mt-1 flex items-center gap-1 text-small hover:underline"
>
{t(locale, 'legal.title.terms')}
<ShIcon name="arrow-right" class="size-3.5" motion="nudge-x" />
</a>
)}
</div>
</li>
);
})}
</ul>
<section class="sh-panel bg-sh-accent-soft mt-8 flex flex-wrap items-center gap-4 border-transparent p-6">
<span class="sh-tile text-sh-accent size-11">
<ShIcon name="message-square-text" class="size-5" />
</span>
<p class="min-w-0 flex-1">{t(locale, 'contact.issues')}</p>
<a href={ISSUES} rel="noopener" class="sh-btn sh-btn-primary sh-anim">
{t(locale, 'contact.issuesLink')}
<ShIcon name="arrow-up-right" class="size-4" motion="nudge-diag" />
</a>
</section>
<p class="text-sh-muted mt-6 max-w-2xl text-small">{t(locale, 'contact.languages')}</p>
</Base>
+51 -28
View File
@@ -9,6 +9,7 @@
// no safe moment to pick one. Copy lives in the dictionaries (error.<kind>.*) // no safe moment to pick one. Copy lives in the dictionaries (error.<kind>.*)
// like every other UI string, so i18n:check covers it. // like every other UI string, so i18n:check covers it.
import Base from '../../layouts/Base.astro'; import Base from '../../layouts/Base.astro';
import ShIcon from '../ShIcon.astro';
import { t } from '../../i18n'; import { t } from '../../i18n';
type Kind = '404' | 'offline' | '403' | '429' | '500'; type Kind = '404' | 'offline' | '403' | '429' | '500';
@@ -23,6 +24,14 @@ interface Props {
noindex?: boolean; noindex?: boolean;
} }
const { kind, noindex = true } = Astro.props; const { kind, noindex = true } = Astro.props;
const ICON: Record<Kind, string> = {
'404': 'map-pinned',
offline: 'wifi-off',
'403': 'lock',
'429': 'hourglass',
'500': 'life-buoy',
};
--- ---
<Base <Base
@@ -32,36 +41,50 @@ const { kind, noindex = true } = Astro.props;
gateExempt gateExempt
alternates={false} alternates={false}
> >
<div class="relative"> <section class="sh-contours py-6 md:py-14">
{/* Giant clipped status code at 40% opacity, behind the text (docs/06 §5). */} {/* The status code, set large in the ledger's mono and fading behind the
<span text (docs/06 §5) — decoration, so hidden from assistive tech. */}
<p
aria-hidden="true" aria-hidden="true"
class="text-sh-muted pointer-events-none absolute -top-10 -left-2 font-mono text-[8rem] leading-none opacity-40 select-none" class="text-sh-accent pointer-events-none font-mono text-[clamp(5rem,18vw,10rem)] leading-none font-medium tracking-tight opacity-25 select-none"
> >
{kind} {kind === 'offline' ? '···' : kind}
</span> </p>
<div class="relative">
<h1 class="text-[length:var(--text-h1)] font-semibold">{t('en', `error.${kind}.title`)}</h1>
<p class="text-sh-muted mt-3 max-w-xl">{t('en', `error.${kind}.body`)}</p>
<h2 class="mt-8 text-[length:var(--text-h3)] font-semibold" lang="vi"> <div class="mt-2 grid max-w-4xl grid-cols-1 gap-6 md:grid-cols-2">
{t('vi', `error.${kind}.title`)} <div class="sh-panel p-6">
</h2> <span class="sh-tile bg-sh-accent-soft text-sh-accent size-11 border-transparent">
<p class="text-sh-muted mt-2 max-w-xl" lang="vi"> <ShIcon name={ICON[kind]} class="size-[22px]" />
{t('vi', `error.${kind}.body`)} </span>
</p> <h1 class="mt-4 text-[length:var(--text-h2)] font-semibold">
{t('en', `error.${kind}.title`)}
<p class="mt-8 flex flex-wrap gap-4"> </h1>
<a href="/" class="text-sh-accent underline"> <p class="text-sh-muted mt-2">{t('en', `error.${kind}.body`)}</p>
{t('en', 'error.home')} </div>
</a> <div class="sh-panel p-6" lang="vi">
<a href="/apps" class="text-sh-accent underline"> <span class="sh-tile bg-sh-accent-soft text-sh-accent size-11 border-transparent">
{t('en', 'nav.apps')} <ShIcon name={ICON[kind]} class="size-[22px]" />
</a> </span>
<a href="/vi" class="text-sh-accent underline" lang="vi"> <h2 class="mt-4 text-[length:var(--text-h2)] font-semibold">
{t('vi', 'error.home')} {t('vi', `error.${kind}.title`)}
</a> </h2>
</p> <p class="text-sh-muted mt-2">{t('vi', `error.${kind}.body`)}</p>
</div>
</div> </div>
</div>
<p class="mt-8 flex flex-wrap gap-3">
<a href="/" class="sh-btn sh-btn-primary sh-anim">
<ShIcon name="anchor" class="size-[18px]" motion="pop" />
{t('en', 'error.home')}
</a>
<a href="/apps" class="sh-btn sh-anim">
<ShIcon name="layout-grid" class="size-[18px]" motion="pop" />
{t('en', 'nav.apps')}
</a>
<a href="/vi" class="sh-btn sh-anim" lang="vi">
<ShIcon name="languages" class="size-[18px]" motion="pop" />
{t('vi', 'error.home')}
</a>
</p>
</section>
</Base> </Base>
+13 -1
View File
@@ -37,7 +37,8 @@ const updated = new Intl.DateTimeFormat(locale === 'vi' ? 'vi-VN' : 'en-GB', {
gateExempt gateExempt
> >
<article class="sh-prose max-w-2xl"> <article class="sh-prose max-w-2xl">
<h1 class="text-[length:var(--text-h1)] font-semibold">{title}</h1> <p class="sh-eyebrow">{t(locale, 'footer.legal.heading')}</p>
<h1 class="mt-2 text-[length:var(--text-h1)] font-semibold">{title}</h1>
<p class="text-sh-muted mt-2 font-mono text-badge"> <p class="text-sh-muted mt-2 font-mono text-badge">
{t(locale, 'legal.lastUpdated', { date: updated })} {t(locale, 'legal.lastUpdated', { date: updated })}
@@ -97,4 +98,15 @@ const updated = new Intl.DateTimeFormat(locale === 'vi' ? 'vi-VN' : 'en-GB', {
.sh-prose li::marker { .sh-prose li::marker {
color: var(--sh-muted); color: var(--sh-muted);
} }
.sh-prose code {
font-family: var(--font-mono);
font-size: 0.9em;
background: var(--sh-surface-2);
border: 1px solid var(--sh-border);
border-radius: 6px;
padding: 0.05em 0.35em;
}
.sh-prose h2[id] {
scroll-margin-top: 6rem;
}
</style> </style>
+187 -19
View File
@@ -4,42 +4,210 @@
// docs/06 §5 — Welcome. Rendered by BOTH /src/pages/index.astro and // docs/06 §5 — Welcome. Rendered by BOTH /src/pages/index.astro and
// /src/pages/vi/index.astro; the locale is the only difference, so the markup // /src/pages/vi/index.astro; the locale is the only difference, so the markup
// lives here exactly once (docs/07 §2). // lives here exactly once (docs/07 §2).
//
// The search "field" in the hero is a LINK to /apps#search, styled as an
// input: the real search is an island on /apps, and docs/02 §5 caps islands
// at six — so the home page stays island-free and works with JS off.
import { getCollection } from 'astro:content';
import Base from '../../layouts/Base.astro'; import Base from '../../layouts/Base.astro';
import ShIcon from '../ShIcon.astro';
import ShJsonLd from '../ShJsonLd.astro'; import ShJsonLd from '../ShJsonLd.astro';
import { localePath, t, type Locale } from '../../i18n'; import { appCount, localePath, t, type Locale } from '../../i18n';
interface Props { interface Props {
locale: Locale; locale: Locale;
} }
const { locale } = Astro.props; const { locale } = Astro.props;
const how = ['welcome.how.official', 'welcome.how.pricing', 'welcome.how.security'] as const; const apps = await getCollection('apps');
const categories = (await getCollection('categories')).sort((a, b) => a.data.order - b.data.order);
const nf = new Intl.NumberFormat(locale === 'vi' ? 'vi-VN' : 'en-GB');
const count = (pred: (a: (typeof apps)[number]) => boolean) => nf.format(apps.filter(pred).length);
const perCategory = (id: string) =>
apps.filter((a) => a.data.categories.some((c) => c.id === id)).length;
// The ledger: every figure counted from the data at build time.
const manifest = [
{ icon: 'package', label: t(locale, 'welcome.manifest.apps'), value: nf.format(apps.length) },
{
icon: 'gift',
label: t(locale, 'welcome.manifest.free'),
value: count((a) => a.data.pricing === 'free'),
},
{
icon: 'receipt',
label: t(locale, 'welcome.manifest.once'),
value: count((a) => a.data.pricing !== 'free'),
},
{
icon: 'shield-check',
label: t(locale, 'welcome.manifest.clean'),
value: count((a) => a.data.security.status === 'clean'),
},
{
icon: 'monitor-smartphone',
label: t(locale, 'welcome.manifest.platforms'),
value: (['windows', 'macos', 'linux'] as const)
.map((p) => count((a) => a.data.platforms.includes(p)))
.join(' · '),
},
];
const how = [
{ key: 'welcome.how.official', icon: 'badge-check' },
{ key: 'welcome.how.pricing', icon: 'hand-coins' },
{ key: 'welcome.how.security', icon: 'calendar-check' },
] as const;
const appsHref = localePath(locale, '/apps');
--- ---
<Base title={`${t(locale, 'site.name')} — ${t(locale, 'site.tagline')}`} {locale}> <Base title={`${t(locale, 'site.name')} — ${t(locale, 'site.tagline')}`} {locale}>
<ShJsonLd {locale} site={Astro.site ?? new URL('https://softharbor.net')} website /> <ShJsonLd {locale} site={Astro.site ?? new URL('https://softharbor.net')} website />
<section class="max-w-3xl"> <section class="sh-contours grid grid-cols-1 items-center gap-10 pt-4 lg:grid-cols-[1.3fr_1fr] lg:gap-14 lg:pt-14">
<h1 class="text-[length:var(--text-display)] font-semibold"> <div class="sh-stagger">
{t(locale, 'welcome.hero.title')} <p class="sh-eyebrow flex items-center gap-2">
</h1> <ShIcon name="compass" class="text-sh-accent size-4" />
<p class="text-sh-muted mt-4 text-[length:var(--text-h3)]">{t(locale, 'welcome.hero.sub')}</p> {t(locale, 'welcome.hero.eyebrow')}
<a </p>
href={localePath(locale, '/apps')} <h1 class="mt-5 text-[length:var(--text-hero)] leading-[1.06] font-bold tracking-[-0.035em]">
class="sh-lift bg-sh-accent text-sh-accent-ink border-sh-border mt-8 inline-block rounded-[var(--radius-card)] border-2 px-5 py-3 font-medium" {t(locale, 'welcome.hero.title')}
> </h1>
{t(locale, 'welcome.cta')} <p class="text-sh-muted mt-5 max-w-xl text-[length:var(--text-h3)] leading-relaxed">
</a> {t(locale, 'welcome.hero.sub')}
</p>
<a href={`${appsHref}#search`} class="sh-searchbox sh-anim mt-8">
<ShIcon name="search" class="text-sh-accent size-5" motion="pop" />
<span>{t(locale, 'welcome.search', { n: nf.format(apps.length) })}</span>
<kbd class="sh-kbd ml-auto" aria-hidden="true">
/
</kbd>
</a>
<div class="mt-5 flex flex-wrap gap-3">
<a href={appsHref} class="sh-btn sh-btn-primary sh-anim">
{t(locale, 'welcome.cta')}
<ShIcon name="arrow-right" class="size-[18px]" motion="nudge-x" />
</a>
<a href={localePath(locale, '/categories')} class="sh-btn sh-anim">
<ShIcon name="shapes" class="size-[18px]" motion="pop" />
{t(locale, 'welcome.categories.all')}
</a>
</div>
</div>
<aside class="sh-panel sh-rise p-6 lg:p-7" aria-labelledby="sh-manifest">
<h2 id="sh-manifest" class="sh-eyebrow flex items-center gap-2">
<ShIcon name="scroll-text" class="size-4" />
{t(locale, 'welcome.manifest')}
</h2>
<dl class="mt-4">
{manifest.map((row) => (
<div class="sh-ledger">
<dt class="flex items-center gap-2.5">
<ShIcon name={row.icon} class="text-sh-accent size-[18px]" />
{row.label}
</dt>
<dd class="font-mono font-medium tabular-nums">{row.value}</dd>
</div>
))}
</dl>
<p class="text-sh-muted mt-4 text-small">{t(locale, 'welcome.manifest.note')}</p>
</aside>
</section> </section>
<section class="mt-16"> <section class="mt-20" aria-labelledby="sh-cats">
<h2 class="text-[length:var(--text-h2)] font-semibold">{t(locale, 'welcome.how.title')}</h2> <div class="flex flex-wrap items-end justify-between gap-3">
<ul class="mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3"> <h2 id="sh-cats" class="text-[length:var(--text-h2)] font-semibold">
{how.map((key) => ( {t(locale, 'welcome.categories')}
<li class="sh-panel p-5"> </h2>
<p>{t(locale, key)}</p> <a
href={localePath(locale, '/categories')}
class="sh-anim text-sh-accent inline-flex items-center gap-1.5 font-medium hover:underline"
>
{t(locale, 'welcome.categories.all')}
<ShIcon name="arrow-right" class="size-4" motion="nudge-x" />
</a>
</div>
<ul class="sh-stagger mt-6 grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
{categories.map((c) => (
<li class="sh-panel sh-lift sh-anim relative flex items-center gap-4 p-4">
<span class="sh-tile text-sh-accent size-12">
<ShIcon name={c.data.icon} class="size-6" motion="pop" />
</span>
<div class="min-w-0">
<h3 class="text-[length:var(--text-body)] font-semibold">
<a href={localePath(locale, `/categories/${c.id}`)} class="sh-stretch">
{c.data.label[locale]}
</a>
</h3>
<p class="sh-eyebrow mt-0.5 normal-case tracking-normal">
{appCount(locale, perCategory(c.id))}
</p>
</div>
<ShIcon
name="arrow-right"
class="text-sh-muted ml-auto size-4 shrink-0"
motion="nudge-x"
/>
</li> </li>
))} ))}
</ul> </ul>
</section> </section>
<section class="mt-20" aria-labelledby="sh-how">
<h2 id="sh-how" class="text-[length:var(--text-h2)] font-semibold">
{t(locale, 'welcome.how.title')}
</h2>
<ol class="mt-6 grid grid-cols-1 gap-4 md:grid-cols-3">
{how.map((item, i) => (
<li class="sh-panel flex gap-4 p-5">
<span class="sh-tile bg-sh-accent-soft text-sh-accent size-11 border-transparent">
<ShIcon name={item.icon} class="size-[22px]" />
</span>
<div>
<p class="sh-eyebrow">{`0${i + 1}`}</p>
<p class="mt-1">{t(locale, item.key)}</p>
</div>
</li>
))}
</ol>
</section>
</Base> </Base>
<style>
.sh-searchbox {
display: flex;
align-items: center;
gap: 0.75rem;
max-width: 34rem;
min-height: 3.5rem;
padding: 0 0.75rem 0 1rem;
border: 1px solid var(--sh-control);
border-radius: var(--radius-card);
background: var(--sh-surface);
box-shadow: var(--sh-shadow-1);
color: var(--sh-muted);
text-decoration: none;
transition:
border-color var(--duration-fast) var(--ease-sh),
box-shadow var(--duration-slow) var(--ease-sh);
}
.sh-searchbox:hover {
border-color: var(--sh-accent);
box-shadow: var(--sh-shadow-2);
}
/* A ruled ledger line: label left, figure right, a hairline between rows. */
.sh-ledger {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: 0.7rem 0;
border-bottom: 1px dashed var(--sh-border);
}
.sh-ledger:last-child {
border-bottom: 0;
}
</style>
+42 -1
View File
@@ -13,15 +13,38 @@
"categories.empty": "No apps in this category yet.", "categories.empty": "No apps in this category yet.",
"categories.intro": "Twelve categories, each linking straight to official pages.", "categories.intro": "Twelve categories, each linking straight to official pages.",
"categories.title": "Categories", "categories.title": "Categories",
"contact.address": "Address",
"contact.collab": "Collaboration",
"contact.conduct": "A Code of Conduct report",
"contact.copyright": "Licensing of the code or the dataset",
"contact.dmca": "A copyright complaint",
"contact.intro": "SoftHarbor is run by one person. Each address below reaches the same maintainer, sorted by purpose, so your message is read in the right context.",
"contact.issues": "Wrong information, a broken link, or an app to suggest? Open a GitHub issue — it is public, and usually faster.",
"contact.issuesLink": "Open an issue",
"contact.languages": "We read and reply in English and Vietnamese. Email is handled as the Privacy Policy describes.",
"contact.legal": "Terms, the disclaimer and other legal questions",
"contact.press": "Press",
"contact.privacy": "Privacy and your data",
"contact.purpose": "About",
"contact.security": "A security vulnerability, or a hijacked or malicious listing",
"contact.takedown": "Changing or removing your app’s listing or logo",
"contact.title": "Contact",
"detail.added": "Added", "detail.added": "Added",
"detail.developer": "Developer", "detail.developer": "Developer",
"detail.disclaimerLink": "Read the Disclaimer",
"detail.download": "Download", "detail.download": "Download",
"detail.evidence": "View scan", "detail.evidence": "View scan",
"detail.facts": "At a glance",
"detail.homepage": "Homepage", "detail.homepage": "Homepage",
"detail.license": "License",
"detail.officialNote": "Links go to the official site. SoftHarbor hosts no downloads.", "detail.officialNote": "Links go to the official site. SoftHarbor hosts no downloads.",
"detail.platforms": "Platforms", "detail.platforms": "Platforms",
"detail.related": "More in {category}",
"detail.repo": "Repository", "detail.repo": "Repository",
"detail.security": "Security", "detail.security": "Security",
"detail.securityNote.clean": "On the date shown, this entry went through our published checklist and nothing worrying turned up. It is not an audit or a guarantee — software can change after a check. Download only from the official link, and verify signatures or checksums where the developer offers them.",
"detail.securityNote.title": "What this status means",
"detail.securityNote.unverified": "The checklist has not been completed for this entry, or something it found needs a closer look. It meets every other rule of the list. Take the care you would with any download, and prefer the official link.",
"detail.tags": "Tags", "detail.tags": "Tags",
"detail.updated": "Updated", "detail.updated": "Updated",
"error.403.body": "Nothing on SoftHarbor requires permission, so this is unexpected. If you reached this page, please report it.", "error.403.body": "Nothing on SoftHarbor requires permission, so this is unexpected. If you reached this page, please report it.",
@@ -43,7 +66,11 @@
"filters.pricing": "Pricing", "filters.pricing": "Pricing",
"filters.show": "Show {n} apps", "filters.show": "Show {n} apps",
"filters.show.one": "Show {n} app", "filters.show.one": "Show {n} app",
"footer.api": "JSON dataset",
"footer.browse": "Browse",
"footer.builtAt": "Built {date}", "footer.builtAt": "Built {date}",
"footer.contact": "Contact",
"footer.data": "Open data",
"footer.github": "Source on GitHub", "footer.github": "Source on GitHub",
"footer.legal.aiDisclosure": "AI disclosure", "footer.legal.aiDisclosure": "AI disclosure",
"footer.legal.disclaimer": "Disclaimer", "footer.legal.disclaimer": "Disclaimer",
@@ -53,6 +80,9 @@
"footer.legal.thirdParty": "Third-party", "footer.legal.thirdParty": "Third-party",
"footer.legal.trademarks": "Trademarks", "footer.legal.trademarks": "Trademarks",
"footer.license": "Code GPL-3.0 · Data CC BY-SA 4.0", "footer.license": "Code GPL-3.0 · Data CC BY-SA 4.0",
"footer.project": "Project",
"footer.releases": "Releases",
"footer.rss": "RSS feed",
"gate.accept": "I understand and accept", "gate.accept": "I understand and accept",
"gate.and": "and", "gate.and": "and",
"gate.body": "SoftHarbor is a link directory. We don't host downloads, and we can't guarantee third-party software. Statuses like \"no known warnings\" reflect checks on the date shown — verify anything you install. By continuing you accept the", "gate.body": "SoftHarbor is a link directory. We don't host downloads, and we can't guarantee third-party software. Statuses like \"no known warnings\" reflect checks on the date shown — verify anything you install. By continuing you accept the",
@@ -78,6 +108,7 @@
"meta.apps": "Browse {n} desktop apps that are free or buy-once, filtered by category, platform and pricing. Every link goes to the developer's official page.", "meta.apps": "Browse {n} desktop apps that are free or buy-once, filtered by category, platform and pricing. Every link goes to the developer's official page.",
"meta.categories": "Twelve categories of desktop software that is free or buy-once — browsers, developer tools, graphics, media, security and more.", "meta.categories": "Twelve categories of desktop software that is free or buy-once — browsers, developer tools, graphics, media, security and more.",
"meta.category": "{label}: {n} desktop apps that are free or buy-once. Every link goes to the developer's own site — SoftHarbor hosts no downloads.", "meta.category": "{label}: {n} desktop apps that are free or buy-once. Every link goes to the developer's own site — SoftHarbor hosts no downloads.",
"meta.contact": "How to reach SoftHarbor: one address per purpose — security, privacy, legal, copyright, listings, press and collaboration.",
"meta.legal": "{title} for SoftHarbor, a directory of desktop software that is free or buy-once.", "meta.legal": "{title} for SoftHarbor, a directory of desktop software that is free or buy-once.",
"nav.apps": "Apps", "nav.apps": "Apps",
"nav.breadcrumb": "Breadcrumb", "nav.breadcrumb": "Breadcrumb",
@@ -114,11 +145,21 @@
"theme.light": "Light", "theme.light": "Light",
"theme.system": "System", "theme.system": "System",
"welcome.categories": "Browse by category", "welcome.categories": "Browse by category",
"welcome.categories.all": "All categories",
"welcome.cta": "Browse all apps", "welcome.cta": "Browse all apps",
"welcome.hero.eyebrow": "Free or buy-once · Windows · macOS · Linux",
"welcome.hero.sub": "A bilingual directory of desktop software that is free, or yours after a single payment — never subscription-only. Straight to every official download page.", "welcome.hero.sub": "A bilingual directory of desktop software that is free, or yours after a single payment — never subscription-only. Straight to every official download page.",
"welcome.hero.title": "Set up a new machine without googling ten tools.", "welcome.hero.title": "Set up a new machine without googling ten tools.",
"welcome.how.official": "Official links only. Every link points at the developer's own site or repository — never a download portal.", "welcome.how.official": "Official links only. Every link points at the developer's own site or repository — never a download portal.",
"welcome.how.pricing": "Free or own it once. Subscription-only software never enters the list.", "welcome.how.pricing": "Free or own it once. Subscription-only software never enters the list.",
"welcome.how.security": "Dated, honest status. We show when an entry was last checked — never a promise that it is safe.", "welcome.how.security": "Dated, honest status. We show when an entry was last checked — never a promise that it is safe.",
"welcome.how.title": "How this list works" "welcome.how.title": "How this list works",
"welcome.manifest": "Manifest",
"welcome.manifest.apps": "Apps listed",
"welcome.manifest.clean": "No known warnings",
"welcome.manifest.free": "Completely free",
"welcome.manifest.note": "Counted when this page was built. Subscription-only software: none, by rule.",
"welcome.manifest.once": "Buy once, own it",
"welcome.manifest.platforms": "Windows · macOS · Linux",
"welcome.search": "Search {n} apps…"
} }
+1
View File
@@ -47,6 +47,7 @@ describe('dictionary parity (hard rule 6 — same check CI runs)', () => {
'platform.windows', 'platform.windows',
'site.name', 'site.name',
'sort.name', // "A–Z" — the Latin range reads the same in Vietnamese 'sort.name', // "A–Z" — the Latin range reads the same in Vietnamese
'welcome.manifest.platforms', // "Windows · macOS · Linux" — three platform names
]; ];
const identical = Object.keys(en).filter( const identical = Object.keys(en).filter(
(k) => en[k as keyof typeof en] === vi[k as keyof typeof vi], (k) => en[k as keyof typeof en] === vi[k as keyof typeof vi],
+12
View File
@@ -24,3 +24,15 @@ export function t(locale: Locale, key: Key, vars: Record<string, string | number
for (const [k, v] of Object.entries(vars)) s = s.replaceAll(`{${k}}`, String(v)); for (const [k, v] of Object.entries(vars)) s = s.replaceAll(`{${k}}`, String(v));
return s; return s;
} }
/**
* "1 app" / "326 apps" / "326 ứng dụng": the plural rule and the digit
* grouping of the page's language. One helper, so no page can print "1 apps".
*/
export function appCount(locale: Locale, n: number): string {
const lang = locale === 'vi' ? 'vi-VN' : 'en-GB';
const one = new Intl.PluralRules(lang).select(n) === 'one';
return t(locale, one ? 'apps.count.one' : 'apps.count', {
n: new Intl.NumberFormat(lang).format(n),
});
}
+42 -1
View File
@@ -13,15 +13,38 @@
"categories.empty": "Danh mục này chưa có ứng dụng nào.", "categories.empty": "Danh mục này chưa có ứng dụng nào.",
"categories.intro": "Mười hai danh mục, mỗi mục dẫn thẳng tới trang chính thức.", "categories.intro": "Mười hai danh mục, mỗi mục dẫn thẳng tới trang chính thức.",
"categories.title": "Danh mục", "categories.title": "Danh mục",
"contact.address": "Địa chỉ",
"contact.collab": "Hợp tác",
"contact.conduct": "Báo cáo vi phạm Quy tắc ứng xử",
"contact.copyright": "Giấy phép của mã nguồn hoặc bộ dữ liệu",
"contact.dmca": "Khiếu nại bản quyền",
"contact.intro": "SoftHarbor do một người vận hành. Mỗi địa chỉ dưới đây đều tới cùng người bảo trì, được chia theo mục đích để thư của bạn được đọc đúng ngữ cảnh.",
"contact.issues": "Thông tin sai, liên kết hỏng, hay muốn đề xuất một ứng dụng? Hãy mở GitHub issue — công khai và thường nhanh hơn.",
"contact.issuesLink": "Mở issue",
"contact.languages": "Chúng tôi đọc và trả lời bằng tiếng Anh và tiếng Việt. Email được xử lý như Chính sách quyền riêng tư mô tả.",
"contact.legal": "Điều khoản, tuyên bố miễn trừ và các câu hỏi pháp lý khác",
"contact.press": "Báo chí",
"contact.privacy": "Quyền riêng tư và dữ liệu của bạn",
"contact.purpose": "Về việc",
"contact.security": "Lỗ hổng bảo mật, hoặc một mục bị chiếm quyền hay độc hại",
"contact.takedown": "Sửa hoặc gỡ mục giới thiệu hay logo ứng dụng của bạn",
"contact.title": "Liên hệ",
"detail.added": "Thêm ngày", "detail.added": "Thêm ngày",
"detail.developer": "Nhà phát triển", "detail.developer": "Nhà phát triển",
"detail.disclaimerLink": "Đọc Tuyên bố miễn trừ",
"detail.download": "Tải về", "detail.download": "Tải về",
"detail.evidence": "Xem kết quả quét", "detail.evidence": "Xem kết quả quét",
"detail.facts": "Tóm lược",
"detail.homepage": "Trang chủ", "detail.homepage": "Trang chủ",
"detail.license": "Giấy phép",
"detail.officialNote": "Các liên kết dẫn tới trang chính thức. SoftHarbor không lưu trữ tệp cài đặt.", "detail.officialNote": "Các liên kết dẫn tới trang chính thức. SoftHarbor không lưu trữ tệp cài đặt.",
"detail.platforms": "Nền tảng", "detail.platforms": "Nền tảng",
"detail.related": "Thêm trong {category}",
"detail.repo": "Kho mã nguồn", "detail.repo": "Kho mã nguồn",
"detail.security": "Bảo mật", "detail.security": "Bảo mật",
"detail.securityNote.clean": "Vào ngày được ghi, mục này đã qua quy trình kiểm tra công khai của chúng tôi và không phát hiện điều gì đáng lo. Đây không phải kiểm toán hay bảo đảm — phần mềm có thể thay đổi sau lần kiểm tra. Chỉ tải từ liên kết chính thức, và xác minh chữ ký hoặc checksum nếu nhà phát triển cung cấp.",
"detail.securityNote.title": "Trạng thái này nghĩa là gì",
"detail.securityNote.unverified": "Quy trình kiểm tra chưa hoàn tất cho mục này, hoặc có điều cần xem kỹ hơn. Mục này đáp ứng mọi quy tắc khác của danh sách. Hãy cẩn trọng như với bất kỳ tệp tải về nào, và ưu tiên liên kết chính thức.",
"detail.tags": "Thẻ", "detail.tags": "Thẻ",
"detail.updated": "Cập nhật", "detail.updated": "Cập nhật",
"error.403.body": "Không phần nào của SoftHarbor yêu cầu quyền truy cập, nên đây là tình huống bất thường. Nếu bạn gặp trang này, hãy báo cho chúng tôi.", "error.403.body": "Không phần nào của SoftHarbor yêu cầu quyền truy cập, nên đây là tình huống bất thường. Nếu bạn gặp trang này, hãy báo cho chúng tôi.",
@@ -43,7 +66,11 @@
"filters.pricing": "Giá", "filters.pricing": "Giá",
"filters.show": "Xem {n} ứng dụng", "filters.show": "Xem {n} ứng dụng",
"filters.show.one": "Xem {n} ứng dụng", "filters.show.one": "Xem {n} ứng dụng",
"footer.api": "Bộ dữ liệu JSON",
"footer.browse": "Khám phá",
"footer.builtAt": "Dựng ngày {date}", "footer.builtAt": "Dựng ngày {date}",
"footer.contact": "Liên hệ",
"footer.data": "Dữ liệu mở",
"footer.github": "Mã nguồn trên GitHub", "footer.github": "Mã nguồn trên GitHub",
"footer.legal.aiDisclosure": "Công bố AI", "footer.legal.aiDisclosure": "Công bố AI",
"footer.legal.disclaimer": "Tuyên bố miễn trừ", "footer.legal.disclaimer": "Tuyên bố miễn trừ",
@@ -53,6 +80,9 @@
"footer.legal.thirdParty": "Bên thứ ba", "footer.legal.thirdParty": "Bên thứ ba",
"footer.legal.trademarks": "Thương hiệu", "footer.legal.trademarks": "Thương hiệu",
"footer.license": "Mã nguồn GPL-3.0 · Dữ liệu CC BY-SA 4.0", "footer.license": "Mã nguồn GPL-3.0 · Dữ liệu CC BY-SA 4.0",
"footer.project": "Dự án",
"footer.releases": "Các bản phát hành",
"footer.rss": "Nguồn RSS",
"gate.accept": "Tôi hiểu và chấp nhận", "gate.accept": "Tôi hiểu và chấp nhận",
"gate.and": "và", "gate.and": "và",
"gate.body": "SoftHarbor là trang tổng hợp liên kết. Chúng tôi không lưu trữ tệp cài đặt và không thể bảo đảm cho phần mềm bên thứ ba. Trạng thái như \"không có cảnh báo đã biết\" chỉ phản ánh việc kiểm tra tại ngày ghi kèm — hãy tự xác minh trước khi cài đặt. Khi tiếp tục, bạn chấp nhận", "gate.body": "SoftHarbor là trang tổng hợp liên kết. Chúng tôi không lưu trữ tệp cài đặt và không thể bảo đảm cho phần mềm bên thứ ba. Trạng thái như \"không có cảnh báo đã biết\" chỉ phản ánh việc kiểm tra tại ngày ghi kèm — hãy tự xác minh trước khi cài đặt. Khi tiếp tục, bạn chấp nhận",
@@ -78,6 +108,7 @@
"meta.apps": "Duyệt {n} ứng dụng desktop miễn phí hoặc mua đứt, lọc theo danh mục, nền tảng và giá. Mọi liên kết đều dẫn tới trang chính thức của nhà phát triển.", "meta.apps": "Duyệt {n} ứng dụng desktop miễn phí hoặc mua đứt, lọc theo danh mục, nền tảng và giá. Mọi liên kết đều dẫn tới trang chính thức của nhà phát triển.",
"meta.categories": "Mười hai danh mục phần mềm desktop miễn phí hoặc mua đứt — trình duyệt, công cụ lập trình, đồ hoạ, đa phương tiện, bảo mật và nhiều hơn nữa.", "meta.categories": "Mười hai danh mục phần mềm desktop miễn phí hoặc mua đứt — trình duyệt, công cụ lập trình, đồ hoạ, đa phương tiện, bảo mật và nhiều hơn nữa.",
"meta.category": "{label}: {n} ứng dụng desktop miễn phí hoặc mua đứt. Mọi liên kết đều dẫn tới trang của chính nhà phát triển — SoftHarbor không lưu trữ tệp cài đặt.", "meta.category": "{label}: {n} ứng dụng desktop miễn phí hoặc mua đứt. Mọi liên kết đều dẫn tới trang của chính nhà phát triển — SoftHarbor không lưu trữ tệp cài đặt.",
"meta.contact": "Cách liên hệ SoftHarbor: mỗi mục đích một địa chỉ — bảo mật, quyền riêng tư, pháp lý, bản quyền, mục giới thiệu, báo chí và hợp tác.",
"meta.legal": "{title} của SoftHarbor, thư mục phần mềm desktop miễn phí hoặc mua đứt.", "meta.legal": "{title} của SoftHarbor, thư mục phần mềm desktop miễn phí hoặc mua đứt.",
"nav.apps": "Ứng dụng", "nav.apps": "Ứng dụng",
"nav.breadcrumb": "Đường dẫn", "nav.breadcrumb": "Đường dẫn",
@@ -114,11 +145,21 @@
"theme.light": "Sáng", "theme.light": "Sáng",
"theme.system": "Theo hệ thống", "theme.system": "Theo hệ thống",
"welcome.categories": "Xem theo danh mục", "welcome.categories": "Xem theo danh mục",
"welcome.categories.all": "Tất cả danh mục",
"welcome.cta": "Xem tất cả ứng dụng", "welcome.cta": "Xem tất cả ứng dụng",
"welcome.hero.eyebrow": "Miễn phí hoặc mua một lần · Windows · macOS · Linux",
"welcome.hero.sub": "Trang tổng hợp song ngữ về phần mềm desktop miễn phí, hoặc thuộc về bạn sau một lần trả tiền — không bao giờ chỉ có thuê bao. Dẫn thẳng tới trang tải chính thức.", "welcome.hero.sub": "Trang tổng hợp song ngữ về phần mềm desktop miễn phí, hoặc thuộc về bạn sau một lần trả tiền — không bao giờ chỉ có thuê bao. Dẫn thẳng tới trang tải chính thức.",
"welcome.hero.title": "Cài máy mới mà không phải google từng phần mềm một.", "welcome.hero.title": "Cài máy mới mà không phải google từng phần mềm một.",
"welcome.how.official": "Chỉ liên kết chính thức. Mọi liên kết đều trỏ tới trang hoặc kho mã của chính nhà phát triển — không qua trang tải trung gian.", "welcome.how.official": "Chỉ liên kết chính thức. Mọi liên kết đều trỏ tới trang hoặc kho mã của chính nhà phát triển — không qua trang tải trung gian.",
"welcome.how.pricing": "Miễn phí hoặc mua đứt. Phần mềm chỉ bán theo thuê bao không bao giờ được đưa vào danh sách.", "welcome.how.pricing": "Miễn phí hoặc mua đứt. Phần mềm chỉ bán theo thuê bao không bao giờ được đưa vào danh sách.",
"welcome.how.security": "Trạng thái có ghi ngày, trung thực. Chúng tôi cho biết mục đó được kiểm tra lần cuối khi nào — không cam kết rằng nó an toàn.", "welcome.how.security": "Trạng thái có ghi ngày, trung thực. Chúng tôi cho biết mục đó được kiểm tra lần cuối khi nào — không cam kết rằng nó an toàn.",
"welcome.how.title": "Danh sách này hoạt động thế nào" "welcome.how.title": "Danh sách này hoạt động thế nào",
"welcome.manifest": "Bản kê",
"welcome.manifest.apps": "Ứng dụng trong danh sách",
"welcome.manifest.clean": "Không có cảnh báo đã biết",
"welcome.manifest.free": "Hoàn toàn miễn phí",
"welcome.manifest.note": "Số liệu tính lúc dựng trang. Phần mềm chỉ bán theo thuê bao: không có, theo quy tắc.",
"welcome.manifest.once": "Mua một lần, dùng mãi",
"welcome.manifest.platforms": "Windows · macOS · Linux",
"welcome.search": "Tìm trong {n} ứng dụng…"
} }
+2 -2
View File
@@ -88,8 +88,8 @@ const gateStrings = {
from no page — so the site was never installable (audit, 2026-10). */} from no page — so the site was never installable (audit, 2026-10). */}
<link rel="manifest" href="/manifest.webmanifest" /> <link rel="manifest" href="/manifest.webmanifest" />
{/* Browser chrome follows the page background in each scheme. */} {/* Browser chrome follows the page background in each scheme. */}
<meta name="theme-color" content="#f8f5ee" media="(prefers-color-scheme: light)" /> <meta name="theme-color" content="#f2f8fb" media="(prefers-color-scheme: light)" />
<meta name="theme-color" content="#16140f" media="(prefers-color-scheme: dark)" /> <meta name="theme-color" content="#06101c" media="(prefers-color-scheme: dark)" />
<link <link
rel="alternate" rel="alternate"
type="application/rss+xml" type="application/rss+xml"
+1 -1
View File
@@ -32,7 +32,7 @@ export function isHuman(now = Date.now()): boolean {
} catch { } catch {
return false; return false;
} }
const until = raw === null || raw.trim() === '' ? NaN : Number(raw); const until = raw === null || raw.trim() === '' ? Number.NaN : Number(raw);
// Anything further out than the longest lifetime was not written by us. // Anything further out than the longest lifetime was not written by us.
return Number.isFinite(until) && until > now && until <= now + PASS_TTL_MS; return Number.isFinite(until) && until > now && until <= now + PASS_TTL_MS;
} }
+8
View File
@@ -0,0 +1,8 @@
---
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 (SkullMute)
// Thin locale wrapper (docs/07 §2) — the page lives in ContactPage.
import ContactPage from '../components/pages/ContactPage.astro';
---
<ContactPage locale="en" />
+2 -1
View File
@@ -44,7 +44,8 @@ export async function GET(context: APIContext) {
// @astrojs/rss has no `guid` option — it derives <guid> from `link`. // @astrojs/rss has no `guid` option — it derives <guid> from `link`.
// docs/05 §A4 wants the bare slug with isPermaLink="false", because the // docs/05 §A4 wants the bare slug with isPermaLink="false", because the
// slug is permanent while a URL is only conventionally so. Injected via // slug is permanent while a URL is only conventionally so. Injected via
// customData; the emitted XML is asserted in the build check. // customData; scripts/check-feed.mjs asserts the EMITTED guids on
// every build, since this seam is invisible to the unit tests.
customData: `<guid isPermaLink="false">${xml(i.guid)}</guid>`, customData: `<guid isPermaLink="false">${xml(i.guid)}</guid>`,
})), })),
}); });
+8
View File
@@ -0,0 +1,8 @@
---
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 (SkullMute)
// Thin locale wrapper (docs/07 §2) — the page lives in ContactPage.
import ContactPage from '../../components/pages/ContactPage.astro';
---
<ContactPage locale="vi" />
+94
View File
@@ -0,0 +1,94 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 (SkullMute)
//
// WCAG AA for the design tokens, read straight from global.css — so a colour
// tweak that breaks legibility fails here, in both themes, before anyone
// has to notice it on a screen. OKLCH is converted the way browsers do
// (OKLab → linear sRGB, gamut-clipped) and compared with the WCAG 2.2
// relative-luminance formula.
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { describe, expect, it } from 'vitest';
const CSS = readFileSync(join(process.cwd(), 'src/styles/global.css'), 'utf8');
type Rgb = [number, number, number];
function oklchToLinearSrgb(l: number, c: number, hDeg: number): Rgb {
const h = (hDeg * Math.PI) / 180;
const a = c * Math.cos(h);
const b = c * Math.sin(h);
const l_ = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3;
const m_ = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3;
const s_ = (l - 0.0894841775 * a - 1.291485548 * b) ** 3;
const clip = (x: number) => Math.min(1, Math.max(0, x));
return [
clip(4.0767416621 * l_ - 3.3077115913 * m_ + 0.2309699292 * s_),
clip(-1.2684380046 * l_ + 2.6097574011 * m_ - 0.3413193965 * s_),
clip(-0.0041960863 * l_ - 0.7034186147 * m_ + 1.707614701 * s_),
];
}
const luminance = ([r, g, b]: Rgb) => 0.2126 * r + 0.7152 * g + 0.0722 * b;
function ratio(fg: Rgb, bg: Rgb): number {
const [hi, lo] = [luminance(fg), luminance(bg)].sort((x, y) => y - x) as [number, number];
return (hi + 0.05) / (lo + 0.05);
}
/** The `--sh-*: oklch(L C H)` declarations of the block opened by `selector`. */
function block(selector: string): Map<string, string> {
const at = CSS.indexOf(`${selector} {`);
expect(at, `token block ${selector}`).toBeGreaterThan(-1);
const body = CSS.slice(at, CSS.indexOf('}', at));
const tokens = new Map<string, string>();
for (const m of body.matchAll(/--sh-([\w-]+):\s*([^;]+);/g)) {
tokens.set(m[1]!, m[2]!.replace(/\s+/g, ' ').trim());
}
return tokens;
}
function color(tokens: Map<string, string>, name: string): Rgb {
const raw = tokens.get(name);
const m = raw && /^oklch\(([\d.]+) ([\d.]+) ([\d.]+)\)$/.exec(raw);
if (!m) throw new Error(`--sh-${name} is not a plain oklch(L C H): ${raw}`);
return oklchToLinearSrgb(Number(m[1]), Number(m[2]), Number(m[3]));
}
const THEMES = {
light: block(":root[data-theme='light']"),
dark: block(":root[data-theme='dark']"),
};
/** [foreground, background, minimum] — text 4.5:1, control edges 3:1. */
const PAIRS: Array<[string, string, number]> = [
...['bg', 'surface', 'surface-2'].flatMap((bg): Array<[string, string, number]> => [
['ink', bg, 7],
['muted', bg, 4.5],
['accent', bg, 4.5],
['ok', bg, 4.5],
['warn', bg, 4.5],
['danger', bg, 4.5],
// WCAG 1.4.11: an input's, select's or button's boundary.
['control', bg, 3],
]),
['accent-ink', 'accent', 4.5],
['ok', 'ok-soft', 4.5],
['accent', 'accent-soft', 4.5],
['warn', 'warn-soft', 4.5],
['ink', 'accent-soft', 4.5],
];
describe('design tokens meet WCAG AA (src/styles/global.css)', () => {
for (const [theme, tokens] of Object.entries(THEMES)) {
it.each(PAIRS)(`${theme}: %s on %s ≥ %s:1`, (fg, bg, min) => {
expect(ratio(color(tokens, fg), color(tokens, bg))).toBeGreaterThanOrEqual(min);
});
}
it('gives scripting-off dark mode exactly the dark theme', () => {
const media = block(' :root:not([data-theme])');
expect([...media]).toEqual([...THEMES.dark]);
});
});
+386 -68
View File
@@ -1,15 +1,21 @@
/* SPDX-License-Identifier: GPL-3.0-only /* SPDX-License-Identifier: GPL-3.0-only
Copyright (C) 2026 poli0981 (SkullMute) Copyright (C) 2026 poli0981 (SkullMute)
Design tokens & base styles — docs/06 §2, §3, §7. */ Design tokens & base styles — docs/06 §2, §3, §7.
v1.1 "Harbor": a harbour master's ledger. Cool chart paper and navy ink by
day, a night harbour by night; hairline rules, soft shadows, mono labels
for the data, and depth contours behind the welcome hero. Every colour pair
that carries text or a control boundary is held to WCAG AA by
src/styles/contrast.test.ts, which reads THIS file. */
@import 'tailwindcss'; @import 'tailwindcss';
/* Self-hosted fonts, latin + vietnamese only (hard rule 7 — zero third-party /* Self-hosted fonts, latin + vietnamese only (hard rule 7). Bricolage is a
requests at runtime). Bricolage is a variable font whose package ships one variable font whose package ships one stylesheet covering
stylesheet covering vietnamese/latin-ext/latin; each @font-face carries a vietnamese/latin-ext/latin; each @font-face carries a unicode-range, so a
unicode-range, so a browser still downloads only the subsets it needs. browser still downloads only the subsets it needs. Be Vietnam Pro and IBM
Be Vietnam Pro and IBM Plex Mono expose per-subset files, so we name exactly Plex Mono expose per-subset files, so we name exactly the weights docs/06
the weights docs/06 §3 calls for and nothing else. */ §3 calls for and nothing else. */
@import '@fontsource-variable/bricolage-grotesque'; @import '@fontsource-variable/bricolage-grotesque';
@import '@fontsource/be-vietnam-pro/latin-400.css'; @import '@fontsource/be-vietnam-pro/latin-400.css';
@import '@fontsource/be-vietnam-pro/latin-500.css'; @import '@fontsource/be-vietnam-pro/latin-500.css';
@@ -24,29 +30,31 @@
@theme { @theme {
/* Design tokens exposed as Tailwind colours, so every use is a UTILITY /* Design tokens exposed as Tailwind colours, so every use is a UTILITY
(`text-sh-muted`, `bg-sh-surface`, `border-sh-border`) and never an inline (`text-sh-muted`, `bg-sh-surface`, `border-sh-control`) and never an
`style` attribute. inline `style` attribute — CSP style-src drops those silently (docs/09
§4, D20). Each maps to the runtime custom property, so the values switch
This is not a style preference — it is a correctness requirement. CSP with html[data-theme]. check:csp fails the build on any `style=`. */
`style-src` governs inline style ATTRIBUTES as well as <style> blocks, and
hashes do not apply to attributes: only 'unsafe-hashes' or 'unsafe-inline'
would permit them. Our policy has neither (docs/09 §4, D20), so every
`style="…"` on the site was silently dropped by the browser — the sticky
header rendered transparent and content bled through it. Found 2026-07-28.
Each maps to the runtime custom property rather than a literal, so the
values still switch with html[data-theme]. A build guard asserts no
`style=` survives into dist (scripts/check-no-inline-styles.mjs). */
--color-sh-bg: var(--sh-bg); --color-sh-bg: var(--sh-bg);
--color-sh-surface: var(--sh-surface); --color-sh-surface: var(--sh-surface);
--color-sh-surface-2: var(--sh-surface-2);
--color-sh-ink: var(--sh-ink); --color-sh-ink: var(--sh-ink);
--color-sh-muted: var(--sh-muted); --color-sh-muted: var(--sh-muted);
--color-sh-accent: var(--sh-accent); --color-sh-accent: var(--sh-accent);
--color-sh-accent-ink: var(--sh-accent-ink); --color-sh-accent-ink: var(--sh-accent-ink);
--color-sh-accent-soft: var(--sh-accent-soft);
--color-sh-ok: var(--sh-ok); --color-sh-ok: var(--sh-ok);
--color-sh-ok-soft: var(--sh-ok-soft);
--color-sh-warn: var(--sh-warn); --color-sh-warn: var(--sh-warn);
--color-sh-warn-soft: var(--sh-warn-soft);
--color-sh-danger: var(--sh-danger); --color-sh-danger: var(--sh-danger);
/* Hairline: separates and frames, never the only edge of a control. */
--color-sh-border: var(--sh-border); --color-sh-border: var(--sh-border);
/* The visible boundary of an input, select or button (WCAG 1.4.11, 3:1). */
--color-sh-control: var(--sh-control);
--shadow-sh-1: var(--sh-shadow-1);
--shadow-sh-2: var(--sh-shadow-2);
--shadow-sh-3: var(--sh-shadow-3);
--font-display: 'Bricolage Grotesque Variable', system-ui, sans-serif; --font-display: 'Bricolage Grotesque Variable', system-ui, sans-serif;
--font-sans: 'Be Vietnam Pro', system-ui, sans-serif; --font-sans: 'Be Vietnam Pro', system-ui, sans-serif;
@@ -54,59 +62,107 @@
/* docs/06 §3 — desktop step; the mobile step is applied in the media query /* docs/06 §3 — desktop step; the mobile step is applied in the media query
at the bottom so the scale lives in one place. */ at the bottom so the scale lives in one place. */
--text-hero: 4rem; /* 64 — the welcome headline only */
--text-display: 2.75rem; /* 44 */ --text-display: 2.75rem; /* 44 */
--text-h1: 2rem; /* 32 */ --text-h1: 2.25rem; /* 36 */
--text-h2: 1.5rem; /* 24 */ --text-h2: 1.5rem; /* 24 */
--text-h3: 1.1875rem; /* 19 */ --text-h3: 1.1875rem; /* 19 */
--text-body: 1rem; /* 16 */ --text-body: 1rem; /* 16 */
--text-small: 0.875rem; /* 14 */ --text-small: 0.875rem; /* 14 */
--text-badge: 0.78125rem; /* 12.5 */ --text-badge: 0.78125rem; /* 12.5 */
--radius-card: 10px; --radius-card: 14px;
--radius-tile: 12px;
--radius-btn: 10px;
--radius-pill: 999px; --radius-pill: 999px;
/* docs/06 §7 */ /* docs/06 §7 */
--ease-sh: cubic-bezier(0.2, 0.8, 0.2, 1); --ease-sh: cubic-bezier(0.2, 0.8, 0.2, 1);
--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
--duration-fast: 150ms; --duration-fast: 150ms;
--duration-slow: 250ms; --duration-slow: 250ms;
} }
/* Colour tokens switch on html[data-theme]; /theme.js sets that attribute /* ── Colour tokens ─────────────────────────────────────────────────────────
before first paint (docs/05 §A8). Light is also the :root default so the theme.js sets html[data-theme] before first paint (docs/05 §A8). With
page is legible if scripting is off entirely. */ scripting off there is no attribute, and the OS preference decides — the
third block below, which must stay identical to the [data-theme='dark']
one (contrast.test.ts compares them). */
:root, :root,
:root[data-theme='light'] { :root[data-theme='light'] {
--sh-bg: oklch(0.97 0.01 85); --sh-bg: oklch(0.975 0.007 230);
--sh-surface: oklch(0.99 0.005 85); --sh-surface: oklch(0.995 0.003 230);
--sh-ink: oklch(0.22 0.015 75); --sh-surface-2: oklch(0.952 0.012 232);
--sh-muted: oklch(0.48 0.012 75); --sh-ink: oklch(0.24 0.035 252);
--sh-accent: oklch(0.52 0.11 235); --sh-muted: oklch(0.47 0.03 250);
--sh-accent-ink: oklch(0.98 0.005 235); --sh-accent: oklch(0.5 0.13 245);
--sh-ok: oklch(0.55 0.12 150); --sh-accent-ink: oklch(0.985 0.005 240);
--sh-warn: oklch(0.62 0.13 75); --sh-accent-soft: oklch(0.94 0.03 240);
--sh-danger: oklch(0.55 0.19 25); --sh-ok: oklch(0.5 0.12 155);
--sh-border: var(--sh-ink); --sh-ok-soft: oklch(0.95 0.035 155);
--sh-warn: oklch(0.53 0.12 62);
--sh-warn-soft: oklch(0.95 0.04 75);
--sh-danger: oklch(0.52 0.18 25);
--sh-border: oklch(0.88 0.014 240);
--sh-control: oklch(0.6 0.035 248);
--sh-contour: oklch(0.5 0.13 245 / 0.14);
--sh-shadow-1: 0 1px 2px oklch(0.24 0.035 252 / 0.05), 0 1px 3px oklch(0.24 0.035 252 / 0.04);
--sh-shadow-2:
0 2px 4px oklch(0.24 0.035 252 / 0.04), 0 14px 30px -12px oklch(0.24 0.035 252 / 0.24);
--sh-shadow-3: 0 28px 64px -16px oklch(0.24 0.035 252 / 0.36);
} }
:root[data-theme='dark'] { :root[data-theme='dark'] {
--sh-bg: oklch(0.19 0.01 85); --sh-bg: oklch(0.17 0.03 255);
--sh-surface: oklch(0.23 0.012 85); --sh-surface: oklch(0.205 0.034 255);
--sh-ink: oklch(0.93 0.008 85); --sh-surface-2: oklch(0.245 0.036 255);
--sh-muted: oklch(0.7 0.01 85); --sh-ink: oklch(0.94 0.012 230);
--sh-accent: oklch(0.72 0.1 235); --sh-muted: oklch(0.75 0.025 240);
--sh-accent-ink: oklch(0.16 0.02 235); --sh-accent: oklch(0.77 0.11 230);
--sh-ok: oklch(0.72 0.12 150); --sh-accent-ink: oklch(0.18 0.04 255);
--sh-warn: oklch(0.75 0.12 75); --sh-accent-soft: oklch(0.27 0.05 245);
--sh-danger: oklch(0.68 0.17 25); --sh-ok: oklch(0.78 0.13 155);
/* 0.42 measured 2.0:1 on surface — the only visible edge of the search box, --sh-ok-soft: oklch(0.27 0.045 160);
sort select and filter button, failing WCAG 1.4.11 (3:1 for UI parts). */ --sh-warn: oklch(0.82 0.12 78);
--sh-border: oklch(0.58 0.012 85); --sh-warn-soft: oklch(0.28 0.045 70);
--sh-danger: oklch(0.74 0.15 25);
--sh-border: oklch(0.31 0.03 252);
--sh-control: oklch(0.6 0.03 245);
--sh-contour: oklch(0.77 0.11 230 / 0.16);
--sh-shadow-1: 0 1px 2px oklch(0 0 0 / 0.35);
--sh-shadow-2: 0 2px 4px oklch(0 0 0 / 0.3), 0 16px 34px -12px oklch(0 0 0 / 0.65);
--sh-shadow-3: 0 28px 64px -16px oklch(0 0 0 / 0.75);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme]) {
--sh-bg: oklch(0.17 0.03 255);
--sh-surface: oklch(0.205 0.034 255);
--sh-surface-2: oklch(0.245 0.036 255);
--sh-ink: oklch(0.94 0.012 230);
--sh-muted: oklch(0.75 0.025 240);
--sh-accent: oklch(0.77 0.11 230);
--sh-accent-ink: oklch(0.18 0.04 255);
--sh-accent-soft: oklch(0.27 0.05 245);
--sh-ok: oklch(0.78 0.13 155);
--sh-ok-soft: oklch(0.27 0.045 160);
--sh-warn: oklch(0.82 0.12 78);
--sh-warn-soft: oklch(0.28 0.045 70);
--sh-danger: oklch(0.74 0.15 25);
--sh-border: oklch(0.31 0.03 252);
--sh-control: oklch(0.6 0.03 245);
--sh-contour: oklch(0.77 0.11 230 / 0.16);
--sh-shadow-1: 0 1px 2px oklch(0 0 0 / 0.35);
--sh-shadow-2: 0 2px 4px oklch(0 0 0 / 0.3), 0 16px 34px -12px oklch(0 0 0 / 0.65);
--sh-shadow-3: 0 28px 64px -16px oklch(0 0 0 / 0.75);
color-scheme: dark;
}
} }
/* Scrollbar colours derive from the ink token, so they follow the theme. */ /* Scrollbar colours derive from the ink token, so they follow the theme. */
:root { :root {
--sh-scrollbar-thumb: color-mix(in oklch, var(--sh-ink) 32%, transparent); --sh-scrollbar-thumb: color-mix(in oklch, var(--sh-ink) 30%, transparent);
--sh-scrollbar-thumb-hover: color-mix(in oklch, var(--sh-ink) 50%, transparent); --sh-scrollbar-thumb-hover: color-mix(in oklch, var(--sh-ink) 48%, transparent);
--sh-scrollbar-track: transparent; --sh-scrollbar-track: transparent;
} }
@@ -122,16 +178,21 @@
html { html {
/* The header is sticky: without this, jumping to #main or tabbing to a /* The header is sticky: without this, jumping to #main or tabbing to a
control near the top puts it underneath the header (WCAG 2.4.11). */ control near the top puts it underneath the header (WCAG 2.4.11). */
scroll-padding-top: 5rem; scroll-padding-top: 5.5rem;
} }
/* Preflight's default placeholder is the text colour at 50 % — 3.3:1 in the /* Preflight's default placeholder is the text colour at 50 %; the muted
light theme. The muted token is ≥ 4.5:1 in both. */ token is ≥ 4.5:1 on every surface. */
::placeholder { ::placeholder {
color: var(--sh-muted); color: var(--sh-muted);
opacity: 1; opacity: 1;
} }
::selection {
background: var(--sh-accent-soft);
color: var(--sh-ink);
}
body { body {
background: var(--sh-bg); background: var(--sh-bg);
color: var(--sh-ink); color: var(--sh-ink);
@@ -146,6 +207,7 @@
h3 { h3 {
font-family: var(--font-display); font-family: var(--font-display);
line-height: 1.15; line-height: 1.15;
letter-spacing: -0.015em;
/* Vietnamese stacks diacritics two deep (ậ, ễ, ữ); the tighter display /* Vietnamese stacks diacritics two deep (ậ, ễ, ữ); the tighter display
leading must not clip them — visual QA item, docs/06 §3. */ leading must not clip them — visual QA item, docs/06 §3. */
text-wrap: balance; text-wrap: balance;
@@ -158,37 +220,196 @@
:focus-visible { :focus-visible {
outline: 2px solid var(--sh-accent); outline: 2px solid var(--sh-accent);
outline-offset: 2px; outline-offset: 2px;
border-radius: 2px; border-radius: 4px;
} }
} }
@layer components { @layer components {
/* The soft-brutalist tell: offset, unblurred shadow (docs/06 §2). */ /* A framed surface: hairline edge, a breath of shadow. */
.sh-panel { .sh-panel {
background: var(--sh-surface); background: var(--sh-surface);
border: 2px solid var(--sh-border); border: 1px solid var(--sh-border);
border-radius: var(--radius-card); border-radius: var(--radius-card);
box-shadow: var(--sh-shadow-1);
} }
/* Hover lift for whole-card links. Pointer devices only: a tap should not
leave a card floating. */
.sh-lift { .sh-lift {
transition: transition:
transform var(--duration-fast) var(--ease-sh), transform var(--duration-slow) var(--ease-sh),
box-shadow var(--duration-fast) var(--ease-sh); box-shadow var(--duration-slow) var(--ease-sh),
border-color var(--duration-slow) var(--ease-sh);
} }
@media (hover: hover) { @media (hover: hover) {
.sh-lift:hover { .sh-lift:hover {
transform: translate(-2px, -2px); transform: translateY(-2px);
box-shadow: 4px 4px 0 var(--sh-border); box-shadow: var(--sh-shadow-2);
border-color: color-mix(in oklch, var(--sh-accent) 45%, var(--sh-border));
} }
} }
/* A stretched-link card shows its focus on the whole card, not on a title
the ring would barely outline. */
.sh-lift:has(:focus-visible) {
outline: 2px solid var(--sh-accent);
outline-offset: 2px;
}
/* Ledger label: small mono capitals. */
.sh-eyebrow {
font-family: var(--font-mono);
font-size: var(--text-badge);
font-weight: 500;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--sh-muted);
}
.sh-pill { .sh-pill {
border: 2px solid var(--sh-border); display: inline-flex;
align-items: center;
gap: 0.3em;
border: 1px solid var(--sh-border);
border-radius: var(--radius-pill); border-radius: var(--radius-pill);
background: var(--sh-surface-2);
font-family: var(--font-mono); font-family: var(--font-mono);
font-size: var(--text-badge); font-size: var(--text-badge);
padding: 0.125rem 0.5rem; line-height: 1.5;
padding: 0.0625rem 0.55rem;
white-space: nowrap;
}
/* Pricing tones. Text stays ≥ 4.5:1 on its own tint (contrast.test.ts). */
.sh-tone-ok {
color: var(--sh-ok);
background: var(--sh-ok-soft);
border-color: transparent;
}
.sh-tone-accent {
color: var(--sh-accent);
background: var(--sh-accent-soft);
border-color: transparent;
}
.sh-tone-warn {
color: var(--sh-warn);
background: var(--sh-warn-soft);
border-color: transparent;
}
.sh-kbd {
display: inline-grid;
place-items: center;
min-width: 1.5em;
border: 1px solid var(--sh-control);
border-bottom-width: 2px;
border-radius: 6px;
font-family: var(--font-mono);
font-size: var(--text-badge);
line-height: 1.4;
padding: 0 0.35em;
}
.sh-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
min-height: 44px;
padding: 0.55rem 1.1rem;
border: 1px solid var(--sh-control);
border-radius: var(--radius-btn);
background: var(--sh-surface);
color: var(--sh-ink);
font-weight: 500;
text-decoration: none;
transition:
background-color var(--duration-fast) var(--ease-sh),
border-color var(--duration-fast) var(--ease-sh),
box-shadow var(--duration-fast) var(--ease-sh);
}
.sh-btn:hover {
background: var(--sh-surface-2);
border-color: var(--sh-accent);
}
.sh-btn-primary {
background: var(--sh-accent);
border-color: var(--sh-accent);
color: var(--sh-accent-ink);
font-weight: 600;
box-shadow: var(--sh-shadow-1);
}
.sh-btn-primary:hover {
background: color-mix(in oklch, var(--sh-accent) 88%, var(--sh-ink));
border-color: color-mix(in oklch, var(--sh-accent) 88%, var(--sh-ink));
box-shadow: var(--sh-shadow-2);
}
/* The square tile a logo or a category icon sits on. */
.sh-tile {
display: grid;
place-items: center;
flex-shrink: 0;
border: 1px solid var(--sh-border);
border-radius: var(--radius-tile);
background: var(--sh-surface-2);
color: var(--sh-ink);
}
/* Sticky header glass: the page shows through, blurred. Without
backdrop-filter it is simply opaque. */
.sh-glass {
background: var(--sh-bg);
border-bottom: 1px solid var(--sh-border);
}
@supports (backdrop-filter: blur(1px)) {
.sh-glass {
background: color-mix(in oklch, var(--sh-bg) 80%, transparent);
backdrop-filter: blur(14px) saturate(1.4);
}
}
/* Depth contours: the welcome hero's chart. Pure CSS — no image request,
nothing for the CSP to allow. Masked so it fades into the page, and kept
INSIDE the section: anything poking past the edge widens a phone's
layout viewport (the page zooms out), whatever overflow says. */
.sh-contours {
position: relative;
isolation: isolate;
}
.sh-contours::before {
content: '';
position: absolute;
z-index: -1;
inset-block-start: -5rem;
inset-inline-end: 0;
width: min(48rem, 100%);
aspect-ratio: 1;
background: repeating-radial-gradient(
circle at 58% 42%,
transparent 0 30px,
var(--sh-contour) 30px 31px
);
mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
pointer-events: none;
}
.sh-contours::after {
content: '';
position: absolute;
z-index: -1;
inset: -3rem 0 auto;
height: 26rem;
background-image: radial-gradient(var(--sh-contour) 1px, transparent 1.5px);
background-size: 24px 24px;
mask-image: linear-gradient(to bottom, #000, transparent);
pointer-events: none;
}
/* Stretched link: its ::after covers the nearest positioned ancestor, so a
whole card is one click target while the accessibility tree keeps ONE
link. Anything else clickable inside must sit above it (`relative z-1`). */
.sh-stretch::after {
content: '';
position: absolute;
inset: 0;
} }
/* Visible only to keyboard users, per docs/06 §9 tab order. */ /* Visible only to keyboard users, per docs/06 §9 tab order. */
@@ -201,12 +422,104 @@
top: 1rem; top: 1rem;
z-index: 50; z-index: 50;
background: var(--sh-surface); background: var(--sh-surface);
border: 2px solid var(--sh-border); border: 1px solid var(--sh-control);
border-radius: var(--radius-card); border-radius: var(--radius-btn);
padding: 0.5rem 0.75rem; padding: 0.5rem 0.75rem;
} }
} }
/* ── Motion ────────────────────────────────────────────────────────────────
Icons react to the control they belong to (`.sh-anim` on the link or
card). Every effect here collapses to nothing under reduced motion — the
rules at the bottom of this file. */
.sh-anim svg {
transition: transform var(--duration-slow) var(--ease-sh);
}
.sh-anim:is(:focus-visible, :focus-within) .sh-nudge-x {
transform: translateX(3px);
}
.sh-anim:is(:focus-visible, :focus-within) .sh-nudge-diag {
transform: translate(2px, -2px);
}
.sh-anim:is(:focus-visible, :focus-within) .sh-pop {
transform: scale(1.12) rotate(-6deg);
transition-timing-function: var(--ease-spring);
}
@media (hover: hover) {
.sh-anim:hover .sh-nudge-x {
transform: translateX(3px);
}
.sh-anim:hover .sh-nudge-diag {
transform: translate(2px, -2px);
}
.sh-anim:hover .sh-pop {
transform: scale(1.12) rotate(-6deg);
transition-timing-function: var(--ease-spring);
}
.sh-anim:hover .sh-draw :is(path, circle, rect, line, polyline, polygon, ellipse) {
stroke-dasharray: 160;
animation: sh-draw 0.8s var(--ease-sh) both;
}
}
@keyframes sh-draw {
from {
stroke-dashoffset: 160;
}
to {
stroke-dashoffset: 0;
}
}
/* First paint: content rises into place, a child at a time. Delays are
classes, not inline styles (CSP). */
@keyframes sh-rise {
from {
opacity: 0;
transform: translateY(12px);
}
to {
opacity: 1;
transform: none;
}
}
.sh-rise,
.sh-stagger > * {
animation: sh-rise 0.6s var(--ease-sh) both;
}
.sh-stagger > :nth-child(2) {
animation-delay: 45ms;
}
.sh-stagger > :nth-child(3) {
animation-delay: 90ms;
}
.sh-stagger > :nth-child(4) {
animation-delay: 135ms;
}
.sh-stagger > :nth-child(5) {
animation-delay: 180ms;
}
.sh-stagger > :nth-child(6) {
animation-delay: 225ms;
}
.sh-stagger > :nth-child(7) {
animation-delay: 270ms;
}
.sh-stagger > :nth-child(8) {
animation-delay: 315ms;
}
.sh-stagger > :nth-child(9) {
animation-delay: 360ms;
}
.sh-stagger > :nth-child(10) {
animation-delay: 405ms;
}
.sh-stagger > :nth-child(11) {
animation-delay: 450ms;
}
.sh-stagger > :nth-child(n + 12) {
animation-delay: 495ms;
}
/* Scrollbars (v1.1) — themed, with the "thin" and "hidden" choices from the /* Scrollbars (v1.1) — themed, with the "thin" and "hidden" choices from the
display menu (src/lib/prefs.ts, applied pre-paint by theme.js). display menu (src/lib/prefs.ts, applied pre-paint by theme.js).
@@ -257,8 +570,9 @@
/* Mobile step of the type scale (docs/06 §3). */ /* Mobile step of the type scale (docs/06 §3). */
@media (width < 40rem) { @media (width < 40rem) {
:root { :root {
--text-hero: 2.625rem; /* 42 */
--text-display: 2.25rem; /* 36 */ --text-display: 2.25rem; /* 36 */
--text-h1: 1.75rem; /* 28 */ --text-h1: 1.875rem; /* 30 */
--text-h2: 1.375rem; /* 22 */ --text-h2: 1.375rem; /* 22 */
--text-h3: 1.125rem; /* 18 */ --text-h3: 1.125rem; /* 18 */
} }
@@ -271,15 +585,18 @@
page a real document load — its own CSP, a fresh island tree — and still page a real document load — its own CSP, a fresh island tree — and still
cross-fade in browsers that support them. Opt-in only without reduced cross-fade in browsers that support them. Opt-in only without reduced
motion; browsers without support simply navigate. The opt-in itself lives motion; browsers without support simply navigate. The opt-in itself lives
in an inline <style> in Base.astro (see the comment there for why it cannot in an inline <style> in Base.astro (see src/lib/inlineCss.ts for why it
live in this file); the rules below only shape the animation. */ cannot live in this file); the rules below only shape the animation. */
/* docs/06 §7 — everything collapses to instant, including View Transitions. */ /* docs/06 §7 — everything collapses to instant, including View Transitions.
Delays go too: a staggered element would otherwise sit invisible (fill
mode `both`) for the length of its delay. */
@media (prefers-reduced-motion: reduce) { @media (prefers-reduced-motion: reduce) {
*, *,
*::before, *::before,
*::after { *::after {
animation-duration: 0.01ms !important; animation-duration: 0.01ms !important;
animation-delay: 0s !important;
animation-iteration-count: 1 !important; animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important; transition-duration: 0.01ms !important;
scroll-behavior: auto !important; scroll-behavior: auto !important;
@@ -297,6 +614,7 @@
:root[data-motion='reduce'] *::before, :root[data-motion='reduce'] *::before,
:root[data-motion='reduce'] *::after { :root[data-motion='reduce'] *::after {
animation-duration: 0.01ms !important; animation-duration: 0.01ms !important;
animation-delay: 0s !important;
animation-iteration-count: 1 !important; animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important; transition-duration: 0.01ms !important;
scroll-behavior: auto !important; scroll-behavior: auto !important;
+1 -1
View File
@@ -33,7 +33,7 @@ export default getViteConfig({
test: { test: {
name: 'unit', name: 'unit',
environment: 'node', environment: 'node',
include: ['src/{lib,i18n}/**/*.test.ts'], include: ['src/{lib,i18n,styles}/**/*.test.ts'],
}, },
}, },
{ {
+1 -1
View File
@@ -102,7 +102,7 @@ function judge(outcome: unknown, check: Check, deps: VerifyDeps): Verdict {
if (isTestSecret(check.secret)) return 'ok'; if (isTestSecret(check.secret)) return 'ok';
if (outcome['hostname'] !== check.hostname || outcome['action'] !== ACTION) return 'rejected'; if (outcome['hostname'] !== check.hostname || outcome['action'] !== ACTION) return 'rejected';
const issued = const issued =
typeof outcome['challenge_ts'] === 'string' ? Date.parse(outcome['challenge_ts']) : NaN; typeof outcome['challenge_ts'] === 'string' ? Date.parse(outcome['challenge_ts']) : Number.NaN;
return deps.now() - issued <= MAX_TOKEN_AGE_MS ? 'ok' : 'rejected'; return deps.now() - issued <= MAX_TOKEN_AGE_MS ? 'ok' : 'rejected';
} }