Skip to content

Commit 97aa22a

Browse files
committed
feat: add cryptic hard achievements and obscure existing secrets
1 parent acc4a1e commit 97aa22a

File tree

4 files changed

+80
-2
lines changed

4 files changed

+80
-2
lines changed

src/components/CommandPalette.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ const CommandPalette = ({
9797
}
9898
}, [isOpen, unlockAchievement]);
9999

100+
useEffect(() => {
101+
const lowerTerm = searchTerm.toLowerCase();
102+
if (lowerTerm === 'hello?' || lowerTerm === 'is anyone there?') {
103+
unlockAchievement('echo_in_the_void');
104+
}
105+
}, [searchTerm, unlockAchievement]);
106+
100107
useEffect(() => {
101108
setSelectedIndex(0);
102109
}, [searchTerm, items]);

src/config/achievements.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,4 +715,25 @@ export const ACHIEVEMENTS = [
715715
icon: <MetronomeIcon size={32} weight="duotone" />,
716716
category: 'Secret',
717717
},
718+
{
719+
id: 'echo_in_the_void',
720+
title: 'Echo in the Void',
721+
description: 'Call out where no one listens.',
722+
icon: <GhostIcon size={32} weight="duotone" />,
723+
category: 'Secret',
724+
},
725+
{
726+
id: 'chaos_theory',
727+
title: 'Chaos Theory',
728+
description: 'The world shifts beneath your feet.',
729+
icon: <ArrowsClockwiseIcon size={32} weight="duotone" />,
730+
category: 'Secret',
731+
},
732+
{
733+
id: 'glitch_in_the_matrix',
734+
title: 'Glitch in the Matrix',
735+
description: 'Seek the paths that do not exist.',
736+
icon: <SkullIcon size={32} weight="duotone" />,
737+
category: 'Secret',
738+
},
718739
];

src/context/VisualSettingsContext.js

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { createContext, useContext, useEffect } from 'react';
1+
import React, { createContext, useContext, useEffect, useRef } from 'react';
22
import usePersistentState from '../hooks/usePersistentState';
33
import { useAchievements } from './AchievementContext';
44

@@ -10,6 +10,8 @@ export const useVisualSettings = () => {
1010

1111
export const VisualSettingsProvider = ({ children }) => {
1212
const { unlockAchievement } = useAchievements();
13+
const themeChangeTimestamps = useRef([]); // Track theme changes
14+
1315
const [isInverted, setIsInverted] = usePersistentState('is-inverted', false);
1416
const [isRetro, setIsRetro] = usePersistentState('is-retro', false);
1517
const [isParty, setIsParty] = usePersistentState('is-party', false);
@@ -41,6 +43,42 @@ export const VisualSettingsProvider = ({ children }) => {
4143
const [isAutumn, setIsAutumn] = usePersistentState('is-autumn', false);
4244
const [isRain, setIsRain] = usePersistentState('is-rain', false);
4345

46+
// Chaos Theory Achievement Tracker
47+
useEffect(() => {
48+
const now = Date.now();
49+
// Filter timestamps older than 10 seconds
50+
themeChangeTimestamps.current = themeChangeTimestamps.current.filter(
51+
(t) => now - t < 10000,
52+
);
53+
// Add current timestamp
54+
themeChangeTimestamps.current.push(now);
55+
56+
// Check if 10 changes happened in 10 seconds
57+
if (themeChangeTimestamps.current.length >= 10) {
58+
unlockAchievement('chaos_theory');
59+
}
60+
}, [
61+
isInverted,
62+
isRetro,
63+
isParty,
64+
isMirror,
65+
isNoir,
66+
isTerminal,
67+
isBlueprint,
68+
isSepia,
69+
isVaporwave,
70+
isCyberpunk,
71+
isGameboy,
72+
isComic,
73+
isSketchbook,
74+
isHellenic,
75+
isGlitch,
76+
isGarden,
77+
isAutumn,
78+
isRain,
79+
unlockAchievement,
80+
]);
81+
4482
useEffect(() => {
4583
if (isInverted) {
4684
document.body.classList.add('invert-mode');

src/pages/NotFoundPage.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
import React from 'react';
1+
import React, { useEffect } from 'react';
22
import { Link } from 'react-router-dom';
33
import { ArrowLeftIcon } from '@phosphor-icons/react';
44
import Seo from '../components/Seo';
5+
import { useAchievements } from '../context/AchievementContext';
56

67
const NotFoundPage = () => {
8+
const { unlockAchievement } = useAchievements();
9+
10+
useEffect(() => {
11+
const visits = parseInt(localStorage.getItem('wrongs') || '0', 10) + 1;
12+
localStorage.setItem('wrongs', visits.toString());
13+
14+
if (visits >= 3) {
15+
unlockAchievement('glitch_in_the_matrix');
16+
}
17+
}, [unlockAchievement]);
18+
719
return (
820
<div className="text-center mt-20 mb-20">
921
<Seo

0 commit comments

Comments
 (0)