Files
FastD da710c4686 Accents, page edits and planet tuning; drop Pencil backups
Design: add the orange second accent from the UZURON palette and split the
colour roles (orange marks, green acts) in both themes; soften the dark green
and lift the dark cards toward the page background. Background options for the
next review are in design/background-options-2026-10-13/.

Page: replace the process block with an individual-approach section; drop the
budget form field; rename the contact field to a preferred channel; add a
submit confirmation dialog, studio links (mail, VK, RuStore), the First Step
Radio card, portfolio filters by platform, stack, genre and status, a cookie
bar and a removable hero ticker. Cards keep the mascot face; the member window
gains the real photo and the city.

Planet: fold the speed knobs into SPEED_TAU and SPEED_MIN with a hard stop
below the threshold; the pill is the only hover target and the summary card is
inert.

Repo: remove .pen backups from the index, ignore backups and Python artefacts,
drop generated pen-sync exports.
2026-10-13 22:08:24 +03:00

171 lines
7.2 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Сверка REPORT.md с генератором замеров (канбан t_7dc6d648, 2026-10-13).
Что проверяет:
1. каждый токен каждого варианта из REPORT.md совпадает с пересчётом `measure-backgrounds.py`;
2. каждое число контраста и шага поверхностей из REPORT.md есть в пересчёте (0 расхождений);
3. превью существуют и имеют заявленный размер 1440×2350;
4. `src/index.html`, `DESIGN.md`, `design/spec.md` не изменены за эту волну (sha256 против
`.baseline-sha256`, записанного до старта);
5. `.pen` на диске не перезаписан: переменные `b-*` в файле — отгруженные.
Запуск: py design/background-options-2026-10-13/check-report.py
Пишет: check-report-2026-10-13.md. Exit 1 — если хоть одна сверка провалилась.
"""
import hashlib
import importlib.util
import json
import sys
from pathlib import Path
from PIL import Image
HERE = Path(__file__).resolve().parent
ROOT = HERE.parents[1]
L = []
FAILS = []
CHECKED = 0
def w(s=""):
L.append(s)
print(s)
def load_module():
spec = importlib.util.spec_from_file_location("mbg", HERE / "measure-backgrounds.py")
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)
return mod
def main():
text = (HERE / "REPORT.md").read_text(encoding="utf-8")
mbg = load_module()
V = mbg.build()
w("# Сверка REPORT.md с генератором замеров")
w()
w("Проект: `G:\\Project\\Haevey_Monster_Team_Page` · канбан `t_7dc6d648` · дата: 2026-10-13")
w("Скрипт: `design/background-options-2026-10-13/check-report.py` (пересчёт из "
"`measure-backgrounds.py`, не из текста отчёта).")
w()
w("## 1. Токены вариантов")
w()
w("| Вариант | Тема | токенов сверено | расхождений |")
w("|---|---|---|---|")
for key in mbg.FAMILIES:
for theme in ("light", "dark"):
bad = []
for token in ("bg", "card", "field", "hairline", "line_strong", "nav"):
hx = V[key][theme][token]
globals()["CHECKED"] = CHECKED + 1
if f"`{hx}`" not in text:
bad.append(f"{token}={hx}")
FAILS.extend(f"{key} {theme}: нет в REPORT.md {b}" for b in bad)
w(f"| {mbg.FAMILIES[key]['name']} | {'светлая' if theme == 'light' else 'тёмная'} | 6 | "
f"{len(bad)} |")
w()
w("## 2. Числа контраста и шага поверхностей")
w()
w("| Вариант | Тема | чисел сверено | расхождений |")
w("|---|---|---|---|")
for key in mbg.FAMILIES:
for theme in ("light", "dark"):
bad = []
p = V[key][theme]
for label, fn, _ in mbg.PAIRS:
val = f"{fn(p):.2f}"
if val not in text:
bad.append(f"{label}={val}")
for label, fn in mbg.STEPS:
val = f"{fn(p):.3f}"
if val not in text:
bad.append(f"{label}={val}")
nav = mbg.comp(p["bg"], 0.94, p["card"])
bsoft = mbg.comp(p["brand"], 0.13 if theme == "light" else 0.16, p["card"])
for label, val in (("navbar", nav), ("brand-soft", bsoft),
("text-1 на navbar", f"{mbg.ratio(p['text_1'], nav):.2f}"),
("зел. текст на тинте", f"{mbg.ratio(p['brand_deep'], bsoft):.2f}")):
if val not in text:
bad.append(f"{label}={val}")
FAILS.extend(f"{key} {theme}: нет в REPORT.md {b}" for b in bad)
w(f"| {mbg.FAMILIES[key]['name']} | {'светлая' if theme == 'light' else 'тёмная'} | "
f"{len(mbg.PAIRS) + len(mbg.STEPS) + 4} | {len(bad)} |")
w()
w("## 3. Превью")
w()
shots = HERE / "shots"
for name in ("v1-paper", "v2-slate", "v3-canvas"):
for theme in ("light", "dark"):
png = shots / f"{name}-{theme}-hero-works.png"
if not png.exists():
FAILS.append(f"нет превью {png.name}")
continue
size = Image.open(png).size
if size != (1440, 2350):
FAILS.append(f"{png.name}: {size}, ожидалось (1440, 2350)")
w(f"- `shots/{png.name}` — {size[0]}×{size[1]}")
for name in ("W0IwN-hero-works.png", "i5mIu-hero-works.png"):
png = shots / "baseline" / name
w(f"- `shots/baseline/{name}` — {'есть' if png.exists() else '**НЕТ**'}")
if not png.exists():
FAILS.append(f"нет базового превью {name}")
w()
w("## 4. Изоляция области: контрольные суммы")
w()
base = {}
for line in (HERE / ".baseline-sha256").read_text(encoding="utf-8").splitlines():
digest, name = line.split(" *")
base[name] = digest
w("| Файл | sha256 до работы | сейчас | вердикт |")
w("|---|---|---|---|")
for name, digest in base.items():
now = hashlib.sha256((ROOT / name).read_bytes()).hexdigest()
ok = now == digest
if not ok:
FAILS.append(f"{name} изменён за волну")
w(f"| `{name}` | `{digest[:12]}…` | `{now[:12]}…` | {'не изменён' if ok else '**ИЗМЕНЁН**'} |")
w()
w("Записи в `git status` по этим файлам относятся к прошлой волне (`t_1533ba29`) и были там "
"до старта задачи — эта волна их не трогала (сверка выше по содержимому, а не по статусу).")
w()
w("## 5. `.pen` на диске не перезаписан")
w()
shipped = {"b-bg": "#F5EEE2", "b-card": "#FFFCF7", "b-field": "#FFFFFF",
"b-hairline": "#E6DCCE", "b-line-strong": "#847863", "b-nav": "#F5EEE2F0"}
for pen in ("Harvey_Monster_Team_Page.pen", "design/Harvey_Monster_Team_Page.pen"):
path = ROOT / pen
doc = json.loads(path.read_text(encoding="utf-8"))
bad = []
for name, want in shipped.items():
var = doc.get("variables", {}).get(name, {})
val = var.get("value")
light = (val[0]["value"] if isinstance(val, list) else val)
if light != want:
bad.append(f"{name}={light}≠{want}")
FAILS.extend(f"{pen}: {b}" for b in bad)
w(f"- `{pen}` — светлые значения `b-*`: {'отгруженные' if not bad else '**РАСХОЖДЕНИЕ**'}")
w()
w("## Итог")
w()
w(f"- Расхождений: **{len(FAILS)}**.")
for f in FAILS:
w(f" - FAIL: {f}")
w()
out = HERE / "check-report-2026-10-13.md"
out.write_text("\n".join(L) + "\n", encoding="utf-8")
print("\nwritten:", out)
return 1 if FAILS else 0
if __name__ == "__main__":
sys.exit(main())