From 29a2bae7d9897b7a06a45e3f64e29fee552cda03 Mon Sep 17 00:00:00 2001
From: Maxim Dolgolyov
Date: Sat, 30 May 2026 10:31:05 +0300
Subject: [PATCH] =?UTF-8?q?feat(phys8=20hub):=20Phase=205=20=E2=80=94=20hu?=
=?UTF-8?q?b=20polish=20+=20cross-cutting?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Hub улучшения:
- .ch-card: подъём на hover (-6px scale 1.01) с тематической box-shadow
по цвету главы.
- .ch-cover::after: shimmer-overlay при наведении (diagonal sweep).
- .ch-cover-wm: micro-перемещение и scale на hover.
- .ch-action svg: стрелка едет вправо на hover.
- .po-xp: пульсирующая тень для overall progress XP-badge (3s loop).
Accessibility:
- aria-label на каждой ch-card с понятным названием темы.
- :focus-visible с 3px outline в brand-цвете для chapter cards.
- :focus-visible с белым outline для hdr-btn на градиенте.
- prefers-reduced-motion: блокирует все анимации.
Mobile responsiveness:
- @media ≤580px: уменьшение шрифта h1 1.4rem, ch-cover-wm 3.8rem.
Footer: '40 параграфов, 7 ЛР, 47 IV-6 интерактивов'.
---
backend/scripts/redesign_p8_hub.cjs | 79 +++++++++++++++++++++++++++
frontend/textbooks/physics_8_hub.html | 46 ++++++++++++++--
2 files changed, 121 insertions(+), 4 deletions(-)
create mode 100644 backend/scripts/redesign_p8_hub.cjs
diff --git a/backend/scripts/redesign_p8_hub.cjs b/backend/scripts/redesign_p8_hub.cjs
new file mode 100644
index 0000000..d94d50d
--- /dev/null
+++ b/backend/scripts/redesign_p8_hub.cjs
@@ -0,0 +1,79 @@
+// Phase 5 — Hub polish: добавить тематические SVG watermarks для каждой
+// chapter-карточки, hover-микро-анимации, live-индикатор прогресса.
+'use strict';
+const fs = require('fs');
+const path = require('path');
+
+const DST = path.join(__dirname, '..', '..', 'frontend', 'textbooks', 'physics_8_hub.html');
+let h = fs.readFileSync(DST, 'utf8');
+
+// === 1. Add hub-level animations CSS (inline into ', HUB_EXTRA_CSS + '\n');
+ console.log('Hub polish CSS injected');
+}
+
+// === 2. Make chapter card titles accessibility-friendly + add aria-labels ===
+// Add aria-label на каждую .ch-card если её нет
+const cardLabels = {
+ 'ch1-card': 'Глава 1: Тепловые явления',
+ 'ch2-card': 'Глава 2: Электромагнитные явления',
+ 'ch3-card': 'Глава 3: Световые явления',
+ 'ch4-card': 'Лабораторный практикум — 7 ЛР'
+};
+for (const [cls, label] of Object.entries(cardLabels)) {
+ const regex = new RegExp(`(]*class="ch-card ${cls}"[^>]*)>`, 'g');
+ h = h.replace(regex, (match, before) => {
+ if (/aria-label=/.test(before)) return match;
+ return `${before} aria-label="${label}">`;
+ });
+}
+
+// === 3. Footer "Created with..." note (or replace existing if any) ===
+// Optional — add a soft footer
+const FOOTER_HTML = `
+
+`;
+if (!h.includes('47 IV-6 интерактивов')) {
+ h = h.replace('
@@ -238,7 +271,7 @@ html.dark .final-cta-sub{color:#c4b5fd}
-
+
Q
Глава 1
@@ -258,7 +291,7 @@ html.dark .final-cta-sub{color:#c4b5fd}
-
+
I
Глава 2
@@ -278,7 +311,7 @@ html.dark .final-cta-sub{color:#c4b5fd}
-
+
F
Глава 3
@@ -298,7 +331,7 @@ html.dark .final-cta-sub{color:#c4b5fd}
-
+
ЛР
Лаборатория
@@ -858,5 +891,10 @@ if (document.readyState === 'loading') {
window.addEventListener('focus', loadProgress);
+
+
+