Meta Description" name="description" />
<!DOCTYPE html>
<html>
<head>
<title>Avitar1 Real Demo</title>
<style>
body{
margin:0;
background:#0f172a;
color:white;
text-align:center;
font-family:Arial;
}
h1{color:#00ffcc;margin-top:10px;}
#coins{margin:10px;font-size:18px;}
#multiplier{
font-size:60px;
margin:20px;
}
canvas{
background:#111827;
border-radius:10px;
margin-top:10px;
}
input,button{
padding:8px 15px;
font-size:16px;
margin:5px;
border:none;
border-radius:5px;
}
button{
cursor:pointer;
background:#00ffcc;
}
button:hover{
opacity:0.8;
}
.crash{color:red;}
.win{color:lime;}
</style>
</head>
<body>
<h1>Avitar1 Real Demo</h1>
<div id="coins"></div>
<div id="multiplier">1.00x</div>
<canvas id="graph" width="400" height="200"></canvas>
<br>
<input type="number" id="betAmount" placeholder="Enter Bet">
<br>
<button onclick="startGame()">Start</button>
<button onclick="cashOut()">Cash Out</button>
<!-- Sounds -->
<audio id="tickSound" src="https://actions.google.com/sounds/v1/cartoon/wood_plank_flicks.ogg"></audio>
<audio id="crashSound" src="https://actions.google.com/sounds/v1/explosions/explosion.ogg"></audio>
<audio id="winSound" src="https://actions.google.com/sounds/v1/cartoon/concussive_drum_hit.ogg"></audio>
<script>
let coins = localStorage.getItem("coins") ? parseInt(localStorage.getItem("coins")) : 1000;
let multiplier = 1.00;
let interval;
let crashPoint;
let gameRunning = false;
let bet = 0;
let ctx = document.getElementById("graph").getContext("2d");
let x = 0;
let y = 200;
function updateCoins(){
document.getElementById("coins").innerHTML = "Coins: " + coins;
localStorage.setItem("coins", coins);
}
updateCoins();
function drawGraph(){
ctx.lineTo(x, y);
ctx.strokeStyle = "#00ffcc";
ctx.stroke();
}
function resetGraph(){
ctx.clearRect(0,0,400,200);
ctx.beginPath();
x = 0;
y = 200;
}
function startGame(){
if(gameRunning) return;
bet = parseInt(document.getElementById("betAmount").value);
if(!bet || bet > coins){
alert("Invalid Bet!");
return;
}
coins -= bet;
updateCoins();
multiplier = 1.00;
crashPoint = (Math.random()*5 + 1.5).toFixed(2);
gameRunning = true;
resetGraph();
document.getElementById("multiplier").className="";
interval = setInterval(()=>{
multiplier += 0.05;
document.getElementById("multiplier").innerHTML = multiplier.toFixed(2)+"x";
// Graph movement
x += 4;
y -= 2;
drawGraph();
document.getElementById("tickSound").play();
if(multiplier >= crashPoint){
clearInterval(interval);
document.getElementById("multiplier").innerHTML="CRASH π₯";
document.getElementById("multiplier").className="crash";
document.getElementById("crashSound").play();
gameRunning=false;
}
},100);
}
function cashOut(){
if(!gameRunning) return;
clearInterval(interval);
let winAmount = Math.floor(bet * multiplier);
coins += winAmount;
updateCoins();
document.getElementById("multiplier").innerHTML="WIN π "+winAmount;
document.getElementById("multiplier").className="win";
document.getElementById("winSound").play();
gameRunning=false;
}
</script>
</body>
</html>4
2
10KB
10KB
178.0ms
192.0ms
239.0ms