Skip to content

Commit 9dcdfab

Browse files
committed
added custom cursor, secrets :3
1 parent ad802f6 commit 9dcdfab

File tree

13 files changed

+259
-174
lines changed

13 files changed

+259
-174
lines changed

src/App.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Navbar from "@/components/Navbar";
44
import AboutPage from "@/pages/AboutPage";
55
import ProjectsPage from "@/pages/ProjectsPage";
66
import APCSPPage from "@/pages/APCSPPage";
7-
import ParallaxPage from "@/pages/ParallaxPage";
87
import FoxGame from "@/games/fox-adventure/components/FoxGame";
98
import { useState, useEffect } from "react";
109

@@ -39,7 +38,6 @@ const App = () => {
3938
return (
4039
<Router>
4140
<div className={`min-h-screen bg-background-primary ${isGameActive ? 'game-active' : ''}`}>
42-
{/* Background Logo */}
4341
<div className="fixed inset-0 z-behind pointer-events-none">
4442
<div className="absolute inset-0">
4543
<img
@@ -50,15 +48,13 @@ const App = () => {
5048
</div>
5149
</div>
5250

53-
{/* Main Content */}
5451
<div className="relative">
5552
<Navbar />
5653
<main className="content-wrapper section-spacing">
5754
<Routes>
5855
<Route path="/" element={<AboutPage />} />
5956
<Route path="/projects" element={<ProjectsPage />} />
6057
<Route path="/apcsp" element={<APCSPPage />} />
61-
{/* <Route path="/parallax" element={<ParallaxPage />} /> */}
6258
<Route path="*" element={
6359
<div className="flex flex-col items-center justify-center min-h-[60vh] space-y-4">
6460
<h1 className="text-4xl font-bold text-glow">404: Page Not Found</h1>
@@ -69,7 +65,6 @@ const App = () => {
6965
</main>
7066
</div>
7167

72-
{/* Fox Game Overlay */}
7368
{isGameActive && <FoxGame />}
7469
</div>
7570
</Router>

src/assets/cursors/default.svg

Lines changed: 21 additions & 0 deletions
Loading

src/assets/cursors/paw.svg

Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 26 additions & 0 deletions
Loading

src/components/VNCViewer.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1-
import React, { useState } from 'react';
1+
import { useState } from 'react';
22
import { Monitor, Power, Lock } from 'lucide-react';
33

44
const VNCViewer = () => {
5-
const [isFullscreen, setIsFullscreen] = useState(false);
65
const [isConnected, setIsConnected] = useState(false);
76

87
const toggleFullscreen = () => {
98
const iframe = document.getElementById('vnc-iframe');
109
if (iframe) {
1110
if (!document.fullscreenElement) {
1211
iframe.requestFullscreen();
13-
setIsFullscreen(true);
1412
} else {
1513
document.exitFullscreen();
16-
setIsFullscreen(false);
1714
}
1815
}
1916
};
2017

2118
return (
2219
<div className="min-h-screen w-full flex items-center justify-center p-4">
2320
<div className="w-full max-w-6xl bg-background-primary/80 backdrop-blur-sm rounded-xl shadow-xl border border-accent-primary/20 overflow-hidden transition-all duration-300 hover:border-accent-neon/40 hover:shadow-accent-primary/20">
24-
{/* Header */}
2521
<div className="flex items-center justify-between p-4 border-b border-accent-primary/20">
2622
<div className="flex items-center gap-3">
2723
<Monitor className="text-accent-primary" size={24} />
@@ -49,7 +45,6 @@ const VNCViewer = () => {
4945
</div>
5046
</div>
5147

52-
{/* VNC Viewer */}
5348
<div className="aspect-video w-full bg-black/50 relative">
5449
{isConnected ? (
5550
<iframe
@@ -66,7 +61,6 @@ const VNCViewer = () => {
6661
)}
6762
</div>
6863

69-
{/* Status Bar */}
7064
<div className="p-2 border-t border-accent-primary/20 flex justify-between items-center text-sm text-text-primary/60">
7165
<span>Status: {isConnected ? 'Connected' : 'Disconnected'}</span>
7266
<span>Press ESC to exit fullscreen</span>

src/games/fox-adventure/components/GameOverlay.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// src/games/fox-adventure/components/GameOverlay.tsx
2-
import React from 'react';
2+
import { Play, RotateCcw } from 'lucide-react';
33
import useGameStore from '../state/gameStore';
4-
import { Play, Pause, RotateCcw } from 'lucide-react';
54

65
export const GameOverlay: React.FC = () => {
76
const { gameStatus, score, startNewGame, resumeGame } = useGameStore();

src/games/fox-adventure/hooks/useGameLoop.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const useGameLoop = () => {
3232

3333
if (gameStore.gameStatus === 'PLAYING') {
3434
// Update entities
35-
gameStore.updateEnemies();
35+
gameStore.updateEnemies(deltaTime);
3636

3737
// Spawn collectibles
3838
spawnCollectible();
@@ -75,4 +75,5 @@ export const useGameLoop = () => {
7575
}
7676
};
7777
}, []);
78-
};
78+
};
79+

src/games/fox-adventure/state/gameStore.ts

Lines changed: 6 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,5 @@
11
import { create } from 'zustand';
2-
3-
interface Position {
4-
x: number;
5-
y: number;
6-
}
7-
8-
interface PowerUp {
9-
id: string;
10-
type: 'SPEED' | 'SHIELD' | 'MAGNET';
11-
duration: number;
12-
position: Position;
13-
}
14-
15-
interface Collectible {
16-
id: string;
17-
type: 'STAR' | 'GEM' | 'KEY';
18-
value: number;
19-
position: Position;
20-
}
21-
22-
interface Enemy {
23-
id: string;
24-
type: 'WOLF' | 'OWL' | 'HUNTER';
25-
position: Position;
26-
direction: Position;
27-
speed: number;
28-
}
29-
30-
interface PlayerState {
31-
position: Position;
32-
health: number;
33-
speed: number;
34-
powerUps: PowerUp[];
35-
isInvincible: boolean;
36-
hasKey: boolean;
37-
}
38-
39-
interface GameState {
40-
player: PlayerState;
41-
enemies: Enemy[];
42-
collectibles: Collectible[];
43-
powerUps: PowerUp[];
44-
score: number;
45-
level: number;
46-
gameStatus: 'MENU' | 'PLAYING' | 'PAUSED' | 'GAME_OVER';
47-
highScores: number[];
48-
timePlayed: number;
49-
50-
// Actions
51-
movePlayer: (direction: Position) => void;
52-
updateEnemies: () => void;
53-
collectItem: (itemId: string) => void;
54-
takeDamage: (amount: number) => void;
55-
activatePowerUp: (powerUpId: string) => void;
56-
startNewGame: () => void;
57-
pauseGame: () => void;
58-
resumeGame: () => void;
59-
}
2+
import type { GameState, Position } from '@/types/game';
603

614
const useGameStore = create<GameState>((set, get) => ({
625
player: {
@@ -76,7 +19,7 @@ const useGameStore = create<GameState>((set, get) => ({
7619
highScores: [],
7720
timePlayed: 0,
7821

79-
movePlayer: (direction) => {
22+
movePlayer: (direction: Position) => {
8023
const { player } = get();
8124
set({
8225
player: {
@@ -112,8 +55,8 @@ const useGameStore = create<GameState>((set, get) => ({
11255
set({ enemies: updatedEnemies });
11356
},
11457

115-
collectItem: (itemId) => {
116-
const { collectibles, score, player } = get();
58+
collectItem: (itemId: string) => {
59+
const { collectibles, score } = get();
11760
const item = collectibles.find(c => c.id === itemId);
11861
if (!item) return;
11962

@@ -123,7 +66,7 @@ const useGameStore = create<GameState>((set, get) => ({
12366
});
12467
},
12568

126-
takeDamage: (amount) => {
69+
takeDamage: (amount: number) => {
12770
const { player, gameStatus } = get();
12871
if (player.isInvincible) return;
12972

@@ -137,7 +80,7 @@ const useGameStore = create<GameState>((set, get) => ({
13780
});
13881
},
13982

140-
activatePowerUp: (powerUpId) => {
83+
activatePowerUp: (powerUpId: string) => {
14184
const { player, powerUps } = get();
14285
const powerUp = powerUps.find(p => p.id === powerUpId);
14386
if (!powerUp) return;
@@ -150,7 +93,6 @@ const useGameStore = create<GameState>((set, get) => ({
15093
powerUps: powerUps.filter(p => p.id !== powerUpId)
15194
});
15295

153-
// Reset power-up after duration
15496
setTimeout(() => {
15597
const currentPlayer = get().player;
15698
set({

0 commit comments

Comments
 (0)