From 157b9c36faeb968ea2aee1963ad8c64f685eb800 Mon Sep 17 00:00:00 2001 From: Trianta <56975502+Trimutex@users.noreply.github.com> Date: Fri, 9 Aug 2024 18:46:40 -0500 Subject: [PATCH] core: better card styling and var name cleaning --- css/home.css | 10 ++++++++-- index.html | 27 ++++++++++++++------------- js/pong.js | 4 +++- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/css/home.css b/css/home.css index 41c430a..751f8bb 100644 --- a/css/home.css +++ b/css/home.css @@ -16,7 +16,7 @@ body { border-bottom-right-radius: 18px; } -.nav-item { +.navItem { margin: 6px; margin-top: 0px; padding: 8px; @@ -37,6 +37,10 @@ body { /*background: #1e2030;*/ } +.cardStats { + font-size: 18px; +} + h1 { width: 130px; text-align: center; @@ -121,9 +125,11 @@ a.button { border-top-left-radius: 18px; border-top-right-radius: 18px; animation: card 3s linear infinite; + max-width: 800px; + margin: 0px auto; } -.card-top { +.cardTop { background: #1e2030; border-top-left-radius: 18px; border-top-right-radius: 18px; diff --git a/index.html b/index.html index aec69c9..e7b82cb 100644 --- a/index.html +++ b/index.html @@ -7,23 +7,24 @@
-

Pong

-
- - - - +

Pong

+ + + + +

Left Paddle Height:

+

Right Paddle Height:

+ View Code
diff --git a/js/pong.js b/js/pong.js index 251cc7e..69b5906 100644 --- a/js/pong.js +++ b/js/pong.js @@ -89,9 +89,11 @@ function loop() { if (ball.dx < 0) { BotMovesPaddle(leftPaddle); + document.getElementById("leftPaddle").innerHTML = leftPaddle.y; } if (ball.dx > 0) { - BotMovesPaddle(rightPaddle); + BotMovesPaddle(rightPaddle); + document.getElementById("rightPaddle").innerHTML = rightPaddle.y; } // move paddles by their velocity