From 1b1cd2f08be4c8e7a1b0596e540d4e7d3cf509e2 Mon Sep 17 00:00:00 2001 From: Frank Schwenk Date: Tue, 8 Apr 2025 20:04:42 +0200 Subject: [PATCH] Add game completion modal when reaching race-to limit --- index.html | 217 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 196 insertions(+), 21 deletions(-) diff --git a/index.html b/index.html index d2dd35e..448d0f0 100644 --- a/index.html +++ b/index.html @@ -982,6 +982,106 @@ min-width: 150px; } } + + /* Game completion modal styles */ + #game-completion-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.7); + z-index: 1000; + display: none; + justify-content: center; + align-items: center; + } + + #game-completion-modal.show { + display: flex; + } + + #game-completion-modal .modal-content { + background-color: #2a2a2a; + padding: 30px; + border-radius: 10px; + width: 90%; + max-width: 500px; + position: relative; + margin: auto; + transform: translateY(0); + } + + .final-scores { + margin: 20px 0; + } + + .final-score { + display: flex; + justify-content: space-between; + align-items: center; + padding: 20px; + margin-bottom: 10px; + background: #333; + border-radius: 5px; + font-size: 24px; + } + + .final-score .player-name { + font-size: 24px; + font-weight: bold; + color: white; + } + + .final-score .score { + font-size: 24px; + font-weight: bold; + color: white; + } + + .winner-announcement { + text-align: center; + margin: 20px 0; + padding: 20px; + background: #4CAF50; + border-radius: 5px; + } + + .winner-announcement h3 { + font-size: 24px; + margin: 0; + color: white; + } + + .modal-buttons { + display: flex; + gap: 10px; + margin-top: 20px; + } + + .modal-buttons .btn { + flex: 1; + padding: 20px; + font-size: 20px; + border: none; + border-radius: 0; + cursor: pointer; + color: white; + } + + .modal-buttons .btn--warning { + background: #f44336; + } + + .modal-buttons .btn:not(.btn--warning) { + background: #333; + } + + #game-completion-modal h2 { + font-size: 24px; + margin-bottom: 20px; + color: white; + } @@ -1154,6 +1254,21 @@ + + + \ No newline at end of file