Skip to content

Commit 8549c8f

Browse files
committed
feat: easter surprise
1 parent 3665aab commit 8549c8f

File tree

10 files changed

+464
-2
lines changed

10 files changed

+464
-2
lines changed

package-lock.json

Lines changed: 74 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
"remark-gfm": "^4.0.1",
5454
"socket.io": "^4.8.1",
5555
"socket.io-client": "^4.8.1",
56-
"tailwindcss": "^4.1.13"
56+
"tailwindcss": "^4.1.13",
57+
"three": "^0.183.2"
5758
},
5859
"devDependencies": {
5960
"@eslint/js": "^9.36.0",
@@ -66,6 +67,7 @@
6667
"@types/pg": "^8.15.5",
6768
"@types/react": "^19.1.13",
6869
"@types/react-dom": "^19.1.9",
70+
"@types/three": "^0.183.1",
6971
"@types/ws": "^8.18.1",
7072
"@vitejs/plugin-react": "^5.0.3",
7173
"cross-env": "^10.1.0",
6.35 MB
Binary file not shown.

public/assets/april/song.mp3

448 KB
Binary file not shown.
1.23 MB
Loading
1.07 MB
Loading
436 KB
Loading
435 KB
Loading

src/pages/Flights.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { steps } from '../components/tutorial/TutorialStepsFlights';
1414
import { updateTutorialStatus } from '../utils/fetch/auth';
1515
import { getChartsForAirport } from '../utils/acars';
1616
import { createChartHandlers } from '../utils/charts';
17+
import { tryPlayAprilCowEasterEgg } from '../utils/aprilCowEasterEgg';
1718
import { useData } from '../hooks/data/useData';
1819
import type { Flight } from '../types/flight';
1920
import type { Position } from '../types/session';
@@ -131,6 +132,7 @@ export default function Flights() {
131132
const flightsSocketConnectedRef = useRef(false);
132133
const arrivalsSocketConnectedRef = useRef(false);
133134
const sessionUsersSocketConnectedRef = useRef(false);
135+
const aprilCowTriggeredRef = useRef(false);
134136

135137
useEffect(() => {
136138
userRef.current = user;
@@ -259,6 +261,14 @@ export default function Flights() {
259261
accessError,
260262
]);
261263

264+
useEffect(() => {
265+
if (!sessionId || !accessId || accessError) return;
266+
if (aprilCowTriggeredRef.current) return;
267+
268+
aprilCowTriggeredRef.current = true;
269+
void tryPlayAprilCowEasterEgg();
270+
}, [sessionId, accessId, accessError]);
271+
262272
useEffect(() => {
263273
if (!sessionId || !accessId || !initialLoadComplete || accessError) return;
264274

0 commit comments

Comments
 (0)