Этап 3: экраны чтения по макету

- API: GET /api/tree, GET /api/articles/:slug, раздача /uploads
- экраны: Главная, Раздел, Статья, Шпаргалка, Избранное (телефон и компьютер)
- блоки статьи, чек-листы с сохранением в localStorage (ключ slug + версия)
- просмотр фото: щипок, двойной тап, свайп, клавиатура
- липкая шапка с прогрессом, оглавление в bottom sheet, избранное, недавние
- три темы (тёмная / светлая / солнце), выбор запоминается
- печать и PDF: окно настроек, печатная версия статьи и шпаргалки с QR
- дизайн-токены в tokens.css, шрифт Onest в сборке
- scripts/check-layout.mjs: проверка отсутствия горизонтальной прокрутки
- исправлены два невидимых символа, на которые ругался линтер

Lighthouse mobile: Performance 95-96, Accessibility 100.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deonisii
2026-10-04 12:33:37 +03:00
co-authored by Claude Opus 5.5
parent be9be3f79e
commit 59be0307cc
39 changed files with 5816 additions and 38 deletions
+70
View File
@@ -0,0 +1,70 @@
// Иконки из макета: 24×24, линия 2, скруглённые концы, цвет текста.
import type { ReactNode } from 'react';
function Svg({ children, size = 24, fill = 'none' }: { children: ReactNode; size?: number; fill?: string }) {
return (
<svg
width={size}
height={size}
viewBox="0 0 24 24"
fill={fill}
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
className="icon"
>
{children}
</svg>
);
}
type P = { size?: number };
export const IconHome = (p: P) => (
<Svg {...p}>
<path d="M3 11l9-7 9 7" />
<path d="M5 10v10h14V10" />
</Svg>
);
export const IconSearch = (p: P) => (
<Svg {...p}>
<circle cx="11" cy="11" r="7" />
<path d="M16.5 16.5L21 21" />
</Svg>
);
export const IconDoc = (p: P) => (
<Svg {...p}>
<rect x="4" y="3" width="16" height="18" rx="2" />
<path d="M8 8h8M8 12h8M8 16h5" />
</Svg>
);
export const IconStar = ({ size, filled }: P & { filled?: boolean }) => (
<Svg size={size} fill={filled ? 'var(--hl)' : 'none'}>
<path d="M12 3.5l2.6 5.3 5.9.9-4.2 4.1 1 5.8-5.3-2.8-5.3 2.8 1-5.8-4.2-4.1 5.9-.9z" />
</Svg>
);
export const IconList = (p: P) => (
<Svg {...p}>
<path d="M4 6h16M4 12h16M4 18h10" />
</Svg>
);
export const IconPrint = (p: P) => (
<Svg {...p}>
<path d="M7 9V3h10v6" />
<rect x="3" y="9" width="18" height="8" rx="2" />
<path d="M7 14h10v7H7z" />
</Svg>
);
export const IconTheme = (p: P) => (
<Svg {...p}>
<circle cx="12" cy="12" r="8" />
<path d="M12 4a8 8 0 0 1 0 16z" fill="currentColor" />
</Svg>
);
export const IconUp = (p: P) => (
<Svg {...p}>
<path d="M12 20V5M5 11l7-7 7 7" />
</Svg>
);