From 0d5a3292d4e94246457c6cc5306045ab85ed4e08 Mon Sep 17 00:00:00 2001 From: Leo dev Date: Mon, 2 Feb 2026 16:30:04 +0100 Subject: [PATCH] Live run layout --- src/app/run/page.tsx | 261 ++++++++++++++----------------------------- 1 file changed, 81 insertions(+), 180 deletions(-) diff --git a/src/app/run/page.tsx b/src/app/run/page.tsx index db633a3..5df6132 100644 --- a/src/app/run/page.tsx +++ b/src/app/run/page.tsx @@ -2,7 +2,21 @@ import { Play, Pause, RotateCcw, Flag, ChevronRight } from "lucide-react"; import SplitRow from "@/components/app/SplitRow"; import { Button } from "@/components/ui/button"; -const Run = () => { +type RunInfo = { + category: "any%" | "100%"; + problems: number; + currentAttempt: number; + pbTime: string; + worldRecord: string; +}; + +type ChatMessage = { + user: string; + message: string; + time: string; +}; + +export default function Run() { const splits = [ { problemName: "Two Sum Dash", @@ -42,194 +56,81 @@ const Run = () => { }, ]; - const runInfo = { - category: "Any% Easy", + const runInfo: RunInfo = { + category: "any%", problems: 5, pbTime: "4:35", worldRecord: "3:58", currentAttempt: 47, }; + const chatMessages = [ + { user: "Alice", message: "Nice split!", time: "1:53" }, + { user: "Bob", message: "Watch out for the string problem!", time: "1:54" }, + { user: "Charlie", message: "PB incoming? 👀", time: "1:55" }, + ]; + return ( -
-
-
- {/* Main Timer Area */} -
- {/* Category Header */} -
-
-
- Category - - {runInfo.category} -
-

- Current Run -

-
-
-

- Attempt #{runInfo.currentAttempt} -

-

- WR:{" "} - - {runInfo.worldRecord} - -

-
-
+
+ {/* Editor */} +
- {/* Timer Display */} -
- {/* Background glow */} -
- -
- {/* Timer */} -
-

1:52.34

-

- PB: {runInfo.pbTime} | Diff:{" "} - +0:12 -

-
- - {/* Progress bar */} -
-
-
- - {/* Controls */} -
- - - -
-
-
- - {/* Current Problem */} -
-
-
-

- Problem 3 of 5 -

-

- String Scramble -

-
- - Easy - -
- -
- - strings - - - manipulation - -
- -
- - PB Split: 0:55 - - | - - Best: 0:38 - -
- - -
-
- - {/* Splits Sidebar */} -
-
-
-

Splits

- - 2/5 Complete - -
- -
- {splits.map((split) => ( - - ))} -
- - {/* Sum of Best */} -
-
- Sum of Best - 3:51 -
-
- Personal Best - - {runInfo.pbTime} - -
-
-
- - {/* Quick Stats */} -
-

- Session Stats -

-
-
- - Runs Today - - 12 -
-
- - Clean Runs - - 3 -
-
- Resets - 9 -
-
- - Time Played - - 1:42:31 -
-
-
-
-
+ {/* Timer & Chat */} +
+ +
); -}; +} -export default Run; +function Timer({ runInfo }: { runInfo: RunInfo }) { + return ( +
+
+
+

1:52.34

+

+ PB: {runInfo.pbTime} | Diff:{" "} + +0:12 +

+
+
+ ); +} + +function Chat({ chatMessages }: { chatMessages: ChatMessage[] }) { + return ( +
+ {/* Header */} +
+

Chat

+ + {chatMessages.length} messages + +
+ + {/* Messages area */} +
+ {chatMessages.map((msg, idx) => ( +
+ {msg.user}:{" "} + {msg.message} + + {msg.time} + +
+ ))} +
+ + {/* Input */} +
+ +
+
+ ); +}