diff --git a/Games/Tennis/index.html b/Games/Tennis/index.html index 29ae60f709..689026f39e 100644 --- a/Games/Tennis/index.html +++ b/Games/Tennis/index.html @@ -6,18 +6,16 @@

🎾 Tennis Showdown 🎾

- -
-
- Player 1: + + +
0 -
-
- Player 2: + 0 -
+ + diff --git a/Games/Tennis/script.js b/Games/Tennis/script.js index 59ba6b0800..3ad17e1b79 100644 --- a/Games/Tennis/script.js +++ b/Games/Tennis/script.js @@ -91,10 +91,10 @@ function draw() { drawBall(); drawPaddles(); - context.fillStyle = "#ffffff"; - context.font = "20px Arial"; - context.fillText("Player 1: " + player1Score, 10, 20); - context.fillText("Player 2: " + player2Score, canvas.width - 120, 20); + const p1score=document.getElementById("player1Score") + p1score.innerHTML=player1Score + const p2score=document.getElementById("player2Score") + p2score.innerHTML=player2Score } diff --git a/Games/Tennis/style.css b/Games/Tennis/style.css index 91604e5a06..242a2522a3 100644 --- a/Games/Tennis/style.css +++ b/Games/Tennis/style.css @@ -21,7 +21,7 @@ canvas { border: 1px solid #fff; background-color: #3e931f; } - +/* .paddle { position: absolute; display: block; @@ -39,33 +39,31 @@ canvas { right: 20px; top: 50%; transform: translateY(-50%); -} - -.score-card { - width: 300px; - background-color: #333; - border-radius: 10px; - margin-top: 20px; - box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); -} - -.player-score { - display: flex; - align-items: center; - padding: 10px; - border-bottom: 1px solid #555; -} - +} */ +/* .player-name { margin-right: 10px; font-weight: bold; +} */ + +#player1Score{ + position: relative; + font-size: 50px; + font-weight: bold; + color: rgba(255, 0, 0, 0.43); + background-color: white; + border-radius: 5px; } -#player1Score, #player2Score { + position: relative; + font-size: 50px; font-weight: bold; + color: rgba(0, 0, 255, 0.43); + background-color: white; + border-radius: 5px; } - +/* .score-card-title { font-size: 24px; color: #fff; @@ -98,4 +96,4 @@ canvas { .footer a:hover { color: #fff; -} +} */