Files
FastD e352335822 Filter bar with hover layer, icon-only project links, design reports
Filters: the panel is a bar (status segment, always visible) plus a body that lives as a layer
under it - collapsed by default, expands on hover/focus/tap and never moves the case grid; the
reset control appears only when a facet is limited; width capped at 720px (measured 45px slack
against 477px before). Facet research report is included.

Links: project links in the mini card and in the project window are icon-only buttons with a
uniform slot (16px card / 18px window) and the accessible name in aria-label; studio contacts
(mail, VK, RuStore) live outside the cards.

Team and page: real photos from the public TITANS team page go to the member window while the
card keeps the mascot; the portfolio gains the First Step Radio card and genre values, the
process block became an individual-approach section, plus a cookie bar and a removable ticker.

Design folders under design/ keep reports, measurements, scripts and the .pen; probe and
before/after screenshot dumps, editor backups and caches are removed. Background-variant and
palette previews stay until the client picks one.
2026-10-15 05:50:52 +03:00

219 lines
11 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.
"""Персист правки «ссылка со знаком площадки без рамки, слот 48, чернила 24» в .pen (§10.28, t_a33fce2f).
Что меняется в макете (и только это):
1. мастер ProjectLink — РАМКИ НЕТ (strokeWidth 0, цвет снят): в проде `.btn--mark{border:0}`;
рамку сохраняет штриховой глиф темы — она ставится инстансом PL_site (`.btn--ghost`);
2. ряд «ССЫЛКА ПРОЕКТА»: PL_site получает рамку 2 px `$brand-deep`, PL_primary остаётся заливкой
`$brand` без рамки (`.btn--primary`);
3. ряд «СОСТОЯНИЯ» приведён к отгруженной анатомии: знак площадки (подложка `$brand-mark` + белый
символ) в состоянии ПОКОЯ, hover — только тень `--shadow-btn` (заливки `--ghost-hover` больше нет),
focus — контур 2 px `$brand-deep`, active — без смены цвета; слот PL_disabled УДАЛЁН:
у ссылки состояния disabled в проде нет (ширина 48 и знак 24 подтверждены замером живого DOM);
4. ряд «КАРТОЧКА»: тот же квадрат 48×48 и знак 24×24, что в окне (компакт 36×36 / 20×20 отменён);
5. подписи строк названы по отгруженному состоянию.
Почему скрипт: Pencil MCP НЕ сохраняет .pen на диск — правки живут только в открытом редакторе,
поэтому те же значения пишутся в канон (корень) и в снимок `design/` напрямую.
Запуск: py design/link-slot-2026-10-14/patch-pen-linkslot.py
Проверка: py design/link-slot-2026-10-14/verify-pen-linkslot.py
"""
import json
import shutil
from pathlib import Path
ROOT = Path("G:/Project/Haevey_Monster_Team_Page")
TARGETS = [(ROOT / "Harvey_Monster_Team_Page.pen", " ", "\r\n"), # канон: indent 2 + CRLF
(ROOT / "design" / "Harvey_Monster_Team_Page.pen", None, "")] # снимок: компакт, без переводов
STAMP = "bak-linkslot-20261014"
MASTER = "EByJw"
PLATE, MARK, LABEL = "p40tIo", "z4oNC", "B9oDO"
GHOST_FRAME = {"stroke": "$brand-deep", "strokeWidth": 2}
FRAMELESS = {"strokeWidth": 0}
DROP = ("stroke",) # ключи, которых в отгруженном состоянии быть не должно
MARK_FACE = {MARK: {"icon": "store", "fill": "#FFFFFF", "width": 24, "height": 24},
PLATE: {"enabled": True, "width": 24, "height": 24, "cornerRadius": 7, "fill": "$brand-mark"}}
HOVER_SHADOW = {"type": "shadow", "shadowType": "outer", "color": "#3A302329",
"offset": {"x": 0, "y": 4}, "blur": 10}
SITE, PRIMARY = "xv726", "z4XWl"
STATES = {"ESknH": "default", "lkOok": "hover", "tn69z": "active", "JIqc4": "focus"}
DROP_DISABLED = "HZiiG" # у ссылки нет состояния disabled
CARD = {"C1esB": "store", "zqgsI": "gamepad-2"}
MARK_INSTANCES = {"PLyfk": "store", "O5Vf0": "gamepad-2"}
CAPTIONS = {
"APqQ5": "ССЫЛКА ПРОЕКТА — ЗНАК БЕЗ ТЕКСТА: квадрат 48×48, знак 24×24 (12 ед., 50 % слота), РАМКИ НЕТ — "
"знаком служит сама кнопка. RuStore и VK — ОФИЦИАЛЬНЫЙ знак площадки (синий квадрат #0077FF + "
"белый символ; геометрия — src/js/main.js, в .pen символ — подстановка lucide, D15). Сайт — глобус, "
"видео — камера: штриховые глифы в слоте 24×24, РАМКУ СОХРАНЯЮТ (она их и предъявляет)",
"X6kox": "ССЫЛКА ПРОЕКТА: default → hover → active → focus (disabled у ссылки нет). Рамки нет; hover — "
"только тень --shadow-btn, заливки нет; focus — кольцо 2 px --brand-deep с отступом 2 px "
"(в макете — контур плашки); :active — сдвиг 1 px без смены цвета",
"c9IKO7": "ССЫЛКА ПРОЕКТА — КАРТОЧКА: тот же квадрат 48×48 и знак 24×24, что в окне — единый слот "
"с 2026-10-14 (компакт 36×36 / 20×20 отменён)",
}
def find(node, nid):
if isinstance(node, dict):
if node.get("id") == nid:
return node
for c in node.get("children") or []:
r = find(c, nid)
if r is not None:
return r
return None
def find_parent(node, nid):
for c in node.get("children") or []:
if isinstance(c, dict) and c.get("id") == nid:
return node
r = find_parent(c, nid)
if r is not None:
return r
return None
def walk(node, fn):
if isinstance(node, dict):
fn(node)
for c in node.get("children") or []:
walk(c, fn)
def count_nodes(doc):
n = [0]
walk(doc, lambda x: n.__setitem__(0, n[0] + 1))
return n[0]
def dump(doc, indent, eol):
text = json.dumps(doc, ensure_ascii=False, indent=indent, separators=None if indent else (",", ":"))
return (text if not indent else text.replace("\n", eol)).encode("utf-8")
def patch_doc(doc):
changed = []
def setp(node, props, tag):
for k, v in props.items():
if node.get(k) != v:
node[k] = v
changed.append(tag + "." + k)
def drop(node, keys, tag):
for k in keys:
if k in node:
del node[k]
changed.append("−" + tag + "." + k)
# 1. мастер: без рамки
master = find(doc, MASTER)
if master is None:
raise SystemExit("не найден компонент " + MASTER)
setp(master, FRAMELESS, MASTER)
drop(master, DROP, MASTER)
if find(master, MARK) is None or find(master, LABEL) is None:
raise SystemExit("у мастера нет знака/подписи")
setp(find(master, MARK), {"width": 24, "height": 24}, MARK)
setp(find(master, LABEL), {"enabled": False}, LABEL)
# 2. ряд вариантов: рамка только у штрихового глифа, primary — заливка без рамки
site = find(doc, SITE)
if site is None:
raise SystemExit("не найден инстанс " + SITE)
setp(site, GHOST_FRAME, SITE)
prim = find(doc, PRIMARY)
if prim is None:
raise SystemExit("не найден инстанс " + PRIMARY)
setp(prim, {"fill": "$brand"}, PRIMARY)
setp(prim, FRAMELESS, PRIMARY)
drop(prim, DROP, PRIMARY)
for iid, icon in MARK_INSTANCES.items():
inst = find(doc, iid)
if inst is None:
raise SystemExit("не найден инстанс " + iid)
d = inst.setdefault("descendants", {})
d[MARK] = dict(MARK_FACE[MARK], icon=icon)
d[PLATE] = dict(MARK_FACE[PLATE])
setp(inst, FRAMELESS, iid)
drop(inst, DROP, iid)
changed.append(iid + ".descendants")
# 3. ряд состояний — отгруженная анатомия знака площадки
for iid, state in STATES.items():
inst = find(doc, iid)
if inst is None:
raise SystemExit("не найден инстанс состояния " + iid)
inst["descendants"] = {MARK: dict(MARK_FACE[MARK]), PLATE: dict(MARK_FACE[PLATE])}
changed.append(iid + ".descendants")
setp(inst, FRAMELESS, iid)
if state == "hover": # hover — только тень, заливки нет
drop(inst, ("fill",), iid)
setp(inst, {"effect": HOVER_SHADOW}, iid)
elif state == "active": # :active — сдвиг 1 px, цвет не меняется
drop(inst, ("fill",), iid)
drop(inst, DROP, iid)
elif state == "focus": # focus — контур 2 px --brand-deep
setp(inst, GHOST_FRAME, iid)
elif state == "default":
drop(inst, ("fill",), iid)
drop(inst, DROP, iid)
# слот disabled удаляется: у ссылки этого состояния в проде нет
holder = find_parent(doc, DROP_DISABLED)
if holder is None:
raise SystemExit("не найден узел " + DROP_DISABLED)
victim = next(c for c in holder["children"] if c.get("id") == DROP_DISABLED)
holder["children"].remove(victim)
changed.append("−" + DROP_DISABLED + " (ref PL_disabled)")
# 4. ряд карточки: единый слот 48 / знак 24
for iid, icon in CARD.items():
inst = find(doc, iid)
if inst is None:
raise SystemExit("не найден инстанс " + iid)
setp(inst, {"width": 48, "height": 48, "padding": [0, 0], "gap": 0,
"justifyContent": "center", "alignItems": "center"}, iid)
d = inst.setdefault("descendants", {})
d[MARK] = dict(MARK_FACE[MARK], icon=icon)
d[PLATE] = dict(MARK_FACE[PLATE])
changed.append(iid + ".descendants")
setp(inst, FRAMELESS, iid)
drop(inst, DROP, iid)
# 5. подписи строк
for cid, text in CAPTIONS.items():
node = find(doc, cid)
if node is None:
raise SystemExit("не найдена подпись " + cid)
setp(node, {"content": text}, cid)
return changed
if __name__ == "__main__":
for path, indent, eol in TARGETS:
raw = path.read_bytes()
doc = json.loads(raw.decode("utf-8"))
nodes_before = count_nodes(doc)
changed = patch_doc(doc)
bak = path.with_suffix(".pen." + STAMP)
if not bak.exists():
shutil.copy2(path, bak)
# формат доказывается бэкапом: сериализация бэкапа обязана совпасть с ним байт-в-байт
bak_doc = json.loads(bak.read_bytes().decode("utf-8"))
if dump(bak_doc, indent, eol) != bak.read_bytes():
raise SystemExit("формат не воспроизводится для " + path.name + " -- правка не записана")
out = dump(doc, indent, eol)
path.write_bytes(out)
print("===", path.parent.name + "/" + path.name, "| формат:", "indent 2 + CRLF" if indent else "компакт")
print(" изменено свойств:", len(changed), "| узлов:", nodes_before, "→", count_nodes(doc),
"(" + str(count_nodes(doc) - nodes_before) + ")")
print(" размер:", len(raw), "→", len(out), "Б; бэкап:", bak.name)
for c in changed:
print(" ·", c)