Skip to content

Commit 00bb8d4

Browse files
committed
feat: theme switch command
1 parent c9eea45 commit 00bb8d4

File tree

3 files changed

+77
-4
lines changed

3 files changed

+77
-4
lines changed

src/data/commands.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,14 @@ export const commands = [
131131
],
132132
},
133133
{
134-
category: 'Visual Effects & Fun',
134+
category: 'Interface & Settings',
135135
items: [
136+
{
137+
title: 'Switch Visual Theme',
138+
description: 'Open a modal to choose between Brufez and Fezluxe aesthetics.',
139+
color: 'amber',
140+
commandId: 'switchTheme',
141+
},
136142
{
137143
title: 'Toggle Reduced Motion',
138144
description: 'Reduce or disable all animations in Fezcodex.',

src/hooks/useCommandRegistry.js

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useMemo, useCallback } from 'react';
1+
import React, { useMemo, useCallback } from 'react';
22
import { useNavigate } from 'react-router-dom';
33
import { useAnimation } from '../context/AnimationContext';
44
import { useToast } from './useToast';
@@ -9,12 +9,14 @@ import { version } from '../version';
99
import { KEY_SIDEBAR_STATE, remove as removeLocalStorageItem } from '../utils/LocalStorageManager';
1010
import LiveClock from '../components/LiveClock';
1111
import GenerativeArt from '../components/GenerativeArt';
12+
import LuxeArt from '../components/LuxeArt';
1213
import TextTransformer from '../components/TextTransformer';
1314
import Stopwatch from '../components/Stopwatch';
15+
import { BugIcon, SparkleIcon } from '@phosphor-icons/react';
1416

1517
// Wrapper for GenerativeArt to handle state locally
1618
const GenerativeArtCommand = () => {
17-
const [seed, setSeed] = useState(() => Math.random().toString(36).substring(7));
19+
const [seed, setSeed] = React.useState(() => Math.random().toString(36).substring(7));
1820

1921
const handleRegenerate = () => {
2022
setSeed(Math.random().toString(36).substring(7));
@@ -30,6 +32,48 @@ const GenerativeArtCommand = () => {
3032
);
3133
};
3234

35+
// Theme Switcher Modal Content
36+
const ThemeSwitcherContent = ({ currentTheme, onSelect }) => {
37+
return (
38+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
39+
{/* BRUFEZ */}
40+
<button
41+
onClick={() => onSelect('brutalist')}
42+
className={`group relative text-left p-8 border transition-all duration-500 rounded-sm overflow-hidden bg-[#050505] ${currentTheme === 'brutalist' ? 'border-[#10B981] shadow-[0_0_20px_rgba(16,185,129,0.2)]' : 'border-white/10 hover:border-white/30'}`}
43+
>
44+
<div className="absolute inset-0 opacity-[0.05] pointer-events-none grayscale">
45+
<GenerativeArt seed="brufez" className="w-full h-full" />
46+
</div>
47+
<div className="relative z-10">
48+
<div className={`w-12 h-12 flex items-center justify-center rounded-sm mb-6 transition-colors ${currentTheme === 'brutalist' ? 'bg-[#10B981] text-black' : 'bg-white/5 text-emerald-500 group-hover:bg-emerald-500 group-hover:text-black'}`}>
49+
<BugIcon size={24} weight="fill" />
50+
</div>
51+
<h3 className="text-2xl font-black text-white uppercase tracking-tighter mb-2">Brufez</h3>
52+
<p className="font-mono text-[10px] text-gray-500 uppercase tracking-widest leading-relaxed">Systemic Brutalism</p>
53+
</div>
54+
</button>
55+
56+
{/* FEZLUXE */}
57+
<button
58+
onClick={() => onSelect('luxe')}
59+
className={`group relative text-left p-8 border transition-all duration-500 rounded-sm overflow-hidden bg-white ${currentTheme === 'luxe' ? 'border-[#8D4004] shadow-[0_0_20px_rgba(141,64,4,0.2)]' : 'border-black/5 hover:border-black/20'}`}
60+
>
61+
<div className="absolute inset-0 opacity-[0.05] pointer-events-none">
62+
<LuxeArt seed="fezluxe" className="w-full h-full mix-blend-multiply" transparent={true} />
63+
</div>
64+
<div className="relative z-10">
65+
<div className={`w-12 h-12 flex items-center justify-center rounded-full mb-6 transition-all duration-500 ${currentTheme === 'luxe' ? 'bg-[#1A1A1A] text-white' : 'bg-[#F5F5F0] text-[#8D4004] shadow-sm group-hover:bg-[#1A1A1A] group-hover:text-white'}`}>
66+
<SparkleIcon size={24} weight="light" />
67+
</div>
68+
<h3 className="text-2xl font-playfairDisplay italic text-[#1A1A1A] mb-2 leading-none">Fezluxe</h3>
69+
<p className="font-outfit text-[10px] text-black/40 uppercase tracking-[0.2em] leading-relaxed">Refined Elegance</p>
70+
</div>
71+
</button>
72+
73+
</div>
74+
);
75+
};
76+
3377
export const useCommandRegistry = ({
3478
openGenericModal,
3579
toggleDigitalRain,
@@ -43,6 +87,7 @@ export const useCommandRegistry = ({
4387
const aboutData = useAboutData();
4488

4589
const {
90+
fezcodexTheme, setFezcodexTheme,
4691
isInverted, toggleInvert,
4792
isRetro, toggleRetro,
4893
isParty, toggleParty,
@@ -73,6 +118,22 @@ export const useCommandRegistry = ({
73118
message: `Reduced Motion has been ${!reduceMotion ? 'enabled' : 'disabled'}.`,
74119
});
75120
},
121+
switchTheme: () => {
122+
openGenericModal(
123+
'Aesthetic Configuration',
124+
<ThemeSwitcherContent
125+
currentTheme={fezcodexTheme}
126+
onSelect={(theme) => {
127+
setFezcodexTheme(theme);
128+
addToast({
129+
title: 'Aesthetic Reconfigured',
130+
message: `System interface shifted to ${theme.toUpperCase()} architecture.`,
131+
type: 'success'
132+
});
133+
}}
134+
/>
135+
);
136+
},
76137
resetSidebarState: () => {
77138
removeLocalStorageItem(KEY_SIDEBAR_STATE);
78139
addToast({
@@ -574,9 +635,10 @@ export const useCommandRegistry = ({
574635
isGlitch, toggleGlitch,
575636
isGarden, toggleGarden,
576637
isAutumn, toggleAutumn,
577-
isRain, toggleRain,
638+
toggleRain,
578639
isFalloutOverlay, toggleFalloutOverlay,
579640
falloutVariant, setFalloutVariant,
641+
fezcodexTheme, setFezcodexTheme,
580642
]);
581643

582644
const executeCommand = useCallback((commandId) => {

src/hooks/useSearchableData.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ const useSearchableData = () => {
141141
];
142142

143143
const customCommands = [
144+
{
145+
title: 'Switch Visual Theme',
146+
type: 'command',
147+
commandId: 'switchTheme',
148+
},
144149
{
145150
title: 'View Source on GitHub',
146151
type: 'command',

0 commit comments

Comments
 (0)