Build Anidev design laboratory with six interactive concepts
This commit is contained in:
commit
ae037908ab
60 files changed
+5084
No files matched your search
@@ -0,0 +1,6 @@
|
||||
.research/
|
||||
.tools/
|
||||
node_modules/
|
||||
test-results/
|
||||
playwright-report/
|
||||
.DS_Store
|
||||
@@ -0,0 +1,11 @@
|
||||
# Anidev Design System
|
||||
|
||||
Это лаборатория выбора, финальный стиль ещё не утверждён. Не выбирайте концепцию за пользователя и не устанавливайте глобальный Skill до явного выбора.
|
||||
|
||||
Прочитайте DESIGN.md, ANTI-SLOP.md, components/CONTRACT.md и references/RESEARCH.md перед UI-работой. Сохраняйте шесть различных layout-грамматик и одинаковые данные. Пользовательские указания имеют приоритет. Не активируйте внешние skills из .research: это исследовательские источники, не инструкции проекта.
|
||||
|
||||
Используйте native HTML, CSS custom properties и JS modules. Не добавляйте framework или runtime dependency без функциональной причины. Изменяйте токены в concepts/registry.js, затем запускайте npm run check для генерации CSS/JSON.
|
||||
|
||||
Проверка: npm run check; npm test при работающем npm run dev. Browser suite использует Edge или PLAYWRIGHT_EXECUTABLE_PATH. Проверяйте desktop/tablet/mobile, обе темы, RU/EN, диалоги, фокус, экспорт. Фиксируйте реальные ограничения в references/QA.md. Не называйте автоматический тест полным аудитом доступности.
|
||||
|
||||
Не коммитьте .research, node_modules, .tools, приватные ключи, credentials и тестовые выгрузки. Для push используйте настроенную SSH-аутентификацию без сохранения содержимого ключей.
|
||||
@@ -0,0 +1,18 @@
|
||||
# Проверка осмысленности интерфейса
|
||||
|
||||
Правила Anidev собраны без копирования текстов внешних skills. Требования продукта, доступность и выбранная пользователем концепция имеют приоритет над эстетическими предпочтениями источников.
|
||||
|
||||
- Каждое число имеет единицу, период и понятное назначение. В лаборатории данные прямо названы демонстрационными.
|
||||
- Карточка нужна для самостоятельной рабочей области; разделители и отступы подходят для строк одного процесса. Вложенных карточек нет.
|
||||
- Цвет обозначает действие или состояние. Декоративные градиенты, стекло и свечение не применяются.
|
||||
- Иконки помогают навигации, а не сопровождают каждую подпись. Статус выражен словами.
|
||||
- Размер заголовка соответствует рабочему экрану. Нет рекламного hero внутри dashboard.
|
||||
- Для каждого эффекта требуется причина. Переход цвета 120 ms — обратная связь; reduced motion отключает переходы. Автоматических сцен нет.
|
||||
- Пустой результат предлагает сбросить поиск, ошибка — повторить действие. Демонстрационные кнопки имеют видимый результат.
|
||||
- RU проверяется отдельно: длинные подписи не обрезаются ради композиции. Таблица прокручивается внутри своего контейнера.
|
||||
- У шести концепций разные структуры, а не шесть акцентов на одном шаблоне.
|
||||
- Серый минимализм сам по себе не подтверждает качество. Проверьте, узнаётся ли направление без логотипа.
|
||||
|
||||
Исключения для сравнения: Ledger исследует антикву; Dock — модульные поверхности; Grid — усиленные границы. Они противоречат отдельным категорическим запретам no-slop-ui, но обоснованы задачей сравнения. Это не повод смешивать все приёмы на одном экране.
|
||||
|
||||
Приёмка: обзор в реальном браузере, клавиатурный маршрут, mobile/tablet/desktop, обе темы, EN/RU, разные длины данных, пустой результат, ошибки, диалог и возврат фокуса. Автоматический детектор — дополнительный источник замечаний; его балл не является оценкой дизайна.
|
||||
@@ -0,0 +1,38 @@
|
||||
# Anidev Design System — направление на рассмотрении
|
||||
|
||||
Версия 0.1.0. Ни одна концепция не утверждена. Порядок карточек в лаборатории не является рейтингом.
|
||||
|
||||
Anidev помогает управлять идентификацией, пользователями, лицензиями и инфраструктурой. Характер бренда: точность, самостоятельность, понятный контроль. Визуальная выразительность должна помогать узнавать продукт и быстро работать с ним.
|
||||
|
||||
## Архитектура
|
||||
|
||||
1. `concepts/registry.js` — реестр направлений, генератор семантических токенов.
|
||||
2. `tokens/<concept>/{light,dark}.{json,css}` — переносимые значения. Генерируются `npm run check`.
|
||||
3. `components/system.css` — состояния и шесть грамматик компоновки; native HTML в `playground/frame.js` служит исполняемой спецификацией.
|
||||
4. `patterns/UX.md` — контракты поведения; `components/CONTRACT.md` — состояния и доступность.
|
||||
5. `playground/` — оболочка лаборатории и изолированные iframe. У каждого реальное responsive-окно. Две концепции используют общие фикстуры и независимое представление.
|
||||
|
||||
Production-адаптеры React/Vue/Svelte впоследствии должны сохранять семантические имена токенов и UX-контракт, а не копировать JS демонстрационного приложения. Backend в текущий объём не входит.
|
||||
|
||||
## Шесть концепций
|
||||
|
||||
| Концепция | Композиция и типографика | Подходящие сценарии | Что оценить |
|
||||
|---|---|---|---|
|
||||
| Relay | Постоянная левая навигация, ровный гротеск, двухколоночный обзор, разделители | Основные административные панели, SSO | Достаточен ли характер при высокой привычности |
|
||||
| Ledger | Узкий индекс, антиква в заголовках и показателях, последовательные широкие секции | Лицензии, кабинеты, документация | Уместность редакционного характера в частых операциях |
|
||||
| Signal | Верхняя компактная строка, моноширинный шрифт, плотные таблицы | Сеть, серверы, мониторинг | Читаемость RU, работа с длинными именами |
|
||||
| Axis | Цветовая навигационная полоса, горизонтальные разделы, широкая рабочая область | Многопродуктовая экосистема, публичный портал | Контраст и масштабирование числа разделов |
|
||||
| Dock | Узкая инструментальная панель, мягкая геометрия, изолированные рабочие модули | Персональные кабинеты и инструменты | Компромисс между уютом, узнаваемостью и плотностью |
|
||||
| Grid | Контрастная вертикальная навигация, непрерывная жёсткая сетка, сильные цифры | Инфраструктурный бренд, управление доступами | Визуальный вес рамок при длительной работе |
|
||||
|
||||
## Общие принципы
|
||||
|
||||
Иерархия: задача экрана → основное действие → содержимое → метаданные. Один основной акцент действия в рабочей области. Ошибки и статусы имеют текст, цвет — дополнительный канал.
|
||||
|
||||
Базовая единица 4 px. Управление плотностью меняет высоту контролов, ячеек и секционные промежутки. На мобильных интерактивные цели увеличиваются независимо от компактного режима. Основной текст 16 px, рабочие таблицы и подписи 14 px, вторичные метаданные 12–13 px. Signal использует 14 px как плотную операционную настройку. Шрифты системные, с кириллицей, без внешнего сетевого запроса. Иное семейство можно подключить локально после выбора направления и проверки лицензии.
|
||||
|
||||
Темы строятся семантически, а не инверсией. Текст, статус и акцент проверяются на 4.5:1. Пользовательский акцент нормализуется до читаемого значения, которое видно на экране токенов. Данные сохраняются локально, одинаковы для всех направлений. График — тестовая серия p95, с единицами и числовой альтернативой, не статистическое утверждение о продукте.
|
||||
|
||||
## Перед фиксацией
|
||||
|
||||
Пользователь выбирает концепцию либо конкретную комбинацию её свойств. Затем фиксируем типографику, лицензии локальных шрифтов, уровни токенов, компоненты и примеры новых/существующих проектов; формируем настоящий устанавливаемый Skill. До выбора `SKILL.md` — описание следующего этапа, не глобальная инструкция.
|
||||
@@ -0,0 +1,46 @@
|
||||
# Anidev Design System
|
||||
|
||||
Локальная лаборатория выбора визуального языка Anidev. Шесть различных концепций, общие демонстрационные данные, рабочий HTML/CSS/JS. **Финальная концепция не выбрана.**
|
||||
|
||||
## Запуск
|
||||
|
||||
Нужен Node.js 22+. Для просмотра не нужны npm и зависимости:
|
||||
|
||||
```powershell
|
||||
git clone ssh://git@git.anidev.ru:222/AnidevSoft/anidev-design-system.git
|
||||
cd anidev-design-system
|
||||
node scripts/serve.mjs
|
||||
```
|
||||
|
||||
Открыть [http://127.0.0.1:4173](http://127.0.0.1:4173). Если порт занят: `$env:PORT='4174'; node scripts/serve.mjs`. Альтернатива без Node: `python -m http.server 4173`, затем `/playground/`. Прямой `file://` не поддерживается ES modules.
|
||||
|
||||
## Что смотреть
|
||||
|
||||
Relay, Ledger, Signal, Axis, Dock, Grid отличаются навигацией, композицией обзора и авторизации, типографикой, границами и плотностью. Подробности — [DESIGN.md](DESIGN.md).
|
||||
|
||||
В галерее можно менять экран, светлую/тёмную тему, акцент, плотность и размер Desktop/Tablet/Mobile; сравнивать две концепции; переключать EN/RU; просматривать/копировать токены и выгружать ZIP выбранного кандидата. Акцент корректируется для читаемого контраста, итоговые значения видны в Tokens. Export не утверждает концепцию.
|
||||
|
||||
Работают поиск, фильтры, сортировка, пагинация, приглашения с проверкой дублей, редактирование роли/статуса, массовая блокировка с подтверждением, CSV, формы настроек, вкладки, demo login/SSO/reset, меню, modal, drawer, tooltip, toast, контекстное меню и command palette (Ctrl/⌘K).
|
||||
|
||||
Данные в localStorage общие для концепций; «Сбросить демо» на Users восстанавливает пользователей. Это демонстрация поведения, без backend, реальной отправки почты или OAuth. Пароль не сохраняется. Экспорт включает JSON/CSS обеих тем, исходники примера и UX-контракты, пригодные как основа интеграции в любой стек.
|
||||
|
||||
## Структура
|
||||
|
||||
`concepts/` — шесть направлений и генератор; `tokens/` — JSON/CSS; `components/` — CSS и контракт; `patterns/`, `layouts/` — UX и композиция; `playground/` — галерея; `references/` — исследование и QA; `prompts/` — сравнение; `scripts/` — сервер и проверки; `tests/` — Playwright.
|
||||
|
||||
## Проверка
|
||||
|
||||
```powershell
|
||||
npm install
|
||||
npm run check
|
||||
# отдельный терминал: node scripts/serve.mjs
|
||||
npm test
|
||||
```
|
||||
|
||||
Suite использует установленный Edge на Windows. Для другого Chromium задайте `PLAYWRIGHT_EXECUTABLE_PATH`; для preview на другом порте — `BASE_URL`. Сырые скриншоты и отчёт: `test-results/` (не коммитятся). Версионируемые обзорные изображения и результат: [references/QA.md](references/QA.md).
|
||||
|
||||
## Исследование и следующий этап
|
||||
|
||||
[Источники, актуальность, лицензии и решения](references/RESEARCH.md). [Правила anti-slop](ANTI-SLOP.md). [Контракт компонентов](components/CONTRACT.md).
|
||||
|
||||
После вашего выбора фиксируются окончательные токены и правила, создаётся устанавливаемый универсальный Skill с примерами нового проекта и миграции. План — [SKILL.md](SKILL.md). Сейчас глобальная установка не производится, чтобы не назначить финальный стиль до вашего решения.
|
||||
@@ -0,0 +1,9 @@
|
||||
# Anidev Skill — этап после выбора
|
||||
|
||||
Статус: не сформирован и не установлен. Этот файл намеренно не объявляет готовый Agent Skill.
|
||||
|
||||
После выбора пользователем нужно прочитать актуальный skill-creator и создать `skills/anidev-design-system/SKILL.md` с корректным frontmatter и ссылками на утверждённые принципы, токены, типографику, правила компонентов, UX-паттерны, anti-slop, визуальные примеры и checklist. Триггер: “Use the Anidev Design System for this project.”
|
||||
|
||||
План подключения: единый Git checkout → ссылка/junction в каталоге skills агента → обновление через `git pull --ff-only`, с зафиксированной версией в подключаемом проекте. Для Codex предусмотреть пользовательский каталог skills и проектный `.agents/skills`; другие агенты подключают тот же Markdown и ссылки на ресурсы. Не копировать все внешние skills в единый контекст. При несовместимой версии остановить миграцию и описать изменения.
|
||||
|
||||
До утверждения не устанавливать глобальный Skill: иначе первое направление в галерее может случайно стать стандартом для новых проектов.
|
||||
@@ -0,0 +1,12 @@
|
||||
@echo off
|
||||
cd /d "%~dp0"
|
||||
echo Anidev Design Laboratory
|
||||
echo Open http://127.0.0.1:4173/playground/ in your browser.
|
||||
echo Press Ctrl+C to stop.
|
||||
where node >nul 2>nul
|
||||
if not errorlevel 1 (
|
||||
node scripts/serve.mjs
|
||||
) else (
|
||||
python -m http.server 4173 --bind 127.0.0.1
|
||||
)
|
||||
pause
|
||||
@@ -0,0 +1,28 @@
|
||||
# Контракт компонентов
|
||||
|
||||
Исполняемые образцы: экран Components; таблица и фильтры — Users; вкладки — Settings; вход — Authentication. Основная стилизация в `system.css`.
|
||||
|
||||
| Компонент | Состояния и взаимодействия |
|
||||
|---|---|
|
||||
| Button | Rest, hover, active, focus-visible, native disabled, aria-busy на ожидании. Enter/Space. Primary для основного действия; danger для опасного |
|
||||
| Input / Select | Связанный label, native валидация и клавиатура, focus, disabled, aria-invalid + текст ошибки. Пароль допускает вставку и password manager |
|
||||
| Checkbox / Radio / Switch | Native inputs, label, checked, disabled; switch имеет role=switch. Space переключает, radio — стрелки браузера |
|
||||
| Table / Pagination | Семантические th/td, caption, aria-sort. Сортировка имени/роли, фильтр, поиск, выбор страницы, частичный выбор, 5 строк/страница. Мобильный горизонтальный скролл только в table-wrap |
|
||||
| Search / Filter | Обновляют список без потери фокуса, сбрасывают страницу, пустой результат со сбросом |
|
||||
| Sidebar / Header / Breadcrumb | Активный раздел aria-current, подписанные иконки, mobile раскрытие. Breadcrumb показывает контекст; не изображает несуществующие ссылки |
|
||||
| Tabs | tablist/tab/tabpanel, aria-selected, roving tabindex, стрелки/Home/End |
|
||||
| Dropdown | Native details/summary для списка действий: Enter/Space раскрывают, Tab проходит действия, Esc закрывает |
|
||||
| Context menu | Правая кнопка, Shift+F10, Enter; role=menu/menuitem, стрелки, Esc, возврат фокуса |
|
||||
| Modal / Drawer | Native dialog.showModal: фон inert, фокус внутри, Esc/Close, возврат к инициатору. Заголовок aria-labelledby. Drawer использует тот же контракт |
|
||||
| Tooltip | Hover и focus-within, role=tooltip, aria-describedby. Не содержит обязательной информации |
|
||||
| Toast | role=status/aria-live=polite, видимый результат без перехвата фокуса |
|
||||
| Status | Текст + семантический цвет; без зависимости от цвета |
|
||||
| Chart | SVG с подписью, единицами, периодом и числовой таблицей. Смена периода. Без декоративных данных и автоматического потока |
|
||||
| Skeleton | aria-busy, метка загрузки, стабильная геометрия; без бесконечного shimmer |
|
||||
| Empty / Error | Объяснение и следующее действие: сброс фильтров / повторить |
|
||||
| Authentication | Native required/email/minlength, autocomplete. Демо-вход, SSO-форма и восстановление; реальная авторизация не подключена |
|
||||
| Command palette | Ctrl/⌘K, поиск, стрелки, Enter, Esc. Native dialog для управления фокусом |
|
||||
|
||||
Hover и active — временные указательные состояния; focus-visible — клавиатурное. Loading и error применяются к операциям и вводам, а не к декоративным статусам. Системные компоненты не должны имитировать состояния, не имеющие смысла для их роли.
|
||||
|
||||
Это спецификация кандидатов и рабочие образцы, ещё не опубликованный пакет production-компонентов. Перед production нужны адаптер выбранного стека, ручная проверка screen reader, backend-контракт и обработка реальных ошибок сети.
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,5 @@
|
||||
# Кандидатные направления
|
||||
|
||||
Имена, назначение, композиция, шрифт и палитры: `registry.js`. Описание различий: `../DESIGN.md`. Одни и те же экраны: `../playground/frame.js`.
|
||||
|
||||
Порядок Relay / Ledger / Signal / Axis / Dock / Grid — порядок просмотра, не рекомендация. Финальная концепция не выбрана.
|
||||
@@ -0,0 +1,170 @@
|
||||
export const concepts = [
|
||||
{
|
||||
id: "relay",
|
||||
name: "Relay",
|
||||
tag: "Инженерная ясность",
|
||||
en: "Engineering clarity",
|
||||
desc: "Левая навигация · нейтральная типографика · тонкие разделители",
|
||||
descEn: "Sidebar · neutral typography · fine dividers",
|
||||
accent: "#27634c",
|
||||
bg: "#f6f8f6",
|
||||
ink: "#203f31",
|
||||
line: "#ccd8cf",
|
||||
radius: "5px",
|
||||
font: "Arial, Helvetica, sans-serif",
|
||||
layout: "sidebar",
|
||||
},
|
||||
{
|
||||
id: "ledger",
|
||||
name: "Ledger",
|
||||
tag: "Редакционный порядок",
|
||||
en: "Editorial order",
|
||||
desc: "Индекс разделов · антиква · широкие строки",
|
||||
descEn: "Section index · serif headings · broad rows",
|
||||
accent: "#9b3c25",
|
||||
bg: "#f5f0e7",
|
||||
ink: "#4b3429",
|
||||
line: "#c9bca7",
|
||||
radius: "0px",
|
||||
font: 'Georgia, "Times New Roman", serif',
|
||||
layout: "editorial",
|
||||
},
|
||||
{
|
||||
id: "signal",
|
||||
name: "Signal",
|
||||
tag: "Операционная консоль",
|
||||
en: "Operations console",
|
||||
desc: "Строка команд · моноширинный шрифт · плотный журнал",
|
||||
descEn: "Command bar · monospace · dense log",
|
||||
accent: "#26754b",
|
||||
bg: "#eaf0e9",
|
||||
ink: "#214c31",
|
||||
line: "#b6cbbb",
|
||||
radius: "0px",
|
||||
font: 'Consolas, "Courier New", monospace',
|
||||
layout: "terminal",
|
||||
},
|
||||
{
|
||||
id: "axis",
|
||||
name: "Axis",
|
||||
tag: "Пространство продукта",
|
||||
en: "Product workspace",
|
||||
desc: "Верхняя навигация · крупные секции · цветовая полоса",
|
||||
descEn: "Top navigation · generous sections · color band",
|
||||
accent: "#285e9d",
|
||||
bg: "#f0f4fa",
|
||||
ink: "#173c68",
|
||||
line: "#c8d7ed",
|
||||
radius: "7px",
|
||||
font: '"Segoe UI", Arial, sans-serif',
|
||||
layout: "horizontal",
|
||||
},
|
||||
{
|
||||
id: "dock",
|
||||
name: "Dock",
|
||||
tag: "Персональный инструмент",
|
||||
en: "Personal instrument",
|
||||
desc: "Узкая панель · мягкая геометрия · рабочие модули",
|
||||
descEn: "Narrow rail · soft geometry · working modules",
|
||||
accent: "#765027",
|
||||
bg: "#f3f0eb",
|
||||
ink: "#543f25",
|
||||
line: "#d5cbbb",
|
||||
radius: "12px",
|
||||
font: '"Trebuchet MS", Arial, sans-serif',
|
||||
layout: "rail",
|
||||
},
|
||||
{
|
||||
id: "grid",
|
||||
name: "Grid",
|
||||
tag: "Структурный характер",
|
||||
en: "Structural character",
|
||||
desc: "Контрастная навигация · жёсткая сетка · рубленый ритм",
|
||||
descEn: "Contrast navigation · rigid grid · bold rhythm",
|
||||
accent: "#a53b21",
|
||||
bg: "#f6f5f1",
|
||||
ink: "#292a25",
|
||||
line: "#bfbfb1",
|
||||
radius: "0px",
|
||||
font: "Arial, Helvetica, sans-serif",
|
||||
layout: "grid",
|
||||
},
|
||||
];
|
||||
export function tokensFor(id, theme = "light", accent, density = "normal") {
|
||||
const c = concepts.find((c) => c.id === id) || concepts[0];
|
||||
const dark = theme === "dark";
|
||||
const palettes = {
|
||||
relay: ["#151c19", "#1b2520", "#e4ece7", "#aabcb1", "#3c4e42"],
|
||||
ledger: ["#211e1a", "#2b2721", "#efe5d6", "#c1b6a6", "#584e41"],
|
||||
signal: ["#101a13", "#16231a", "#d4e8d9", "#a4bfa9", "#36533e"],
|
||||
axis: ["#141c28", "#1b2738", "#e6edf8", "#a6bad6", "#3b4f6c"],
|
||||
dock: ["#211e1a", "#2d2821", "#f1e7d9", "#c7b6a0", "#5a4d3c"],
|
||||
grid: ["#191a18", "#252622", "#f1f1e7", "#b8bcaf", "#53574a"],
|
||||
};
|
||||
const p = palettes[c.id];
|
||||
let selected = accent || c.accent;
|
||||
const luminance = (hex) =>
|
||||
hex
|
||||
.match(/\w\w/g)
|
||||
.map((x) => parseInt(x, 16) / 255)
|
||||
.map((x) => (x <= 0.04045 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4))
|
||||
.reduce((s, v, i) => s + v * [0.2126, 0.7152, 0.0722][i], 0);
|
||||
const contrast = (a, b) => {
|
||||
const x = luminance(a),
|
||||
y = luminance(b);
|
||||
return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05);
|
||||
};
|
||||
const backgrounds = dark ? [p[0], p[1]] : [c.bg, "#ffffff"];
|
||||
for (
|
||||
let i = 0;
|
||||
i < 100 && backgrounds.some((bg) => contrast(selected, bg) < 4.5);
|
||||
i++
|
||||
)
|
||||
selected =
|
||||
"#" +
|
||||
selected
|
||||
.match(/\w\w/g)
|
||||
.map((v) =>
|
||||
Math.round(parseInt(v, 16) * 0.95 + (dark ? 255 * 0.05 : 0))
|
||||
.toString(16)
|
||||
.padStart(2, "0"),
|
||||
)
|
||||
.join("");
|
||||
// Accent is also used for text; normalize it for both surfaces before choosing button text.
|
||||
const rgb = selected.match(/\w\w/g).map((x) => parseInt(x, 16));
|
||||
const lum = rgb
|
||||
.map((x) => {
|
||||
x /= 255;
|
||||
return x <= 0.04045 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;
|
||||
})
|
||||
.reduce((s, v, i) => s + v * [0.2126, 0.7152, 0.0722][i], 0);
|
||||
const on = lum > 0.179 ? "#101810" : "#ffffff";
|
||||
return {
|
||||
"color.bg": dark ? p[0] : c.bg,
|
||||
"color.surface": dark ? p[1] : "#ffffff",
|
||||
"color.text": dark ? p[2] : "#202622",
|
||||
"color.muted": dark ? p[3] : "#59635e",
|
||||
"color.border": dark ? p[4] : c.line,
|
||||
"color.accent": selected,
|
||||
"color.on-accent": on,
|
||||
"color.danger": dark ? "#ffafa5" : "#a22923",
|
||||
"color.success": dark ? "#a2d3ab" : "#26623b",
|
||||
"radius.control": c.radius,
|
||||
"font.body": c.id === "ledger" ? "Arial, Helvetica, sans-serif" : c.font,
|
||||
"font.heading": c.font,
|
||||
"space.unit": "4px",
|
||||
"space.section":
|
||||
density === "compact" ? "18px" : density === "relaxed" ? "36px" : "26px",
|
||||
"size.control":
|
||||
density === "compact" ? "34px" : density === "relaxed" ? "46px" : "40px",
|
||||
"space.cell":
|
||||
density === "compact" ? "9px" : density === "relaxed" ? "18px" : "13px",
|
||||
"motion.duration": "120ms",
|
||||
"layout.kind": c.layout,
|
||||
};
|
||||
}
|
||||
export const cssVars = (t) =>
|
||||
Object.entries(t)
|
||||
.filter(([k]) => k !== "layout.kind")
|
||||
.map(([k, v]) => `--${k.replaceAll(".", "-")}: ${v};`)
|
||||
.join("\n");
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta http-equiv="refresh" content="0;url=playground/" />
|
||||
<title>Anidev Design System</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="playground/">Открыть лабораторию Anidev</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,12 @@
|
||||
# Компоновки
|
||||
|
||||
Грамматики находятся в `components/system.css`, селекторы `body[data-concept=…]`. Основной shell: navigation + main-column (header + content). Каждая концепция меняет структуру через Grid/Flex, сохраняя DOM-порядок чтения. Авторизация имеет отдельную композицию для каждого направления.
|
||||
|
||||
- Relay: 190px sidebar, двухколоночный обзор.
|
||||
- Ledger: 155px индекс, широкая последовательность, крупная антиква.
|
||||
- Signal: командная полоса, компактный header и строки.
|
||||
- Axis: горизонтальная навигация и широкая рабочая область.
|
||||
- Dock: 110px rail, модули с мягкой геометрией.
|
||||
- Grid: 215px контрастный sidebar, непрерывная сетка разделов.
|
||||
|
||||
900px: сворачивается двухколоночный контент; 600px: навигация по кнопке меню, метрики в строки, формы в одну колонку. Таблицы сохраняют семантику в локальном скролл-контейнере. Mobile в лаборатории имеет фактический iframe viewport 390px; Tablet — максимум 768px; Desktop занимает доступную ширину. При сравнении окно сужается до ширины половины stage — это показано в панели размеров.
|
||||
Generated
+44
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "anidev-design-system",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "anidev-design-system",
|
||||
"version": "0.1.0",
|
||||
"devDependencies": {
|
||||
"playwright": "^1.58.0"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright": {
|
||||
"version": "1.65.1",
|
||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.1.tgz",
|
||||
"integrity": "sha512-vJ1FuoOrNwOKHUIVEvSt3jT1L+wjjDpwhwIstKtfvTh8XIG4FG4bIFuvNdMxi81LGfAhUgUZleVFaOLY4RIUUw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"playwright-core": "1.65.1"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright-core": {
|
||||
"version": "1.65.1",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.1.tgz",
|
||||
"integrity": "sha512-hqPpz7blSMPxWVdoeE1yiBSzXsKiVOd2k+kjCvmUywD2GPO2Dd9HfcWnq9NN0GHbNZDFgZ9JfBFr+X5/BLo0qw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"playwright-core": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "anidev-design-system",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {"dev": "node scripts/serve.mjs", "start": "node scripts/serve.mjs", "test": "node tests/browser.mjs", "check": "node scripts/check.mjs"},
|
||||
"devDependencies": {"playwright": "^1.58.0"}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
# UX-паттерны
|
||||
|
||||
**Управление пользователями.** Поиск имени/email → фильтр роли → сортировка → выбор строки → редактирование доступа в модальном окне. Массовая блокировка требует отдельного подтверждения. Приглашение проверяет дубли email. Экспорт CSV соответствует фильтру. Все направления используют одну localStorage-фикстуру; обновления синхронизируются между iframe.
|
||||
|
||||
**Настройки.** Основные данные, безопасность и уведомления разделены вкладками. Enter отправляет форму, Cancel восстанавливает её сохранённые значения. Сохранение подтверждается toast. Поля не меняют production: всё в браузере.
|
||||
|
||||
**Авторизация.** Email → пароль → ожидание → dashboard. Ошибки форм обрабатываются native валидацией. SSO и восстановление имеют отдельные демо-формы с явным сообщением об отсутствии внешней отправки. В production этот слой заменяется безопасной интеграцией с identity provider; demo JS не служит защитой доступа.
|
||||
|
||||
**Диалоги.** Инициирующая кнопка → осмысленный заголовок → форма → cancel/submit. Esc закрывает; фокус возвращается к инициатору. Опасное действие не выполняется открытием окна.
|
||||
|
||||
**Сравнение.** Выбрать A и B → одинаковый экран, тему, плотность и размер → оценить композицию → проверить компоненты и обе темы. Акцент каждого направления независим. Экспорт кандидата не фиксирует окончательный выбор.
|
||||
|
||||
**Новый проект.** После утверждения: подключить выбранные токены и CSS, выбрать layout, переносить semantic HTML и поведение в свой стек. Проверить keyboard/mobile/EN/RU и состояния ошибок до интеграции backend.
|
||||
|
||||
**Существующий проект.** Инвентаризировать токены и компоненты; составить таблицу соответствия; сначала перевести цвета/типографику/ритм, затем контролы и layout. Сохранить бизнес-поведение, URL и контент. Не переписывать приложение ради смены стиля.
|
||||
@@ -0,0 +1,16 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<title>Anidev — Concept preview</title>
|
||||
<link rel="stylesheet" href="../components/system.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip" href="#content">Skip to content</a>
|
||||
<div id="app"></div>
|
||||
<dialog id="dialog" aria-labelledby="dialog-title"></dialog>
|
||||
<div id="toast" role="status" aria-live="polite"></div>
|
||||
<script type="module" src="frame.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,841 @@
|
||||
import { concepts, tokensFor, cssVars } from "../concepts/registry.js";
|
||||
const params = new URLSearchParams(location.search),
|
||||
concept = concepts.find((c) => c.id === params.get("concept")) || concepts[0];
|
||||
const theme = params.get("theme") === "dark" ? "dark" : "light",
|
||||
density = params.get("density") || "normal",
|
||||
locale = params.get("locale") === "en" ? "en" : "ru";
|
||||
const rawAccent = params.get("accent"),
|
||||
accent = /^#[0-9a-f]{6}$/i.test(rawAccent) ? rawAccent : concept.accent;
|
||||
const tokens = tokensFor(concept.id, theme, accent, density);
|
||||
document.documentElement.style.cssText = cssVars(tokens);
|
||||
document.documentElement.lang = locale;
|
||||
document.body.dataset.concept = concept.id;
|
||||
document.body.dataset.theme = theme;
|
||||
const t = (ru, en) => (locale === "ru" ? ru : en);
|
||||
const number = (v, digits = 0) =>
|
||||
new Intl.NumberFormat(locale, {
|
||||
minimumFractionDigits: digits,
|
||||
maximumFractionDigits: digits,
|
||||
}).format(v);
|
||||
const $ = (s) => document.querySelector(s),
|
||||
escape = (s) =>
|
||||
String(s).replace(
|
||||
/[&<>"']/g,
|
||||
(c) =>
|
||||
({
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
">": ">",
|
||||
'"': """,
|
||||
"'": "'",
|
||||
})[c],
|
||||
);
|
||||
const initialUsers = [
|
||||
{
|
||||
id: 1,
|
||||
name: "Anna Volkova",
|
||||
email: "anna@anidev.ru",
|
||||
role: "admin",
|
||||
status: "active",
|
||||
last: "09:42",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "Mikhail Orlov",
|
||||
email: "mikhail@anidev.ru",
|
||||
role: "developer",
|
||||
status: "active",
|
||||
last: "09:38",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Elena Kim",
|
||||
email: "elena@anidev.ru",
|
||||
role: "viewer",
|
||||
status: "active",
|
||||
last: "09:21",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "Denis Petrov",
|
||||
email: "denis@anidev.ru",
|
||||
role: "developer",
|
||||
status: "invited",
|
||||
last: "—",
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: "Sofia Morozova",
|
||||
email: "sofia@anidev.ru",
|
||||
role: "viewer",
|
||||
status: "suspended",
|
||||
last: "26.11",
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: "Pavel Sokolov",
|
||||
email: "pavel@anidev.ru",
|
||||
role: "developer",
|
||||
status: "active",
|
||||
last: "08:56",
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
name: "Maria Ivanova",
|
||||
email: "maria@anidev.ru",
|
||||
role: "admin",
|
||||
status: "active",
|
||||
last: "08:40",
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
name: "Alex Chen",
|
||||
email: "alex@anidev.ru",
|
||||
role: "viewer",
|
||||
status: "active",
|
||||
last: "08:32",
|
||||
},
|
||||
];
|
||||
let users;
|
||||
try {
|
||||
users =
|
||||
JSON.parse(localStorage.getItem("anidev.users") || "null") ||
|
||||
structuredClone(initialUsers);
|
||||
} catch {
|
||||
users = structuredClone(initialUsers);
|
||||
}
|
||||
let settings;
|
||||
try {
|
||||
settings = JSON.parse(localStorage.getItem("anidev.settings") || "null") || {
|
||||
name: "Anidev Production",
|
||||
slug: "anidev-prod",
|
||||
region: "eu",
|
||||
email: "ops@anidev.ru",
|
||||
mfa: true,
|
||||
audit: true,
|
||||
};
|
||||
} catch {
|
||||
settings = {
|
||||
name: "Anidev Production",
|
||||
slug: "anidev-prod",
|
||||
region: "eu",
|
||||
email: "ops@anidev.ru",
|
||||
mfa: true,
|
||||
audit: true,
|
||||
};
|
||||
}
|
||||
let page = [
|
||||
"dashboard",
|
||||
"users",
|
||||
"settings",
|
||||
"auth",
|
||||
"components",
|
||||
"tokens",
|
||||
].includes(params.get("page"))
|
||||
? params.get("page")
|
||||
: "dashboard";
|
||||
let query = "",
|
||||
role = "all",
|
||||
userPage = 1,
|
||||
sortAsc = true,
|
||||
sortKey = "name",
|
||||
selected = new Set(),
|
||||
tab = "general",
|
||||
chartRange = "24h";
|
||||
const pageNames = {
|
||||
dashboard: t("Обзор", "Overview"),
|
||||
users: t("Пользователи", "Users"),
|
||||
settings: t("Настройки", "Settings"),
|
||||
auth: t("Авторизация", "Sign in"),
|
||||
components: t("Компоненты", "Components"),
|
||||
tokens: t("Токены", "Tokens"),
|
||||
};
|
||||
const icons = {
|
||||
dashboard:
|
||||
'<rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/>',
|
||||
users:
|
||||
'<circle cx="9" cy="8" r="3"/><path d="M3 21v-3a6 6 0 0 1 12 0v3M16 5a3 3 0 0 1 0 6M18 15a5 5 0 0 1 3 5"/>',
|
||||
settings:
|
||||
'<path d="M4 7h16M4 17h16"/><circle cx="9" cy="7" r="3"/><circle cx="16" cy="17" r="3"/>',
|
||||
components:
|
||||
'<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 10h18M10 10v11"/>',
|
||||
tokens: '<path d="m8 4-6 8 6 8M16 4l6 8-6 8M14 2l-4 20"/>',
|
||||
};
|
||||
const icon = (id) =>
|
||||
`<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true">${icons[id] || icons.dashboard}</svg>`;
|
||||
const wordmark = '<div class="wordmark"><b>a/</b><span>anidev</span></div>';
|
||||
function persist() {
|
||||
try {
|
||||
localStorage.setItem("anidev.users", JSON.stringify(users));
|
||||
localStorage.setItem("anidev.settings", JSON.stringify(settings));
|
||||
} catch {
|
||||
toast(t("Хранилище браузера недоступно", "Browser storage unavailable"));
|
||||
}
|
||||
}
|
||||
let toastTimer;
|
||||
function toast(message) {
|
||||
$("#toast").textContent = message;
|
||||
$("#toast").style.display = "block";
|
||||
clearTimeout(toastTimer);
|
||||
toastTimer = setTimeout(() => ($("#toast").style.display = "none"), 3500);
|
||||
}
|
||||
function nav() {
|
||||
return `<aside class="navigation">${wordmark}<div class="workspace-label">ANIDEV / PRODUCTION</div><nav aria-label="${t("Основная навигация", "Main navigation")}" class="nav-links">${["dashboard", "users", "settings", "components", "tokens"].map((p) => `<button data-page="${p}" ${page === p ? 'aria-current="page"' : ""} title="${pageNames[p]}">${icon(p)}<span>${pageNames[p]}</span></button>`).join("")}</nav><div class="nav-bottom">eu-central-1<br>Workspace / Pro<br><button data-page="auth" style="font-size:12px;margin-top:15px">${t("Выйти", "Sign out")}</button></div></aside>`;
|
||||
}
|
||||
function header() {
|
||||
return `<header class="app-header"><button class="mobile-menu" data-action="mobile-menu" aria-label="${t("Открыть навигацию", "Open navigation")}" aria-expanded="false">☰</button><div class="breadcrumb">Anidev <span aria-hidden="true">/</span> Production <span aria-hidden="true">/</span> ${pageNames[page]}</div><div class="header-actions"><button class="command-trigger" data-action="command">${t("Найти команду", "Find a command")} <kbd>⌘ K</kbd></button><button class="avatar" data-action="profile" aria-label="${t("Профиль Anna Volkova", "Anna Volkova profile")}">AV</button></div></header>`;
|
||||
}
|
||||
const heading = (title, desc, actions = "") =>
|
||||
`<div class="page-heading"><div><div class="overline">ANIDEV://PRODUCTION/${page.toUpperCase()}</div><h1>${title}</h1><p>${desc}</p></div><div class="heading-actions">${actions}</div></div>`;
|
||||
function render() {
|
||||
document.title = `Anidev / ${concept.name} / ${pageNames[page]}`;
|
||||
$("#app").innerHTML =
|
||||
page === "auth"
|
||||
? auth()
|
||||
: `<div class="shell">${nav()}<div class="main-column">${header()}<main id="content" tabindex="-1">${{ dashboard, users: userScreen, settings: settingsScreen, components: componentScreen, tokens: tokenScreen }[page]()}</main></div></div>`;
|
||||
bindForms();
|
||||
if (page === "users") bindUsers();
|
||||
}
|
||||
function chart() {
|
||||
const values =
|
||||
chartRange === "24h"
|
||||
? [
|
||||
32, 30, 34, 33, 35, 42, 38, 34, 33, 32, 37, 35, 38, 41, 43, 39, 36,
|
||||
35, 37, 40, 38, 34, 32, 34,
|
||||
]
|
||||
: [34, 38, 36, 41, 37, 35, 34];
|
||||
const points = values
|
||||
.map((v, i) => `${(i * 500) / (values.length - 1)},${145 - (v - 25) * 5}`)
|
||||
.join(" ");
|
||||
return `<div class="chart" role="img" aria-label="${t("Задержка p95: от 30 до 43 мс. Текущая 34 мс.", "p95 latency: 30 to 43 ms. Current 34 ms.")}"><svg viewBox="0 0 500 150" preserveAspectRatio="none" aria-hidden="true"><path class="chart-grid" d="M0 20H500M0 75H500M0 130H500"/><polygon class="chart-area" points="0,150 ${points} 500,150"/><polyline class="chart-line" points="${points}"/></svg><div class="axis-labels"><span>${chartRange === "24h" ? "00:00" : "21.11"}</span><span>${chartRange === "24h" ? "06:00" : "23.11"}</span><span>${chartRange === "24h" ? "12:00" : "25.11"}</span><span>${chartRange === "24h" ? "18:00" : "27.11"}</span></div></div><p class="chart-legend">${t("p95 · миллисекунды · ниже — лучше · тестовая выборка", "p95 · milliseconds · lower is better · sample dataset")}</p><details class="chart-data"><summary>${t("Числовые данные", "Numerical data")}</summary><div class="chart-data-scroll"><table><thead><tr><th>${t("Время UTC", "Time UTC")}</th><th>p95 / ms</th></tr></thead><tbody>${values.map((v, i) => `<tr><td>${chartRange === "24h" ? String(i).padStart(2, "0") + ":00" : 21 + i + ".11"}</td><td>${v}</td></tr>`).join("")}</tbody></table></div></details>`;
|
||||
}
|
||||
function dashboard() {
|
||||
return `${heading(t("Обзор инфраструктуры", "Infrastructure overview"), t("Production · 27 ноября 2026", "Production · November 27, 2026"), `<button data-action="activity">${t("Журнал событий", "Activity log")}</button><button class="primary" data-action="invite">${t("Пригласить участника", "Invite member")}</button>`)}
|
||||
<div class="health-line"><strong>${t("Все системы работают штатно", "All systems operational")}</strong><span>${t("Проверено в 09:42 UTC · демонстрация", "Checked at 09:42 UTC · demo")}</span></div>
|
||||
<section class="metrics" aria-label="${t("Ключевые показатели", "Key metrics")}"><div class="metric"><div class="metric-label">${t("Доступность за 30 дней", "30-day availability")}</div><div class="metric-value">${number(99.98, 2)}<span style="font-size:.5em">%</span></div><div class="metric-note">${t("SLO 99.9% · в пределах цели", "SLO 99.9% · within target")}</div></div><div class="metric"><div class="metric-label">${t("Активные сессии", "Active sessions")}</div><div class="metric-value">${number(1284)}</div><div class="metric-note">${t("SSO · за последние 15 минут", "SSO · last 15 minutes")}</div></div><div class="metric"><div class="metric-label">${t("Задержка API, p95", "API latency, p95")}</div><div class="metric-value">34 <span style="font-size:.5em">ms</span></div><div class="metric-note">${t("Порог оповещения: 100 мс", "Alert threshold: 100 ms")}</div></div></section>
|
||||
<div class="dashboard-grid"><section class="panel"><div class="section-title"><h2>${t("Время ответа API", "API response time")}</h2><select id="chart-range" aria-label="${t("Период графика", "Chart period")}" style="min-height:30px;font-size:12px;padding:4px 7px"><option value="24h" ${chartRange === "24h" ? "selected" : ""}>24 ${t("часа", "hours")}</option><option value="7d" ${chartRange === "7d" ? "selected" : ""}>7 ${t("дней", "days")}</option></select></div>${chart()}</section><section class="panel"><div class="section-title"><h2>${t("Сервисы", "Services")}</h2><span>3 / 3 ONLINE</span></div><div class="services">${[
|
||||
["Identity", "18 ms"],
|
||||
["License API", "34 ms"],
|
||||
["Edge Gateway", "12 ms"],
|
||||
]
|
||||
.map(
|
||||
([name, time]) =>
|
||||
`<div class="service"><span>${name}</span><small>${time}</small><span class="status">${t("Работает", "Operational")}</span></div>`,
|
||||
)
|
||||
.join(
|
||||
"",
|
||||
)}</div><p class="chart-legend">eu-central-1 · ${t("проверка каждую минуту", "checked every minute")}</p></section></div>
|
||||
<section class="activity" id="activity"><div class="section-title"><h2>${t("Последние события", "Recent activity")}</h2><span>UTC</span></div>${[
|
||||
[
|
||||
"09:42",
|
||||
t("Обновлена политика доступа", "Access policy updated"),
|
||||
"Anna Volkova",
|
||||
],
|
||||
[
|
||||
"09:38",
|
||||
t("Выпущена лицензия AN-2048", "License AN-2048 issued"),
|
||||
"License API",
|
||||
],
|
||||
[
|
||||
"09:21",
|
||||
t("Успешная авторизация через SSO", "Successful SSO authentication"),
|
||||
"Elena Kim",
|
||||
],
|
||||
]
|
||||
.map(
|
||||
([time, event, who]) =>
|
||||
`<div class="activity-row"><time>${time}</time><span>${event}</span><span>${who}</span></div>`,
|
||||
)
|
||||
.join(
|
||||
"",
|
||||
)}</section><p class="compact-note">${t("Демонстрационные данные. Подключение к реальной инфраструктуре отсутствует.", "Demonstration data. No connection to live infrastructure.")}</p>`;
|
||||
}
|
||||
const roleName = (r) =>
|
||||
({
|
||||
admin: t("Администратор", "Administrator"),
|
||||
developer: t("Разработчик", "Developer"),
|
||||
viewer: t("Наблюдатель", "Viewer"),
|
||||
})[r];
|
||||
const statusName = (s) =>
|
||||
({
|
||||
active: t("Активен", "Active"),
|
||||
invited: t("Приглашён", "Invited"),
|
||||
suspended: t("Заблокирован", "Suspended"),
|
||||
})[s];
|
||||
function filteredUsers() {
|
||||
return users
|
||||
.filter(
|
||||
(u) =>
|
||||
(u.name + " " + u.email).toLowerCase().includes(query.toLowerCase()) &&
|
||||
(role === "all" || u.role === role),
|
||||
)
|
||||
.sort((a, b) => a[sortKey].localeCompare(b[sortKey]) * (sortAsc ? 1 : -1));
|
||||
}
|
||||
function userScreen() {
|
||||
return `${heading(t("Пользователи", "Users"), t("Участники рабочего пространства и их доступ.", "Workspace members and their access."), `<button data-action="reset-users">${t("Сбросить демо", "Reset demo")}</button><button class="primary" data-action="invite">${t("Пригласить участника", "Invite member")}</button>`)}<div class="page-body"><div class="toolbar"><input class="search" id="user-search" type="search" placeholder="${t("Поиск по имени или email", "Search name or email")}" aria-label="${t("Поиск пользователей", "Search users")}" value="${escape(query)}"><select id="role-filter" aria-label="${t("Фильтр по роли", "Filter role")}"><option value="all">${t("Все роли", "All roles")}</option>${["admin", "developer", "viewer"].map((r) => `<option value="${r}" ${role === r ? "selected" : ""}>${roleName(r)}</option>`).join("")}</select><button data-action="download-users">CSV</button></div><div id="user-results">${userResults()}</div></div>`;
|
||||
}
|
||||
function userResults() {
|
||||
const filtered = filteredUsers();
|
||||
userPage = Math.max(
|
||||
1,
|
||||
Math.min(userPage, Math.ceil(filtered.length / 5) || 1),
|
||||
);
|
||||
const visible = filtered.slice((userPage - 1) * 5, userPage * 5);
|
||||
return `${selected.size ? `<div class="selection-bar"><span>${t("Выбрано", "Selected")}: ${selected.size}</span><button class="danger" data-action="bulk-suspend">${t("Заблокировать", "Suspend")}</button><button data-action="clear-selection">${t("Снять выбор", "Clear selection")}</button></div>` : ""}
|
||||
${
|
||||
!filtered.length
|
||||
? `<div class="empty-state"><h3>${t("Пользователи не найдены", "No users found")}</h3><p>${t("Попробуйте другое имя или сбросьте фильтр.", "Try another name or reset the filter.")}</p><button data-action="clear-filters">${t("Сбросить фильтры", "Reset filters")}</button></div>`
|
||||
: `<div class="table-wrap"><table><caption style="position:absolute;width:1px;height:1px;overflow:hidden">${t("Участники Anidev Production", "Anidev Production members")}</caption><thead><tr><th style="width:35px"><input type="checkbox" id="select-all" aria-label="${t("Выбрать текущую страницу", "Select current page")}" ${visible.every((u) => selected.has(u.id)) ? "checked" : ""}></th><th aria-sort="${sortKey === "name" ? (sortAsc ? "ascending" : "descending") : "none"}"><button class="row-action" data-sort="name">${t("Участник", "Member")} ${sortKey === "name" ? (sortAsc ? "↑" : "↓") : ""}</button></th><th aria-sort="${sortKey === "role" ? (sortAsc ? "ascending" : "descending") : "none"}"><button class="row-action" data-sort="role">${t("Роль", "Role")}</button></th><th>${t("Статус", "Status")}</th><th>${t("Был в сети", "Last seen")}</th><th><span class="muted">${t("Действия", "Actions")}</span></th></tr></thead><tbody>${visible
|
||||
.map(
|
||||
(u) =>
|
||||
`<tr><td><input type="checkbox" data-select="${u.id}" aria-label="${t("Выбрать", "Select")} ${escape(u.name)}" ${selected.has(u.id) ? "checked" : ""}></td><td><div class="person"><span class="avatar">${escape(
|
||||
u.name
|
||||
.split(" ")
|
||||
.map((n) => n[0])
|
||||
.join(""),
|
||||
)}</span><div>${escape(u.name)}<small>${escape(u.email)}</small></div></div></td><td>${roleName(u.role)}</td><td><span class="status ${u.status === "suspended" ? "warn" : ""}">${statusName(u.status)}</span></td><td><small>${u.last}</small></td><td><button class="row-action" data-edit="${u.id}" aria-label="${t("Изменить", "Edit")} ${escape(u.name)}">${t("Изменить", "Edit")}</button></td></tr>`,
|
||||
)
|
||||
.join("")}</tbody></table></div>`
|
||||
}
|
||||
<div class="pagination"><span>${filtered.length ? t("Показано", "Showing") + " " + ((userPage - 1) * 5 + 1) + "–" + Math.min(userPage * 5, filtered.length) + " / " + filtered.length : t("Нет результатов", "No results")}</span><div><button data-action="prev" ${userPage === 1 ? "disabled" : ""}>${t("Назад", "Previous")}</button><button data-action="next" ${userPage * 5 >= filtered.length ? "disabled" : ""}>${t("Далее", "Next")}</button></div></div>`;
|
||||
}
|
||||
function refreshUsers() {
|
||||
const search = $("#user-search");
|
||||
if (search) search.value = query;
|
||||
const filter = $("#role-filter");
|
||||
if (filter) filter.value = role;
|
||||
$("#user-results").innerHTML = userResults();
|
||||
bindSelection();
|
||||
}
|
||||
function bindUsers() {
|
||||
$("#user-search").oninput = (e) => {
|
||||
query = e.target.value;
|
||||
userPage = 1;
|
||||
refreshUsers();
|
||||
};
|
||||
$("#role-filter").onchange = (e) => {
|
||||
role = e.target.value;
|
||||
userPage = 1;
|
||||
refreshUsers();
|
||||
};
|
||||
bindSelection();
|
||||
}
|
||||
function bindSelection() {
|
||||
const all = $("#select-all");
|
||||
if (all) {
|
||||
const visible = filteredUsers().slice((userPage - 1) * 5, userPage * 5);
|
||||
all.indeterminate =
|
||||
visible.some((u) => selected.has(u.id)) &&
|
||||
!visible.every((u) => selected.has(u.id));
|
||||
all.onchange = (e) => {
|
||||
visible.forEach((u) =>
|
||||
e.target.checked ? selected.add(u.id) : selected.delete(u.id),
|
||||
);
|
||||
refreshUsers();
|
||||
};
|
||||
}
|
||||
document.querySelectorAll("[data-select]").forEach(
|
||||
(el) =>
|
||||
(el.onchange = () => {
|
||||
const id = Number(el.dataset.select);
|
||||
el.checked ? selected.add(id) : selected.delete(id);
|
||||
refreshUsers();
|
||||
}),
|
||||
);
|
||||
}
|
||||
function settingsScreen() {
|
||||
return `${heading(t("Настройки пространства", "Workspace settings"), t("Идентификация, безопасность и уведомления.", "Identity, security and notifications."))}<div class="page-body"><div class="tabs" role="tablist" aria-label="${t("Раздел настроек", "Settings section")}">${["general", "security", "notifications"].map((v, i) => `<button role="tab" id="tab-${v}" aria-controls="settings-panel" data-tab="${v}" aria-selected="${tab === v}" tabindex="${tab === v ? "0" : "-1"}">${[t("Основные", "General"), t("Безопасность", "Security"), t("Уведомления", "Notifications")][i]}</button>`).join("")}</div><section id="settings-panel" role="tabpanel" aria-labelledby="tab-${tab}" class="settings-layout"><div class="settings-copy"><h2>${tab === "general" ? t("Ваше пространство", "Your workspace") : tab === "security" ? t("Контроль доступа", "Access control") : t("Оповещения", "Notifications")}</h2><p>${tab === "general" ? t("Эти данные видны участникам организации.", "These details are visible to organization members.") : t("Изменения применяются к этому демо.", "Changes apply to this demo.")}</p></div><form id="settings-form">${tab === "general" ? `<label class="field">${t("Название", "Workspace name")}<input name="name" required maxlength="60" value="${escape(settings.name)}"></label><label class="field">${t("Идентификатор", "Workspace slug")}<input name="slug" required pattern="[a-z0-9-]+" value="${escape(settings.slug)}"><small>${t("Строчные латинские буквы, цифры и дефис.", "Lowercase letters, numbers and hyphens.")}</small></label><label class="field">${t("Регион данных", "Data region")}<select name="region"><option value="eu" ${settings.region === "eu" ? "selected" : ""}>Europe / Frankfurt</option><option value="us" ${settings.region === "us" ? "selected" : ""}>US / Virginia</option></select></label>` : tab === "security" ? `<div class="form-row"><label for="mfa"><b>${t("Двухфакторная авторизация", "Two-factor authentication")}</b><small style="display:block">${t("Обязательна для всех участников", "Required for all members")}</small></label><input class="switch" type="checkbox" role="switch" name="mfa" id="mfa" ${settings.mfa ? "checked" : ""}></div><div class="form-row"><label for="audit">${t("Журналировать действия", "Record audit events")}</label><input class="switch" type="checkbox" role="switch" name="audit" id="audit" ${settings.audit ? "checked" : ""}></div><button type="button" data-action="sessions">${t("Управление сессиями", "Manage sessions")}</button>` : `<label class="field">${t("Email для оповещений", "Alert email")}<input type="email" name="email" required value="${escape(settings.email)}"></label><div class="form-row"><input type="checkbox" id="incidents" checked><label for="incidents">${t("Инциденты и недоступность сервисов", "Incidents and service outages")}</label></div>`}<div class="form-footer"><button type="reset">${t("Отменить", "Cancel")}</button><button class="primary" type="submit">${t("Сохранить изменения", "Save changes")}</button></div></form></section></div>`;
|
||||
}
|
||||
function auth() {
|
||||
return `<main id="content" class="auth-layout" style="max-width:none;padding:0"><section class="auth-brand">${wordmark}<div class="auth-statement">${t("Ваша инфраструктура.<br>Под вашим контролем.", "Your infrastructure.<br>Under your control.")}</div><small>ANIDEV IDENTITY / ${t("ДЕМОНСТРАЦИЯ", "DEMONSTRATION")}</small></section><section class="auth-main"><form id="auth-form" class="auth-form"><h1>${t("Вход в Anidev", "Sign in to Anidev")}</h1><p>${t("Продолжите работу с вашим пространством.", "Continue to your workspace.")}</p><label class="field">Email<input name="email" type="email" autocomplete="username" placeholder="you@company.com" required></label><label class="field">${t("Пароль", "Password")}<input name="password" type="password" autocomplete="current-password" minlength="8" required aria-describedby="password-hint"><small id="password-hint">${t("Демо: любой email и пароль от 8 символов.", "Demo: any email and a password of 8+ characters.")}</small></label><div class="form-row"><input id="remember" type="checkbox"><label for="remember">${t("Запомнить меня", "Remember me")}</label><button class="row-action" type="button" data-action="recover">${t("Забыли пароль?", "Forgot password?")}</button></div><p class="error-text" id="auth-error" role="alert"></p><button class="primary" type="submit">${t("Войти", "Sign in")}</button><div class="auth-divider">${t("или корпоративный аккаунт", "or your company account")}</div><button type="button" class="sso" data-action="sso">${t("Войти через SSO", "Continue with SSO")}</button><div class="auth-foot"><span>© Anidev 2026</span><button class="row-action" type="button" data-page="dashboard">${t("Вернуться к обзору", "Back to overview")}</button></div></form></section></main>`;
|
||||
}
|
||||
function componentScreen() {
|
||||
return `${heading(t("Библиотека компонентов", "Component library"), t("Единые состояния. Шесть способов выражения.", "Shared states. Six ways of expressing them."), `<button data-action="command">${t("Команды", "Commands")} ⌘K</button>`)}<div class="page-body"><div class="library">
|
||||
<section class="specimen"><h2>Buttons</h2><div class="component-row"><button class="primary" data-action="demo-save">${t("Сохранить", "Save")}</button><button data-action="toast">${t("Вторичная", "Secondary")}</button><button class="danger" data-action="delete">${t("Удалить", "Delete")}</button><button disabled>Disabled</button><button aria-busy="true" disabled>${t("Загрузка…", "Loading…")}</button></div><small>Hover · active · focus · disabled · loading</small></section>
|
||||
<section class="specimen"><h2>Inputs & selects</h2><label class="field">${t("Имя проекта", "Project name")}<input placeholder="Anidev Production"></label><label class="field">Email<input aria-invalid="true" aria-describedby="sample-error" value="invalid-email"><small class="error-text" id="sample-error">${t("Введите корректный email", "Enter a valid email")}</small></label><select aria-label="${t("Окружение", "Environment")}"><option>Production</option><option>Staging</option></select><input aria-label="Disabled input" disabled value="Read only"></section>
|
||||
<section class="specimen"><h2>Selection controls</h2><div class="form-row"><input id="check-demo" type="checkbox" checked><label for="check-demo">${t("Email-уведомления", "Email notifications")}</label></div><fieldset style="border:0;padding:0"><legend>${t("Период хранения", "Retention period")}</legend><div class="component-row"><label><input type="radio" name="retention" value="30" checked> 30 ${t("дней", "days")}</label><label><input type="radio" name="retention" value="90"> 90 ${t("дней", "days")}</label></div></fieldset><div class="form-row"><label for="switch-demo">${t("Автообновление", "Auto refresh")}</label><input id="switch-demo" class="switch" role="switch" type="checkbox" checked></div></section>
|
||||
<section class="specimen"><h2>Overlays & feedback</h2><div class="component-row"><button data-action="invite">Modal</button><button data-action="drawer">Drawer</button><button data-action="toast">Toast</button><span class="tooltip-wrap"><button aria-describedby="demo-tooltip">Tooltip</button><span class="tooltip" id="demo-tooltip" role="tooltip">${t("Скопировать идентификатор", "Copy identifier")}</span></span></div><details><summary>${t("Действия проекта", "Project actions")}</summary><div class="dropdown"><button data-action="rename">${t("Переименовать", "Rename")}</button><button data-action="download-users">${t("Экспорт CSV", "Export CSV")}</button><button class="danger" data-action="delete">${t("Удалить", "Delete")}</button></div></details><div class="context-target" tabindex="0" role="button" aria-haspopup="menu" style="margin-top:15px">${t("Контекстное меню: правая кнопка, Shift+F10 или Enter", "Context menu: right click, Shift+F10 or Enter")}</div></section>
|
||||
<section class="specimen"><h2>Empty state</h2><div class="empty-state"><h3>${t("Пока нет API-ключей", "No API keys yet")}</h3><p>${t("Создайте ключ для подключения сервиса.", "Create a key to connect your service.")}</p><button data-action="create-key">${t("Создать ключ", "Create key")}</button></div></section>
|
||||
<section class="specimen"><h2>Error & skeleton</h2><div class="error-state" role="status"><p>${t("Не удалось загрузить журнал.", "Could not load the log.")}</p><button data-action="retry">${t("Повторить", "Retry")}</button></div><div aria-label="${t("Загрузка данных", "Loading data")}" aria-busy="true" style="margin-top:20px"><div class="skeleton"></div><div class="skeleton"></div><div class="skeleton"></div></div></section>
|
||||
<section class="specimen"><h2>Status indicators</h2><div class="component-row"><span class="status">${t("Работает", "Operational")}</span><span class="status warn">${t("Недоступен", "Unavailable")}</span><span class="muted">${t("Ожидает", "Pending")}</span></div><p class="muted" style="font-size:13px">${t("Состояние выражено текстом, а не только цветом.", "Status uses text as well as color.")}</p></section>
|
||||
<section class="specimen"><h2>Chart</h2>${chart()}</section></div><p class="compact-note">${t("Таблицы, пагинация и фильтры — на экране «Пользователи»; вкладки — в настройках; форма входа — в авторизации.", "Tables, pagination and filters: Users. Tabs: Settings. Sign-in form: Authentication.")}</p></div>`;
|
||||
}
|
||||
function tokenScreen() {
|
||||
return `${heading(t("Дизайн-токены", "Design tokens"), `${concept.name} / ${theme} / ${density}`, `<button data-action="copy-json">${t("Копировать JSON", "Copy JSON")}</button><button class="primary" data-action="copy-css">${t("Копировать CSS", "Copy CSS")}</button>`)}<div class="page-body"><div class="tokens-list">${Object.entries(
|
||||
tokens,
|
||||
)
|
||||
.map(
|
||||
([key, value]) =>
|
||||
`<div class="token-row"><code>${key}</code><span class="token-value">${value.startsWith("#") ? `<i class="color-chip" style="background:${value}"></i>` : ""}${escape(value)}</span></div>`,
|
||||
)
|
||||
.join(
|
||||
"",
|
||||
)}</div><pre class="code-block">:root {\n${cssVars(tokens)}\n}</pre><p class="compact-note">${t("Экспорт галереи включает обе темы, JSON и CSS. Акцент применяется к каждой концепции отдельно.", "Gallery export includes both themes, JSON and CSS. Each concept retains its own accent.")}</p></div>`;
|
||||
}
|
||||
let dialogInitiator = null;
|
||||
function openDialog(title, body, cls = "") {
|
||||
const d = $("#dialog");
|
||||
if (d.open) d.close();
|
||||
dialogInitiator = document.activeElement;
|
||||
d.className = cls;
|
||||
d.innerHTML = `<div class="dialog-heading"><h2 id="dialog-title">${title}</h2><button class="close" data-action="close" aria-label="${t("Закрыть", "Close")}">×</button></div>${body}`;
|
||||
d.showModal();
|
||||
return d;
|
||||
}
|
||||
function invite() {
|
||||
openDialog(
|
||||
t("Пригласить участника", "Invite a member"),
|
||||
`<p>${t("Приглашение будет добавлено в демонстрационный список. Письмо не отправляется.", "The invitation is added to the demo list. No email is sent.")}</p><form id="invite-form"><label class="field">${t("Имя", "Name")}<input name="name" required maxlength="80" autocomplete="name"></label><label class="field">Email<input name="email" type="email" required autocomplete="email"></label><label class="field">${t("Роль", "Role")}<select name="role">${["developer", "viewer", "admin"].map((r) => `<option value="${r}">${roleName(r)}</option>`).join("")}</select></label><p id="invite-error" class="error-text" role="alert"></p><div class="form-footer"><button type="button" data-action="close">${t("Отмена", "Cancel")}</button><button class="primary" type="submit">${t("Добавить приглашение", "Add invitation")}</button></div></form>`,
|
||||
);
|
||||
$("#invite-form").onsubmit = (e) => {
|
||||
e.preventDefault();
|
||||
const f = new FormData(e.target),
|
||||
email = f.get("email").trim().toLowerCase();
|
||||
if (users.some((u) => u.email.toLowerCase() === email)) {
|
||||
$("#invite-error").textContent = t(
|
||||
"Этот email уже добавлен.",
|
||||
"This email already exists.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
users.push({
|
||||
id: Date.now(),
|
||||
name: f.get("name").trim(),
|
||||
email,
|
||||
role: f.get("role"),
|
||||
status: "invited",
|
||||
last: "—",
|
||||
});
|
||||
persist();
|
||||
$("#dialog").close();
|
||||
if (page === "users") refreshUsers();
|
||||
toast(t("Приглашение добавлено в демо", "Invitation added to demo"));
|
||||
};
|
||||
}
|
||||
function editUser(id) {
|
||||
const user = users.find((u) => u.id === id);
|
||||
if (!user) return;
|
||||
openDialog(
|
||||
escape(user.name),
|
||||
`<p>${escape(user.email)}</p><form id="edit-user"><label class="field">${t("Роль", "Role")}<select name="role">${["admin", "developer", "viewer"].map((r) => `<option value="${r}" ${user.role === r ? "selected" : ""}>${roleName(r)}</option>`).join("")}</select></label><label class="field">${t("Статус", "Status")}<select name="status">${["active", "invited", "suspended"].map((s) => `<option value="${s}" ${user.status === s ? "selected" : ""}>${statusName(s)}</option>`).join("")}</select></label><div class="form-footer"><button type="button" data-action="close">${t("Отмена", "Cancel")}</button><button type="submit" class="primary">${t("Сохранить", "Save")}</button></div></form>`,
|
||||
);
|
||||
$("#edit-user").onsubmit = (e) => {
|
||||
e.preventDefault();
|
||||
const data = new FormData(e.target);
|
||||
user.role = data.get("role");
|
||||
user.status = data.get("status");
|
||||
persist();
|
||||
$("#dialog").close();
|
||||
refreshUsers();
|
||||
toast(t("Доступ обновлён", "Access updated"));
|
||||
};
|
||||
}
|
||||
function command() {
|
||||
openDialog(
|
||||
t("Команды", "Commands"),
|
||||
`<input id="command-search" type="search" placeholder="${t("Найти экран…", "Find a page…")}" aria-label="${t("Поиск команд", "Search commands")}" style="width:100%"><div class="command-list">${Object.entries(
|
||||
pageNames,
|
||||
)
|
||||
.map(([id, name]) => `<button data-page="${id}">${name}</button>`)
|
||||
.join(
|
||||
"",
|
||||
)}<button data-action="invite">${t("Пригласить участника", "Invite member")}</button></div><small>${t("↑ ↓ — выбор · Enter — открыть · Esc — закрыть", "↑ ↓ to navigate · Enter to open · Esc to close")}</small>`,
|
||||
);
|
||||
$("#command-search").oninput = (e) =>
|
||||
document
|
||||
.querySelectorAll(".command-list button")
|
||||
.forEach(
|
||||
(b) =>
|
||||
(b.hidden = !b.textContent
|
||||
.toLowerCase()
|
||||
.includes(e.target.value.toLowerCase())),
|
||||
);
|
||||
}
|
||||
function download(name, text, type = "text/plain") {
|
||||
const url = URL.createObjectURL(new Blob(["\ufeff", text], { type }));
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = name;
|
||||
a.click();
|
||||
setTimeout(() => URL.revokeObjectURL(url), 30000);
|
||||
}
|
||||
async function copy(text) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
toast(t("Скопировано", "Copied"));
|
||||
} catch {
|
||||
openDialog(
|
||||
t("Скопируйте вручную", "Copy manually"),
|
||||
`<textarea readonly aria-label="Copy" style="width:100%;height:220px">${escape(text)}</textarea>`,
|
||||
);
|
||||
$("#dialog textarea").select();
|
||||
}
|
||||
}
|
||||
function bindForms() {
|
||||
if ($("#settings-form"))
|
||||
$("#settings-form").onsubmit = (e) => {
|
||||
e.preventDefault();
|
||||
const f = new FormData(e.target);
|
||||
if (tab === "general") {
|
||||
settings.name = f.get("name").trim();
|
||||
settings.slug = f.get("slug");
|
||||
settings.region = f.get("region");
|
||||
} else if (tab === "security") {
|
||||
settings.mfa = f.has("mfa");
|
||||
settings.audit = f.has("audit");
|
||||
} else {
|
||||
settings.email = f.get("email");
|
||||
settings.incidents = $("#incidents").checked;
|
||||
}
|
||||
persist();
|
||||
toast(t("Настройки сохранены", "Settings saved"));
|
||||
};
|
||||
if ($("#settings-form"))
|
||||
$("#settings-form").onreset = (e) => {
|
||||
e.preventDefault();
|
||||
render();
|
||||
};
|
||||
if ($("#incidents") && settings.incidents !== undefined)
|
||||
$("#incidents").checked = settings.incidents;
|
||||
if ($("#auth-form"))
|
||||
$("#auth-form").onsubmit = async (e) => {
|
||||
e.preventDefault();
|
||||
const b = e.target.querySelector("[type=submit]");
|
||||
b.disabled = true;
|
||||
b.setAttribute("aria-busy", "true");
|
||||
b.textContent = t("Вход…", "Signing in…");
|
||||
await new Promise((r) => setTimeout(r, 450));
|
||||
page = "dashboard";
|
||||
render();
|
||||
toast(t("Демонстрационный вход выполнен", "Demo sign-in complete"));
|
||||
};
|
||||
if ($("#chart-range"))
|
||||
$("#chart-range").onchange = (e) => {
|
||||
chartRange = e.target.value;
|
||||
render();
|
||||
};
|
||||
const target = $(".context-target");
|
||||
if (target) {
|
||||
target.oncontextmenu = (e) => {
|
||||
e.preventDefault();
|
||||
contextMenu(e.clientX, e.clientY);
|
||||
};
|
||||
target.onkeydown = (e) => {
|
||||
if ((e.shiftKey && e.key === "F10") || e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
const r = target.getBoundingClientRect();
|
||||
contextMenu(r.left, r.top);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
function contextMenu(x, y) {
|
||||
$(".context-menu")?.remove();
|
||||
const menu = document.createElement("div");
|
||||
menu.className = "context-menu";
|
||||
menu.setAttribute("role", "menu");
|
||||
menu.innerHTML = `<button role="menuitem" data-action="copy-id">${t("Копировать ID", "Copy ID")}</button><button role="menuitem" data-action="drawer">${t("Подробности", "Details")}</button>`;
|
||||
document.body.append(menu);
|
||||
menu.style.left = Math.min(x, innerWidth - 200) + "px";
|
||||
menu.style.top = Math.min(y, innerHeight - 130) + "px";
|
||||
menu.querySelector("button").focus();
|
||||
}
|
||||
document.addEventListener("click", async (e) => {
|
||||
const pageButton = e.target.closest("[data-page]");
|
||||
if (pageButton) {
|
||||
page = pageButton.dataset.page;
|
||||
$("#dialog").close();
|
||||
render();
|
||||
$("#content")?.focus();
|
||||
return;
|
||||
}
|
||||
const sorter = e.target.closest("[data-sort]");
|
||||
if (sorter) {
|
||||
sortAsc = sortKey === sorter.dataset.sort ? !sortAsc : true;
|
||||
sortKey = sorter.dataset.sort;
|
||||
refreshUsers();
|
||||
return;
|
||||
}
|
||||
const edit = e.target.closest("[data-edit]");
|
||||
if (edit) {
|
||||
editUser(Number(edit.dataset.edit));
|
||||
return;
|
||||
}
|
||||
const tabButton = e.target.closest("[data-tab]");
|
||||
if (tabButton) {
|
||||
tab = tabButton.dataset.tab;
|
||||
render();
|
||||
$("#tab-" + tab).focus();
|
||||
return;
|
||||
}
|
||||
const button = e.target.closest("[data-action]"),
|
||||
action = button?.dataset.action;
|
||||
if (!e.target.closest(".context-menu")) $(".context-menu")?.remove();
|
||||
if (!action) return;
|
||||
const actions = {
|
||||
"mobile-menu": () => {
|
||||
const nav = $(".navigation");
|
||||
nav.classList.toggle("open");
|
||||
button.setAttribute("aria-expanded", nav.classList.contains("open"));
|
||||
},
|
||||
close: () => $("#dialog").close(),
|
||||
invite,
|
||||
command,
|
||||
activity: () => $("#activity").scrollIntoView({ behavior: "smooth" }),
|
||||
profile: () =>
|
||||
openDialog(
|
||||
"Anna Volkova",
|
||||
`<p>anna@anidev.ru</p><p>${roleName("admin")} · Anidev Production</p><button data-page="settings">${t("Настройки пространства", "Workspace settings")}</button><button data-page="auth">${t("Выйти", "Sign out")}</button>`,
|
||||
),
|
||||
prev: () => {
|
||||
userPage--;
|
||||
refreshUsers();
|
||||
},
|
||||
next: () => {
|
||||
userPage++;
|
||||
refreshUsers();
|
||||
},
|
||||
"clear-filters": () => {
|
||||
query = "";
|
||||
role = "all";
|
||||
userPage = 1;
|
||||
refreshUsers();
|
||||
},
|
||||
"clear-selection": () => {
|
||||
selected.clear();
|
||||
refreshUsers();
|
||||
},
|
||||
"bulk-suspend": () => {
|
||||
openDialog(
|
||||
t("Заблокировать участников?", "Suspend members?"),
|
||||
`<p>${t("Количество выбранных участников", "Selected members")}: ${selected.size}</p><div class="form-footer"><button data-action="close">${t("Отмена", "Cancel")}</button><button class="primary" data-action="confirm-suspend">${t("Заблокировать", "Suspend")}</button></div>`,
|
||||
);
|
||||
},
|
||||
"confirm-suspend": () => {
|
||||
users
|
||||
.filter((u) => selected.has(u.id))
|
||||
.forEach((u) => (u.status = "suspended"));
|
||||
selected.clear();
|
||||
persist();
|
||||
$("#dialog").close();
|
||||
refreshUsers();
|
||||
toast(t("Доступ заблокирован", "Access suspended"));
|
||||
},
|
||||
"reset-users": () => {
|
||||
users = structuredClone(initialUsers);
|
||||
selected.clear();
|
||||
query = "";
|
||||
role = "all";
|
||||
userPage = 1;
|
||||
persist();
|
||||
render();
|
||||
toast(t("Тестовые данные восстановлены", "Demo data restored"));
|
||||
},
|
||||
"download-users": () => {
|
||||
const csv = [
|
||||
"Name,Email,Role,Status",
|
||||
...filteredUsers().map((u) =>
|
||||
[u.name, u.email, u.role, u.status]
|
||||
.map((v) => '"' + String(v).replaceAll('"', '""') + '"')
|
||||
.join(","),
|
||||
),
|
||||
].join("\r\n");
|
||||
download("anidev-users.csv", csv, "text/csv;charset=utf-8");
|
||||
},
|
||||
toast: () =>
|
||||
toast(t("Изменения сохранены в демонстрации", "Demo changes saved")),
|
||||
"demo-save": async () => {
|
||||
button.disabled = true;
|
||||
button.setAttribute("aria-busy", "true");
|
||||
const old = button.textContent;
|
||||
button.textContent = t("Сохранение…", "Saving…");
|
||||
await new Promise((r) => setTimeout(r, 500));
|
||||
button.disabled = false;
|
||||
button.removeAttribute("aria-busy");
|
||||
button.textContent = old;
|
||||
toast(t("Сохранено", "Saved"));
|
||||
},
|
||||
drawer: () =>
|
||||
openDialog(
|
||||
t("Сведения о пространстве", "Workspace details"),
|
||||
`<p>ANIDEV / PRODUCTION</p><dl><dt>${t("Регион", "Region")}</dt><dd>eu-central-1</dd><dt>${t("Владелец", "Owner")}</dt><dd>Anna Volkova</dd><dt>${t("Создано", "Created")}</dt><dd>2026-01-14</dd></dl><div class="form-footer"><button data-action="close">${t("Закрыть", "Close")}</button></div>`,
|
||||
"drawer",
|
||||
),
|
||||
sessions: () =>
|
||||
openDialog(
|
||||
t("Активные сессии", "Active sessions"),
|
||||
`<p>Windows · Edge · Moscow</p><p>${t("Текущая сессия · 09:42 UTC", "Current session · 09:42 UTC")}</p><button data-action="revoke">${t("Завершить другие демо-сессии", "Revoke other demo sessions")}</button>`,
|
||||
),
|
||||
revoke: () => {
|
||||
$("#dialog").close();
|
||||
toast(t("Другие демо-сессии завершены", "Other demo sessions revoked"));
|
||||
},
|
||||
recover: () => {
|
||||
openDialog(
|
||||
t("Восстановить доступ", "Reset password"),
|
||||
`<p>${t("Демо-форма. Письмо не отправляется.", "Demo form. No email is sent.")}</p><form id="recover-form"><label class="field">Email<input type="email" name="email" required></label><button class="primary" type="submit">${t("Продолжить", "Continue")}</button></form>`,
|
||||
);
|
||||
$("#recover-form").onsubmit = (e) => {
|
||||
e.preventDefault();
|
||||
$("#dialog").close();
|
||||
toast(
|
||||
t("Демо-запрос восстановления принят", "Demo reset request accepted"),
|
||||
);
|
||||
};
|
||||
},
|
||||
sso: () => {
|
||||
openDialog(
|
||||
t("Корпоративный вход", "Company sign-in"),
|
||||
`<p>${t("Проверка демонстрационного домена. OAuth-провайдер не подключён.", "Demo domain validation. No OAuth provider is connected.")}</p><form id="sso-form"><label class="field">${t("Рабочий email", "Work email")}<input type="email" required></label><button class="primary" type="submit">${t("Войти в демо", "Enter demo")}</button></form>`,
|
||||
);
|
||||
$("#sso-form").onsubmit = (e) => {
|
||||
e.preventDefault();
|
||||
$("#dialog").close();
|
||||
page = "dashboard";
|
||||
render();
|
||||
toast(t("Демо SSO-вход выполнен", "Demo SSO sign-in complete"));
|
||||
};
|
||||
},
|
||||
delete: () =>
|
||||
openDialog(
|
||||
t("Удалить тестовый проект?", "Delete demo project?"),
|
||||
`<p>${t("Демонстрация подтверждения опасного действия. Данные пространства сохранятся.", "Demonstration of destructive action confirmation. Workspace data is retained.")}</p><div class="form-footer"><button data-action="close">${t("Отмена", "Cancel")}</button><button class="danger" data-action="confirm-delete">${t("Удалить", "Delete")}</button></div>`,
|
||||
),
|
||||
"confirm-delete": () => {
|
||||
$("#dialog").close();
|
||||
toast(t("Тестовый проект удалён", "Demo project deleted"));
|
||||
},
|
||||
rename: () => {
|
||||
openDialog(
|
||||
t("Переименовать проект", "Rename project"),
|
||||
`<form id="rename-form"><label class="field">${t("Название", "Name")}<input name="name" required value="${escape(settings.name)}"></label><button class="primary" type="submit">${t("Сохранить", "Save")}</button></form>`,
|
||||
);
|
||||
$("#rename-form").onsubmit = (e) => {
|
||||
e.preventDefault();
|
||||
settings.name = new FormData(e.target).get("name").trim();
|
||||
persist();
|
||||
$("#dialog").close();
|
||||
toast(t("Название сохранено: ", "Name saved: ") + settings.name);
|
||||
};
|
||||
},
|
||||
"create-key": () => {
|
||||
const key = "an_demo_" + crypto.randomUUID().replaceAll("-", "");
|
||||
openDialog(
|
||||
t("Тестовый API-ключ", "Demo API key"),
|
||||
`<p>${t("Ключ не даёт доступ к реальным сервисам.", "This key does not access real services.")}</p><input aria-label="API key" readonly value="${key}" style="width:100%"><button id="copy-key" style="margin-top:15px">${t("Копировать", "Copy")}</button>`,
|
||||
);
|
||||
$("#copy-key").onclick = () => copy(key);
|
||||
},
|
||||
retry: () => {
|
||||
const box = button.closest(".error-state");
|
||||
box.innerHTML = `<span class="status">${t("Журнал загружен · 3 события", "Log loaded · 3 events")}</span>`;
|
||||
box.style.borderColor = "var(--color-border)";
|
||||
},
|
||||
"copy-id": () => {
|
||||
copy("ws_anidev_prod");
|
||||
$(".context-menu")?.remove();
|
||||
},
|
||||
"copy-json": () => copy(JSON.stringify(tokens, null, 2)),
|
||||
"copy-css": () => copy(":root {\n" + cssVars(tokens) + "\n}"),
|
||||
};
|
||||
if (actions[action]) await actions[action]();
|
||||
document.querySelectorAll("details[open]").forEach((el) => {
|
||||
if (!el.contains(e.target) || action) el.open = false;
|
||||
});
|
||||
});
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "k") {
|
||||
e.preventDefault();
|
||||
command();
|
||||
}
|
||||
if (e.key === "Escape") {
|
||||
if ($(".context-menu")) {
|
||||
$(".context-menu").remove();
|
||||
$(".context-target")?.focus();
|
||||
}
|
||||
document
|
||||
.querySelectorAll("details[open]")
|
||||
.forEach((el) => (el.open = false));
|
||||
}
|
||||
const tabs = [...document.querySelectorAll("[role=tab]")];
|
||||
if (
|
||||
tabs.includes(e.target) &&
|
||||
["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)
|
||||
) {
|
||||
e.preventDefault();
|
||||
const index = tabs.indexOf(e.target);
|
||||
const next =
|
||||
e.key === "Home"
|
||||
? 0
|
||||
: e.key === "End"
|
||||
? tabs.length - 1
|
||||
: (index + (e.key === "ArrowRight" ? 1 : -1) + tabs.length) %
|
||||
tabs.length;
|
||||
tab = tabs[next].dataset.tab;
|
||||
render();
|
||||
$("#tab-" + tab).focus();
|
||||
}
|
||||
if (
|
||||
$("#dialog").open &&
|
||||
$(".command-list") &&
|
||||
["ArrowDown", "ArrowUp", "Enter"].includes(e.key)
|
||||
) {
|
||||
const buttons = [
|
||||
...document.querySelectorAll(".command-list button:not([hidden])"),
|
||||
];
|
||||
if (!buttons.length) return;
|
||||
const index = buttons.indexOf(document.activeElement);
|
||||
if (e.key === "Enter" && document.activeElement === $("#command-search")) {
|
||||
e.preventDefault();
|
||||
buttons[0].click();
|
||||
} else if (e.key !== "Enter") {
|
||||
e.preventDefault();
|
||||
buttons[
|
||||
(index + (e.key === "ArrowDown" ? 1 : -1) + buttons.length) %
|
||||
buttons.length
|
||||
].focus();
|
||||
}
|
||||
}
|
||||
const menu = $(".context-menu");
|
||||
if (menu && ["ArrowDown", "ArrowUp"].includes(e.key)) {
|
||||
e.preventDefault();
|
||||
const buttons = [...menu.querySelectorAll("button")];
|
||||
buttons[
|
||||
(buttons.indexOf(document.activeElement) +
|
||||
(e.key === "ArrowDown" ? 1 : -1) +
|
||||
buttons.length) %
|
||||
buttons.length
|
||||
].focus();
|
||||
}
|
||||
});
|
||||
$("#dialog").addEventListener("close", () => {
|
||||
if (dialogInitiator?.isConnected) dialogInitiator.focus();
|
||||
});
|
||||
$("#dialog").addEventListener("click", (e) => {
|
||||
if (e.target === $("#dialog")) {
|
||||
const r = e.target.getBoundingClientRect();
|
||||
if (
|
||||
e.clientX < r.left ||
|
||||
e.clientX > r.right ||
|
||||
e.clientY < r.top ||
|
||||
e.clientY > r.bottom
|
||||
)
|
||||
e.target.close();
|
||||
}
|
||||
});
|
||||
// Refresh shared fixture edits in both comparison panes, preserving each pane's layout.
|
||||
addEventListener("storage", (e) => {
|
||||
if (e.key === "anidev.users") {
|
||||
try {
|
||||
users = JSON.parse(e.newValue);
|
||||
if (page === "users") refreshUsers();
|
||||
} catch {}
|
||||
}
|
||||
if (e.key === "anidev.settings") {
|
||||
try {
|
||||
settings = JSON.parse(e.newValue);
|
||||
if (page === "settings") render();
|
||||
} catch {}
|
||||
}
|
||||
});
|
||||
render();
|
||||
@@ -0,0 +1,515 @@
|
||||
:root {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
color: #e9e9e9;
|
||||
background: #151617;
|
||||
font-synthesis: none;
|
||||
}
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
button,
|
||||
select,
|
||||
input {
|
||||
font: inherit;
|
||||
}
|
||||
button,
|
||||
select,
|
||||
a,
|
||||
input[type="color"],
|
||||
input[type="checkbox"] {
|
||||
cursor: pointer;
|
||||
}
|
||||
button,
|
||||
select {
|
||||
color: inherit;
|
||||
background: #232527;
|
||||
border: 1px solid #494c4f;
|
||||
border-radius: 5px;
|
||||
min-height: 36px;
|
||||
padding: 7px 11px;
|
||||
}
|
||||
button:hover,
|
||||
select:hover {
|
||||
background: #34373a;
|
||||
}
|
||||
button:focus-visible,
|
||||
select:focus-visible,
|
||||
input:focus-visible,
|
||||
a:focus-visible {
|
||||
outline: 3px solid #d7f3a3;
|
||||
outline-offset: 3px;
|
||||
}
|
||||
a {
|
||||
color: inherit;
|
||||
}
|
||||
button:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: wait;
|
||||
}
|
||||
[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
.mast {
|
||||
padding: 22px 3.5%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #353738;
|
||||
gap: 20px;
|
||||
}
|
||||
.brand {
|
||||
text-decoration: none;
|
||||
font-size: 23px;
|
||||
font-weight: bold;
|
||||
letter-spacing: -1px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
.brand > span:last-child {
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
color: #aaa;
|
||||
letter-spacing: 0;
|
||||
border-left: 1px solid #505354;
|
||||
padding-left: 15px;
|
||||
}
|
||||
.mark {
|
||||
color: #dcf8ad;
|
||||
font-size: 29px;
|
||||
}
|
||||
.mast-end {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
.version,
|
||||
.eyebrow {
|
||||
font:
|
||||
12px Consolas,
|
||||
monospace;
|
||||
letter-spacing: 1.6px;
|
||||
color: #a8b19f;
|
||||
}
|
||||
.export {
|
||||
background: #dcf8ad;
|
||||
color: #1b2414;
|
||||
border-color: #dcf8ad;
|
||||
}
|
||||
.export:hover {
|
||||
background: #c1e08c;
|
||||
}
|
||||
main {
|
||||
max-width: 1900px;
|
||||
margin: auto;
|
||||
padding: 0 3.5%;
|
||||
}
|
||||
.intro {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
padding: 40px 0 30px;
|
||||
gap: 20px;
|
||||
}
|
||||
.eyebrow {
|
||||
margin: 0 0 16px;
|
||||
}
|
||||
h1 {
|
||||
font-size: clamp(29px, 3.2vw, 48px);
|
||||
letter-spacing: -1.8px;
|
||||
line-height: 1.06;
|
||||
font-weight: 500;
|
||||
margin: 0;
|
||||
}
|
||||
h1 span {
|
||||
color: #a2a6a8;
|
||||
}
|
||||
.intro-copy {
|
||||
font-size: 14px;
|
||||
line-height: 1.7;
|
||||
color: #aeb2b5;
|
||||
margin: 0 0 3px;
|
||||
}
|
||||
.concepts {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, 1fr);
|
||||
gap: 9px;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
.concept {
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
border-color: #393c3e;
|
||||
overflow: hidden;
|
||||
background: #1b1d1f;
|
||||
min-width: 0;
|
||||
}
|
||||
.concept[aria-pressed="true"] {
|
||||
border-color: #dcf8ad;
|
||||
box-shadow: 0 0 0 1px #dcf8ad;
|
||||
}
|
||||
.swatch {
|
||||
height: 72px;
|
||||
display: flex;
|
||||
padding: 12px;
|
||||
gap: 6px;
|
||||
background: var(--swatch-bg);
|
||||
position: relative;
|
||||
}
|
||||
.swatch:before {
|
||||
content: "";
|
||||
width: 20%;
|
||||
background: var(--swatch-ink);
|
||||
opacity: 0.18;
|
||||
}
|
||||
.swatch:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 34%;
|
||||
height: 5px;
|
||||
top: 19px;
|
||||
left: 35%;
|
||||
background: var(--swatch-ink);
|
||||
box-shadow:
|
||||
0 12px 0 var(--swatch-line),
|
||||
0 24px 0 var(--swatch-line);
|
||||
}
|
||||
.concept:nth-child(2) .swatch:before {
|
||||
width: 0;
|
||||
}
|
||||
.concept:nth-child(2) .swatch:after {
|
||||
height: 11px;
|
||||
width: 55%;
|
||||
left: 13%;
|
||||
top: 16px;
|
||||
box-shadow: 0 24px 0 var(--swatch-line);
|
||||
}
|
||||
.concept:nth-child(3) .swatch:after {
|
||||
height: 2px;
|
||||
box-shadow:
|
||||
0 8px 0 var(--swatch-ink),
|
||||
0 16px 0 var(--swatch-line),
|
||||
0 24px 0 var(--swatch-line);
|
||||
}
|
||||
.concept:nth-child(4) .swatch:before {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
}
|
||||
.concept:nth-child(4) .swatch:after {
|
||||
top: 35px;
|
||||
left: 15%;
|
||||
width: 30%;
|
||||
}
|
||||
.concept:nth-child(5) .swatch:before {
|
||||
width: 10%;
|
||||
border-radius: 6px;
|
||||
}
|
||||
.concept:nth-child(5) .swatch:after {
|
||||
height: 26px;
|
||||
width: 28%;
|
||||
top: 27px;
|
||||
left: 30%;
|
||||
box-shadow: 40px 0 0 var(--swatch-line);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.concept:nth-child(6) .swatch:before {
|
||||
width: 33%;
|
||||
opacity: 1;
|
||||
}
|
||||
.concept:nth-child(6) .swatch:after {
|
||||
height: 20px;
|
||||
left: 48%;
|
||||
top: 25px;
|
||||
box-shadow: 0 0 0 1px var(--swatch-ink);
|
||||
}
|
||||
.concept-info {
|
||||
padding: 12px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 5px;
|
||||
font-size: 15px;
|
||||
}
|
||||
.concept-info small {
|
||||
color: #a6aaad;
|
||||
font:
|
||||
12px Consolas,
|
||||
monospace;
|
||||
}
|
||||
.concept-caption {
|
||||
display: block;
|
||||
padding: 0 12px 13px;
|
||||
color: #a6aaad;
|
||||
font-size: 12px;
|
||||
}
|
||||
.lab {
|
||||
border: 1px solid #414447;
|
||||
border-radius: 7px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.toolbar {
|
||||
padding: 14px;
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
align-items: flex-end;
|
||||
flex-wrap: wrap;
|
||||
background: #1b1d1f;
|
||||
}
|
||||
.toolbar label {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
font-size: 12px;
|
||||
color: #b6bbbe;
|
||||
}
|
||||
.toolbar label.compare {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
height: 36px;
|
||||
gap: 5px;
|
||||
}
|
||||
.toolbar select {
|
||||
font-size: 13px;
|
||||
max-width: 180px;
|
||||
}
|
||||
.toolbar input[type="color"] {
|
||||
padding: 3px;
|
||||
border: 1px solid #494c4f;
|
||||
height: 36px;
|
||||
width: 42px;
|
||||
border-radius: 5px;
|
||||
background: none;
|
||||
}
|
||||
.devices {
|
||||
display: flex;
|
||||
gap: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.devices legend {
|
||||
font-size: 12px;
|
||||
color: #b6bbbe;
|
||||
padding: 0 0 6px;
|
||||
}
|
||||
.devices button {
|
||||
font-size: 12px;
|
||||
border-radius: 0;
|
||||
}
|
||||
.devices button:first-of-type {
|
||||
border-radius: 5px 0 0 5px;
|
||||
}
|
||||
.devices button:last-of-type {
|
||||
border-radius: 0 5px 5px 0;
|
||||
}
|
||||
.devices button[aria-pressed="true"] {
|
||||
background: #e4e8e1;
|
||||
color: #181b16;
|
||||
}
|
||||
.stage-meta {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 15px;
|
||||
background: #232527;
|
||||
padding: 12px 18px;
|
||||
font-size: 12px;
|
||||
color: #adb3b6;
|
||||
}
|
||||
.stage-meta > div {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
}
|
||||
#current-name {
|
||||
color: #eef0ec;
|
||||
font-weight: bold;
|
||||
}
|
||||
#dimensions {
|
||||
font-family: Consolas, monospace;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.workspace {
|
||||
display: flex;
|
||||
gap: 18px;
|
||||
padding: 22px;
|
||||
overflow: auto;
|
||||
background: #303335;
|
||||
min-height: 650px;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.preview-pane {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
.frame-viewport {
|
||||
overflow: auto;
|
||||
margin: auto;
|
||||
width: 100%;
|
||||
background: #202224;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 8px 35px #0003;
|
||||
}
|
||||
iframe {
|
||||
display: block;
|
||||
border: 0;
|
||||
width: 100%;
|
||||
height: 900px;
|
||||
background: white;
|
||||
}
|
||||
.frame-heading {
|
||||
font:
|
||||
13px Consolas,
|
||||
monospace;
|
||||
margin: 0 0 10px;
|
||||
color: #d4d9dc;
|
||||
}
|
||||
.frame-heading:empty {
|
||||
display: none;
|
||||
}
|
||||
.workspace[data-device="tablet"] .frame-viewport {
|
||||
max-width: 768px;
|
||||
}
|
||||
.workspace[data-device="mobile"] .frame-viewport {
|
||||
max-width: 390px;
|
||||
}
|
||||
.workspace[data-device="mobile"] iframe {
|
||||
height: 844px;
|
||||
}
|
||||
.workspace.comparing .preview-pane {
|
||||
min-width: 340px;
|
||||
}
|
||||
.stage-note {
|
||||
font-size: 12px;
|
||||
color: #afb4b7;
|
||||
margin: 0;
|
||||
padding: 13px 18px;
|
||||
background: #202224;
|
||||
}
|
||||
footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
padding: 24px 0;
|
||||
color: #92999e;
|
||||
font-size: 11px;
|
||||
}
|
||||
footer > span:first-child {
|
||||
font-family: Consolas, monospace;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
#notice {
|
||||
position: fixed;
|
||||
bottom: 25px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: #dcf8ad;
|
||||
color: #15210d;
|
||||
border-radius: 5px;
|
||||
padding: 14px 20px;
|
||||
display: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
.skip {
|
||||
position: fixed;
|
||||
top: -100px;
|
||||
background: #dcf8ad;
|
||||
color: black;
|
||||
padding: 15px;
|
||||
z-index: 100;
|
||||
}
|
||||
.skip:focus {
|
||||
top: 5px;
|
||||
}
|
||||
@media (max-width: 1000px) {
|
||||
.concepts {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
.version {
|
||||
display: none;
|
||||
}
|
||||
.intro-copy {
|
||||
max-width: 250px;
|
||||
}
|
||||
.toolbar {
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
.mast {
|
||||
padding: 15px;
|
||||
}
|
||||
.brand {
|
||||
font-size: 20px;
|
||||
}
|
||||
.brand > span:last-child {
|
||||
display: none;
|
||||
}
|
||||
.mast-end {
|
||||
gap: 6px;
|
||||
}
|
||||
.mast-end button {
|
||||
font-size: 12px;
|
||||
}
|
||||
main {
|
||||
padding: 0 15px;
|
||||
}
|
||||
.intro {
|
||||
padding-top: 28px;
|
||||
display: block;
|
||||
}
|
||||
.intro-copy {
|
||||
margin-top: 20px;
|
||||
font-size: 13px;
|
||||
max-width: none;
|
||||
}
|
||||
.concepts {
|
||||
gap: 7px;
|
||||
}
|
||||
.concept-info {
|
||||
font-size: 14px;
|
||||
}
|
||||
.concept-caption {
|
||||
font-size: 11px;
|
||||
}
|
||||
.swatch {
|
||||
height: 62px;
|
||||
}
|
||||
.toolbar {
|
||||
padding: 12px;
|
||||
}
|
||||
.toolbar label {
|
||||
flex: 1;
|
||||
min-width: 75px;
|
||||
}
|
||||
.toolbar select {
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.workspace {
|
||||
padding: 10px;
|
||||
}
|
||||
.stage-meta {
|
||||
padding: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
#current-desc {
|
||||
display: none;
|
||||
}
|
||||
footer {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.workspace.comparing {
|
||||
flex-direction: column;
|
||||
}
|
||||
.workspace.comparing .preview-pane {
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.stage-note {
|
||||
line-height: 1.5;
|
||||
}
|
||||
.concept-caption {
|
||||
min-height: 42px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
import { concepts, tokensFor, cssVars } from "../concepts/registry.js";
|
||||
const $ = (s) => document.querySelector(s);
|
||||
const defaults = {
|
||||
concept: "relay",
|
||||
second: "ledger",
|
||||
page: "dashboard",
|
||||
theme: "light",
|
||||
density: "normal",
|
||||
size: "desktop",
|
||||
locale: "ru",
|
||||
compare: false,
|
||||
accents: {},
|
||||
};
|
||||
let state = { ...defaults };
|
||||
try {
|
||||
state = {
|
||||
...defaults,
|
||||
...JSON.parse(localStorage.getItem("anidev.lab") || "{}"),
|
||||
};
|
||||
} catch {}
|
||||
const strings = {
|
||||
page: ["Экран", "Page"],
|
||||
theme: ["Тема", "Theme"],
|
||||
accent: ["Акцент", "Accent"],
|
||||
density: ["Плотность", "Density"],
|
||||
viewport: ["Размер", "Viewport"],
|
||||
compare: ["Сравнить", "Compare"],
|
||||
second: ["Вторая концепция", "Second concept"],
|
||||
note: [
|
||||
"Демонстрационные данные · Изменения сохраняются только в этом браузере · Ctrl/⌘ K — команды",
|
||||
"Demo data · Changes are stored in this browser only · Ctrl/⌘ K — commands",
|
||||
],
|
||||
research: ["Исследование и решения", "Research & decisions"],
|
||||
status: [
|
||||
"Концепции на рассмотрении — финальная не выбрана",
|
||||
"Explorations in review — no final concept selected",
|
||||
],
|
||||
};
|
||||
function render() {
|
||||
const en = state.locale === "en";
|
||||
document.documentElement.lang = state.locale;
|
||||
$("#concepts").innerHTML = concepts
|
||||
.map(
|
||||
(c, i) =>
|
||||
`<button class="concept" data-concept="${c.id}" aria-pressed="${c.id === state.concept}"><span class="swatch" style="--swatch-bg:${c.bg};--swatch-ink:${c.ink};--swatch-line:${c.line}"></span><span class="concept-info"><b>${c.name}</b><small>0${i + 1}</small></span><span class="concept-caption">${en ? c.en : c.tag}</span></button>`,
|
||||
)
|
||||
.join("");
|
||||
$("#second").innerHTML = concepts
|
||||
.map(
|
||||
(c) =>
|
||||
`<option value="${c.id}" ${c.id === state.second ? "selected" : ""}>${c.name}</option>`,
|
||||
)
|
||||
.join("");
|
||||
for (const key of ["page", "theme", "density"])
|
||||
$("#" + key).value = state[key];
|
||||
$("#compare").checked = state.compare;
|
||||
$("#compare-label").hidden = !state.compare;
|
||||
$("#pane-b").hidden = !state.compare;
|
||||
$("#workspace").classList.toggle("comparing", state.compare);
|
||||
$("#workspace").dataset.device = state.size;
|
||||
const c = concepts.find((c) => c.id === state.concept);
|
||||
$("#accent").value = state.accents[c.id] || c.accent;
|
||||
$("#current-name").textContent = c.name;
|
||||
$("#current-desc").textContent = en ? c.descEn : c.desc;
|
||||
$("#heading-a").textContent = state.compare ? "A / " + c.name : "";
|
||||
$("#heading-b").textContent =
|
||||
"B / " + concepts.find((c) => c.id === state.second).name;
|
||||
$("#dimensions").textContent = {
|
||||
desktop: en ? "Desktop / fluid" : "Desktop / по ширине",
|
||||
tablet: "768 × 900",
|
||||
mobile: "390 × 844",
|
||||
}[state.size];
|
||||
document
|
||||
.querySelectorAll("[data-size]")
|
||||
.forEach((b) =>
|
||||
b.setAttribute("aria-pressed", b.dataset.size === state.size),
|
||||
);
|
||||
document
|
||||
.querySelectorAll("[data-i]")
|
||||
.forEach((e) => (e.textContent = strings[e.dataset.i][en ? 1 : 0]));
|
||||
$("#locale").textContent = en ? "RU" : "EN";
|
||||
$("#export").textContent = en ? "Export system" : "Экспорт системы";
|
||||
$("h1").innerHTML = en
|
||||
? "One product.<br><span>Six perspectives.</span>"
|
||||
: "Один продукт.<br><span>Шесть точек зрения.</span>";
|
||||
$(".intro-copy").innerHTML = en
|
||||
? "Working interfaces for infrastructure.<br>Explore the character. Inspect the details.<br>You choose the final direction."
|
||||
: "Рабочие интерфейсы для инфраструктуры.<br>Исследуйте характер, проверьте детали.<br>Финальное направление выбираете вы.";
|
||||
const labels = en
|
||||
? [
|
||||
"Dashboard",
|
||||
"Users",
|
||||
"Settings",
|
||||
"Authentication",
|
||||
"Components",
|
||||
"Tokens",
|
||||
]
|
||||
: [
|
||||
"Dashboard",
|
||||
"Пользователи",
|
||||
"Настройки",
|
||||
"Авторизация",
|
||||
"Компоненты",
|
||||
"Токены",
|
||||
];
|
||||
[...$("#page").options].forEach((o, i) => (o.text = labels[i]));
|
||||
[...$("#theme").options].forEach(
|
||||
(o, i) => (o.text = (en ? ["Light", "Dark"] : ["Светлая", "Тёмная"])[i]),
|
||||
);
|
||||
[...$("#density").options].forEach(
|
||||
(o, i) =>
|
||||
(o.text = (
|
||||
en
|
||||
? ["Normal", "Compact", "Relaxed"]
|
||||
: ["Обычная", "Компактная", "Свободная"]
|
||||
)[i]),
|
||||
);
|
||||
for (const side of ["a", "b"]) {
|
||||
if (side === "b" && !state.compare) continue;
|
||||
const concept = side === "a" ? state.concept : state.second;
|
||||
const params = new URLSearchParams({
|
||||
concept,
|
||||
page: state.page,
|
||||
theme: state.theme,
|
||||
density: state.density,
|
||||
locale: state.locale,
|
||||
accent:
|
||||
state.accents[concept] || concepts.find((c) => c.id === concept).accent,
|
||||
});
|
||||
const src = "frame.html?" + params;
|
||||
if ($("#preview-" + side).getAttribute("src") !== src)
|
||||
$("#preview-" + side).src = src;
|
||||
}
|
||||
try {
|
||||
localStorage.setItem("anidev.lab", JSON.stringify(state));
|
||||
} catch {}
|
||||
}
|
||||
$("#concepts").addEventListener("click", (e) => {
|
||||
const b = e.target.closest("[data-concept]");
|
||||
if (b) {
|
||||
state.concept = b.dataset.concept;
|
||||
render();
|
||||
}
|
||||
});
|
||||
for (const key of ["page", "theme", "density", "second"])
|
||||
$("#" + key).addEventListener("change", (e) => {
|
||||
state[key] = e.target.value;
|
||||
render();
|
||||
});
|
||||
$("#accent").addEventListener("change", (e) => {
|
||||
state.accents[state.concept] = e.target.value;
|
||||
render();
|
||||
});
|
||||
$("#compare").addEventListener("change", (e) => {
|
||||
state.compare = e.target.checked;
|
||||
render();
|
||||
});
|
||||
document.querySelectorAll("[data-size]").forEach(
|
||||
(b) =>
|
||||
(b.onclick = () => {
|
||||
state.size = b.dataset.size;
|
||||
render();
|
||||
}),
|
||||
);
|
||||
$("#locale").onclick = () => {
|
||||
state.locale = state.locale === "ru" ? "en" : "ru";
|
||||
render();
|
||||
};
|
||||
function notice(text) {
|
||||
$("#notice").textContent = text;
|
||||
$("#notice").style.display = "block";
|
||||
setTimeout(() => ($("#notice").style.display = "none"), 4500);
|
||||
}
|
||||
// Uncompressed ZIP, UTF-8 filenames, CRC32: no runtime or export dependency.
|
||||
function zip(files) {
|
||||
const enc = new TextEncoder();
|
||||
let offset = 0;
|
||||
const chunks = [],
|
||||
central = [];
|
||||
const u16 = (v, n) => {
|
||||
v.push(n & 255, (n >>> 8) & 255);
|
||||
},
|
||||
u32 = (v, n) => {
|
||||
u16(v, n);
|
||||
u16(v, n >>> 16);
|
||||
};
|
||||
for (const [name, content] of Object.entries(files)) {
|
||||
const bytes = enc.encode(content),
|
||||
nb = enc.encode(name);
|
||||
let crc = -1;
|
||||
for (const b of bytes) {
|
||||
crc ^= b;
|
||||
for (let k = 0; k < 8; k++)
|
||||
crc = (crc >>> 1) ^ (crc & 1 ? 0xedb88320 : 0);
|
||||
}
|
||||
crc = (crc ^ -1) >>> 0;
|
||||
const h = [];
|
||||
u32(h, 0x04034b50);
|
||||
u16(h, 20);
|
||||
u16(h, 0x800);
|
||||
u16(h, 0);
|
||||
u16(h, 0);
|
||||
u16(h, 0);
|
||||
u32(h, crc);
|
||||
u32(h, bytes.length);
|
||||
u32(h, bytes.length);
|
||||
u16(h, nb.length);
|
||||
u16(h, 0);
|
||||
h.push(...nb);
|
||||
chunks.push(new Uint8Array(h), bytes);
|
||||
const c = [];
|
||||
u32(c, 0x02014b50);
|
||||
u16(c, 20);
|
||||
u16(c, 20);
|
||||
u16(c, 0x800);
|
||||
u16(c, 0);
|
||||
u16(c, 0);
|
||||
u16(c, 0);
|
||||
u32(c, crc);
|
||||
u32(c, bytes.length);
|
||||
u32(c, bytes.length);
|
||||
u16(c, nb.length);
|
||||
u16(c, 0);
|
||||
u16(c, 0);
|
||||
u16(c, 0);
|
||||
u16(c, 0);
|
||||
u32(c, 0);
|
||||
u32(c, offset);
|
||||
c.push(...nb);
|
||||
central.push(new Uint8Array(c));
|
||||
offset += h.length + bytes.length;
|
||||
}
|
||||
const size = central.reduce((n, c) => n + c.length, 0),
|
||||
end = [];
|
||||
u32(end, 0x06054b50);
|
||||
u16(end, 0);
|
||||
u16(end, 0);
|
||||
u16(end, central.length);
|
||||
u16(end, central.length);
|
||||
u32(end, size);
|
||||
u32(end, offset);
|
||||
u16(end, 0);
|
||||
return new Blob([...chunks, ...central, new Uint8Array(end)], {
|
||||
type: "application/zip",
|
||||
});
|
||||
}
|
||||
$("#export").onclick = async () => {
|
||||
const button = $("#export");
|
||||
button.disabled = true;
|
||||
try {
|
||||
const c = concepts.find((c) => c.id === state.concept),
|
||||
accent = state.accents[c.id] || c.accent;
|
||||
const files = {};
|
||||
const paths = [
|
||||
"components/system.css",
|
||||
"concepts/registry.js",
|
||||
"playground/frame.html",
|
||||
"playground/frame.js",
|
||||
"tokens/schema.json",
|
||||
"components/CONTRACT.md",
|
||||
"patterns/UX.md",
|
||||
"layouts/README.md",
|
||||
"DESIGN.md",
|
||||
"ANTI-SLOP.md",
|
||||
];
|
||||
const fetched = await Promise.all(
|
||||
paths.map(async (p) => {
|
||||
const r = await fetch("../" + p);
|
||||
if (!r.ok) throw Error(p);
|
||||
return [p, await r.text()];
|
||||
}),
|
||||
);
|
||||
for (const [p, t] of fetched) files[p] = t;
|
||||
for (const theme of ["light", "dark"]) {
|
||||
const tokens = tokensFor(c.id, theme, accent, state.density);
|
||||
files[`tokens/${theme}.json`] = JSON.stringify(tokens, null, 2);
|
||||
files[`tokens/${theme}.css`] = `:root {\n${cssVars(tokens)}\n}\n`;
|
||||
}
|
||||
files["selection.json"] = JSON.stringify(
|
||||
{
|
||||
version: "0.1.0",
|
||||
status: "candidate-export",
|
||||
concept: c.id,
|
||||
accent,
|
||||
density: state.density,
|
||||
theme: state.theme,
|
||||
locale: state.locale,
|
||||
},
|
||||
null,
|
||||
2,
|
||||
);
|
||||
files["index.html"] =
|
||||
`<!doctype html><meta charset="utf-8"><title>Anidev ${c.name}</title><script>location.replace('playground/frame.html?${new URLSearchParams({ concept: c.id, accent, density: state.density, theme: state.theme, locale: state.locale })}')<\/script>`;
|
||||
files["README.md"] =
|
||||
`# Anidev / ${c.name}\nCandidate export, not final approval.\nServe this folder over HTTP (for example python -m http.server 8080).\nOpen index.html.\nUse tokens/light.css or tokens/dark.css and components/system.css in any framework.\nSemantic token JSON is the source of values.\nNo upstream implementation is bundled. Final Skill follows user concept selection.\n`;
|
||||
const url = URL.createObjectURL(zip(files)),
|
||||
a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = `anidev-${c.id}.zip`;
|
||||
a.click();
|
||||
setTimeout(() => URL.revokeObjectURL(url), 30000);
|
||||
notice(
|
||||
state.locale === "ru"
|
||||
? "Экспортирована кандидатная система: " + c.name
|
||||
: "Candidate system exported: " + c.name,
|
||||
);
|
||||
} catch (e) {
|
||||
notice("Export error: " + e.message);
|
||||
} finally {
|
||||
button.disabled = false;
|
||||
}
|
||||
};
|
||||
render();
|
||||
@@ -0,0 +1,125 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Anidev — Design laboratory</title>
|
||||
<link rel="stylesheet" href="gallery.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip" href="#workspace">К предпросмотру</a>
|
||||
<header class="mast">
|
||||
<a class="brand" href="./"
|
||||
><span class="mark">a/</span> anidev <span>design laboratory</span></a
|
||||
>
|
||||
<div class="mast-end">
|
||||
<span class="version">EXPLORATIONS / 0.1</span
|
||||
><button id="locale">EN</button
|
||||
><button id="export" class="export">Экспорт системы</button>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<section class="intro">
|
||||
<div>
|
||||
<p class="eyebrow">ANIDEV DESIGN SYSTEM</p>
|
||||
<h1>Один продукт.<br /><span>Шесть точек зрения.</span></h1>
|
||||
</div>
|
||||
<p class="intro-copy">
|
||||
Рабочие интерфейсы для инфраструктуры.<br />Исследуйте характер,
|
||||
проверьте детали.<br />Финальное направление выбираете вы.
|
||||
</p>
|
||||
</section>
|
||||
<section aria-label="Концепции" class="concepts" id="concepts"></section>
|
||||
<section class="lab" aria-label="Лаборатория">
|
||||
<div class="toolbar">
|
||||
<label
|
||||
><span data-i="page">Экран</span
|
||||
><select id="page">
|
||||
<option value="dashboard">Dashboard</option>
|
||||
<option value="users">Пользователи</option>
|
||||
<option value="settings">Настройки</option>
|
||||
<option value="auth">Авторизация</option>
|
||||
<option value="components">Компоненты</option>
|
||||
<option value="tokens">Токены</option>
|
||||
</select></label
|
||||
><label
|
||||
><span data-i="theme">Тема</span
|
||||
><select id="theme">
|
||||
<option value="light">Светлая</option>
|
||||
<option value="dark">Тёмная</option>
|
||||
</select></label
|
||||
><label
|
||||
><span data-i="accent">Акцент</span
|
||||
><input
|
||||
type="color"
|
||||
id="accent"
|
||||
aria-label="Акцентный цвет" /></label
|
||||
><label
|
||||
><span data-i="density">Плотность</span
|
||||
><select id="density">
|
||||
<option value="normal">Обычная</option>
|
||||
<option value="compact">Компактная</option>
|
||||
<option value="relaxed">Свободная</option>
|
||||
</select></label
|
||||
>
|
||||
<fieldset class="devices">
|
||||
<legend data-i="viewport">Размер</legend>
|
||||
<button data-size="desktop" aria-pressed="true">Desktop</button
|
||||
><button data-size="tablet" aria-pressed="false">Tablet</button
|
||||
><button data-size="mobile" aria-pressed="false">Mobile</button>
|
||||
</fieldset>
|
||||
<label class="compare"
|
||||
><input type="checkbox" id="compare" /><span data-i="compare"
|
||||
>Сравнить</span
|
||||
></label
|
||||
><label id="compare-label" hidden
|
||||
><span data-i="second">Вторая концепция</span
|
||||
><select id="second"></select
|
||||
></label>
|
||||
</div>
|
||||
<div class="stage-meta">
|
||||
<div>
|
||||
<span id="current-name">Relay</span><span id="current-desc"></span>
|
||||
</div>
|
||||
<span id="dimensions">1440 × 900</span>
|
||||
</div>
|
||||
<div class="workspace" id="workspace" tabindex="-1">
|
||||
<div class="preview-pane">
|
||||
<div class="frame-heading" id="heading-a"></div>
|
||||
<div class="frame-viewport">
|
||||
<iframe
|
||||
id="preview-a"
|
||||
title="Концепция A"
|
||||
src="frame.html?concept=relay"
|
||||
></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<div class="preview-pane" id="pane-b" hidden>
|
||||
<div class="frame-heading" id="heading-b"></div>
|
||||
<div class="frame-viewport">
|
||||
<iframe
|
||||
id="preview-b"
|
||||
title="Концепция B"
|
||||
src="about:blank"
|
||||
></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="stage-note" data-i="note">
|
||||
Демонстрационные данные · Изменения сохраняются только в этом браузере
|
||||
· Ctrl/⌘ K — команды
|
||||
</p>
|
||||
</section>
|
||||
<footer>
|
||||
<span>ANIDEV / SYSTEMS WITH CHARACTER</span
|
||||
><a href="../references/RESEARCH.md" data-i="research"
|
||||
>Исследование и решения</a
|
||||
><span data-i="status"
|
||||
>Концепции на рассмотрении — финальная не выбрана</span
|
||||
>
|
||||
</footer>
|
||||
</main>
|
||||
<div id="notice" role="status"></div>
|
||||
<script type="module" src="gallery.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
# Как оценивать варианты
|
||||
|
||||
Откройте одинаковый экран в двух концепциях. Оцените по отдельности: скорость поиска нужного действия; информационную плотность; узнаваемость Anidev; читаемость таблицы и русского текста; удобство mobile; пригодность для ежедневной работы. Затем поменяйте тему и откройте диалог приглашения.
|
||||
|
||||
Пример обратной связи: «Выбираю Signal, но навигацию хочу как у Relay; акцент #…; плотность compact; заголовки оставить моноширинными». Это основание для согласования итоговой системы, не инструкция автоматически смешать все лучшие детали.
|
||||
@@ -0,0 +1,40 @@
|
||||
# Проверка галереи
|
||||
|
||||
27.11.2026, Windows, настоящий Microsoft Edge через Playwright 1.65.1. Проверки воспроизводятся командой `npm test` при работающем сервере. Browser report формируется в `test-results/report.json`.
|
||||
|
||||
## Автоматическая проверка
|
||||
|
||||
**230 passed / 0 failed**, ошибок JavaScript не зафиксировано.
|
||||
|
||||
- Матрица 6 концепций × 2 темы × 3 разрешения × 6 экранов: 216 комбинаций. Разрешения 1440×900, 768×1024, 390×844. Проверяется загрузка и отсутствие горизонтального переполнения документа. Для таблиц допустим локальный скролл.
|
||||
- Dashboard, users, settings, auth, components, tokens. Диалог приглашения открыт/закрыт во всех 36 комбинациях concept/theme/viewport.
|
||||
- Поиск, фильтр роли, сортировка, пагинация, empty state, приглашение и дубль email, редактирование доступа, массовый выбор и подтверждение блокировки.
|
||||
- Сохранение настроек и повторная загрузка, стрелки вкладок, native валидация входа, demo sign-in, команды с клавиатуры, удержание фокуса в dialog и возврат к инициатору.
|
||||
- Drawer, dropdown, tooltip, контекстное меню Shift+F10/стрелки/Enter, recovery ошибки.
|
||||
- EN для каждого экрана каждой концепции: нет кириллицы в отображаемом UI. RU проверяется матрицей.
|
||||
- Галерея: переключатели, comparison, фактическая mobile-ширина iframe, пользовательский акцент, экспорт. Mobile-меню всех концепций и compact/relaxed на настройках.
|
||||
- ZIP: 17 файлов, CRC всех записей проверен Python zipfile; проверено наличие токенов обеих тем и необходимых CSS/JS/HTML. Распакованный экспорт открыт отдельно: экран Ledger и modal работают, ошибок JavaScript нет.
|
||||
|
||||
`node scripts/check.mjs`: шесть разных layout-грамматик, 36 конфигураций токенов (6×2×3), контраст основного/вторичного текста, акцента и статусов не ниже 4.5:1 на обеих поверхностях; JSON/CSS сгенерированы.
|
||||
|
||||
## Визуальная проверка
|
||||
|
||||
Скриншоты снимаются настоящим браузером, не являются макетами. Обзорные изображения:
|
||||
|
||||
- [Светлая, desktop](concepts-light-desktop.jpg)
|
||||
- [Тёмная, desktop](concepts-dark-desktop.jpg)
|
||||
- [Светлая, mobile](concepts-light-mobile.jpg)
|
||||
- [Тёмная, mobile](concepts-dark-mobile.jpg)
|
||||
- [Галерея](gallery.png)
|
||||
|
||||
Сырые 67 screenshots хранятся локально в `test-results/screenshots/`; в Git включены только обзорные изображения. Для пересборки: `node scripts/contact-sheets.mjs` после browser suite.
|
||||
|
||||
Во время QA исправлены Windows-пути и относительные URL сервера, контраст тёмного акцента, сохранённые значения Cancel, числовая альтернатива графику, описание tooltip, возврат фокуса, размер мобильных контролов, читаемость Dock-навигации и лишняя полоса закрытой mobile-навигации. Два промежуточных сбоя были неоднозначными селекторами тестов после добавления компонентов; финальная матрица прошла после исправлений.
|
||||
|
||||
## Ограничения
|
||||
|
||||
Это работающая локальная лаборатория и спецификация кандидатов, не готовый production backend. Реальные email, SSO/OAuth, API и telemetry не подключены. Skeleton/ошибки — управляемые демонстрации. Изменения хранятся в браузере.
|
||||
|
||||
Тесты Edge не заменяют проверку Firefox/Safari, screen reader и контента реального проекта. Полный аудит WCAG не заявляется. Внешний Impeccable CLI не запущен: в клоне нет бинарника Windows, а первая загрузка engine из sandbox не удалась. Его рекомендациям не приписывается автоматический PASS; QA проведён собственными проверками и Playwright. Поиск UI/UX Pro Max реально выполнялся локально.
|
||||
|
||||
Финальная концепция и устанавливаемый Skill ждут выбора пользователя. Внешняя публикация Sites не выполнялась: запрос был на локальное приложение и Git push.
|
||||
@@ -0,0 +1,44 @@
|
||||
# Исследование Anidev
|
||||
|
||||
Проверено 27.11.2026. Репозитории реально клонированы; идентификаторы коммитов и даты сохранены в [repository-audit.json](repository-audit.json). Это снимок, а не обещание неизменности upstream. Внешние файлы находятся только в игнорируемой `.research/`, не входят в push и экспорт.
|
||||
|
||||
## Инструменты
|
||||
|
||||
| Источник | Архитектура и пригодность | Что используем совместно | Что исключаем | Лицензия / последний проверенный коммит |
|
||||
|---|---|---|---|---|
|
||||
| [Impeccable](https://github.com/pbakaus/impeccable) | Skill + специализированные playbooks, CLI, детерминированный engine. Различает рабочие и рекламные поверхности | Разделение Operate/Persuade, узкий critique → audit → harden → polish, проверка результата в браузере | Shader/overdrive не нужны рабочим панелям; не устанавливаем всю систему и её hooks как обязательную зависимость | Apache-2.0; `2fc5e1459e` от 26.11.2026 |
|
||||
| [Taste Skill](https://github.com/Leonxlnx/taste-skill) | Skill, библиотека направлений, starter/assets, scripts/checker/finish gate, локальная установка ссылкой | Осознанное art direction, система до страниц, проверка настоящего UI и повторное использование Git checkout | Правило «секция на экран», обязательные hero entrances, фотографии и сценические эффекты не переносим в admin | MIT; `952435f63a` от 27.11.2026 |
|
||||
| [UI/UX Pro Max](https://github.com/nextlevelbuilder/ui-ux-pro-max-skill) | CSV knowledge base, Python/BM25-поиск по UX/стилям/цветам/графикам/стекам, генерация system + overrides + token exports | Поиск по задаче, доступность, адаптивность таблиц, семантические токены. Реально запущены запросы `data table accessibility keyboard pagination` и `latency monitoring time series` | Результат генератора — подсказка, не бренд Anidev. Не переносим случайную палитру или рекомендуемую библиотеку без причины | MIT; `11ca2b3bdd` от 27.11.2026 |
|
||||
| [No Slop UI](https://github.com/LeoStehlik/no-slop-ui) | Небольшой skill, banned patterns, palette/stack recipes, checklist, проверочные примеры | Плотность, реальные рабочие сценарии, сдержанные эффекты, проверка каждого экрана | Предпочтение shadcn/Sonner не универсально; абсолютные запреты антиквы/плавающих панелей несовместимы с исследованием шести направлений | MIT; `c5f80190f0` от 22.11.2026 |
|
||||
| [Anti AI Slop](https://github.com/muris11/anti-ai-slop) | Набор тематических skills, taxonomy P0–P6, core filter, installer | Проверка назначения каждого решения, сходства случайных defaults, ошибок UX и правдоподобия данных | Не грузим весь каталог и установочный wizard. Фильтр качества не задаёт визуальный язык | MIT; `5768372bf3` от 30.09.2026 |
|
||||
| [Frontend Craft](https://github.com/nattergabriel/frontend-craft) | Один skill + foundations, craft checklist, каталог признаков; пути нового дизайна и исправления существующего | Изучен как аналитический источник: полезно различать отсутствие направления и непоследовательность реализации | Не распространяем текст, checklist, код или упаковку: явная лицензия в проверенном дереве не найдена | Лицензия не найдена; `c0e0cea524` от 16.07.2026 |
|
||||
|
||||
У всех источников доступна история и рабочее дерево на дату проверки. Последние коммиты показывают особенно свежие изменения у первых четырёх; сентябрьский/июльский snapshot остальных не означает, что они непригодны, но их конкретные рекомендации нужно перепроверять. Популярность не использовалась как критерий качества. Проверенные пакеты: Impeccable 4.11.1, Taste 2.5.1, No Slop 0.8.0 по их файлам. API GitHub ограничил запросы, поэтому доказательная база — clone и commit, а не кэшированные числа звёзд.
|
||||
|
||||
## Разрешение конфликтов
|
||||
|
||||
| Конфликт | Решение Anidev |
|
||||
|---|---|
|
||||
| Taste требует сцен и движения, No Slop запрещает трансформации | Публичная презентация может иметь art direction; операционные экраны используют только обратную связь. В этой галерее нет декоративного движения |
|
||||
| No Slop предпочитает sans; другие источники предлагают контрастные пары | Проверяем sans/serif/mono как разные кандидаты. Для длинного текста и форм сохраняем читаемость и кириллицу |
|
||||
| Источники рекомендуют React/shadcn, задача требует независимости | Native HTML/CSS/JS и семантические токены; framework adapters позже |
|
||||
| Одни списки банят приёмы, другие судят по назначению | Запреты брифа обязательны. Остальные техники оцениваем по продуктовой причине и результату в браузере |
|
||||
| Несколько источников повторяют focus/contrast/mobile/empty state | Один компонентный контракт и один QA-проход, без дублирующих prompt-блоков |
|
||||
|
||||
Рекомендуемый набор для будущего агента: утверждённый Anidev Skill как единственный источник визуального языка; UI/UX Pro Max по конкретному вопросу; Impeccable по конкретной области для critique/audit/harden; один краткий Anidev anti-slop checklist. Внешние системы необязательны для работы экспортированной системы.
|
||||
|
||||
## Продуктовые ориентиры
|
||||
|
||||
Это интерпретации публичных материалов и документации; закрытые аккаунты и приватные панели не исследовались.
|
||||
|
||||
- [Linear](https://linear.app/features): приоритет рабочей области, компактный контекст и быстрые действия. Для Anidev — Relay, без копирования фирменной оболочки.
|
||||
- [Vercel Geist](https://vercel.com/geist/introduction): контрастная система и связность компонентов. Для Anidev — роли цветов, строгие границы и обе темы.
|
||||
- [Raycast](https://www.raycast.com/): клавиатурный доступ и поиск команд. Для Anidev — Ctrl/⌘K с поиском и навигацией стрелками.
|
||||
- [GitHub Primer](https://primer.style/): отделение product UI от brand UI и общие основы доступности. Для Anidev — повторяемость таблиц, форм и управляемых состояний.
|
||||
- [Stripe Dashboard docs](https://docs.stripe.com/dashboard/basics): навигация по ресурсам, фильтры, управление участниками и ролями. Для Anidev — одинаковый рабочий сценарий пользователей во всех концепциях.
|
||||
- [Notion](https://www.notion.com/product): спокойная контентная иерархия. Для Anidev — возможность последовательного чтения и редакционный кандидат Ledger.
|
||||
- [Cloudflare](https://developers.cloudflare.com/fundamentals/concepts/accounts-and-zones/): контексты account/zone; [настройки профиля](https://developers.cloudflare.com/fundamentals/user-profiles/customize-account/) объединяют язык и appearance; [клавиатурные команды](https://developers.cloudflare.com/changelog/post/2026-05-04-keyboard-shortcuts/) управляют навигацией и таблицами. Для Anidev — явный контекст пространства и сервиса, переключатели языка/темы и команды. Закрытый dashboard не проверялся.
|
||||
|
||||
## Лицензионное решение
|
||||
|
||||
Ни один upstream skill не включён в распространяемые файлы. Наш код и инструкции написаны для этой задачи. Если позже заимствуются MIT-файлы, сохранить copyright/permission notice; для Apache — LICENSE и применимые notices и указание изменений. Frontend Craft не копировать до получения разрешения/лицензии. Шрифты в текущей версии системные; файлы шрифтов не распространяются. Лицензию самой Anidev определяет владелец репозитория; open-source лицензию от его имени не назначаем.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 238 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 196 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 243 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 196 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 136 KiB |
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"date": "2026-11-27T15:35:52.822Z",
|
||||
"browser": "158.0.4370.45",
|
||||
"passed": 230,
|
||||
"failed": 0,
|
||||
"errors": [],
|
||||
"matrix": "6 concepts x 2 themes x 3 viewports x 6 screens",
|
||||
"screenshots": 67,
|
||||
"standaloneExport": "passed",
|
||||
"zipCRC": "passed",
|
||||
"tokenConfigurations": 36,
|
||||
"limitations": [
|
||||
"Edge only; not a full WCAG audit",
|
||||
"No production backend or real OAuth",
|
||||
"Final concept and installable Skill require user selection"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
[
|
||||
{
|
||||
"repository": "https://github.com/muris11/anti-ai-slop.git",
|
||||
"commit": "5768372bf3272c7d59c354cec3a16f5c39d036bc",
|
||||
"commitDate": "2026-09-30T14:58:18+07:00",
|
||||
"checked": "2026-11-27",
|
||||
"licenseFile": "LICENSE",
|
||||
"license": "MIT"
|
||||
},
|
||||
{
|
||||
"repository": "https://github.com/nattergabriel/frontend-craft.git",
|
||||
"commit": "c0e0cea5244ed36a8c4b7b76c27dfc4e5dc01011",
|
||||
"commitDate": "2026-07-16T16:20:39+02:00",
|
||||
"checked": "2026-11-27",
|
||||
"licenseFile": null,
|
||||
"license": "No license found; do not redistribute"
|
||||
},
|
||||
{
|
||||
"repository": "https://github.com/pbakaus/impeccable.git",
|
||||
"commit": "2fc5e1459efbbf06d92c7306517c286bf12490cf",
|
||||
"commitDate": "2026-11-26T02:23:55+01:00",
|
||||
"checked": "2026-11-27",
|
||||
"licenseFile": "LICENSE",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
{
|
||||
"repository": "https://github.com/LeoStehlik/no-slop-ui.git",
|
||||
"commit": "c5f80190f0a6cbd906b81d54e79e2756931077fb",
|
||||
"commitDate": "2026-11-22T16:15:17+01:00",
|
||||
"checked": "2026-11-27",
|
||||
"licenseFile": "LICENSE",
|
||||
"license": "MIT"
|
||||
},
|
||||
{
|
||||
"repository": "https://github.com/Leonxlnx/taste-skill.git",
|
||||
"commit": "952435f63acece7d2fcb4b4d3c1786c1c43603e0",
|
||||
"commitDate": "2026-11-27T00:58:09+01:00",
|
||||
"checked": "2026-11-27",
|
||||
"licenseFile": "LICENSE",
|
||||
"license": "MIT"
|
||||
},
|
||||
{
|
||||
"repository": "https://github.com/nextlevelbuilder/ui-ux-pro-max-skill.git",
|
||||
"commit": "11ca2b3bdd555649f278ee348c32a9302b24dcf1",
|
||||
"commitDate": "2026-11-27T14:07:41+07:00",
|
||||
"checked": "2026-11-27",
|
||||
"licenseFile": "LICENSE",
|
||||
"license": "MIT"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,58 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFile, mkdir, writeFile } from "node:fs/promises";
|
||||
import { concepts, tokensFor, cssVars } from "../concepts/registry.js";
|
||||
assert.equal(concepts.length, 6);
|
||||
assert.equal(new Set(concepts.map((c) => c.layout)).size, 6);
|
||||
const luminance = (hex) =>
|
||||
hex
|
||||
.match(/\w\w/g)
|
||||
.map((x) => parseInt(x, 16) / 255)
|
||||
.map((x) => (x <= 0.04045 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4))
|
||||
.reduce((s, v, i) => s + v * [0.2126, 0.7152, 0.0722][i], 0);
|
||||
const contrast = (a, b) => {
|
||||
const x = luminance(a),
|
||||
y = luminance(b);
|
||||
return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05);
|
||||
};
|
||||
for (const c of concepts)
|
||||
for (const theme of ["light", "dark"])
|
||||
for (const density of ["compact", "normal", "relaxed"]) {
|
||||
const t = tokensFor(c.id, theme, undefined, density);
|
||||
for (const bg of ["color.bg", "color.surface"])
|
||||
for (const fg of [
|
||||
"color.text",
|
||||
"color.muted",
|
||||
"color.danger",
|
||||
"color.success",
|
||||
"color.accent",
|
||||
])
|
||||
assert.ok(
|
||||
contrast(t[fg], t[bg]) >= 4.5,
|
||||
`${c.id}/${theme}/${fg} contrast ${contrast(t[fg], t[bg])}`,
|
||||
);
|
||||
assert.ok(contrast(t["color.accent"], t["color.on-accent"]) >= 4.5);
|
||||
}
|
||||
for (const c of concepts)
|
||||
for (const theme of ["light", "dark"]) {
|
||||
const tokens = tokensFor(c.id, theme);
|
||||
await mkdir(`tokens/${c.id}`, { recursive: true });
|
||||
await writeFile(
|
||||
`tokens/${c.id}/${theme}.json`,
|
||||
JSON.stringify(tokens, null, 2) + "\n",
|
||||
);
|
||||
await writeFile(
|
||||
`tokens/${c.id}/${theme}.css`,
|
||||
`:root {\n${cssVars(tokens)}\n}\n`,
|
||||
);
|
||||
}
|
||||
for (const file of [
|
||||
"playground/index.html",
|
||||
"playground/frame.html",
|
||||
"components/system.css",
|
||||
"playground/frame.js",
|
||||
"playground/gallery.js",
|
||||
])
|
||||
assert.ok((await readFile(file, "utf8")).length > 100);
|
||||
console.log(
|
||||
"PASS: six layout grammars, 36 token sets, default text contrast, generated CSS/JSON.",
|
||||
);
|
||||
@@ -0,0 +1,35 @@
|
||||
import { chromium } from "playwright";
|
||||
const base = process.env.BASE_URL || "http://127.0.0.1:4173";
|
||||
const browser = await chromium.launch({
|
||||
executablePath:
|
||||
process.env.PLAYWRIGHT_EXECUTABLE_PATH ||
|
||||
(process.platform === "win32"
|
||||
? "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
||||
: undefined),
|
||||
headless: true,
|
||||
});
|
||||
try {
|
||||
const page = await browser.newPage();
|
||||
for (const device of ["desktop", "mobile"])
|
||||
for (const theme of ["light", "dark"]) {
|
||||
const width = device === "desktop" ? 640 : 300,
|
||||
height = device === "desktop" ? 570 : 780;
|
||||
await page.setViewportSize({
|
||||
width: width * 3,
|
||||
height: (height + 35) * 2,
|
||||
});
|
||||
await page.setContent(
|
||||
`<style>*{box-sizing:border-box}body{margin:0;background:#303335;color:white;display:grid;grid-template-columns:repeat(3,${width}px);font:14px Arial}section{width:${width}px;height:${height + 35}px;padding:0 8px 8px}header{height:35px;padding:10px}img{width:100%;height:${height - 8}px;object-fit:contain;object-position:top;background:#202224}</style>${["relay", "ledger", "signal", "axis", "dock", "grid"].map((c) => `<section><header>${c.toUpperCase()} / ${theme} / ${device}</header><img src="${base}/test-results/screenshots/${c}-${theme}-${device}-dashboard.png"></section>`).join("")}`,
|
||||
);
|
||||
await page
|
||||
.locator("img")
|
||||
.evaluateAll((imgs) => Promise.all(imgs.map((i) => i.decode())));
|
||||
await page.screenshot({
|
||||
path: `references/concepts-${theme}-${device}.jpg`,
|
||||
type: "jpeg",
|
||||
quality: 90,
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
await browser.close();
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import http from "node:http";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import path from "node:path";
|
||||
const root = path.resolve(fileURLToPath(new URL("../", import.meta.url)));
|
||||
const types = {
|
||||
".html": "text/html; charset=utf-8",
|
||||
".css": "text/css; charset=utf-8",
|
||||
".js": "text/javascript; charset=utf-8",
|
||||
".json": "application/json; charset=utf-8",
|
||||
".svg": "image/svg+xml",
|
||||
".md": "text/plain; charset=utf-8",
|
||||
};
|
||||
const port = Number(process.env.PORT || 4173);
|
||||
http
|
||||
.createServer(async (req, res) => {
|
||||
try {
|
||||
const pathname = decodeURIComponent(
|
||||
new URL(req.url, "http://localhost").pathname,
|
||||
);
|
||||
if (pathname === "/") {
|
||||
res.writeHead(302, { Location: "/playground/" });
|
||||
res.end();
|
||||
return;
|
||||
}
|
||||
const file = path.resolve(
|
||||
root,
|
||||
"." + (pathname.endsWith("/") ? pathname + "index.html" : pathname),
|
||||
);
|
||||
if (!file.startsWith(root + path.sep)) throw Error();
|
||||
const data = await readFile(file);
|
||||
res.writeHead(200, {
|
||||
"Content-Type": types[path.extname(file)] || "application/octet-stream",
|
||||
"Cache-Control": "no-store",
|
||||
});
|
||||
res.end(data);
|
||||
} catch {
|
||||
res.writeHead(404);
|
||||
res.end("Not found");
|
||||
}
|
||||
})
|
||||
.listen(port, "127.0.0.1", () =>
|
||||
console.log(`Anidev Design System: http://127.0.0.1:${port}`),
|
||||
);
|
||||
@@ -0,0 +1,329 @@
|
||||
import { chromium } from "playwright";
|
||||
import assert from "node:assert/strict";
|
||||
import { mkdir, writeFile } from "node:fs/promises";
|
||||
import { concepts } from "../concepts/registry.js";
|
||||
const base = process.env.BASE_URL || "http://127.0.0.1:4173";
|
||||
const executablePath =
|
||||
process.env.PLAYWRIGHT_EXECUTABLE_PATH ||
|
||||
(process.platform === "win32"
|
||||
? "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
||||
: undefined);
|
||||
const browser = await chromium.launch({ executablePath, headless: true });
|
||||
const context = await browser.newContext({ acceptDownloads: true });
|
||||
const page = await context.newPage();
|
||||
page.setDefaultTimeout(8000);
|
||||
const errors = [],
|
||||
failures = [],
|
||||
cases = [];
|
||||
page.on("pageerror", (e) => errors.push(e.message));
|
||||
await mkdir("test-results/screenshots", { recursive: true });
|
||||
const url = (c, p = "dashboard", theme = "light", locale = "ru") =>
|
||||
`${base}/playground/frame.html?${new URLSearchParams({ concept: c, page: p, theme, locale })}`;
|
||||
async function check(name, fn) {
|
||||
try {
|
||||
await fn();
|
||||
cases.push({ name, status: "pass" });
|
||||
} catch (e) {
|
||||
failures.push({ name, error: e.message });
|
||||
console.log("FAIL", name, e.message);
|
||||
}
|
||||
}
|
||||
try {
|
||||
await check("HTTP root and gallery", async () => {
|
||||
const r = await page.goto(base);
|
||||
assert.equal(r.status(), 200);
|
||||
await page.locator("#concepts button").first().waitFor();
|
||||
assert.equal(await page.locator("#concepts button").count(), 6);
|
||||
await page.frameLocator("#preview-a").locator("h1").waitFor();
|
||||
await page.screenshot({ path: "references/gallery.png", fullPage: true });
|
||||
});
|
||||
for (const c of concepts)
|
||||
for (const theme of ["light", "dark"])
|
||||
for (const [device, width, height] of [
|
||||
["desktop", 1440, 900],
|
||||
["tablet", 768, 1024],
|
||||
["mobile", 390, 844],
|
||||
]) {
|
||||
await page.setViewportSize({ width, height });
|
||||
for (const p of [
|
||||
"dashboard",
|
||||
"users",
|
||||
"settings",
|
||||
"auth",
|
||||
"components",
|
||||
"tokens",
|
||||
]) {
|
||||
await check(`${c.id}/${theme}/${device}/${p}`, async () => {
|
||||
await page.goto(url(c.id, p, theme));
|
||||
await page.locator("h1").waitFor();
|
||||
const overflow = await page.evaluate(() => ({
|
||||
scroll: document.documentElement.scrollWidth,
|
||||
client: document.documentElement.clientWidth,
|
||||
}));
|
||||
assert.ok(
|
||||
overflow.scroll <= overflow.client + 1,
|
||||
JSON.stringify(overflow),
|
||||
);
|
||||
if (
|
||||
p === "dashboard" ||
|
||||
(device === "desktop" &&
|
||||
theme === "light" &&
|
||||
["users", "settings", "auth"].includes(p))
|
||||
)
|
||||
await page.screenshot({
|
||||
path: `test-results/screenshots/${c.id}-${theme}-${device}-${p}.png`,
|
||||
fullPage: true,
|
||||
});
|
||||
if (p === "dashboard") {
|
||||
await page.locator("[data-action=invite]").first().click();
|
||||
assert.ok(await page.locator("#dialog").evaluate((d) => d.open));
|
||||
if (device === "desktop")
|
||||
await page.screenshot({
|
||||
path: `test-results/screenshots/${c.id}-${theme}-modal.png`,
|
||||
});
|
||||
await page.keyboard.press("Escape");
|
||||
assert.equal(
|
||||
await page.locator("#dialog").evaluate((d) => d.open),
|
||||
false,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
await page.setViewportSize({ width: 1280, height: 900 });
|
||||
await check(
|
||||
"User search, filter, pagination, sorting, empty state",
|
||||
async () => {
|
||||
await page.goto(url("relay", "users"));
|
||||
await page.locator("#user-search").fill("anna");
|
||||
assert.equal(await page.locator("tbody tr").count(), 1);
|
||||
await page.locator("#user-search").fill("no-such-person");
|
||||
await page.locator("[data-action=clear-filters]").click();
|
||||
await page.locator("[data-action=next]").click();
|
||||
assert.equal(await page.locator("tbody tr").count(), 3);
|
||||
await page.locator("#role-filter").selectOption("admin");
|
||||
assert.equal(await page.locator("tbody tr").count(), 2);
|
||||
await page.locator("[data-sort=name]").click();
|
||||
await page.locator("[data-action=reset-users]").click();
|
||||
},
|
||||
);
|
||||
await check("Invite validation, creation, duplicate detection", async () => {
|
||||
await page.locator("[data-action=invite]:visible").click();
|
||||
await page.locator("#invite-form input[name=name]").fill("Test Member");
|
||||
await page
|
||||
.locator("#invite-form input[name=email]")
|
||||
.fill("test@example.com");
|
||||
await page.locator("#invite-form button[type=submit]").click();
|
||||
await page.locator("#user-search").fill("test@example.com");
|
||||
assert.equal(await page.locator("tbody tr").count(), 1);
|
||||
await page.locator("[data-action=invite]:visible").click();
|
||||
await page.locator("#invite-form input[name=name]").fill("Duplicate");
|
||||
await page
|
||||
.locator("#invite-form input[name=email]")
|
||||
.fill("test@example.com");
|
||||
await page.locator("#invite-form button[type=submit]").click();
|
||||
assert.ok(await page.locator("#invite-error").innerText());
|
||||
await page.keyboard.press("Escape");
|
||||
});
|
||||
await check("Edit, selection and confirmed bulk suspension", async () => {
|
||||
await page.locator("[data-edit]").first().click();
|
||||
await page.locator("#edit-user select[name=role]").selectOption("admin");
|
||||
await page.locator("#edit-user button[type=submit]").click();
|
||||
await page.locator("[data-select]").first().check();
|
||||
await page.locator("[data-action=bulk-suspend]").click();
|
||||
await page.locator("[data-action=confirm-suspend]").click();
|
||||
assert.match(await page.locator("tbody").innerText(), /Заблокирован/);
|
||||
await page.locator("[data-action=reset-users]").click();
|
||||
});
|
||||
await check("Settings persistence and keyboard tabs", async () => {
|
||||
await page.goto(url("grid", "settings"));
|
||||
await page.locator("input[name=name]").fill("Anidev Test");
|
||||
await page.locator("#settings-form button[type=submit]").click();
|
||||
await page.reload();
|
||||
assert.equal(
|
||||
await page.locator("input[name=name]").inputValue(),
|
||||
"Anidev Test",
|
||||
);
|
||||
await page.locator("#tab-general").focus();
|
||||
await page.keyboard.press("ArrowRight");
|
||||
assert.equal(
|
||||
await page.locator("#tab-security").getAttribute("aria-selected"),
|
||||
"true",
|
||||
);
|
||||
await page.locator("#mfa").uncheck();
|
||||
await page.locator("#settings-form button[type=submit]").click();
|
||||
await page.reload();
|
||||
await page.locator("#tab-security").click();
|
||||
assert.equal(await page.locator("#mfa").isChecked(), false);
|
||||
});
|
||||
await check("Auth native validation and demo sign in", async () => {
|
||||
await page.goto(url("axis", "auth"));
|
||||
await page.locator("input[name=email]").fill("test@example.com");
|
||||
await page.locator("input[name=password]").fill("short");
|
||||
await page.locator("#auth-form button[type=submit]").click();
|
||||
assert.equal(await page.locator("#auth-form").count(), 1);
|
||||
await page.locator("input[name=password]").fill("long-password");
|
||||
await page.locator("#auth-form button[type=submit]").click();
|
||||
await page.locator(".health-line").waitFor();
|
||||
});
|
||||
await check("Command palette keyboard and modal focus trap", async () => {
|
||||
await page.keyboard.press("Control+k");
|
||||
await page.locator("#command-search").fill("Пользователи");
|
||||
await page.keyboard.press("Enter");
|
||||
await page.locator("#user-search").waitFor();
|
||||
await page.locator("[data-action=invite]:visible").click();
|
||||
for (let i = 0; i < 12; i++) await page.keyboard.press("Tab");
|
||||
assert.equal(
|
||||
await page.evaluate(() => document.activeElement.closest("dialog")?.id),
|
||||
"dialog",
|
||||
);
|
||||
await page.keyboard.press("Escape");
|
||||
assert.equal(
|
||||
await page
|
||||
.locator("[data-action=invite]:visible")
|
||||
.evaluate((e) => e === document.activeElement),
|
||||
true,
|
||||
);
|
||||
});
|
||||
await check(
|
||||
"Drawer, dropdown, tooltip, context menu and recovery states",
|
||||
async () => {
|
||||
await page.goto(url("dock", "components"));
|
||||
await page.locator("[data-action=drawer]").click();
|
||||
assert.match(
|
||||
await page.locator("#dialog").getAttribute("class"),
|
||||
/drawer/,
|
||||
);
|
||||
await page.keyboard.press("Escape");
|
||||
await page.locator("details:not(.chart-data) > summary").click();
|
||||
await page.locator("[data-action=rename]").click();
|
||||
await page.keyboard.press("Escape");
|
||||
await page.locator(".tooltip-wrap button").focus();
|
||||
assert.equal(await page.locator(".tooltip").isVisible(), true);
|
||||
await page.locator(".context-target").focus();
|
||||
await page.keyboard.press("Shift+F10");
|
||||
await page.locator(".context-menu").waitFor();
|
||||
await page.keyboard.press("ArrowDown");
|
||||
await page.keyboard.press("Enter");
|
||||
await page.locator("dialog.drawer").waitFor();
|
||||
await page.keyboard.press("Escape");
|
||||
await page.locator("[data-action=retry]").click();
|
||||
assert.match(
|
||||
await page.locator(".error-state").innerText(),
|
||||
/Журнал загружен/,
|
||||
);
|
||||
},
|
||||
);
|
||||
await check("EN localization for each screen and concept", async () => {
|
||||
for (const c of concepts)
|
||||
for (const p of [
|
||||
"dashboard",
|
||||
"users",
|
||||
"settings",
|
||||
"auth",
|
||||
"components",
|
||||
"tokens",
|
||||
]) {
|
||||
await page.goto(url(c.id, p, "dark", "en"));
|
||||
await page.locator("h1").waitFor();
|
||||
assert.equal(await page.locator("html").getAttribute("lang"), "en");
|
||||
const text = await page.locator("body").innerText();
|
||||
assert.equal(
|
||||
/[А-Яа-яЁё]/.test(text),
|
||||
false,
|
||||
`${c.id}/${p}: Russian text in EN`,
|
||||
);
|
||||
}
|
||||
});
|
||||
await check(
|
||||
"Gallery controls, comparison and actual mobile viewport",
|
||||
async () => {
|
||||
await page.goto(base);
|
||||
await page.locator("[data-concept=ledger]").click();
|
||||
await page.locator("#theme").selectOption("dark");
|
||||
await page.locator("#density").selectOption("compact");
|
||||
await page.locator("#page").selectOption("users");
|
||||
await page.locator("[data-size=mobile]").click();
|
||||
await page.locator("#compare").check();
|
||||
await page.locator("#second").selectOption("signal");
|
||||
await page.frameLocator("#preview-b").locator("#user-search").waitFor();
|
||||
assert.equal(
|
||||
await page
|
||||
.frameLocator("#preview-a")
|
||||
.locator("body")
|
||||
.getAttribute("data-concept"),
|
||||
"ledger",
|
||||
);
|
||||
assert.ok(
|
||||
await page.locator("#preview-a").evaluate((e) => e.clientWidth <= 390),
|
||||
);
|
||||
await page.locator("#accent").fill("#ffcc00");
|
||||
await page.locator("#accent").dispatchEvent("change");
|
||||
await page.frameLocator("#preview-a").locator("h1").waitFor();
|
||||
},
|
||||
);
|
||||
await check("Mobile navigation and density variants", async () => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
for (const c of concepts) {
|
||||
await page.goto(url(c.id));
|
||||
await page.locator("[data-action=mobile-menu]").click();
|
||||
await page.locator(".nav-links [data-page=users]").click();
|
||||
await page.locator("#user-search").waitFor();
|
||||
for (const density of ["compact", "relaxed"]) {
|
||||
await page.goto(url(c.id, "settings") + "&density=" + density);
|
||||
await page.locator("h1").waitFor();
|
||||
assert.ok(
|
||||
await page.evaluate(
|
||||
() => document.documentElement.scrollWidth <= innerWidth + 1,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
await page.setViewportSize({ width: 1280, height: 900 });
|
||||
await page.goto(base);
|
||||
await page.locator("[data-concept=ledger]").click();
|
||||
});
|
||||
await check("Export archive download", async () => {
|
||||
const download = page.waitForEvent("download");
|
||||
await page.locator("#export").click();
|
||||
const d = await download;
|
||||
await d.saveAs("test-results/anidev-export.zip");
|
||||
assert.match(d.suggestedFilename(), /anidev-ledger.zip/);
|
||||
});
|
||||
await check("Gallery mobile overflow", async () => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await page.goto(base);
|
||||
await page.locator("#concepts button").first().waitFor();
|
||||
assert.ok(
|
||||
await page.evaluate(
|
||||
() => document.documentElement.scrollWidth <= innerWidth + 1,
|
||||
),
|
||||
);
|
||||
await page.screenshot({
|
||||
path: "test-results/screenshots/gallery-mobile.png",
|
||||
fullPage: true,
|
||||
});
|
||||
});
|
||||
await check("No runtime errors", async () => assert.deepEqual(errors, []));
|
||||
} finally {
|
||||
await writeFile(
|
||||
"test-results/report.json",
|
||||
JSON.stringify(
|
||||
{
|
||||
date: new Date().toISOString(),
|
||||
browser: await browser.version(),
|
||||
passed: cases.length,
|
||||
failed: failures.length,
|
||||
cases,
|
||||
failures,
|
||||
errors,
|
||||
},
|
||||
null,
|
||||
2,
|
||||
),
|
||||
);
|
||||
await context.close();
|
||||
await browser.close();
|
||||
}
|
||||
console.log(`Browser QA: ${cases.length} passed, ${failures.length} failed`);
|
||||
if (failures.length) process.exitCode = 1;
|
||||
@@ -0,0 +1,19 @@
|
||||
:root {
|
||||
--color-bg: #141c28;
|
||||
--color-surface: #1b2738;
|
||||
--color-text: #e6edf8;
|
||||
--color-muted: #a6bad6;
|
||||
--color-border: #3b4f6c;
|
||||
--color-accent: #7195be;
|
||||
--color-on-accent: #101810;
|
||||
--color-danger: #ffafa5;
|
||||
--color-success: #a2d3ab;
|
||||
--radius-control: 7px;
|
||||
--font-body: "Segoe UI", Arial, sans-serif;
|
||||
--font-heading: "Segoe UI", Arial, sans-serif;
|
||||
--space-unit: 4px;
|
||||
--space-section: 26px;
|
||||
--size-control: 40px;
|
||||
--space-cell: 13px;
|
||||
--motion-duration: 120ms;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"color.bg": "#141c28",
|
||||
"color.surface": "#1b2738",
|
||||
"color.text": "#e6edf8",
|
||||
"color.muted": "#a6bad6",
|
||||
"color.border": "#3b4f6c",
|
||||
"color.accent": "#7195be",
|
||||
"color.on-accent": "#101810",
|
||||
"color.danger": "#ffafa5",
|
||||
"color.success": "#a2d3ab",
|
||||
"radius.control": "7px",
|
||||
"font.body": "\"Segoe UI\", Arial, sans-serif",
|
||||
"font.heading": "\"Segoe UI\", Arial, sans-serif",
|
||||
"space.unit": "4px",
|
||||
"space.section": "26px",
|
||||
"size.control": "40px",
|
||||
"space.cell": "13px",
|
||||
"motion.duration": "120ms",
|
||||
"layout.kind": "horizontal"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
:root {
|
||||
--color-bg: #f0f4fa;
|
||||
--color-surface: #ffffff;
|
||||
--color-text: #202622;
|
||||
--color-muted: #59635e;
|
||||
--color-border: #c8d7ed;
|
||||
--color-accent: #285e9d;
|
||||
--color-on-accent: #ffffff;
|
||||
--color-danger: #a22923;
|
||||
--color-success: #26623b;
|
||||
--radius-control: 7px;
|
||||
--font-body: "Segoe UI", Arial, sans-serif;
|
||||
--font-heading: "Segoe UI", Arial, sans-serif;
|
||||
--space-unit: 4px;
|
||||
--space-section: 26px;
|
||||
--size-control: 40px;
|
||||
--space-cell: 13px;
|
||||
--motion-duration: 120ms;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"color.bg": "#f0f4fa",
|
||||
"color.surface": "#ffffff",
|
||||
"color.text": "#202622",
|
||||
"color.muted": "#59635e",
|
||||
"color.border": "#c8d7ed",
|
||||
"color.accent": "#285e9d",
|
||||
"color.on-accent": "#ffffff",
|
||||
"color.danger": "#a22923",
|
||||
"color.success": "#26623b",
|
||||
"radius.control": "7px",
|
||||
"font.body": "\"Segoe UI\", Arial, sans-serif",
|
||||
"font.heading": "\"Segoe UI\", Arial, sans-serif",
|
||||
"space.unit": "4px",
|
||||
"space.section": "26px",
|
||||
"size.control": "40px",
|
||||
"space.cell": "13px",
|
||||
"motion.duration": "120ms",
|
||||
"layout.kind": "horizontal"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
:root {
|
||||
--color-bg: #211e1a;
|
||||
--color-surface: #2d2821;
|
||||
--color-text: #f1e7d9;
|
||||
--color-muted: #c7b6a0;
|
||||
--color-border: #5a4d3c;
|
||||
--color-accent: #a58b70;
|
||||
--color-on-accent: #101810;
|
||||
--color-danger: #ffafa5;
|
||||
--color-success: #a2d3ab;
|
||||
--radius-control: 12px;
|
||||
--font-body: "Trebuchet MS", Arial, sans-serif;
|
||||
--font-heading: "Trebuchet MS", Arial, sans-serif;
|
||||
--space-unit: 4px;
|
||||
--space-section: 26px;
|
||||
--size-control: 40px;
|
||||
--space-cell: 13px;
|
||||
--motion-duration: 120ms;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"color.bg": "#211e1a",
|
||||
"color.surface": "#2d2821",
|
||||
"color.text": "#f1e7d9",
|
||||
"color.muted": "#c7b6a0",
|
||||
"color.border": "#5a4d3c",
|
||||
"color.accent": "#a58b70",
|
||||
"color.on-accent": "#101810",
|
||||
"color.danger": "#ffafa5",
|
||||
"color.success": "#a2d3ab",
|
||||
"radius.control": "12px",
|
||||
"font.body": "\"Trebuchet MS\", Arial, sans-serif",
|
||||
"font.heading": "\"Trebuchet MS\", Arial, sans-serif",
|
||||
"space.unit": "4px",
|
||||
"space.section": "26px",
|
||||
"size.control": "40px",
|
||||
"space.cell": "13px",
|
||||
"motion.duration": "120ms",
|
||||
"layout.kind": "rail"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
:root {
|
||||
--color-bg: #f3f0eb;
|
||||
--color-surface: #ffffff;
|
||||
--color-text: #202622;
|
||||
--color-muted: #59635e;
|
||||
--color-border: #d5cbbb;
|
||||
--color-accent: #765027;
|
||||
--color-on-accent: #ffffff;
|
||||
--color-danger: #a22923;
|
||||
--color-success: #26623b;
|
||||
--radius-control: 12px;
|
||||
--font-body: "Trebuchet MS", Arial, sans-serif;
|
||||
--font-heading: "Trebuchet MS", Arial, sans-serif;
|
||||
--space-unit: 4px;
|
||||
--space-section: 26px;
|
||||
--size-control: 40px;
|
||||
--space-cell: 13px;
|
||||
--motion-duration: 120ms;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"color.bg": "#f3f0eb",
|
||||
"color.surface": "#ffffff",
|
||||
"color.text": "#202622",
|
||||
"color.muted": "#59635e",
|
||||
"color.border": "#d5cbbb",
|
||||
"color.accent": "#765027",
|
||||
"color.on-accent": "#ffffff",
|
||||
"color.danger": "#a22923",
|
||||
"color.success": "#26623b",
|
||||
"radius.control": "12px",
|
||||
"font.body": "\"Trebuchet MS\", Arial, sans-serif",
|
||||
"font.heading": "\"Trebuchet MS\", Arial, sans-serif",
|
||||
"space.unit": "4px",
|
||||
"space.section": "26px",
|
||||
"size.control": "40px",
|
||||
"space.cell": "13px",
|
||||
"motion.duration": "120ms",
|
||||
"layout.kind": "rail"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
:root {
|
||||
--color-bg: #191a18;
|
||||
--color-surface: #252622;
|
||||
--color-text: #f1f1e7;
|
||||
--color-muted: #b8bcaf;
|
||||
--color-border: #53574a;
|
||||
--color-accent: #c37d6d;
|
||||
--color-on-accent: #101810;
|
||||
--color-danger: #ffafa5;
|
||||
--color-success: #a2d3ab;
|
||||
--radius-control: 0px;
|
||||
--font-body: Arial, Helvetica, sans-serif;
|
||||
--font-heading: Arial, Helvetica, sans-serif;
|
||||
--space-unit: 4px;
|
||||
--space-section: 26px;
|
||||
--size-control: 40px;
|
||||
--space-cell: 13px;
|
||||
--motion-duration: 120ms;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"color.bg": "#191a18",
|
||||
"color.surface": "#252622",
|
||||
"color.text": "#f1f1e7",
|
||||
"color.muted": "#b8bcaf",
|
||||
"color.border": "#53574a",
|
||||
"color.accent": "#c37d6d",
|
||||
"color.on-accent": "#101810",
|
||||
"color.danger": "#ffafa5",
|
||||
"color.success": "#a2d3ab",
|
||||
"radius.control": "0px",
|
||||
"font.body": "Arial, Helvetica, sans-serif",
|
||||
"font.heading": "Arial, Helvetica, sans-serif",
|
||||
"space.unit": "4px",
|
||||
"space.section": "26px",
|
||||
"size.control": "40px",
|
||||
"space.cell": "13px",
|
||||
"motion.duration": "120ms",
|
||||
"layout.kind": "grid"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
:root {
|
||||
--color-bg: #f6f5f1;
|
||||
--color-surface: #ffffff;
|
||||
--color-text: #202622;
|
||||
--color-muted: #59635e;
|
||||
--color-border: #bfbfb1;
|
||||
--color-accent: #a53b21;
|
||||
--color-on-accent: #ffffff;
|
||||
--color-danger: #a22923;
|
||||
--color-success: #26623b;
|
||||
--radius-control: 0px;
|
||||
--font-body: Arial, Helvetica, sans-serif;
|
||||
--font-heading: Arial, Helvetica, sans-serif;
|
||||
--space-unit: 4px;
|
||||
--space-section: 26px;
|
||||
--size-control: 40px;
|
||||
--space-cell: 13px;
|
||||
--motion-duration: 120ms;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"color.bg": "#f6f5f1",
|
||||
"color.surface": "#ffffff",
|
||||
"color.text": "#202622",
|
||||
"color.muted": "#59635e",
|
||||
"color.border": "#bfbfb1",
|
||||
"color.accent": "#a53b21",
|
||||
"color.on-accent": "#ffffff",
|
||||
"color.danger": "#a22923",
|
||||
"color.success": "#26623b",
|
||||
"radius.control": "0px",
|
||||
"font.body": "Arial, Helvetica, sans-serif",
|
||||
"font.heading": "Arial, Helvetica, sans-serif",
|
||||
"space.unit": "4px",
|
||||
"space.section": "26px",
|
||||
"size.control": "40px",
|
||||
"space.cell": "13px",
|
||||
"motion.duration": "120ms",
|
||||
"layout.kind": "grid"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
:root {
|
||||
--color-bg: #211e1a;
|
||||
--color-surface: #2b2721;
|
||||
--color-text: #efe5d6;
|
||||
--color-muted: #c1b6a6;
|
||||
--color-border: #584e41;
|
||||
--color-accent: #bd7e6e;
|
||||
--color-on-accent: #101810;
|
||||
--color-danger: #ffafa5;
|
||||
--color-success: #a2d3ab;
|
||||
--radius-control: 0px;
|
||||
--font-body: Arial, Helvetica, sans-serif;
|
||||
--font-heading: Georgia, "Times New Roman", serif;
|
||||
--space-unit: 4px;
|
||||
--space-section: 26px;
|
||||
--size-control: 40px;
|
||||
--space-cell: 13px;
|
||||
--motion-duration: 120ms;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"color.bg": "#211e1a",
|
||||
"color.surface": "#2b2721",
|
||||
"color.text": "#efe5d6",
|
||||
"color.muted": "#c1b6a6",
|
||||
"color.border": "#584e41",
|
||||
"color.accent": "#bd7e6e",
|
||||
"color.on-accent": "#101810",
|
||||
"color.danger": "#ffafa5",
|
||||
"color.success": "#a2d3ab",
|
||||
"radius.control": "0px",
|
||||
"font.body": "Arial, Helvetica, sans-serif",
|
||||
"font.heading": "Georgia, \"Times New Roman\", serif",
|
||||
"space.unit": "4px",
|
||||
"space.section": "26px",
|
||||
"size.control": "40px",
|
||||
"space.cell": "13px",
|
||||
"motion.duration": "120ms",
|
||||
"layout.kind": "editorial"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
:root {
|
||||
--color-bg: #f5f0e7;
|
||||
--color-surface: #ffffff;
|
||||
--color-text: #202622;
|
||||
--color-muted: #59635e;
|
||||
--color-border: #c9bca7;
|
||||
--color-accent: #9b3c25;
|
||||
--color-on-accent: #ffffff;
|
||||
--color-danger: #a22923;
|
||||
--color-success: #26623b;
|
||||
--radius-control: 0px;
|
||||
--font-body: Arial, Helvetica, sans-serif;
|
||||
--font-heading: Georgia, "Times New Roman", serif;
|
||||
--space-unit: 4px;
|
||||
--space-section: 26px;
|
||||
--size-control: 40px;
|
||||
--space-cell: 13px;
|
||||
--motion-duration: 120ms;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"color.bg": "#f5f0e7",
|
||||
"color.surface": "#ffffff",
|
||||
"color.text": "#202622",
|
||||
"color.muted": "#59635e",
|
||||
"color.border": "#c9bca7",
|
||||
"color.accent": "#9b3c25",
|
||||
"color.on-accent": "#ffffff",
|
||||
"color.danger": "#a22923",
|
||||
"color.success": "#26623b",
|
||||
"radius.control": "0px",
|
||||
"font.body": "Arial, Helvetica, sans-serif",
|
||||
"font.heading": "Georgia, \"Times New Roman\", serif",
|
||||
"space.unit": "4px",
|
||||
"space.section": "26px",
|
||||
"size.control": "40px",
|
||||
"space.cell": "13px",
|
||||
"motion.duration": "120ms",
|
||||
"layout.kind": "editorial"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
:root {
|
||||
--color-bg: #151c19;
|
||||
--color-surface: #1b2520;
|
||||
--color-text: #e4ece7;
|
||||
--color-muted: #aabcb1;
|
||||
--color-border: #3c4e42;
|
||||
--color-accent: #689283;
|
||||
--color-on-accent: #101810;
|
||||
--color-danger: #ffafa5;
|
||||
--color-success: #a2d3ab;
|
||||
--radius-control: 5px;
|
||||
--font-body: Arial, Helvetica, sans-serif;
|
||||
--font-heading: Arial, Helvetica, sans-serif;
|
||||
--space-unit: 4px;
|
||||
--space-section: 26px;
|
||||
--size-control: 40px;
|
||||
--space-cell: 13px;
|
||||
--motion-duration: 120ms;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"color.bg": "#151c19",
|
||||
"color.surface": "#1b2520",
|
||||
"color.text": "#e4ece7",
|
||||
"color.muted": "#aabcb1",
|
||||
"color.border": "#3c4e42",
|
||||
"color.accent": "#689283",
|
||||
"color.on-accent": "#101810",
|
||||
"color.danger": "#ffafa5",
|
||||
"color.success": "#a2d3ab",
|
||||
"radius.control": "5px",
|
||||
"font.body": "Arial, Helvetica, sans-serif",
|
||||
"font.heading": "Arial, Helvetica, sans-serif",
|
||||
"space.unit": "4px",
|
||||
"space.section": "26px",
|
||||
"size.control": "40px",
|
||||
"space.cell": "13px",
|
||||
"motion.duration": "120ms",
|
||||
"layout.kind": "sidebar"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
:root {
|
||||
--color-bg: #f6f8f6;
|
||||
--color-surface: #ffffff;
|
||||
--color-text: #202622;
|
||||
--color-muted: #59635e;
|
||||
--color-border: #ccd8cf;
|
||||
--color-accent: #27634c;
|
||||
--color-on-accent: #ffffff;
|
||||
--color-danger: #a22923;
|
||||
--color-success: #26623b;
|
||||
--radius-control: 5px;
|
||||
--font-body: Arial, Helvetica, sans-serif;
|
||||
--font-heading: Arial, Helvetica, sans-serif;
|
||||
--space-unit: 4px;
|
||||
--space-section: 26px;
|
||||
--size-control: 40px;
|
||||
--space-cell: 13px;
|
||||
--motion-duration: 120ms;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"color.bg": "#f6f8f6",
|
||||
"color.surface": "#ffffff",
|
||||
"color.text": "#202622",
|
||||
"color.muted": "#59635e",
|
||||
"color.border": "#ccd8cf",
|
||||
"color.accent": "#27634c",
|
||||
"color.on-accent": "#ffffff",
|
||||
"color.danger": "#a22923",
|
||||
"color.success": "#26623b",
|
||||
"radius.control": "5px",
|
||||
"font.body": "Arial, Helvetica, sans-serif",
|
||||
"font.heading": "Arial, Helvetica, sans-serif",
|
||||
"space.unit": "4px",
|
||||
"space.section": "26px",
|
||||
"size.control": "40px",
|
||||
"space.cell": "13px",
|
||||
"motion.duration": "120ms",
|
||||
"layout.kind": "sidebar"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"Anidev semantic token map v0.1","type":"object","required":["color.bg","color.surface","color.text","color.muted","color.border","color.accent","color.on-accent","radius.control","font.body","font.heading","space.unit","size.control","layout.kind"],"additionalProperties":{"type":"string"},"description":"Flat framework-independent token map. CSS names replace dots with hyphens. This is a project format, not a claim of DTCG compliance."}
|
||||
@@ -0,0 +1,19 @@
|
||||
:root {
|
||||
--color-bg: #101a13;
|
||||
--color-surface: #16231a;
|
||||
--color-text: #d4e8d9;
|
||||
--color-muted: #a4bfa9;
|
||||
--color-border: #36533e;
|
||||
--color-accent: #579574;
|
||||
--color-on-accent: #101810;
|
||||
--color-danger: #ffafa5;
|
||||
--color-success: #a2d3ab;
|
||||
--radius-control: 0px;
|
||||
--font-body: Consolas, "Courier New", monospace;
|
||||
--font-heading: Consolas, "Courier New", monospace;
|
||||
--space-unit: 4px;
|
||||
--space-section: 26px;
|
||||
--size-control: 40px;
|
||||
--space-cell: 13px;
|
||||
--motion-duration: 120ms;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"color.bg": "#101a13",
|
||||
"color.surface": "#16231a",
|
||||
"color.text": "#d4e8d9",
|
||||
"color.muted": "#a4bfa9",
|
||||
"color.border": "#36533e",
|
||||
"color.accent": "#579574",
|
||||
"color.on-accent": "#101810",
|
||||
"color.danger": "#ffafa5",
|
||||
"color.success": "#a2d3ab",
|
||||
"radius.control": "0px",
|
||||
"font.body": "Consolas, \"Courier New\", monospace",
|
||||
"font.heading": "Consolas, \"Courier New\", monospace",
|
||||
"space.unit": "4px",
|
||||
"space.section": "26px",
|
||||
"size.control": "40px",
|
||||
"space.cell": "13px",
|
||||
"motion.duration": "120ms",
|
||||
"layout.kind": "terminal"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
:root {
|
||||
--color-bg: #eaf0e9;
|
||||
--color-surface: #ffffff;
|
||||
--color-text: #202622;
|
||||
--color-muted: #59635e;
|
||||
--color-border: #b6cbbb;
|
||||
--color-accent: #26754b;
|
||||
--color-on-accent: #ffffff;
|
||||
--color-danger: #a22923;
|
||||
--color-success: #26623b;
|
||||
--radius-control: 0px;
|
||||
--font-body: Consolas, "Courier New", monospace;
|
||||
--font-heading: Consolas, "Courier New", monospace;
|
||||
--space-unit: 4px;
|
||||
--space-section: 26px;
|
||||
--size-control: 40px;
|
||||
--space-cell: 13px;
|
||||
--motion-duration: 120ms;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"color.bg": "#eaf0e9",
|
||||
"color.surface": "#ffffff",
|
||||
"color.text": "#202622",
|
||||
"color.muted": "#59635e",
|
||||
"color.border": "#b6cbbb",
|
||||
"color.accent": "#26754b",
|
||||
"color.on-accent": "#ffffff",
|
||||
"color.danger": "#a22923",
|
||||
"color.success": "#26623b",
|
||||
"radius.control": "0px",
|
||||
"font.body": "Consolas, \"Courier New\", monospace",
|
||||
"font.heading": "Consolas, \"Courier New\", monospace",
|
||||
"space.unit": "4px",
|
||||
"space.section": "26px",
|
||||
"size.control": "40px",
|
||||
"space.cell": "13px",
|
||||
"motion.duration": "120ms",
|
||||
"layout.kind": "terminal"
|
||||
}
|
||||
Reference in new issue
Block a user