Files
portfolio/app/components/ThemeToggle.tsx
denshooter 96ec2d867f feat: plakat redesign phase 1 (tokens, fonts, poster hero, header) (#74)
- New design tokens: signal red, ink and paper as RGB channels; ink and paper
  swap roles in dark mode so every component inverts cleanly
- Fonts via next/font: Bricolage Grotesque (with wdth/opsz axes), Geist,
  Geist Mono; drop Inter and Playfair
- Poster hero: kicker, giant DK0 wordmark that reacts to pointer distance
  (weight and width through a damped spring, desktop only, off for reduced
  motion), claim as h1, intro with thesis countdown, marquee strip
- Header in poster style: transparent over the red hero, paper strip with
  ink rule when scrolled or on subpages; drawer menu restyled
- Remove wavy SVG separators, CSS shader gradient, background blobs and
  unused providers that caused the pink/purple bands between sections
- Drop the global p/span/div color override so colors inherit properly
- New hero texts in de/en, tests and i18n key check updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 23:48:39 +02:00

40 lines
1.1 KiB
TypeScript

"use client";
import * as React from "react";
import { Monitor, Moon, Sun } from "lucide-react";
import { useTheme } from "./ThemeProvider";
export function ThemeToggle() {
const { theme, setTheme } = useTheme();
const [mounted, setMounted] = React.useState(false);
React.useEffect(() => {
setMounted(true);
}, []);
if (!mounted) {
return <div className="ml-1 h-9 w-9" />;
}
const cycle = () => {
const next = theme === "system" ? "light" : theme === "light" ? "dark" : "system";
setTheme(next);
};
return (
<button
onClick={cycle}
className="ml-1 rounded-full border-[1.5px] border-ink p-2 text-ink transition-[background-color,color,transform] duration-150 ease-out hover:bg-ink hover:text-paper active:scale-[0.97]"
aria-label={`Current theme: ${theme}. Click to switch.`}
title={theme === "system" ? "System" : theme === "dark" ? "Dark" : "Light"}
>
{theme === "system" ? (
<Monitor size={16} />
) : theme === "dark" ? (
<Sun size={16} />
) : (
<Moon size={16} />
)}
</button>
);
}