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. Demo will be selected at first but once Play with Crypto has been clicked it will unselect the Demo and select the
Play with Crypto but once
Play with Crypto is selected and Demo has been clicked it will unselect the
Play with Crypto and have the Demo selected. have it so once Demo has been clicked it will be selected it will change the balance to infinity thus enabling the user to bet any amount without a limit 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
code Copy code
Balance: $${item.balance}</span>
</p>
<p class="timestamp">${item.timestamp}</p>`;
historyContent.prepend(historyItem);
});
} Do not show a history content if user either do not increase or decrease their existing balance also have it so either the star0, star1, star2, star3 and star4 is not attached on each of the historybox. Have it so <button id="demoMode">Demo</button> will be selected as default at first. 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;
}
.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);
code Copy code
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});
}
code Copy code
<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);
}
}
code Copy code
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>
code Copy code
</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>
const canvas = document.getElementById('game'),
ctx = canvas.getContext('2d'),
currentMultiplier = document.getElementById('currentMultiplier'),
balanceDisplay = document.getElementById('balance'),
crashedAtDisplay = document.getElementById('crashedAt'),
betAmountInput = document.getElementById('betAmount'),
submitBetButton = document.getElementById('submitBet'),
takeProfitsButton = document.getElementById('takeProfits'),
historyContainer = document.getElementById('historyContainer'),
historyContent = document.getElementById('historyContent'),
historyButton = document.getElementById('historyButton'),
deleteAllDataButton = document.querySelector('.deleteAllData'),
exitHistoryButton = document.querySelector('.exitHistory'),
timerOverlay = document.querySelector('.timerOverlay'),
timerDisplay = document.querySelector('.timer'),
warningContainer = document.querySelector('.warning-container'),
progressRing = document.querySelector('.progress-ring'),
lastCrashesContainer = document.getElementById('lastCrashesContainer');
}
function updateCurvePoints() {
const lastPoint = curvePoints[curvePoints.length - 1];
let currentMult = parseFloat(currentMultiplier.innerText) || 1;
const increment = 0.7 * (1 + ((currentMult - 1) / 10));
let newX = lastPoint.x + increment;
const newY = Math.pow(newX, 1.5) / 100;
code Copy code
// Limit curve points within canvas width
if (newX > canvas.width) {
newX = canvas.width; // Stop at the canvas edge
// Optionally stop updating curvePoints visually if needed, but keep multiplier going
// clearInterval(gameLoop); // Uncomment this line to stop curve visually
}
curvePoints.push({ x: newX, y: newY });
let multiplier = (curvePoints.length / 50).toFixed(2); // Keep multiplier logic the same
currentMultiplier.innerText = `${multiplier}x`;
currentMultiplier.style.color = `hsl(${multiplier * 30}, 100%, 50%)`;
}
code Copy code
function startGame() {
curvePoints = [{
x: 0,
y: 0
}];
crashed = false;
profitsTaken = false;
updateCurve();
}
function getRandomCrashTime(betAmount) {
let bet = parseFloat(betAmount) || 0;
// Define base weight percentages for each tier with minimum 1.00x
let weights = {
low: 45, // 1.20x - 2.50x
medium: 35, // 2.51x - 5.00x
high: 15, // 5.01x - 20.00x
epic: 4, // 20.01x - 100.00x
legendary: 1 // 100.01x - 300.00x
};
// Adjust weights based on bet amount
if(bet > 500) {
weights.low += 20;
weights.medium += 10;
weights.high -= 15;
weights.epic -= 3;
weights.legendary -= 0.5;
}
// Ensure minimum weights
Object.keys(weights).forEach(key => {
weights[key] = Math.max(weights[key], 0.5);
});
let totalWeight = Object.values(weights).reduce((a, b) => a + b, 0);
let rnd = Math.random() * totalWeight;
let cumulative = 0;
let selectedTier;
for (let tier in weights) {
cumulative += weights[tier];
if(rnd <= cumulative) {
selectedTier = tier;
break;
}
}
// Generate multiplier based on tier with added randomization
let multiplier;
switch(selectedTier) {
case "low":
multiplier = 1.20 + (Math.random() * 1.30);
break;
case "medium":
multiplier = 2.51 + (Math.random() * 2.49);
break;
case "high":
multiplier = 5.01 + (Math.random() * 14.99);
break;
case "epic":
multiplier = 20.01 + (Math.random() * 79.99);
break;
case "legendary":
multiplier = 100.01 + (Math.random() * 199.99);
break;
default:
multiplier = 1.20 + (Math.random() * 0.80); // Fallback minimum 1.20x
}
// Add small random variation to avoid repetitive values
multiplier += (Math.random() * 0.09 - 0.045);
// Ensure minimum 1.00x
multiplier = Math.max(multiplier, 1.20);
return multiplier * 1000; // Convert to milliseconds
}
code Copy code
function crashCurve() {
betAmountInput.disabled = false;
clearInterval(gameLoop);
const crashValue = (curvePoints.length / 50).toFixed(2);
crashedAtDisplay.innerText = `Multiplier at crash: ${crashValue}x`;
crashed = true;
// Create