Serve planet and mascots from src/assets

- Move served planet (animated webp, posters, 300 frames) and team mascots into src/assets/
- Use relative paths (assets/...) that work in file://, on the dev server and with docroot=src
- Screenshot pipeline writes to src/assets/projects
- Halo audit: report and measurements, ticker ring fix, shadow rules in DESIGN.md and spec.md
This commit is contained in:
FastD committed 2026-11-10 18:42:12 +03:00
1 parent b60d00d55c
commit 9e7b1e3430
476 files changed
+27742 -69

No files matched your search

+2 -2
View File
@@ -94,8 +94,8 @@ function toList(v) {
return t.includes(',') ? t.split(',').map((s) => s.trim()).filter(Boolean) : [t];
}
// Пути в .md заданы от корня сайта (/Work_files/…) — в разметке используются как есть.
// ⚠️ Деплой: содержимое src/ кладётся в docroot, Work_files/ и api/ — рядом с ним.
// Пути в .md относительны docroot (assets/…) — работают в file://, на dev-server и на хостинге.
// Отдаваемые ассеты лежат внутри src/assets/, сырьё — в Work_files/.
function sitePath(p) {
return String(p == null ? '' : p).trim();
}
+6 -6
View File
@@ -1,8 +1,8 @@
// project-shots.mjs — конвейер и валидатор карточных изображений проектов (#work).
//
// Контракт (см. Work_files/projects/README.md):
// путь на диске : Work_files/projects/<slug>/01.webp (регистр папки — как в git)
// URL из src/ : ../Work_files/projects/<slug>/01.webp
// Контракт (см. src/assets/projects/README.md):
// путь на диске : src/assets/projects/<slug>/01.webp (регистр папки — как в git)
// URL из src/ : assets/projects/<slug>/01.webp
// формат : WebP, 16:9 (1600×900), ≤ 500 000 Б
//
// Режимы:
@@ -18,7 +18,7 @@ import { dirname, join, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
const SHOT_DIR = join(ROOT, 'Work_files', 'projects');
const SHOT_DIR = join(ROOT, 'src', 'assets', 'projects');
// Слаги — из content/projects/*.md (title/status/платформы живут там).
const SLUGS = ['aquatherium', 'battlecaps', 'moba', 'ww-wheels'];
@@ -75,7 +75,7 @@ const kb = (n) => `${(n / 1000).toFixed(1)} KB`;
const shotPath = (slug) => join(SHOT_DIR, slug, '01.webp');
// Канонический URL = абсолютный от корня сайта: ровно так уже записано в content/projects/*.md
// (и так же в _template.md). Требует, чтобы корень веб-сервера = корень репозитория.
const shotUrl = (slug) => `/Work_files/projects/${slug}/01.webp`;
const shotUrl = (slug) => `assets/projects/${slug}/01.webp`;
// Центрированный кроп 16:9 из любого источника: scale с увеличением + crop.
function encode(src, out, w, h, q, focus) {
@@ -141,7 +141,7 @@ async function check() {
const aspectOk = Math.abs(w / h - 16 / 9) < 0.005;
let http = '';
if (args.http) {
const url = `${args.http.replace(/\/$/, '')}/Work_files/projects/${slug}/01.webp`;
const url = `${args.http.replace(/\/$/, '')}/src/assets/projects/${slug}/01.webp`;
try {
const res = await fetch(url, { method: 'HEAD' });
http = String(res.status);