feat(race-day): run buttons follow the race flags
Green starts or resumes, red pauses (stops the race), checkered finishes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ba35f9e7d2
commit
8120ebc1b5
4 files changed
+15
-5
No files matched your search
+1
-1
@@ -15,7 +15,7 @@ No changes recorded yet.
|
||||
- **Race Day is where sessions are run.** Quick actions at the top: **Start practice** (continues today's Open Practice or creates and starts a new one), **New track layout** (only for practice; the running practice moves onto it) and **Create race**. A session picker switches session without going to Timing. Only the buttons that apply are shown (no greyed-out Pause before a start), with practice wording (Pause practice / Finish practice) and no start lights for practice.
|
||||
- **New practice day** on Race Day replaces "Reset data" on Timing: clears today's timing for the selected Open Practice while every lap stays in the training stats.
|
||||
- **Timing is for following.** Start, stop and reset moved to Race Day; Timing keeps the session picker, the leaderboard and lap clean-up, with a link to Race Day. Opening a session from Race Setup now goes to Race Day.
|
||||
- Run buttons use traffic-light colours: green starts or resumes (also Go now and the count-down's Resume), amber pauses or holds, red finishes. The Start practice button turns green with a pulsing dot while the practice runs, and amber while it is paused.
|
||||
- Run buttons follow the race flags: green flag starts or resumes (also Go now and the count-down's Resume), red flag pauses (stops the race), checkered flag finishes. The Start practice button is green with a pulsing dot while the practice runs, and red while it is paused. Amber is only used to hold the start count-down.
|
||||
- The Dashboard shows the three common tasks first: Start practice, Create race and Series / cup.
|
||||
- The guide, both READMEs, the Race Day screenshot and the "Run a session" video follow the new flow (count-down, hold, To 10 s, pause, finish).
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 368 KiB After Width: | Height: | Size: 369 KiB |
@@ -216,7 +216,7 @@ export function renderRaceDayView(deps) {
|
||||
const layoutAllowed = !session || isPracticeSessionType(session.type);
|
||||
dom.view.innerHTML = `
|
||||
<section class="race-day-quick" aria-label="${escapeHtml(t("race_day.quick_title"))}">
|
||||
<button class="btn ${practice?.status === "running" ? "btn-go is-live" : practice?.status === "paused" ? "btn-hold" : "btn-go"} race-day-quick-btn" type="button" id="raceDayQuickPractice">${practice?.status === "running" ? '<span class="live-dot" aria-hidden="true"></span>' : practice?.status === "paused" ? "⏸" : "▶"} ${escapeHtml(practiceLabel)}</button>
|
||||
<button class="btn ${practice?.status === "running" ? "btn-go is-live" : practice?.status === "paused" ? "btn-danger" : "btn-go"} race-day-quick-btn" type="button" id="raceDayQuickPractice">${practice?.status === "running" ? '<span class="live-dot" aria-hidden="true"></span>' : practice?.status === "paused" ? "⏸" : "▶"} ${escapeHtml(practiceLabel)}</button>
|
||||
${layoutAllowed ? `<button class="btn race-day-quick-btn" type="button" data-track-layout-new>🧱 ${escapeHtml(t("race_day.quick_layout"))}</button>` : ""}
|
||||
<button class="btn race-day-quick-btn" type="button" id="raceDayQuickRace">🏁 ${escapeHtml(t("race_day.quick_race"))}</button>
|
||||
</section>
|
||||
@@ -254,9 +254,9 @@ export function renderRaceDayView(deps) {
|
||||
: isLiveSession ? "" : `<button id="raceDayStart" class="btn btn-go" type="button" ${canStart ? "" : "disabled"}>${t(isPracticeSession ? "race_day.start_practice" : "timing.start")}</button>`}
|
||||
${prologue ? "" : `
|
||||
<!-- Practice gets plain words; a race keeps race wording. Only the buttons that apply are shown. -->
|
||||
${session?.status === "running" ? `<button id="raceDayPause" class="btn btn-hold" type="button">${t(isPracticeSession ? "race_day.pause_practice" : "audio.race_pause")}</button>` : ""}
|
||||
${session?.status === "running" ? `<button id="raceDayPause" class="btn btn-danger" type="button">⏸ ${t(isPracticeSession ? "race_day.pause_practice" : "audio.race_pause")}</button>` : ""}
|
||||
${session?.status === "paused" ? `<button id="raceDayResume" class="btn btn-go" type="button">${t(isPracticeSession ? "race_day.resume_practice" : "audio.race_resume")}</button>` : ""}
|
||||
${isLiveSession ? `<button id="raceDayFinish" class="btn btn-danger" type="button">${t(isPracticeSession ? "race_day.finish_practice" : "race_day.finish")}</button>` : ""}
|
||||
${isLiveSession ? `<button id="raceDayFinish" class="btn btn-checkered" type="button">🏁 ${t(isPracticeSession ? "race_day.finish_practice" : "race_day.finish")}</button>` : ""}
|
||||
${isPracticeSession ? `<button id="raceDayNewPracticeDay" class="btn" type="button" title="${escapeHtml(t("race_day.new_practice_day_hint"))}">${t("race_day.new_practice_day")}</button>` : ""}`}
|
||||
</div>
|
||||
${isPracticeSession ? "" : `<div id="raceDayStartLights" class="race-start-lights" data-state="${escapeHtml(getStartLightState())}">
|
||||
|
||||
+11
-1
@@ -1930,7 +1930,8 @@ body {
|
||||
);
|
||||
}
|
||||
|
||||
/* Traffic-light run controls: green starts or resumes, amber holds, red (.btn-danger) finishes. */
|
||||
/* Run controls follow the race flags: green flag starts or resumes, red flag (.btn-danger) stops the
|
||||
race (pause), checkered flag finishes. Amber only holds the start count-down. */
|
||||
.btn-go {
|
||||
color: #fff;
|
||||
border-color: color-mix(in srgb, var(--ok) 62%, black 38%);
|
||||
@@ -1943,6 +1944,15 @@ body {
|
||||
background: linear-gradient(180deg, color-mix(in srgb, var(--warn) 85%, white 15%), color-mix(in srgb, var(--warn) 80%, black 20%));
|
||||
}
|
||||
|
||||
.btn-checkered {
|
||||
color: #111;
|
||||
border-color: #111;
|
||||
background-color: #fff;
|
||||
background-image: repeating-conic-gradient(rgba(0, 0, 0, 0.14) 0 25%, transparent 0 50%);
|
||||
background-size: 14px 14px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.btn-go:disabled,
|
||||
.btn-hold:disabled {
|
||||
filter: grayscale(0.7);
|
||||
|
||||
Reference in new issue
Block a user