Scan the code to replace what is necessary from the requirements and each code is separate so it isn't all in one code for each requirement. Don't show the balance untill either the Demo or Play with Crypto has been clicked. have it so once Demo has been clicked it enable the user to bet any amount without a finite limited balance ONLY ON THE DEMO MODE while if the user
clicked on Play with Crypto it will be selected and the balance will show up but won't use what was used for
Balance: $${item.balance}</span>
</p>
<p class="timestamp">${item.timestamp}</p>`;
historyContent.prepend(historyItem);
});
} but do not show an history item result if user did not clicked <button id="submitBet">Place Bet</button> while having a number in the <input type="number" id="betAmount" value="0" onkeypress="return isNumberKey(event)" oninput="validateInput(this)" step="any" min="0" placeholder="Enter amount"> without messing up any functionalities. when the user is not on the page it will keep going but so the multiplier won't keep being 0.04x to fit the requirements definitely, precisely and perfected without any shortcuts for each requirements:
@keyframes moveBackground {
from { background-position: 0 0; }
to { background-position: 100vw 100vh; }
}
#gameContainer{position:relative;width:95%;max-width:600px;margin:0px auto;box-shadow:0 0 5px var(--neon-blue);border-radius:12px;overflow:hidden;}
#game{width:100%;height:300px;background-color:#000;border:0px solid var(--neon-blue);border-radius:0x;overflow:hidden;}
#currentMultiplier{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:2rem;color:var(--neon-pink);text-shadow:0 0 10px var(--neon-pink);transition:color 0.2s ease-in-out;}
#lastCrashesContainer{width:95%;max-width:360px;margin:20px auto;overflow-x:auto;white-space:nowrap;background-color:rgba(0,0,0,0.7);border:1px solid var(--neon-blue);border-radius:11px;padding:10px;}
.lastCrashes {
display: inline-block;
margin: 2px;
padding: 7px;
border-radius: 15px;
color: #fff;
}
.glow {
animation: glow 10s infinite;
}
@keyframes glow {
0% {
box-shadow: 0 0 0px;
}
10% {
box-shadow: 0 0 5px;
}
25% {
box-shadow: 0 0 6px;
}
50% {
box-shadow: 0 0 15px;
}
75% {
box-shadow: 0 0 6px;
}
90% {
box-shadow: 0 0 0px;
}
100% {
box-shadow: 0 0 0px;
}
}
#lastCrashes p{margin:0 5px;font-size:1rem;text-shadow:0 0 5px currentColor;transform:skewX(-5deg);transition:transform 0.3s ease-in-out;}
#infoContainer{display:flex;flex-direction:column;align-items:center;width:95%;max-width:360px;background-color:rgba(0,0,0,0.7);border:1px solid var(--neon-blue);border-radius:10px;padding:10px;margin:12px auto;}
#balance,#crashedAt{font-size:1.2rem;margin:10px 0;text-align:center;}
#betContainer{display:flex;align-items:center;justify-content:center;margin:10px 0;}
#betAmount{width:80px;padding:8px;background-color:#222;color:#fff;border:1px solid var(--neon-blue);border-radius:5px;margin-left:5px;font-family:'Anonymous Pro', monospace;}
#buttonContainer{display:flex;justify-content:space-around;width:100%;margin-top:5px;}
#takeProfits{font-family:'Anonymous Pro', monospace;margin: 5px 5px;padding:25px 18px;font-size:1rem;background-color:#222;color:#fff;border:1px solid var(--neon-green);border-radius:5px;cursor:pointer;transition:background-color 0.3s ease, transform 0.2s ease;}
#submitBet{font-family:'Anonymous Pro', monospace;margin: 14px; padding:25px 3px;font-size:1rem;background-color:#222;color:#fff;border:1px solid var(--neon-pink);border-radius:5px;cursor:pointer;transition:background-color 0.3s ease, transform 0.2s ease;}
#historyButton{font-family:'Anonymous Pro', monospace; margin: 9px 9px; padding:0px 5px;font-size:1rem;background-color:#222;color:#fff;border:1px solid var(--neon-blue);border-radius:20px;cursor:pointer;transition:background-color 0.3s ease, transform 0.2s ease;}
#takeProfits:hover{background-color:var(--neon-green);color:#000;transform:scale(1.05);}
#historyButton:hover{background-color:var(--neon-blue);color:#000;transform:scale(1.05);}
#submitBet:hover{background-color:var(--neon-pink);color:#000;transform:scale(1.05);}
#submitBet:disabled,#takeProfits:disabled{opacity:0.3;cursor:not-allowed;transform:none;}
#historyContainer{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.95);display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:4009;opacity:0;visibility:hidden;transition:opacity 0.3s ease-in-out;}
#historyContainer.show{opacity:1;visibility:visible;}
#historyBox{width:90%;max-width:500px;font-size: clamp(0.85rem, 2vw, 1rem);background-color:rgba(0,0,0,0.8);border:2px solid var(--neon-blue);border-radius:10px;padding:15px;max-height:80vh;overflow-y:auto;box-shadow:0 0 20px var(--neon-blue);}
#historyTitle{font-size:1.4rem;margin-bottom:15px;text-align:center;color:var(--neon-green);text-shadow:0 0 10px var(--neon-green);}
#historyContent{display:flex;flex-direction:column-reverse;max-height:calc(80vh - 100px);overflow-y:auto;}
.historyItem{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;margin-bottom:8px;border-bottom:1px solid var(--neon-green);font-size:1rem;background-color:rgba(0,0,0,0.5);border-radius:8px;transition:background-color 0.3s ease, transform 0.2s ease;}
.historyItem:hover{background-color:rgba(0,0,0,0.8);transform:scale(1.02);}
.historyItem p{margin:0;flex:1;}
.historyItem .timestamp{font-size:0.8rem;color:rgba(255,255,255,0.7);}
.deleteAllData,.exitHistory{background-color:#ff0000;padding:10px 15px;border:none;color:#fff;font-size:1rem;cursor:pointer;margin-top:15px;font-family:'Anonymous Pro', monospace;border-radius:5px;transition:background-color 0.3s ease, transform 0.2s ease;}
.deleteAllData:hover,.exitHistory:hover{transform:scale(1.05);}
.exitHistory{background-color:var(--neon-blue);}
.warning-container{position:fixed;top:10px;left:50%;transform:translateX(-50%);background-color:rgba(255,102,0,0.9);color:#fff;padding:10px 20px;border-radius:5px;z-index:1001;display:none;animation:vibrate 0.3s infinite alternate;box-shadow:0 0 10px rgba(255,102,0,0.9);}
@keyframes vibrate{from{transform:translateX(-50%) rotate(-1deg);}to{transform:translateX(-50%) rotate(1deg);}}
.timerOverlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.8);z-index:1000;display:flex;justify-content:center;align-items:center;flex-direction:column;opacity:0;visibility:hidden;transition:opacity 0.3s ease-in-out;}
.timerOverlay.show{opacity:1;visibility:visible;}
.timer{font-size:2rem;color:#fff;text-shadow:0 0 10px var(--neon-blue);margin-bottom:10px;}
.progress-ring{width:80px;height:80px;border-radius:50%;background:conic-gradient(var(--neon-blue) 0%,var(--neon-pink) 0%);animation:spin 10s linear infinite;border:10px solid transparent;box-shadow:0 0 15px var(--neon-pink);background-color:rgba(0,0,0,0.5);}
@keyframes spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}
@media (min-width: 768px) {
#game{height:350px;}
#currentMultiplier{font-size:3rem;}
#lastCrashes p{font-size:1.2rem;}
#balance,#crashedAt{font-size:1.4rem;}
.timer{font-size:3rem;}
.progress-ring{width:120px;height:120px;}
}
#demoMode, #cryptoMode {
font-family: 'Anonymous Pro', monospace;
margin: 5px;
padding: 15px 10px;
font-size: 1rem;
background-color: #222;
color: #fff;
border: 1px solid var(--neon-blue);
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
flex: 1; /* Ensure buttons take equal space /
min-width: 120px; / Minimum width for responsiveness /
max-width: 200px; / Maximum width for larger screens */
}
#demoMode:hover, #cryptoMode:hover {
background-color: var(--neon-blue);
color: #000;
transform: scale(1.05);
}
#demoMode:disabled, #cryptoMode:disabled {
opacity: 0.3;
cursor: not-allowed;
transform: none;
}
#demoMode.selected, #cryptoMode.selected {
background-color: var(--neon-blue) !important;
color: #000 !important;
}
.starfield {
background-color: rgba(0,0,0,0);
}
.star0 {
height: 1px;
width: 1px;
opacity: 0.4;
position: absolute;
}
.star1 {
height: 2px;
width: 2px;
border-radius: 50%;
opacity: 0.5;
position: absolute;
}
.star2 {
height: 3px;
width: 3px;
border-radius: 50%;
opacity: 0.6;
position: absolute;
}
.star3 {
height: 4px;
width: 4px;
border-radius: 50%;
opacity: 0.7;
position: absolute;
}
.star4 {
height: 5px;
width: 5px;
border-radius: 50%;
opacity: 1;
position: absolute;
}
// Calculate the diagonal distance for -45 degree movement
var diagonalDistance = Math.sqrt(width * width + height * height);
for (var l = 0; l < layerCount; ++l) {
var layer = document.createElement('div');
layer.setAttribute('id', 'layer' + l);
layer.setAttribute('class', 'starfield');
universe.appendChild(layer);
for (var i = 0; i < starCount; ++i) {
var xpos = Math.round(Math.random() * (width + height)) - height; // Adjusted x position range
var ypos = Math.round(Math.random() * (width + height)) - width; // Adjusted y position range
// Create two stars for the seamless loop, positioned for -45 degree diagonal movement
for (var s = 0; s < 2; ++s) {
var star = document.createElement('div');
star.setAttribute('class', 'star' + Math.floor(Math.random() * 5)); // Randomly assign star sizes 0-4
// Calculate position for -45 degree movement
var translateX = xpos + s * diagonalDistance * Math.cos(Math.PI / 4);
var translateY = ypos + s * diagonalDistance * Math.sin(Math.PI / 4);
star.style.webkitTransform = 'translate(' + translateX + 'px, ' + translateY + 'px)';
star.style.transform = 'translate(' + translateX + 'px, ' + translateY + 'px)';
star.style.backgroundColor = 'white';
layer.appendChild(star);
}
}
// Animate the layer diagonally at -45 degrees
layer.animate([{transform: 'translate3d(0, 0, 0)'},
{transform: 'translate3d(-' + diagonalDistance * Math.cos(Math.PI / 4) + 'px, ' + diagonalDistance * Math.sin(Math.PI / 4) + 'px, 0)'}],
{duration: Math.pow(2, layerCount - l) * 15000, // Adjusted duration for diagonal
iterations: Infinity});
}
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
overflow: hidden;
}
section {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background-size: cover;
}
@keyframes animateBg {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.2);
}
}
span {
position: absolute;
top: 50%;
left: 50%;
width: 4px;
height: 4px;
background: #fff;
border-radius: 50%;
box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1), 0 0 0 8px rgba(255, 255, 255, 0.1), 0 0 20px rgba(255, 255, 255, 0.1);
animation: animate 3s linear infinite;
/* Add transform origin to the left */
transform-origin: left center;
}
span::before {
content: '';
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 300px;
height: 1px;
background: linear-gradient(90deg, #fff, transparent);
}
@keyframes animate {
0% {
/* Change translateX to translateX(2000px) */
transform: rotate(315deg) translateX(2000px);
opacity: 0;
}
30% {
opacity: 1;
}
100% {
transform: rotate(315deg) translateX(-1000px);
opacity: 0;
}
}
/* Apply random animation delays and durations to each span */
span {
animation-duration: calc(var(--duration) * 1s);
}
</style>
</section>
<script>
// JavaScript to randomize the top and right positions and animation parameters
const spans = document.querySelectorAll('span');
spans.forEach(span => {
const top = Math.random() * 100 + 'vh'; // Random top position within viewport height
const right = Math.random() * 100 + 'vw';// Random right position within viewport width
const delay = Math.random() * 3;
const duration = Math.random() * 2 + 1; // Duration between 1 and 3 seconds
span.style.top = top;
span.style.right = right;
span.style.setProperty('--delay', delay);
span.style.setProperty('--duration', duration);
// Remove left initial styling
span.style.left = 'initial';
});
</script>