willy.club/views/templates/header.php
2023-02-12 14:54:12 +01:00

47 lines
1.4 KiB
PHP

<?php
function special_events(): string {
if (in_array(date('m'), ['12', '1'])) {
return 'Winter';
}
return 'Nothing';
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?=htmlspecialchars($title)?> - the Willy Club</title>
<link rel="stylesheet" href="<?=url('/static/style/fonts.css')?>">
<link rel="stylesheet" href="<?=url('/static/style/main.css')?>">
<link rel="shortcut icon" href="<?=url('/static/img/wc.gif')?>" type="image/x-icon">
</head>
<body>
<?php if (special_events() === 'Winter'): ?>
<script src="<?=url('/static/js/snow.js')?>"></script>
<?php endif; ?>
<header>
<div id="radio"></div>
<script>
// some browsers (cough cough safari) dont like the live broadcast and so just keeps loading forever
window.addEventListener('load', function () {
radio.innerHTML = `
<audio controls autoplay><source src="<?=url('/radio/hbr1/trance.ogg')?>?` + Date.now() + `" type="audio/ogg"></audio>
`;
});
</script>
<br>
<a href="<?=url('/')?>">
<img src="<?=url('/static/img/welcome-to-willy-club.png')?>" alt="Click here to go to the homepage!">
</a>
</header>
<hr>
<main>