From 7114f984991fba4f070baa49683a6ff7598ed102 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 7 Dec 2025 18:24:18 +0000 Subject: [PATCH] Changes --- src/components/TerminalCommand.tsx | 16 +++++++++----- src/contexts/AchievementsContext.tsx | 33 +++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/src/components/TerminalCommand.tsx b/src/components/TerminalCommand.tsx index 907306e..5071b8e 100644 --- a/src/components/TerminalCommand.tsx +++ b/src/components/TerminalCommand.tsx @@ -27,6 +27,7 @@ const commands: Record = { '/chat': '/ai', '/achievements': '/achievements', '/ach': '/achievements', + '/a': '/achievements', }; const helpText = `Available commands: @@ -43,10 +44,15 @@ const helpText = `Available commands: /breakout - Play Breakout /music, /m - Navigate to Music Player /ai, /chat - Navigate to AI Chat + /achievements - View achievements /help, /h - Show this help message - /clear, /c - Clear terminal output + /clear, /c - Clear terminal output`; - ...there may be other commands.`; +const helpHint = ` + ╔══════════════════════════════════════════╗ + ║ ...there may be other commands. ║ + ║ Perhaps a HINT to an easter egg exists? ║ + ╚══════════════════════════════════════════╝`; const TerminalCommand = () => { const [isOpen, setIsOpen] = useState(false); @@ -114,7 +120,7 @@ const TerminalCommand = () => { unlockAchievement('terminal_user'); if (trimmedInput === '/help' || trimmedInput === '/h') { - setOutput(prev => [...prev, helpText]); + setOutput(prev => [...prev, helpText, '---HINT---' + helpHint]); } else if (trimmedInput === '/hint') { unlockAchievement('hint_seeker'); setOutput(prev => [...prev, @@ -186,8 +192,8 @@ const TerminalCommand = () => { className="h-48 overflow-y-auto p-4 font-mono text-sm text-primary/90" > {output.map((line, i) => ( -
- {line} +
+ {line.startsWith('---HINT---') ? line.replace('---HINT---', '') : line}
))}
diff --git a/src/contexts/AchievementsContext.tsx b/src/contexts/AchievementsContext.tsx index 55ee8b1..d510e5f 100644 --- a/src/contexts/AchievementsContext.tsx +++ b/src/contexts/AchievementsContext.tsx @@ -40,11 +40,11 @@ const defaultAchievements: Achievement[] = [ { id: 'all_pages', name: 'Completionist', description: 'Visit every page on the site', icon: '🗺️', unlocked: false, secret: true }, // Time achievements - { id: 'time_1min', name: 'Quick Visit', description: 'Spend 1 minute on the site', icon: '⏱️', unlocked: false }, - { id: 'time_5min', name: 'Taking Your Time', description: 'Spend 5 minutes on the site', icon: '⏰', unlocked: false }, - { id: 'time_15min', name: 'Deep Dive', description: 'Spend 15 minutes on the site', icon: '🕐', unlocked: false }, - { id: 'time_30min', name: 'Marathon Session', description: 'Spend 30 minutes on the site', icon: '🕑', unlocked: false, secret: true }, - { id: 'time_1hour', name: 'No Life', description: 'Spend 1 hour on the site', icon: '💀', unlocked: false, secret: true }, + { id: 'time_5min', name: 'Quick Visit', description: 'Spend 5 minutes on the site', icon: '⏱️', unlocked: false }, + { id: 'time_15min', name: 'Taking Your Time', description: 'Spend 15 minutes on the site', icon: '⏰', unlocked: false }, + { id: 'time_30min', name: 'Deep Dive', description: 'Spend 30 minutes on the site', icon: '🕐', unlocked: false }, + { id: 'time_1hour', name: 'Marathon Session', description: 'Spend 1 hour on the site', icon: '🕑', unlocked: false, secret: true }, + { id: 'time_2hour', name: 'No Life', description: 'Spend 2 hours on the site', icon: '💀', unlocked: false, secret: true }, // Game achievements { id: 'tetris_played', name: 'Block Stacker', description: 'Play Tetris', icon: '🧱', unlocked: false }, @@ -125,11 +125,11 @@ export const AchievementsProvider = ({ children }: { children: ReactNode }) => { // Check time-based achievements useEffect(() => { - if (timeOnSite >= 60) unlockAchievement('time_1min'); if (timeOnSite >= 300) unlockAchievement('time_5min'); if (timeOnSite >= 900) unlockAchievement('time_15min'); if (timeOnSite >= 1800) unlockAchievement('time_30min'); if (timeOnSite >= 3600) unlockAchievement('time_1hour'); + if (timeOnSite >= 7200) unlockAchievement('time_2hour'); }, [timeOnSite]); // Check time of day achievements @@ -187,11 +187,17 @@ export const AchievementsProvider = ({ children }: { children: ReactNode }) => { unlockAchievement('first_visit'); }, []); + const [notification, setNotification] = useState(null); + const unlockAchievement = useCallback((id: string) => { setAchievements(prev => { const achievement = prev.find(a => a.id === id); if (!achievement || achievement.unlocked) return prev; + // Show notification + setNotification(achievement); + setTimeout(() => setNotification(null), 4000); + const updated = prev.map(a => a.id === id ? { ...a, unlocked: true, unlockedAt: Date.now() } : a ); @@ -224,6 +230,21 @@ export const AchievementsProvider = ({ children }: { children: ReactNode }) => { }} > {children} + {/* Achievement Notification */} + {notification && ( +
+
+
+ {notification.icon} +
+
ACHIEVEMENT UNLOCKED!
+
{notification.name}
+
{notification.description}
+
+
+
+
+ )} ); };