From 74a198addc39aea097967847c1813993f4d015f5 Mon Sep 17 00:00:00 2001 From: Peppa Date: Sat, 14 Nov 2026 16:34:19 +0500 Subject: [PATCH] =?UTF-8?q?HWT-2:=20=D0=B4=D0=B8=D0=B7=D0=B0=D0=B9=D0=BD?= =?UTF-8?q?=20=D0=B2=20=D1=81=D1=82=D0=B8=D0=BB=D0=B5=20Apple=20=E2=80=94?= =?UTF-8?q?=20=D1=82=D0=BE=D0=BA=D0=B5=D0=BD=D1=8B,=20=D1=82=D1=91=D0=BC?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F=20=D1=82=D0=B5=D0=BC=D0=B0,=20=D1=81=D1=82?= =?UTF-8?q?=D0=B5=D0=BA=D0=BB=D1=8F=D0=BD=D0=BD=D0=B0=D1=8F=20=D1=88=D0=B0?= =?UTF-8?q?=D0=BF=D0=BA=D0=B0,=20=D0=BA=D0=B0=D1=80=D1=82=D0=BE=D1=87?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B8=20pill-=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- index.html | 4 + openspec/changes/hwt-2-apple-style/tasks.md | 10 +- styles.css | 334 ++++++++++++++++---- 3 files changed, 277 insertions(+), 71 deletions(-) diff --git a/index.html b/index.html index fb2c936..6a43fec 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,10 @@ + + + + HelloWorldTrello diff --git a/openspec/changes/hwt-2-apple-style/tasks.md b/openspec/changes/hwt-2-apple-style/tasks.md index 7626f47..7f3e115 100644 --- a/openspec/changes/hwt-2-apple-style/tasks.md +++ b/openspec/changes/hwt-2-apple-style/tasks.md @@ -1,13 +1,13 @@ ## 1. Дизайн-токены и база -- [ ] 1.1 Переписать `:root` на токены Apple-палитры (светлая) + тёмная тема в `prefers-color-scheme: dark`; системный шрифтовой стек; `meta theme-color` в `index.html` +- [x] 1.1 Переписать `:root` на токены Apple-палитры (светлая) + тёмная тема в `prefers-color-scheme: dark`; системный шрифтовой стек; `meta theme-color` в `index.html` ## 2. Компоненты -- [ ] 2.1 Шапка: sticky, полупрозрачный фон + backdrop-filter с fallback; поле и pill-кнопка «+ Столбец» -- [ ] 2.2 Столбцы, карточки, drag-over/dragging, кнопка удаления (hover/focus, всегда при `hover: none`), форма добавления карточки -- [ ] 2.3 Переходы и `prefers-reduced-motion: reduce` +- [x] 2.1 Шапка: sticky, полупрозрачный фон + backdrop-filter с fallback; поле и pill-кнопка «+ Столбец» +- [x] 2.2 Столбцы, карточки, drag-over/dragging, кнопка удаления (hover/focus, всегда при `hover: none`), форма добавления карточки +- [x] 2.3 Переходы и `prefers-reduced-motion: reduce` ## 3. Проверка -- [ ] 3.1 `node --check app.js`, статическая проверка CSS (баланс скобок, все классы из app.js покрыты), `openspec validate hwt-2-apple-style --strict` +- [x] 3.1 `node --check app.js`, статическая проверка CSS (баланс скобок, все классы из app.js покрыты), `openspec validate hwt-2-apple-style --strict` diff --git a/styles.css b/styles.css index f28af5a..e407419 100644 --- a/styles.css +++ b/styles.css @@ -1,16 +1,68 @@ +/* HWT-2: визуальный стиль в духе Apple (см. openspec/specs/board-visual-style) */ + :root { - color-scheme: light; - --bg: #f4f5f7; - --header-bg: #ffffff; - --column-bg: #ebecf0; + color-scheme: light dark; + + --bg: #f5f5f7; + --header-bg: rgba(251, 251, 253, 0.72); + --header-bg-solid: rgba(251, 251, 253, 0.94); + --column-bg: rgba(255, 255, 255, 0.6); + --column-border: rgba(0, 0, 0, 0.06); --card-bg: #ffffff; - --text: #172b4d; - --muted: #5e6c84; - --accent: #0079bf; + --input-bg: rgba(118, 118, 128, 0.12); + --input-bg-focus: #ffffff; + --text: #1d1d1f; + --muted: #6e6e73; + --accent: #0071e3; + --accent-hover: #0077ed; --accent-contrast: #ffffff; - --danger: #b04632; - --border: #dfe1e6; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; + --accent-ring: rgba(0, 113, 227, 0.32); + --accent-tint: rgba(0, 113, 227, 0.1); + --danger: #ff3b30; + --separator: rgba(0, 0, 0, 0.08); + + --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06); + --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04); + --shadow-column: 0 1px 2px rgba(0, 0, 0, 0.03), 0 8px 24px rgba(0, 0, 0, 0.04); + + --radius-column: 16px; + --radius-card: 12px; + --radius-input: 10px; + --radius-pill: 999px; + + --ease: cubic-bezier(0.25, 0.1, 0.25, 1); + --duration: 0.2s; + + font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", + "Helvetica Neue", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + letter-spacing: -0.01em; +} + +@media (prefers-color-scheme: dark) { + :root { + --bg: #000000; + --header-bg: rgba(22, 22, 23, 0.72); + --header-bg-solid: rgba(22, 22, 23, 0.94); + --column-bg: #1c1c1e; + --column-border: rgba(255, 255, 255, 0.06); + --card-bg: #2c2c2e; + --input-bg: rgba(118, 118, 128, 0.24); + --input-bg-focus: #1c1c1e; + --text: #f5f5f7; + --muted: #98989d; + --accent: #0a84ff; + --accent-hover: #409cff; + --accent-ring: rgba(10, 132, 255, 0.4); + --accent-tint: rgba(10, 132, 255, 0.16); + --danger: #ff453a; + --separator: rgba(255, 255, 255, 0.1); + + --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4); + --shadow-card-hover: 0 6px 16px rgba(0, 0, 0, 0.5); + --shadow-column: none; + } } * { @@ -22,20 +74,39 @@ body { background: var(--bg); color: var(--text); min-height: 100vh; + font-size: 15px; + line-height: 1.4; } +/* --- шапка: полупрозрачная, размытая, закреплена сверху --- */ + .app-header { + position: sticky; + top: 0; + z-index: 10; display: flex; + flex-wrap: wrap; align-items: center; - gap: 24px; - padding: 12px 20px; - background: var(--header-bg); - border-bottom: 1px solid var(--border); + justify-content: space-between; + gap: 12px 24px; + padding: 14px 28px; + background: var(--header-bg-solid); + border-bottom: 1px solid var(--separator); +} + +@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { + .app-header { + background: var(--header-bg); + -webkit-backdrop-filter: saturate(180%) blur(20px); + backdrop-filter: saturate(180%) blur(20px); + } } .app-header h1 { - font-size: 18px; margin: 0; + font-size: 21px; + font-weight: 600; + letter-spacing: -0.02em; } .add-column-form { @@ -43,49 +114,94 @@ body { gap: 8px; } -.add-column-form input { - padding: 6px 10px; - border: 1px solid var(--border); - border-radius: 4px; +/* --- поля ввода в стиле iOS --- */ + +input[type="text"] { + font: inherit; font-size: 14px; - min-width: 200px; + color: var(--text); + background: var(--input-bg); + border: 1px solid transparent; + border-radius: var(--radius-input); + padding: 8px 12px; + outline: none; + transition: background var(--duration) var(--ease), box-shadow var(--duration) var(--ease), + border-color var(--duration) var(--ease); } +input[type="text"]::placeholder { + color: var(--muted); +} + +input[type="text"]:focus { + background: var(--input-bg-focus); + border-color: var(--accent); + box-shadow: 0 0 0 4px var(--accent-ring); +} + +.add-column-form input { + min-width: 220px; +} + +/* --- pill-кнопки --- */ + button { + font: inherit; + font-size: 14px; + font-weight: 500; cursor: pointer; border: none; - border-radius: 4px; - padding: 6px 12px; - font-size: 14px; + border-radius: var(--radius-pill); + padding: 8px 16px; background: var(--accent); color: var(--accent-contrast); + transition: background var(--duration) var(--ease), transform var(--duration) var(--ease), + opacity var(--duration) var(--ease), color var(--duration) var(--ease); } button:hover { - opacity: 0.9; + background: var(--accent-hover); } +button:active { + transform: scale(0.96); +} + +button:focus-visible { + outline: none; + box-shadow: 0 0 0 4px var(--accent-ring); +} + +/* --- доска --- */ + .board { display: flex; - gap: 16px; - padding: 20px; + gap: 20px; + padding: 28px; align-items: flex-start; overflow-x: auto; } .empty-hint { color: var(--muted); + font-size: 17px; + margin: 48px auto; + text-align: center; } +/* --- столбцы --- */ + .column { background: var(--column-bg); - border-radius: 6px; - width: 260px; - flex: 0 0 260px; - padding: 10px; + border: 1px solid var(--column-border); + border-radius: var(--radius-column); + box-shadow: var(--shadow-column); + width: 280px; + flex: 0 0 280px; + padding: 14px; display: flex; flex-direction: column; - gap: 8px; + gap: 10px; } .column-header { @@ -95,78 +211,120 @@ button:hover { gap: 6px; } -.column-title { +.column .column-title { font-weight: 600; - font-size: 15px; - border: none; + font-size: 17px; + letter-spacing: -0.02em; background: transparent; - color: var(--text); + border-color: transparent; width: 100%; - padding: 2px 4px; - border-radius: 3px; + padding: 4px 8px; + border-radius: 8px; } -.column-title:hover, -.column-title:focus { - background: #ffffff80; - outline: none; +.column .column-title:hover { + background: var(--input-bg); +} + +.column .column-title:focus { + background: var(--input-bg-focus); + border-color: var(--accent); + box-shadow: 0 0 0 4px var(--accent-ring); } .card-list { display: flex; flex-direction: column; - gap: 6px; - min-height: 10px; + gap: 8px; + min-height: 12px; + border-radius: var(--radius-card); + transition: background var(--duration) var(--ease), box-shadow var(--duration) var(--ease); } .card-list.drag-over { - background: #0079bf22; - border-radius: 4px; + background: var(--accent-tint); + box-shadow: 0 0 0 2px var(--accent-tint); } +/* --- карточки --- */ + .card { background: var(--card-bg); - border-radius: 4px; - padding: 8px 10px; - box-shadow: 0 1px 0 #091e4240; + border-radius: var(--radius-card); + padding: 10px 10px 10px 12px; + box-shadow: var(--shadow-card); display: flex; justify-content: space-between; - align-items: flex-start; + align-items: center; gap: 6px; + cursor: grab; + transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease), + opacity var(--duration) var(--ease); +} + +.card:hover { + box-shadow: var(--shadow-card-hover); + transform: translateY(-1px); +} + +.card:active { + cursor: grabbing; } .card.dragging { opacity: 0.4; + transform: scale(0.98); } -.card-text { +.card .card-text { flex: 1; - border: none; + min-width: 0; background: transparent; - color: var(--text); - font-size: 14px; - padding: 2px; - resize: none; - font-family: inherit; + border-color: transparent; + font-size: 15px; + padding: 2px 4px; + border-radius: 6px; } -.card-text:focus { - outline: 1px solid var(--accent); - border-radius: 3px; +.card .card-text:focus { + background: transparent; + border-color: var(--accent); + box-shadow: 0 0 0 3px var(--accent-ring); } .card-delete { + flex: 0 0 auto; + width: 24px; + height: 24px; + padding: 0; + display: inline-flex; + align-items: center; + justify-content: center; + font-size: 16px; + line-height: 1; background: transparent; color: var(--muted); - padding: 2px 6px; - font-size: 14px; - line-height: 1; + opacity: 0; +} + +.card:hover .card-delete, +.card:focus-within .card-delete { + opacity: 1; } .card-delete:hover { + background: var(--input-bg); color: var(--danger); } +@media (hover: none) { + .card-delete { + opacity: 1; + } +} + +/* --- форма добавления карточки --- */ + .add-card-form { display: flex; gap: 6px; @@ -174,8 +332,52 @@ button:hover { .add-card-form input { flex: 1; - padding: 6px 8px; - border: 1px solid var(--border); - border-radius: 4px; - font-size: 14px; + min-width: 0; +} + +.add-card-form button { + width: 34px; + height: 34px; + padding: 0; + font-size: 20px; + line-height: 1; +} + +/* --- узкие экраны --- */ + +@media (max-width: 600px) { + .app-header { + padding: 12px 16px; + } + + .add-column-form { + width: 100%; + } + + .add-column-form input { + flex: 1; + min-width: 0; + } + + .board { + padding: 16px; + gap: 14px; + } +} + +/* --- уважение «Уменьшить движение» --- */ + +@media (prefers-reduced-motion: reduce) { + *, + *::before, + *::after { + transition: none !important; + animation: none !important; + } + + .card:hover, + .card.dragging, + button:active { + transform: none; + } }