Skip to content

Commit fe0bc2f

Browse files
committed
Drop end-of-competition refs.
1 parent 68dfbc7 commit fe0bc2f

7 files changed

Lines changed: 63 additions & 391 deletions

File tree

‎bun.lock‎

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"@types/d3": "^7.4.3",
1515
"@types/node": "^25.6.2",
1616
"@types/react-dom": "^19.2.3",
17-
"canvas-confetti": "^1.9.4",
1817
"class-variance-authority": "^0.7.1",
1918
"clsx": "^2.1.1",
2019
"d3": "^7.9.0",

‎src/components/Layout.tsx‎

Lines changed: 58 additions & 196 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
22
import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet';
3-
import { useIsOSFP, useTheme } from '@/lib/theme';
3+
import { useTheme } from '@/lib/theme';
44
import { cn } from '@/lib/utils';
55
import { Menu, Moon, Sun } from 'lucide-react';
66
import React from 'react';
@@ -51,82 +51,66 @@ interface NavbarProps {
5151
lastUpdateTime: Date | null;
5252
}
5353

54+
// Konami code (↑ ↑ ↓ ↓ ← → ← → B A) — the trigger for the hidden minigame.
55+
const KONAMI_SEQUENCE = [
56+
'ArrowUp',
57+
'ArrowUp',
58+
'ArrowDown',
59+
'ArrowDown',
60+
'ArrowLeft',
61+
'ArrowRight',
62+
'ArrowLeft',
63+
'ArrowRight',
64+
'b',
65+
'a',
66+
];
67+
5468
/**
55-
* Basketball "OSFP mode" button. Lives next to the dark/light toggle and
56-
* lights up red when the theme is active — a small joke for the Olympiacos
57-
* Final Four day, intentionally opt-in so the everyday dark/light flow is
58-
* untouched.
69+
* Hidden basketball minigame — a leftover easter egg from the live event.
70+
* There's deliberately no button: enter the Konami code anywhere on the page
71+
* to tip off. A small reward for the curious now that the competition is over.
5972
*/
60-
const OSFPToggle = ({ size = 16 }: { size?: number }) => {
61-
const { isOsfpEnabled, toggleOSFP } = useTheme();
62-
const [showGame, setShowGame] = React.useState(false);
63-
const holdTimer = React.useRef<ReturnType<typeof setTimeout> | null>(null);
64-
const longPressed = React.useRef(false);
65-
const active = isOsfpEnabled;
66-
67-
const handlePointerDown = () => {
68-
longPressed.current = false;
69-
holdTimer.current = setTimeout(() => {
70-
longPressed.current = true;
71-
setShowGame(true);
72-
}, 1000);
73-
};
74-
75-
const handlePointerUp = () => {
76-
if (holdTimer.current) {
77-
clearTimeout(holdTimer.current);
78-
holdTimer.current = null;
79-
}
80-
if (!longPressed.current) {
81-
toggleOSFP();
82-
}
83-
};
73+
const BasketballEasterEgg = () => {
74+
const [open, setOpen] = React.useState(false);
75+
const progress = React.useRef(0);
76+
77+
React.useEffect(() => {
78+
const onKeyDown = (e: KeyboardEvent) => {
79+
const key = e.key.length === 1 ? e.key.toLowerCase() : e.key;
80+
if (key === KONAMI_SEQUENCE[progress.current]) {
81+
progress.current += 1;
82+
if (progress.current === KONAMI_SEQUENCE.length) {
83+
progress.current = 0;
84+
setOpen(true);
85+
}
86+
} else {
87+
// Wrong key resets the run, but a stray first key can start a new one.
88+
progress.current = key === KONAMI_SEQUENCE[0] ? 1 : 0;
89+
}
90+
};
91+
window.addEventListener('keydown', onKeyDown);
92+
return () => window.removeEventListener('keydown', onKeyDown);
93+
}, []);
8494

8595
return (
86-
<>
87-
<button
88-
onPointerDown={handlePointerDown}
89-
onPointerUp={handlePointerUp}
90-
onPointerCancel={() => {
91-
if (holdTimer.current) {
92-
clearTimeout(holdTimer.current);
93-
holdTimer.current = null;
94-
}
95-
}}
96-
aria-pressed={active}
97-
aria-label={active ? 'Exit OSFP theme' : 'Enable OSFP (Olympiacos) theme'}
98-
title={active ? 'Πάμε Θρύλε! Hold to hoop.' : 'OSFP — Final Four edition'}
99-
className={cn(
100-
'flex cursor-pointer items-center justify-center rounded-lg border p-2 text-sm leading-none transition-opacity select-none hover:opacity-80',
101-
active
102-
? 'bg-primary text-primary-foreground border-primary shadow-primary/40 shadow-md'
103-
: 'bg-card text-foreground border-border'
104-
)}
105-
style={{ width: size + 16, height: size + 16 }}
96+
<Dialog open={open} onOpenChange={setOpen}>
97+
<DialogContent
98+
aria-describedby={undefined}
99+
className="max-h-[90vh] max-w-lg overflow-y-auto sm:max-w-[480px]"
106100
>
107-
<span aria-hidden className="text-base leading-none">
108-
🏀
109-
</span>
110-
</button>
111-
<Dialog open={showGame} onOpenChange={setShowGame}>
112-
<DialogContent
113-
aria-describedby={undefined}
114-
className="max-h-[90vh] max-w-lg overflow-y-auto sm:max-w-[480px]"
115-
>
116-
<DialogHeader>
117-
<DialogTitle>🏀 Basketball Minigame</DialogTitle>
118-
</DialogHeader>
119-
<div className="overflow-hidden rounded-lg">
120-
<iframe
121-
src={`${import.meta.env.BASE_URL}basket/index.html`}
122-
className="w-full border-0"
123-
style={{ aspectRatio: '400 / 625' }}
124-
title="Basketball Game"
125-
/>
126-
</div>
127-
</DialogContent>
128-
</Dialog>
129-
</>
101+
<DialogHeader>
102+
<DialogTitle>🏀 Basketball Minigame</DialogTitle>
103+
</DialogHeader>
104+
<div className="overflow-hidden rounded-lg">
105+
<iframe
106+
src={`${import.meta.env.BASE_URL}basket/index.html`}
107+
className="w-full border-0"
108+
style={{ aspectRatio: '400 / 625' }}
109+
title="Basketball Game"
110+
/>
111+
</div>
112+
</DialogContent>
113+
</Dialog>
130114
);
131115
};
132116

@@ -141,7 +125,7 @@ const Navbar = ({ lastUpdateTime }: NavbarProps) => {
141125
<div className="mx-auto flex max-w-7xl items-center justify-between">
142126
<div className="flex items-center space-x-4">
143127
<h1 className="text-foreground text-xl font-bold">
144-
<a href="/">Attack-Defense CTF</a>
128+
<Link to="/">Attack-Defense CTF</Link>
145129
</h1>
146130
</div>
147131

@@ -152,7 +136,6 @@ const Navbar = ({ lastUpdateTime }: NavbarProps) => {
152136
Last Update: {lastUpdateTime ? lastUpdateTime.toLocaleTimeString() : 'Never'}
153137
</div>
154138
<div className="flex items-center space-x-2">
155-
<OSFPToggle size={16} />
156139
<button
157140
onClick={toggleTheme}
158141
aria-label={themeLabel}
@@ -166,7 +149,6 @@ const Navbar = ({ lastUpdateTime }: NavbarProps) => {
166149

167150
{/* Mobile */}
168151
<div className="flex items-center space-x-2 lg:hidden">
169-
<OSFPToggle size={18} />
170152
<button
171153
onClick={toggleTheme}
172154
aria-label={themeLabel}
@@ -245,128 +227,9 @@ const Footer = () => (
245227
</footer>
246228
);
247229

248-
/**
249-
* Stylized riff on the Olympiacos crest — a young athlete (ephebe) wearing
250-
* a laurel wreath. Geometric, intentionally non-photo-real so it reads as
251-
* "vibe", not as the trademarked logo. Renders in whatever `currentColor`
252-
* is so it can sit on red, white, or anything in between.
253-
*/
254-
const OSFPLaurelHead = ({ size = 24 }: { size?: number }) => (
255-
<svg
256-
aria-hidden
257-
width={size}
258-
height={size}
259-
viewBox="0 0 64 64"
260-
fill="currentColor"
261-
xmlns="http://www.w3.org/2000/svg"
262-
>
263-
{/* Laurel wreath — two arcs of leaves crowning the head */}
264-
<g>
265-
<ellipse cx="18" cy="22" rx="2.6" ry="5.4" transform="rotate(-45 18 22)" />
266-
<ellipse cx="22" cy="15" rx="2.6" ry="5.4" transform="rotate(-25 22 15)" />
267-
<ellipse cx="28" cy="11" rx="2.6" ry="5.4" transform="rotate(-10 28 11)" />
268-
<ellipse cx="36" cy="11" rx="2.6" ry="5.4" transform="rotate(10 36 11)" />
269-
<ellipse cx="42" cy="15" rx="2.6" ry="5.4" transform="rotate(25 42 15)" />
270-
<ellipse cx="46" cy="22" rx="2.6" ry="5.4" transform="rotate(45 46 22)" />
271-
</g>
272-
{/* Head */}
273-
<circle cx="32" cy="30" r="9" />
274-
{/* Shoulders / bust */}
275-
<path d="M18 58 C18 47 24 42 32 42 C40 42 46 47 46 58 Z" />
276-
</svg>
277-
);
278-
279-
/**
280-
* Floating "ΘΡΥΛΟΣ" badge that only mounts in OSFP mode. Bottom-right,
281-
* doesn't intercept clicks. Carries the stylized ephebe crest, club name,
282-
* basketball, and trophy — designed so a viewer who's never heard of
283-
* Olympiacos still knows exactly what theme they're looking at.
284-
*/
285-
const OSFPCelebration = () => {
286-
const isOSFP = useIsOSFP();
287-
if (!isOSFP) return null;
288-
return (
289-
<div
290-
aria-hidden
291-
className="animate-osfp-slide-in pointer-events-none fixed bottom-4 left-1/2 z-50 flex w-max -translate-x-1/2 items-center gap-2.5 rounded-full border border-white/25 py-2 pr-4 pl-2 text-sm font-bold text-white shadow-lg sm:right-4 sm:left-auto sm:translate-x-0"
292-
style={{
293-
background: 'linear-gradient(135deg, hsl(353 88% 42%), hsl(353 88% 30%))',
294-
boxShadow: '0 12px 32px -10px hsl(353 88% 42% / 0.6)',
295-
}}
296-
>
297-
<span className="grid h-7 w-7 place-items-center rounded-full bg-white text-[hsl(353_88%_42%)] shadow-inner">
298-
<OSFPLaurelHead size={18} />
299-
</span>
300-
<span className="flex flex-col leading-tight">
301-
<span className="text-[10px] font-medium tracking-[0.18em] text-white/80 uppercase">
302-
Ολυμπιακος Β.C.
303-
</span>
304-
<span className="text-sm tracking-wide">ΘΡΥΛΟΣ · Final Four</span>
305-
</span>
306-
<span className="animate-osfp-bounce inline-block text-base leading-none">🏀</span>
307-
<span className="text-base leading-none">🏆</span>
308-
</div>
309-
);
310-
};
311-
312-
/**
313-
* Tongue-in-cheek "we're wrapping the CTF before tipoff" PSA. Sits right
314-
* under the navbar in OSFP mode so the joke lands the moment a viewer
315-
* switches in. Bold red strip with white text — impossible to miss, but
316-
* still pointer-event-passive so it never blocks interactions below.
317-
*/
318-
const OSFPTipoffBanner = () => {
319-
const isOSFP = useIsOSFP();
320-
if (!isOSFP) return null;
321-
return (
322-
<div
323-
role="note"
324-
aria-label="Olympiacos Final Four tipoff notice"
325-
className="w-full px-4 py-2 text-center text-sm font-semibold text-white"
326-
style={{
327-
background: 'linear-gradient(90deg, hsl(353 88% 36%), hsl(353 88% 46%), hsl(353 88% 36%))',
328-
boxShadow: 'inset 0 -1px 0 hsl(353 88% 28%)',
329-
}}
330-
>
331-
<span className="inline-flex flex-wrap items-center justify-center gap-x-2 gap-y-1">
332-
<span aria-hidden>🏀</span>
333-
<span>
334-
Pencils down at <span className="font-bold tracking-wide">20:59</span> —{' '}
335-
<span className="hidden sm:inline">Final Four </span>tipoff waits for no shell.
336-
</span>
337-
<span aria-hidden>🏆</span>
338-
</span>
339-
</div>
340-
);
341-
};
342-
343-
/**
344-
* Bold red+white vertical-stripe band — the iconic ερυθρόλευκοι kit
345-
* pattern, but as a slim 8px ribbon across the viewport. Renders only in
346-
* OSFP mode; used at the top and bottom of the page so every view is
347-
* unmistakably Olympiacos without compromising readability.
348-
*/
349-
const OSFPStripeBar = () => {
350-
const isOSFP = useIsOSFP();
351-
if (!isOSFP) return null;
352-
return (
353-
<div
354-
aria-hidden
355-
className="h-2 w-full shrink-0"
356-
style={{
357-
background:
358-
'repeating-linear-gradient(90deg, hsl(353 88% 42%) 0 28px, hsl(0 0% 100%) 28px 56px)',
359-
boxShadow: 'inset 0 -1px 0 hsl(353 35% 80%)',
360-
}}
361-
/>
362-
);
363-
};
364-
365230
const Layout = ({ children, lastUpdateTime }: LayoutProps) => (
366231
<div className="bg-background flex min-h-screen flex-col">
367-
<OSFPStripeBar />
368232
<Navbar lastUpdateTime={lastUpdateTime} />
369-
<OSFPTipoffBanner />
370233
<div className="text-foreground top-16 z-50 mx-auto w-full px-4 py-2 text-right text-sm">
371234
Stuck?{' '}
372235
<a
@@ -379,9 +242,8 @@ const Layout = ({ children, lastUpdateTime }: LayoutProps) => (
379242
</a>
380243
</div>
381244
<main className="grow overflow-hidden">{children}</main>
382-
<OSFPStripeBar />
383245
<Footer />
384-
<OSFPCelebration />
246+
<BasketballEasterEgg />
385247
</div>
386248
);
387249

0 commit comments

Comments
 (0)