Skip to content

Commit c5389fb

Browse files
committed
feat: Glitch Mode.
1 parent 7595218 commit c5389fb

File tree

6 files changed

+90
-3
lines changed

6 files changed

+90
-3
lines changed

src/components/CommandPalette.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ const CommandPalette = ({isOpen, setIsOpen, openGenericModal, toggleDigitalRain}
6363
isGameboy, toggleGameboy,
6464
isComic, toggleComic,
6565
isSketchbook, toggleSketchbook,
66-
isHellenic, toggleHellenic
66+
isHellenic, toggleHellenic,
67+
isGlitch, toggleGlitch
6768
} = useVisualSettings();
6869

6970
const filteredItems = filterItems(items, searchTerm);
@@ -286,6 +287,14 @@ const CommandPalette = ({isOpen, setIsOpen, openGenericModal, toggleDigitalRain}
286287
duration: 2000
287288
});
288289
break;
290+
case 'toggleGlitchMode':
291+
toggleGlitch();
292+
addToast({
293+
title: !isGlitch ? 'Glitch Mode On' : 'Glitch Mode Off',
294+
message: !isGlitch ? 'System corruption detected.' : 'Signal stabilized.',
295+
duration: 2000
296+
});
297+
break;
289298
case 'showTime': {
290299
openGenericModal('Current Time', <LiveClock/>);
291300
break;

src/context/VisualSettingsContext.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const VisualSettingsProvider = ({children}) => {
2222
const [isComic, setIsComic] = usePersistentState('is-comic', false);
2323
const [isSketchbook, setIsSketchbook] = usePersistentState('is-sketchbook', false);
2424
const [isHellenic, setIsHellenic] = usePersistentState('is-hellenic', false);
25+
const [isGlitch, setIsGlitch] = usePersistentState('is-glitch', false);
2526

2627
useEffect(() => {
2728
if (isInverted) {
@@ -135,6 +136,14 @@ export const VisualSettingsProvider = ({children}) => {
135136
}
136137
}, [isHellenic]);
137138

139+
useEffect(() => {
140+
if (isGlitch) {
141+
document.body.classList.add('glitch-mode');
142+
} else {
143+
document.body.classList.remove('glitch-mode');
144+
}
145+
}, [isGlitch]);
146+
138147
const toggleInvert = () => setIsInverted(prev => !prev);
139148
const toggleRetro = () => setIsRetro(prev => !prev);
140149
const toggleParty = () => setIsParty(prev => !prev);
@@ -149,6 +158,7 @@ export const VisualSettingsProvider = ({children}) => {
149158
const toggleComic = () => setIsComic(prev => !prev);
150159
const toggleSketchbook = () => setIsSketchbook(prev => !prev);
151160
const toggleHellenic = () => setIsHellenic(prev => !prev);
161+
const toggleGlitch = () => setIsGlitch(prev => !prev);
152162

153163
return (
154164
<VisualSettingsContext.Provider value={{
@@ -165,7 +175,8 @@ export const VisualSettingsProvider = ({children}) => {
165175
isGameboy, toggleGameboy,
166176
isComic, toggleComic,
167177
isSketchbook, toggleSketchbook,
168-
isHellenic, toggleHellenic
178+
isHellenic, toggleHellenic,
179+
isGlitch, toggleGlitch
169180
}}>
170181
{children}
171182
</VisualSettingsContext.Provider>);

src/hooks/useSearchableData.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ const useSearchableData = () => {
118118
{ title: 'Toggle Comic Book Mode', type: 'command', commandId: 'toggleComicMode' },
119119
{ title: 'Toggle Sketchbook Mode', type: 'command', commandId: 'toggleSketchbookMode' },
120120
{ title: 'Toggle Hellenic Mode', type: 'command', commandId: 'toggleHellenicMode' },
121+
{ title: 'Toggle Dystopian Glitch Mode', type: 'command', commandId: 'toggleGlitchMode' },
121122
];
122123

123124
setItems([...staticRoutes, ...customCommands, ...allPosts, ...allProjects, ...allLogs, ...allApps]);

src/index.css

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,3 +557,60 @@ body.hellenic-mode h3 {
557557
letter-spacing: 2px;
558558
text-shadow: 1px 1px 0 #d4af37;
559559
}
560+
561+
/* Dystopian Glitch Mode */
562+
body.glitch-mode {
563+
background-color: #0a0a0a !important;
564+
color: #dcdcdc !important;
565+
font-family: 'VT323', 'Courier New', monospace !important;
566+
}
567+
568+
body.glitch-mode::before {
569+
content: " ";
570+
display: block;
571+
position: fixed;
572+
top: 0;
573+
left: 0;
574+
bottom: 0;
575+
right: 0;
576+
background: repeating-linear-gradient(transparent 0px, transparent 2px, #222 3px);
577+
pointer-events: none;
578+
z-index: 1000;
579+
opacity: 0.3;
580+
}
581+
582+
body.glitch-mode * {
583+
border-color: #333 !important;
584+
box-shadow: -2px 0 0 rgba(255,0,0,.5), 2px 0 0 rgba(0,255,255,.5);
585+
}
586+
587+
body.glitch-mode a {
588+
color: #ff003c !important;
589+
text-shadow: 2px 0 #00fff9, -2px 0 #ff00c1;
590+
text-decoration: line-through;
591+
}
592+
593+
body.glitch-mode a:hover {
594+
text-decoration: none;
595+
background: #ff003c;
596+
color: #fff !important;
597+
}
598+
599+
body.glitch-mode img {
600+
filter: grayscale(100%) contrast(2);
601+
mix-blend-mode: hard-light;
602+
clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
603+
}
604+
605+
@keyframes glitch-anim {
606+
0% { transform: translate(0) }
607+
20% { transform: translate(-2px, 2px) }
608+
40% { transform: translate(-2px, -2px) }
609+
60% { transform: translate(2px, 2px) }
610+
80% { transform: translate(2px, -2px) }
611+
100% { transform: translate(0) }
612+
}
613+
614+
body.glitch-mode h1, body.glitch-mode h2, body.glitch-mode h3 {
615+
animation: glitch-anim 2s infinite;
616+
}

src/pages/CommandsPage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const commandsData = [
6161
{ title: "Toggle Comic Book Mode", description: "Switch to a vibrant pop-art comic style. (Easter Egg)", color: "red" },
6262
{ title: "Toggle Sketchbook Mode", description: "Switch to a hand-drawn sketchbook style. (Easter Egg)", color: "stone" },
6363
{ title: "Toggle Hellenic Mode", description: "Switch to a classical Greek architecture style. (Easter Egg)", color: "amber" },
64+
{ title: "Toggle Dystopian Glitch Mode", description: "Switch to a corrupted digital data style. (Easter Egg)", color: "slate" },
6465
]
6566
},
6667
{

src/pages/SettingsPage.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ const SettingsPage = () => {
4747
isGameboy, toggleGameboy,
4848
isComic, toggleComic,
4949
isSketchbook, toggleSketchbook,
50-
isHellenic, toggleHellenic
50+
isHellenic, toggleHellenic,
51+
isGlitch, toggleGlitch
5152
} = useVisualSettings();
5253

5354
const {addToast} = useToast();
@@ -273,6 +274,13 @@ const SettingsPage = () => {
273274
checked={isHellenic}
274275
onChange={toggleHellenic}
275276
/>
277+
<div className="mb-4"></div>
278+
<CustomToggle
279+
id="enable-glitch-mode"
280+
label="> Dystopian Glitch Mode"
281+
checked={isGlitch}
282+
onChange={toggleGlitch}
283+
/>
276284
</div>
277285
{/* Sidebar Stuff */}
278286
<h1 className="text-3xl font-arvo font-normal mb-4 text-app">

0 commit comments

Comments
 (0)