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
@@ -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