flash.moe/components/header.php
2022-02-05 03:35:42 +00:00

58 lines
3.1 KiB
PHP

<?php
$menu = isset($menu) && is_array($menu) ? $menu : FM_NAV;
$backgrounds = isset($backgrounds) && is_array($backgrounds) ? $backgrounds : FM_BGS;
$baseUrl = empty($external) ? '' : '//' . $_SERVER['HTTP_HOST'];
$showNowPlaying = !empty($is_index) || !empty($do_fullscreen_header);
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title><?=($title ?? 'flash.moe');?></title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
<link href="<?=$baseUrl;?>/css/2021.css" type="text/css" rel="stylesheet"/>
<link href="<?=$baseUrl;?>/assets/sprite.css" type="text/css" rel="stylesheet"/>
<link href="<?=$baseUrl;?>/css/electrolize/style.css" type="text/css" rel="stylesheet"/>
<?php if(isset($styles) && is_array($styles)) foreach($styles as $style): ?>
<link href="<?=$style;?>" type="text/css" rel="stylesheet"/>
<?php endforeach;?>
<?php if(isset($is_365) && $is_365): ?>
<style type="text/css">
body {
transform: rotate(<?=date('z');?>deg);
}
</style>
<?php endif; ?>
</head>
<body class="<?php if(isset($is_index)) { echo 'index ';} if(isset($do_fullscreen_header)) { echo 'fullscreen-header ';} if(isset($is_now_playing)) { echo 'now-playing ';} ?>">
<div class="header">
<div class="header-background">
<img src="<?=($backgrounds[array_rand($backgrounds)]);?>" alt=""/>
</div>
<div class="header-foreground"<?php if(isset($offset) && $offset > 0) echo " style=\"padding-bottom: {$offset}px\""; ?>>
<a class="header-logo" href="/" data-fm-dynload="">
<div class="header-flash">flash</div>
<div class="header-wave">wave</div>
</a>
<div class="header-right">
<div class="header-now-playing header-now-playing-hidden">
<div class="header-now-playing-icon" title="Now listening to...">
<a href="/now-listening" data-fm-dynload=""><div class="fmi fmi-music"></div></a>
</div>
<div class="header-now-playing-cover">
<img src="//now.flash.moe/resources/no-cover.png" alt=""/>
</div>
<div class="header-now-playing-details">
<div class="header-now-playing-title"><a href="#" target="_blank" rel="noopener"></a></div>
<div class="header-now-playing-artist"><a href="#" target="_blank" rel="noopener"></a></div>
</div>
</div>
<div class="header-menu">
<?php foreach($menu as $link): ?>
<a href="<?=$link['link'];?>"<?php if($link['link'][0] === '/' && substr($link['link'], 0, 2) !== '//') { echo ' data-fm-dynload=""'; } ?>><?=$link['title'];?></a>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<div class="container">