Subir archivos a "/"

Archivos iniciales
This commit is contained in:
2026-06-15 17:15:03 +02:00
commit 5ffa8a150b
3 changed files with 59 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
//La movemos cada 1000ms
setInterval(moverGallina, 500);
//InnerHeight y Width pa que no se salva de la pantalla.
function moverGallina() {
let top = Math.floor(Math.random() * (innerHeight - 100 + 1) + 100);
let right = Math.floor(Math.random() * (innerHeight - 100 + 1) + 100);
let bottom = Math.floor(Math.random() * innerWidth + 100);
let left = Math.floor(Math.random() * (innerWidth - 100 + 1) + 100);
//Lo de las comillas y el dolar dolor de wevos
document.getElementById("gallina").style.margin =
`${top}px ${right}px ${bottom}px ${left}px`;
}
function ganar(){
alert('¡Has pillado a la gallina!');
}