Update index.php
This commit is contained in:
41
index.php
41
index.php
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user