Scan to open on your phone
Point a camera at the QR code - it opens this exact paste, no app needed.
https://codepastes.com/zzgrpd46ew5dt8f9sin-tituloPlain Text
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Atrapa el cuadrado</title>
<style>
body {
text-align: center;
font-family: Arial;
background: #17172b;
color: white;
}
h1 { color: #ff5555; }
#zona {
width: 90%;
height: 400px;
background: #29294a;
margin: 20px auto;
position: relative;
border-radius: 15px;
overflow: hidden;
}
#cuadrado {
width: 45px;
height: 45px;
background: #ff3333;
position: absolute;
border-radius: 10px;
cursor: pointer;
}
button {
padding: 12px 25px;
font-size: 18px;
border: none;
border-radius: 10px;
background: #ff5555;
color: white;
cursor: pointer;
}
</style>
</head>
<body>
<h1>馃幆 隆Atrapa el cuadrado!</h1>
<h2>Puntos: <span id="puntos">0</span></h2>
<h2>Tiempo: <span id="tiempo">30</span>s</h2>
<button onclick="iniciar()">EMPEZAR</button>
<div id="zona">
<div id="cuadrado" onclick="atrapar()"></div>
</div>
<script>
let puntos = 0;
let tiempo = 30;
let jugando = false;
let reloj;
function mover() {
let zona = document.getElementById("zona");
let cuadrado = document.getElementById("cuadrado");
cuadrado.style.left =
Math.random() * (zona.clientWidth - 45) + "px";
cuadrado.style.top =
Math.random() * (zona.clientHeight - 45) + "px";
}
function iniciar() {
puntos = 0;
tiempo = 30;
jugando = true;
document.getElementById("puntos").textContent = puntos;
document.getElementById("tiempo").textContent = tiempo;
clearInterval(reloj);
mover();
reloj = setInterval(() => {
tiempo--;
document.getElementById("tiempo").textContent = tiempo;
if (tiempo <= 0) {
clearInterval(reloj);
jugando = false;
alert("隆Se acab贸! Tu puntuaci贸n: " + puntos);
}
}, 1000);
}
function atrapar() {
if (!jugando) return;
puntos++;
document.getElementById("puntos").textContent = puntos;
mover();
}
</script>
</body>
</html>
1,900 chars 路 codepastes.com