From a52505004ec29ba9c71c5c5bc95413e92850f284 Mon Sep 17 00:00:00 2001 From: prince-gh Date: Tue, 3 Sep 2024 13:56:27 +0530 Subject: [PATCH] Added new features --- index.html | 10 ++++------ script.js | 7 +++++++ style.css | 9 ++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index 4bfcff0..f14e0b5 100644 --- a/index.html +++ b/index.html @@ -20,11 +20,7 @@
-
-
-
-
-
+
@@ -35,7 +31,9 @@
-
+
+ +
diff --git a/script.js b/script.js index f4d71b9..ffc7733 100644 --- a/script.js +++ b/script.js @@ -29,6 +29,12 @@ function startGame() { if (currentIndex > 9) { message.textContent = 'Congratulations! You won!'; start.style.display = 'block'; + start.textContent = 'New Game'; + start.addEventListener('click',(e)=>{ + boxes.forEach(b => b.classList.remove('flipped')); + currentIndex = 1; + }) + } } else { message.textContent = 'Wrong sequence! Try again!'; @@ -43,6 +49,7 @@ function startGame() { }, 3000); } + function shuffle(array) { for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); diff --git a/style.css b/style.css index fe08728..7f56628 100644 --- a/style.css +++ b/style.css @@ -69,22 +69,17 @@ body { & .c3{ top: 280px; } - animation: move 20s linear infinite; - + animation: move 10s linear infinite; } @keyframes move{ from{ transform: translateX(0%); }to{ - transform: translateX(-50%); + transform: translateX(-25%); } } - - - - .headder{ width: 100%; display: flex;