From 4b11eaf7b6420851da55ce575660df3d85ed2d4d Mon Sep 17 00:00:00 2001
From: MajesticWafer <123651667+MajesticWafer@users.noreply.github.com>
Date: Tue, 12 Nov 2024 12:19:21 -0500
Subject: [PATCH] Update index.html
---
slots/index.html | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/slots/index.html b/slots/index.html
index 9ea63ba..3be48cc 100644
--- a/slots/index.html
+++ b/slots/index.html
@@ -99,7 +99,7 @@
0% { opacity: 1; }
100% { opacity: 0; }
}
- .currency {
+ .score {
font-size: 1.25rem;
font-weight: bold;
position: absolute;
@@ -109,7 +109,7 @@
- Moolah: 0
+ Score: 0 | High Score: 0
@@ -146,13 +146,12 @@
🎰 Slot Machine 🎰
const emojis = ["🍒", "🍋", "🍉", "🍇", "🔔", "⭐", "💎"];
const slotMachine = document.getElementById("slot-machine");
const moneyRainDiv = document.getElementById("money-rain");
- const currencyDisplay = document.getElementById("currency");
- let currency = 0;
- let newCurrency = parseInt(getCookie("savedCurrency") || 0);
- currency += newCurrency;
+ const scoreDisplay = document.getElementById("score");
+ let score = 0;
+ let highScore = getCookie("highScore") || 0;
// Update high score
- currencyDisplay.textContent = `Moolah: ${currency}`;
+ scoreDisplay.textContent = `Score: ${score} | High Score: ${highScore}`;
function pullsfx() {
const sfx = document.getElementById("pull-audio");
@@ -178,8 +177,8 @@ 🎰 Slot Machine 🎰
if (emoji1 === emoji2 && emoji2 === emoji3) {
result.textContent = "🎉 Jackpot! 🎉";
- currency += 100;
- updateSavedCurrency();
+ score += 100;
+ updateHighScore();
slotMachine.style.boxShadow = "0 0 20px gold";
moneyRain();
setTimeout(() => slotMachine.style.boxShadow = "", 500);
@@ -191,13 +190,13 @@ 🎰 Slot Machine 🎰
setTimeout(() => spinButton.disabled = false, 800);
- currencyDisplay.textContent = `Moolah: ${currency}`;
+ scoreDisplay.textContent = `Score: ${score} | High Score: ${highScore}`;
}
- function updateSavedCurrency() {
- if (currency > savedCurrency) {
- savedCurrency = currency;
- setCookie("savedCurrency", savedCurrency, 365);
+ function updateHighScore() {
+ if (score > highScore) {
+ highScore = score;
+ setCookie("highScore", highScore, 365);
}
}