Update index.php

This commit is contained in:
2025-12-29 20:36:54 +01:00
parent 0d169f4277
commit 515829ecb9

View File

@@ -1,13 +1,44 @@
<?php
echo "yo ";
// PHP startpunt (kan later scores / sessions doen)
?>
<!DOCTYPE html>
<html>
<html lang="nl">
<head>
<title>yippy</title>
<meta charset="UTF-8">
<title>T-REX</title>
</head>
<body>
<h1>dit komt uit html</h1>
<p><?php echo "dit komt uit PHP"; ?></p>
<h1>T-Rex Run (in de tab 😎)</h1>
<p>Kijk naar de titel van dit tabblad</p>
<script>
let trex = "🦖";
let ground = "____________________";
let pos = 0;
let dir = 1;
let score = 0;
function updateTitle() {
let before = ground.substring(0, pos);
let after = ground.substring(pos + 2);
// obstakel
let obstacle = (score % 10 === 0) ? "::" : " ";
document.title =
before + trex + after + obstacle + " score:" + score;
pos += dir;
if (pos <= 0 || pos >= ground.length - 2) {
dir *= -1;
}
score++;
}
setInterval(updateTitle, 200);
</script>
</body>
</html>