Skip to content

Commit 7c86861

Browse files
committed
refactor: local storage
1 parent bc23969 commit 7c86861

File tree

10 files changed

+451
-142
lines changed

10 files changed

+451
-142
lines changed

public/apps/apps.json

Lines changed: 71 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,10 @@
11
{
2-
"Whimsical Tools": {
3-
"name": "Whimsical Tools",
4-
"description": "Playful generators and tools for creative and imaginative tasks.",
2+
"Games": {
3+
"name": "Games",
4+
"description": "Playable games to test your skills, memory, and luck.",
55
"icon": "GameControllerIcon",
66
"order": 1,
77
"apps": [
8-
{
9-
"slug": "codename-generator",
10-
"to": "/apps/codename-generator",
11-
"title": "Codename Generator",
12-
"description": "Generate cool, spy-ish project names.",
13-
"icon": "ShieldCheckIcon"
14-
},
15-
{
16-
"slug": "fantasy-name-generator",
17-
"to": "/apps/fantasy-name-generator",
18-
"title": "Fantasy Name Generator",
19-
"description": "Generate fantasy names for characters, places, and items.",
20-
"icon": "SparkleIcon"
21-
},
22-
{
23-
"slug": "picker-wheel",
24-
"to": "/apps/picker-wheel",
25-
"title": "Picker Wheel",
26-
"description": "A spinning wheel to pick a random winner from a list of entries.",
27-
"icon": "CircleDashedIcon"
28-
},
29-
{
30-
"slug": "tournament-bracket",
31-
"to": "/apps/tournament-bracket",
32-
"title": "Tournament Bracket",
33-
"description": "Create and manage tournament brackets.",
34-
"icon": "ListNumbersIcon"
35-
},
36-
{
37-
"slug": "dice-roller",
38-
"to": "/apps/dice-roller",
39-
"title": "Dice Roller",
40-
"description": "Roll various types of dice for your games and adventures.",
41-
"icon": "DiceSixIcon"
42-
},
43-
{
44-
"slug": "excuse-generator",
45-
"to": "/apps/excuse-generator",
46-
"title": "Excuse Generator",
47-
"description": "Generate funny and absurd excuses for any situation.",
48-
"icon": "SmileyWinkIcon"
49-
},
50-
{
51-
"slug": "magic-8-ball",
52-
"to": "/apps/magic-8-ball",
53-
"title": "Magic 8-Ball",
54-
"description": "Ask a yes/no question and let the Magic 8-Ball reveal your fate!",
55-
"icon": "QuestionIcon"
56-
},
578
{
589
"slug": "card-game",
5910
"to": "/apps/card-game",
@@ -130,14 +81,78 @@
13081
"title": "Whack-a-Bug",
13182
"description": "Test your reflexes by fixing bugs as fast as you can!",
13283
"icon": "BugIcon"
84+
},
85+
{
86+
"slug": "simon-says",
87+
"to": "/apps/simon-says",
88+
"title": "Simon Says",
89+
"description": "Test your memory by repeating the sequence of lights.",
90+
"icon": "CirclesFourIcon"
91+
}
92+
]
93+
},
94+
"Whimsical Tools": {
95+
"name": "Whimsical Tools",
96+
"description": "Playful generators and tools for creative and imaginative tasks.",
97+
"icon": "SparkleIcon",
98+
"order": 2,
99+
"apps": [
100+
{
101+
"slug": "codename-generator",
102+
"to": "/apps/codename-generator",
103+
"title": "Codename Generator",
104+
"description": "Generate cool, spy-ish project names.",
105+
"icon": "ShieldCheckIcon"
106+
},
107+
{
108+
"slug": "fantasy-name-generator",
109+
"to": "/apps/fantasy-name-generator",
110+
"title": "Fantasy Name Generator",
111+
"description": "Generate fantasy names for characters, places, and items.",
112+
"icon": "SparkleIcon"
113+
},
114+
{
115+
"slug": "picker-wheel",
116+
"to": "/apps/picker-wheel",
117+
"title": "Picker Wheel",
118+
"description": "A spinning wheel to pick a random winner from a list of entries.",
119+
"icon": "CircleDashedIcon"
120+
},
121+
{
122+
"slug": "tournament-bracket",
123+
"to": "/apps/tournament-bracket",
124+
"title": "Tournament Bracket",
125+
"description": "Create and manage tournament brackets.",
126+
"icon": "ListNumbersIcon"
127+
},
128+
{
129+
"slug": "dice-roller",
130+
"to": "/apps/dice-roller",
131+
"title": "Dice Roller",
132+
"description": "Roll various types of dice for your games and adventures.",
133+
"icon": "DiceSixIcon"
134+
},
135+
{
136+
"slug": "excuse-generator",
137+
"to": "/apps/excuse-generator",
138+
"title": "Excuse Generator",
139+
"description": "Generate funny and absurd excuses for any situation.",
140+
"icon": "SmileyWinkIcon"
141+
},
142+
{
143+
"slug": "magic-8-ball",
144+
"to": "/apps/magic-8-ball",
145+
"title": "Magic 8-Ball",
146+
"description": "Ask a yes/no question and let the Magic 8-Ball reveal your fate!",
147+
"icon": "QuestionIcon"
133148
}
134149
]
135150
},
136151
"Generators": {
137152
"name": "Generators",
138153
"description": "Tools for generating various types of data and content.",
139154
"icon": "MagicWandIcon",
140-
"order": 2,
155+
"order": 3,
141156
"apps": [
142157
{
143158
"slug": "json-generator",
@@ -187,7 +202,7 @@
187202
"name": "Converters",
188203
"description": "Tools for converting data formats and types.",
189204
"icon": "ArrowsLeftRightIcon",
190-
"order": 3,
205+
"order": 4,
191206
"apps": [
192207
{
193208
"slug": "json-piml-converter",
@@ -244,7 +259,7 @@
244259
"name": "Utilities",
245260
"description": "General purpose tools and helpers for various tasks.",
246261
"icon": "ToolboxIcon",
247-
"order": 4,
262+
"order": 5,
248263
"apps": [
249264
{
250265
"slug": "image-toolkit",
@@ -311,4 +326,4 @@
311326
}
312327
]
313328
}
314-
}
329+
}

src/components/AnimatedRoutes.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import WordLadderPage from '../pages/apps/WordLadderPage'; // Import WordLadderP
5959
import LightsOutPage from '../pages/apps/LightsOutPage'; // Import LightsOutPage
6060
import NonogramPage from '../pages/apps/NonogramPage'; // Import NonogramPage
6161
import WhackABugPage from '../pages/apps/WhackABugPage';
62+
import SimonSaysPage from '../pages/apps/SimonSaysPage';
6263
import SettingsPage from '../pages/SettingsPage';
6364

6465
import UsefulLinksPage from '../pages/UsefulLinksPage';
@@ -564,6 +565,10 @@ function AnimatedRoutes() {
564565
path="/apps::wab"
565566
element={<Navigate to="/apps/whack-a-bug" replace />}
566567
/>
568+
<Route
569+
path="/apps::simon"
570+
element={<Navigate to="/apps/simon-says" replace />}
571+
/>
567572
{/* End of hardcoded redirects */}
568573
<Route
569574
path="/apps/ip"
@@ -1140,6 +1145,20 @@ function AnimatedRoutes() {
11401145
</motion.div>
11411146
}
11421147
/>
1148+
<Route
1149+
path="/apps/simon-says"
1150+
element={
1151+
<motion.div
1152+
initial="initial"
1153+
animate="in"
1154+
exit="out"
1155+
variants={pageVariants}
1156+
transition={pageTransition}
1157+
>
1158+
<SimonSaysPage />
1159+
</motion.div>
1160+
}
1161+
/>
11431162
{/* D&D specific 404 page */}
11441163
<Route
11451164
path="/stories/*"

src/components/CommandPalette.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AnimatePresence, motion } from 'framer-motion';
44
import useSearchableData from '../hooks/useSearchableData';
55
import { useAnimation } from '../context/AnimationContext';
66
import { useToast } from '../hooks/useToast';
7-
import { SIDEBAR_KEYS, remove as removeLocalStorageItem } from '../utils/LocalStorageManager';
7+
import { KEY_SIDEBAR_STATE, remove as removeLocalStorageItem } from '../utils/LocalStorageManager';
88
import { version } from '../version'; // Import the version
99
import LiveClock from './LiveClock'; // Import LiveClock
1010
import GenerativeArt from './GenerativeArt'; // Import GenerativeArt
@@ -47,9 +47,7 @@ const CommandPalette = ({ isOpen, setIsOpen, openGenericModal, toggleDigitalRain
4747
});
4848
break;
4949
case 'resetSidebarState':
50-
SIDEBAR_KEYS.forEach((key) => {
51-
removeLocalStorageItem(key);
52-
});
50+
removeLocalStorageItem(KEY_SIDEBAR_STATE);
5351
addToast({
5452
title: 'Success',
5553
message: 'Sidebar state has been reset. The page will now reload.',

0 commit comments

Comments
 (0)