feat: светлая тема как основная + переключатель тем

- CSS-переменные --bg, --surface, --ink, --mute, --accent для обеих тем
- darkMode: 'class' в Tailwind config
- ThemeToggle компонент с Sun/Moon, сохраняет выбор в localStorage
- Inline-скрипт в layout.js защищает от FOUC (FlashOfUnstyledContent)
- Авто-определение по prefers-color-scheme как fallback
- not-found.js: красивая 404 страница вместо дефолтной Next
- Обновлены все компоненты и страницы — Header, Footer, ArticleCard, page.js, blog, tag, about
This commit is contained in:
Alexey Pavlov
2026-05-31 09:07:44 +03:00
parent d8d1affcc8
commit a16bf812e4
12 changed files with 231 additions and 75 deletions
+14 -10
View File
@@ -1,22 +1,26 @@
import Link from 'next/link';
import { Sparkles, Github } from 'lucide-react';
import { Sparkles } from 'lucide-react';
import ThemeToggle from './ThemeToggle';
export default function Header() {
return (
<header className="border-b border-border/60 sticky top-0 z-20 bg-bg/85 backdrop-blur-md">
<header className="sticky top-0 z-20 border-b-soft" style={{ background: 'rgb(var(--bg) / 0.85)', backdropFilter: 'saturate(180%) blur(12px)' }}>
<div className="container-wide flex items-center justify-between py-4">
<Link href="/" className="flex items-center gap-2 group">
<div className="w-8 h-8 rounded-lg bg-accent/15 flex items-center justify-center group-hover:bg-accent/25 transition-colors">
<Sparkles className="w-4 h-4 text-accent" />
<div className="w-8 h-8 rounded-lg flex items-center justify-center transition-colors" style={{ background: 'rgb(var(--accent) / 0.12)' }}>
<Sparkles className="w-4 h-4 accent" />
</div>
<span className="font-bold text-lg tracking-tight">ZeroPost</span>
<span className="font-bold text-lg tracking-tight ink">ZeroPost</span>
</Link>
<nav className="flex items-center gap-1 sm:gap-4 text-sm">
<Link href="/" className="btn-ghost text-sm py-1.5">Статьи</Link>
<Link href="/about" className="btn-ghost text-sm py-1.5">О проекте</Link>
<a href="https://app.zeropost.ru" className="btn-primary text-sm py-1.5">
Открыть кабинет
<nav className="flex items-center gap-1 sm:gap-2 text-sm">
<Link href="/" className="btn btn-ghost text-sm py-1.5">Статьи</Link>
<Link href="/about" className="btn btn-ghost text-sm py-1.5">О проекте</Link>
<a href="https://app.zeropost.ru" className="btn btn-primary text-sm py-1.5 ml-1">
Кабинет
</a>
<div className="ml-1">
<ThemeToggle />
</div>
</nav>
</div>
</header>