From 41fcbfd9cac9eaef387a315ff01e817e3847380f Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 24 Sep 2025 18:14:59 -0400 Subject: [PATCH] Left right visuals on visualizer --- web/superball.html | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/web/superball.html b/web/superball.html index 65b827a..c68f1b5 100644 --- a/web/superball.html +++ b/web/superball.html @@ -1489,7 +1489,7 @@ // Generate the "Throw the Superball" button HTML function generateThrowButtonHtml() { return ` -
+
Ready
Click to start
@@ -1760,17 +1760,26 @@ // Generate HTML for timeline visualization function generateTimelineHtml(eventFlow) { - return eventFlow.map((step, index) => ` -
-
-
${formatTime(step.time)}
-
${formatAbsoluteTime(step.time)}
+ return eventFlow.map((step, index) => { + // Determine alignment based on actor type + const isRelay = step.actor.startsWith('Relay ('); + const alignmentClass = isRelay ? 'align-right' : 'align-left'; + const alignmentStyle = isRelay + ? 'width: 60%; margin-left: auto; margin-right: 0;' + : 'width: 60%; margin-left: 0; margin-right: auto;'; + + return ` +
+
+
${formatTime(step.time)}
+
${formatAbsoluteTime(step.time)}
+
+
${step.actor}
+
${step.action}
+
${step.size} bytes
-
${step.actor}
-
${step.action}
-
${step.size} bytes
-
- `).join(''); + `; + }).join(''); } // Format absolute time (HH:MM:SS)