flash.moe/components/header.php

52 lines
2.9 KiB
PHP
Raw Normal View History

2020-07-30 00:55:37 +00:00
<?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);
2020-07-30 00:55:37 +00:00
?>
<!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;?>/assets/2020v2.css" type="text/css" rel="stylesheet"/>
2020-08-20 19:56:46 +00:00
<link href="<?=$baseUrl;?>/assets/sprite.css" type="text/css" rel="stylesheet"/>
<link href="<?=$baseUrl;?>/css/electrolize/style.css" type="text/css" rel="stylesheet"/>
2020-07-30 00:55:37 +00:00
<?php if(isset($styles) && is_array($styles)) foreach($styles as $style): ?>
<link href="<?=$style;?>" type="text/css" rel="stylesheet"/>
<?php endforeach;?>
</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 ';} ?>">
2020-07-30 00:55:37 +00:00
<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="">
2020-07-30 00:55:37 +00:00
<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>
2020-07-30 00:55:37 +00:00
</div>
<div class="header-menu">
2020-07-30 00:55:37 +00:00
<?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>
2020-07-30 00:55:37 +00:00
<?php endforeach; ?>
</div>
2020-07-30 00:55:37 +00:00
</div>
</div>
</div>
<div class="container">