Skip to content

Commit 9e36670

Browse files
committed
feat: are you not entertained achievements.
1 parent fb54c68 commit 9e36670

File tree

9 files changed

+196
-14
lines changed

9 files changed

+196
-14
lines changed

src/App.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import ScrollToTop from './components/ScrollToTop';
77
import ContactModal from './components/ContactModal';
88
import GenericModal from './components/GenericModal';
99
import DigitalRain from './components/DigitalRain';
10+
import BSOD from './components/BSOD'; // Import BSOD
1011
import { AnimationProvider } from './context/AnimationContext'; // Import AnimationProvider
1112
import { CommandPaletteProvider } from './context/CommandPaletteContext';
1213
import { VisualSettingsProvider } from './context/VisualSettingsContext';
@@ -22,6 +23,8 @@ function App() {
2223
content: null,
2324
});
2425
const [isRainActive, setIsRainActive] = useState(false); // State for Digital Rain
26+
const [isBSODActive, setIsBSODActive] = useState(false); // State for BSOD
27+
2528
const toggleModal = () => {
2629
setIsModalOpen(!isModalOpen);
2730
};
@@ -42,6 +45,9 @@ function App() {
4245
const toggleDigitalRain = () => {
4346
setIsRainActive((prev) => !prev);
4447
};
48+
const toggleBSOD = () => {
49+
setIsBSODActive((prev) => !prev);
50+
};
4551

4652
return (
4753
<AnimationProvider>
@@ -51,6 +57,7 @@ function App() {
5157
<AchievementListeners />
5258
<VisualSettingsProvider>
5359
<DigitalRain isActive={isRainActive} />
60+
<BSOD isActive={isBSODActive} toggleBSOD={toggleBSOD} />
5461
<ScrollToTop />
5562
<CommandPaletteProvider>
5663
<Layout
@@ -59,6 +66,7 @@ function App() {
5966
toggleSearch={toggleSearch}
6067
openGenericModal={openGenericModal}
6168
toggleDigitalRain={toggleDigitalRain}
69+
toggleBSOD={toggleBSOD}
6270
>
6371
<AnimatedRoutes />
6472
</Layout>

src/components/AchievementListeners.js

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,27 @@ const AchievementListeners = () => {
66
const [konamiIndex, setKonamiIndex] = useState(0);
77

88
const [cheaterIndex, setCheaterIndex] = useState(0);
9-
// Night Owl Check
9+
// Night Owl Check
10+
useEffect(() => {
11+
const checkNightOwl = () => {
12+
const now = new Date();
13+
const hour = now.getHours();
14+
// Between 3 AM (03:00) and 5 AM (05:00)
15+
if (hour >= 3 && hour < 5) {
16+
unlockAchievement('night_owl');
17+
}
18+
};
19+
checkNightOwl();
20+
}, [unlockAchievement]);
1021

11-
useEffect(() => {
12-
const checkNightOwl = () => {
13-
const now = new Date();
14-
const hour = now.getHours();
15-
// Between 3 AM (03:00) and 5 AM (05:00)
16-
if (hour >= 3 && hour < 5) {
17-
unlockAchievement('night_owl');
22+
// Time Traveller Check
23+
useEffect(() => {
24+
if (new Date().getFullYear() < 2000) {
25+
unlockAchievement('time_traveller_system');
1826
}
19-
};
27+
}, [unlockAchievement]);
2028

21-
checkNightOwl();
22-
}, [unlockAchievement]);
23-
// Konami Code Listener
29+
// Konami Code Listener
2430
useEffect(() => {
2531
// Konami Code Sequence: Up, Up, Down, Down, Left, Right, Left, Right, B, A
2632
const konamiCode = [

src/components/AnimatedRoutes.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ const NotebookViewerPage = lazy(
144144
const NewsPage = lazy(() => import('../pages/NewsPage'));
145145
const CommandsPage = lazy(() => import('../pages/CommandsPage'));
146146
const AchievementsPage = lazy(() => import('../pages/AchievementsPage'));
147+
const SitemapPage = lazy(() => import('../pages/SitemapPage'));
147148

148149
const pageVariants = {
149150
initial: {
@@ -573,6 +574,22 @@ function AnimatedRoutes() {
573574
</motion.div>
574575
}
575576
/>
577+
<Route
578+
path="/sitemap"
579+
element={
580+
<motion.div
581+
initial="initial"
582+
animate="in"
583+
exit="out"
584+
variants={pageVariants}
585+
transition={pageTransition}
586+
>
587+
<Suspense fallback={<Loading />}>
588+
<SitemapPage />
589+
</Suspense>
590+
</motion.div>
591+
}
592+
/>
576593
{/* Hardcoded redirects for fc::apps:: paths */}
577594
<Route
578595
path="/apps::pinned"

src/components/BSOD.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import React, { useEffect } from 'react';
2+
3+
const BSOD = ({ isActive, toggleBSOD }) => {
4+
useEffect(() => {
5+
if (!isActive) return;
6+
7+
const handleKeyDown = () => {
8+
toggleBSOD();
9+
};
10+
11+
window.addEventListener('keydown', handleKeyDown);
12+
return () => window.removeEventListener('keydown', handleKeyDown);
13+
}, [isActive, toggleBSOD]);
14+
15+
if (!isActive) return null;
16+
17+
return (
18+
<div
19+
className="fixed inset-0 bg-[#0000AA] text-white font-mono p-4 sm:p-10 z-[9999] text-base sm:text-xl overflow-hidden cursor-pointer select-none flex flex-col"
20+
onClick={toggleBSOD}
21+
>
22+
<p>A problem has been detected and Fezcodex has been shut down to prevent damage to your browser.</p>
23+
<br />
24+
<p className="mb-8 font-bold">FEZ_CODEX_FATAL_ERROR</p>
25+
<p>If this is the first time you've seen this stop error screen, restart your computer. If this screen appears again, follow these steps:</p>
26+
<br />
27+
<p>Check to make sure any new hardware or software is properly installed. If this is a new installation, ask your hardware or software manufacturer for any Windows updates you might need.</p>
28+
<br />
29+
<p>If problems continue, disable or remove any newly installed hardware or software. Disable BIOS memory options such as caching or shadowing.</p>
30+
<br />
31+
<p>Technical Information:</p>
32+
<br />
33+
<p>*** STOP: 0x00000000 (0x00000000, 0x00000000, 0x00000000, 0x00000000)</p>
34+
<br />
35+
<p className="mt-4">Beginning dump of physical memory...</p>
36+
<p>Physical memory dump complete.</p>
37+
<p>Contact your system administrator or technical support group for further assistance.</p>
38+
<div className="absolute bottom-10 left-4 sm:left-10 animate-pulse">
39+
Press any key to reboot...
40+
</div>
41+
</div>
42+
);
43+
};
44+
45+
export default BSOD;

src/components/CommandPalette.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const CommandPalette = ({
3838
setIsOpen,
3939
openGenericModal,
4040
toggleDigitalRain,
41+
toggleBSOD,
4142
}) => {
4243
const [searchTerm, setSearchTerm] = useState('');
4344
const [selectedIndex, setSelectedIndex] = useState(0);
@@ -102,12 +103,20 @@ const CommandPalette = ({
102103
if (lowerTerm === 'hello?' || lowerTerm === 'is anyone there?') {
103104
unlockAchievement('echo_in_the_void');
104105
}
106+
if (lowerTerm === 'command palette' || lowerTerm === 'the hacker') {
107+
unlockAchievement('the_paradox');
108+
}
105109
}, [searchTerm, unlockAchievement]);
106110

107111
useEffect(() => {
108112
setSelectedIndex(0);
109113
}, [searchTerm, items]);
110114

115+
const triggerBSOD = () => {
116+
unlockAchievement('bsod');
117+
toggleBSOD();
118+
};
119+
111120
const handleItemClick = (item) => {
112121
if (!item) return;
113122

@@ -596,7 +605,10 @@ const CommandPalette = ({
596605
);
597606
} else if (event.key === 'Enter') {
598607
event.preventDefault();
599-
if (filteredItems[selectedIndex]) {
608+
if (searchTerm.toLowerCase() === 'bsod') {
609+
triggerBSOD();
610+
handleClose();
611+
} else if (filteredItems[selectedIndex]) {
600612
handleItemClick(filteredItems[selectedIndex]);
601613
}
602614
} else if (event.key === 'Escape') {
@@ -616,7 +628,14 @@ const CommandPalette = ({
616628

617629
window.addEventListener('keydown', handleKeyDown);
618630
return () => window.removeEventListener('keydown', handleKeyDown);
619-
}, [isOpen, filteredItems, selectedIndex, isAnimationEnabled]);
631+
}, [
632+
isOpen,
633+
filteredItems,
634+
selectedIndex,
635+
isAnimationEnabled,
636+
searchTerm,
637+
triggerBSOD,
638+
]);
620639

621640
useEffect(() => {
622641
const selectedItem = resultsRef.current?.children[selectedIndex];

src/components/DigitalRain.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,38 @@
11
import React, { useRef, useEffect, memo } from 'react';
2+
import { useAchievements } from '../context/AchievementContext';
23

34
const DigitalRain = memo(({ isActive }) => {
45
const canvasRef = useRef(null);
6+
const { unlockAchievement } = useAchievements();
7+
const idleTimerRef = useRef(null);
8+
9+
useEffect(() => {
10+
if (!isActive) {
11+
clearTimeout(idleTimerRef.current);
12+
return;
13+
}
14+
15+
const resetTimer = () => {
16+
clearTimeout(idleTimerRef.current);
17+
idleTimerRef.current = setTimeout(() => {
18+
unlockAchievement('the_void_stares_back');
19+
}, 60000); // 1 minute
20+
};
21+
22+
window.addEventListener('mousemove', resetTimer);
23+
window.addEventListener('keydown', resetTimer);
24+
window.addEventListener('click', resetTimer);
25+
26+
// Start initial timer
27+
resetTimer();
28+
29+
return () => {
30+
window.removeEventListener('mousemove', resetTimer);
31+
window.removeEventListener('keydown', resetTimer);
32+
window.removeEventListener('click', resetTimer);
33+
clearTimeout(idleTimerRef.current);
34+
};
35+
}, [isActive, unlockAchievement]);
536

637
useEffect(() => {
738
if (!isActive) return;

src/components/Layout.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const Layout = ({
2222
toggleSearch,
2323
openGenericModal,
2424
toggleDigitalRain,
25+
toggleBSOD,
2526
}) => {
2627
const [isSidebarOpen, setIsSidebarOpen] = useState(window.innerWidth > 768);
2728
const { isPaletteOpen, setIsPaletteOpen } = useCommandPalette();
@@ -68,6 +69,7 @@ const Layout = ({
6869
setIsOpen={setIsPaletteOpen}
6970
openGenericModal={openGenericModal}
7071
toggleDigitalRain={toggleDigitalRain}
72+
toggleBSOD={toggleBSOD}
7173
/>
7274
<div className="bg-gray-950 min-h-screen font-sans flex">
7375
<Sidebar

src/config/achievements.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,41 @@ export const ACHIEVEMENTS = [
751751
icon: <PhoneIcon size={32} weight="duotone" />,
752752
category: 'Secret',
753753
},
754+
{
755+
id: 'time_traveller_system',
756+
title: 'Time Traveller',
757+
description: 'Go back to where it all began.',
758+
icon: <TimerIcon size={32} weight="duotone" />,
759+
category: 'Secret',
760+
},
761+
{
762+
id: 'the_paradox',
763+
title: 'The Paradox',
764+
description: 'Look for the tool within the tool.',
765+
icon: <QuestionMarkIcon size={32} weight="duotone" />,
766+
category: 'Secret',
767+
},
768+
{
769+
id: 'the_cartographer',
770+
title: 'The Cartographer',
771+
description: 'Map the territory.',
772+
icon: <CompassIcon size={32} weight="duotone" />,
773+
category: 'Secret',
774+
},
775+
{
776+
id: 'the_void_stares_back',
777+
title: 'The Void Stares Back',
778+
description: 'Stare into the abyss...',
779+
icon: <EyeIcon size={32} weight="duotone" />,
780+
category: 'Secret',
781+
},
782+
{
783+
id: 'bsod',
784+
title: 'Fatal Error',
785+
description: '0x00000000',
786+
icon: <SkullIcon size={32} weight="duotone" />,
787+
category: 'Secret',
788+
},
754789
{
755790
id: 'clean_slate',
756791
title: 'Clean Slate',

src/pages/SitemapPage.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React, { useEffect } from 'react';
2+
import { useAchievements } from '../context/AchievementContext';
3+
4+
const SitemapPage = () => {
5+
const { unlockAchievement } = useAchievements();
6+
7+
useEffect(() => {
8+
unlockAchievement('the_cartographer');
9+
window.location.href = '/sitemap.xml';
10+
}, [unlockAchievement]);
11+
12+
return (
13+
<div className="p-10 text-center text-white text-xl">
14+
<h1>Redirecting to Sitemap...</h1>
15+
</div>
16+
);
17+
};
18+
19+
export default SitemapPage;

0 commit comments

Comments
 (0)