Update index.php

This commit is contained in:
2025-12-29 20:43:42 +01:00
parent 463ef9eac7
commit e58d2c930a

View File

@@ -1,62 +1,15 @@
<?php
// later kan hier PHP score / sessions
<?php
echo "hellotjes"
?>
echo "yo ";
?>
<!DOCTYPE html>
<html lang="nl">
<html>
<head>
<meta charset="UTF-8">
<title>loading...</title>
<title>PHP test</title>
</head>
<body>
<h1>Kijk naar de tab 👆</h1>
<script>
// vaste dino positie
const dinoPos = 5;
// wereld (komma = obstakel)
let world = " , , , ";
let jumping = false;
let jumpFrames = 0;
function gameTick() {
// wereld schuift naar links
world = world.slice(1) + (Math.random() < 0.15 ? "," : " ");
let display = "";
for (let i = 0; i < world.length; i++) {
if (i === dinoPos) {
// dino
if (jumping && world[i] === ",") {
display += ";"; // springt over obstakel
} else {
display += ".";
}
} else {
display += world[i];
}
}
document.title = display;
// jump logica
if (jumping) {
jumpFrames--;
if (jumpFrames <= 0) jumping = false;
}
}
// space = jump
document.addEventListener("keydown", e => {
if (e.code === "Space" && !jumping) {
jumping = true;
jumpFrames = 4;
}
});
setInterval(gameTick, 180);
</script>
<h1>dit komt uit html</h1>
<p><?php echo "dit komt uit PHP"; ?></p>
</body>
</html>
</html>