Skip to content

Commit 0121a11

Browse files
Fixing some stuff
1 parent a325b33 commit 0121a11

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

client/src/pages/index.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ import {
1111
} from "@/components/ui/eventHighlightCard";
1212
import Explosion from "@/components/ui/Explosion";
1313
import LandingGames from "@/components/ui/landingGames";
14+
import { useExplosionContext } from "@/contexts/ExplosionContext";
1415
import { UiEvent, useEvents } from "@/hooks/useEvents";
1516

1617
export default function Landing() {
1718
const [showExplosion, setShowExplosion] = useState(false);
1819
const [isShaking, setIsShaking] = useState(false);
1920

21+
const { triggerExplosionAt } = useExplosionContext();
2022
const handleExplode = () => {
2123
if (showExplosion) return;
2224

@@ -25,6 +27,15 @@ export default function Landing() {
2527
// Trigger screen shake
2628
setIsShaking(true);
2729
setTimeout(() => setIsShaking(false), 400);
30+
31+
for (let i = 0; i < 10; i++) {
32+
setTimeout(() => {
33+
// Random position with 10% margin from edges
34+
const x = window.innerWidth * (0.1 + Math.random() * 0.8);
35+
const y = window.innerHeight * (0.1 + Math.random() * 0.8);
36+
triggerExplosionAt(x, y);
37+
}, i * 50); // Stagger by 50ms
38+
}
2839
};
2940

3041
const { data, isPending, isError, isFetching } = useEvents({

0 commit comments

Comments
 (0)