veza/apps/web/src/components/theme/ThemeSwitcher.tsx

110 lines
3.4 KiB
TypeScript
Raw Normal View History

import { Palette } from 'lucide-react';
interface ThemeSwitcherProps {
currentTheme: string;
onThemeChange: (theme: string) => void;
}
const themes = [
{
id: 'cyber',
name: 'Cyber',
colors: ['#66FCF1', '#FF00FF'],
description: 'Neon Cyan & Magenta',
gradient: 'linear-gradient(135deg, #66FCF1 0%, #FF00FF 100%)',
},
{
id: 'ocean',
name: 'Ocean',
colors: ['#0EA5E9', '#06B6D4'],
description: 'Sky Blue & Teal',
gradient: 'linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%)',
},
{
id: 'forest',
name: 'Forest',
colors: ['#22C55E', '#84CC16'],
description: 'Green & Lime',
gradient: 'linear-gradient(135deg, #22C55E 0%, #84CC16 100%)',
},
{
id: 'sunset',
name: 'Sunset',
colors: ['#F97316', '#A855F7'],
description: 'Orange & Purple',
gradient: 'linear-gradient(135deg, #F97316 0%, #A855F7 100%)',
},
];
export function ThemeSwitcher({
currentTheme,
onThemeChange,
}: ThemeSwitcherProps) {
return (
<div className="space-y-6">
<div className="flex items-center gap-4">
<div className="w-10 h-10 rounded-xl bg-kodo-cyan flex items-center justify-center">
<Palette className="w-5 h-5 text-white" />
</div>
<div>
<h3 className="text-xl font-bold text-white">Color Theme</h3>
<p className="text-sm text-kodo-secondary">
Choose your visual style
</p>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
{themes.map((theme) => (
<button
key={theme.id}
onClick={() => onThemeChange(theme.id)}
className={`group relative p-8 rounded-2xl border-2 transition-all duration-[var(--duration-normal)] text-left overflow-hidden ${
currentTheme === theme.id
? 'border-kodo-cyan bg-kodo-cyan/10 shadow-lg shadow-kodo-cyan/20'
: 'border-white/10 bg-kodo-graphite/50 hover:border-white/30 hover:bg-kodo-graphite'
}`}
>
{/* Gradient Background */}
<div
className="absolute inset-0 opacity-10 group-hover:opacity-20 transition-opacity"
style={{ background: theme.gradient }}
/>
{/* Content */}
<div className="relative z-10">
<div className="flex items-center gap-4 mb-3">
<div className="flex gap-2">
{theme.colors.map((color, i) => (
<div
key={i}
className="w-10 h-10 rounded-lg shadow-lg transition-opacity group-hover:opacity-80"
style={{ backgroundColor: color }}
/>
))}
</div>
</div>
<div className="mb-2">
<div className="font-bold text-lg text-white mb-1">
{theme.name}
</div>
<div className="text-sm text-kodo-secondary">
{theme.description}
</div>
</div>
{currentTheme === theme.id && (
<div className="flex items-center gap-2 text-kodo-steel font-mono text-sm animate-slide-in-left">
<div className="w-2 h-2 rounded-full bg-kodo-cyan animate-glow-pulse" />
Active Theme
</div>
)}
</div>
</button>
))}
</div>
</div>
);
}