HTML cleanup, make header mobile-friendly

This commit is contained in:
ruan 2015-09-23 09:14:38 +02:00
parent 17f13948f0
commit 8bc3af57f9
6 changed files with 57 additions and 31 deletions

View File

@ -1,7 +1,3 @@
body {
padding-top: 70px;
}
.noselect { .noselect {
-webkit-touch-callout: none; -webkit-touch-callout: none;
-webkit-user-select: none; -webkit-user-select: none;

View File

@ -0,0 +1,3 @@
<script src="includes/js/jquery.min.js"></script>
<script src="includes/js/bootstrap.min.js"></script>
<?php echo "</html>"; ?>

View File

@ -1,7 +0,0 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="LiteBans">
<link rel="shortcut icon" href="includes/img/minecraft.ico">
<link href="includes/css/bootstrap.css" rel="stylesheet">
<link href="includes/css/custom.css" rel="stylesheet">

View File

@ -3,24 +3,59 @@ namespace litebans;
require_once './includes/settings.php'; require_once './includes/settings.php';
$settings = new Settings(false); $settings = new Settings(false);
function navbar($links) {
echo '<ul class="nav navbar-nav">';
foreach ($links as $page => $title) {
$li = "li";
if ((substr($_SERVER['SCRIPT_NAME'], -strlen($page))) === $page) {
$li .= ' class="active"';
}
echo "<$li><a href=\"$page\">$title</a></li>";
}
echo '</ul>';
}
?> ?>
<div class="navbar navbar-default navbar-fixed-top" role="navigation"> <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="LiteBans">
<link rel="shortcut icon" href="includes/img/minecraft.ico">
<!-- CSS -->
<link href="includes/css/bootstrap.css" rel="stylesheet">
<link href="includes/css/custom.css" rel="stylesheet">
</head>
<header class="navbar navbar-default navbar-static-top" role="banner">
<div class="container"> <div class="container">
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#litebans-navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?php echo $settings->name_link; ?>"><?php echo $settings->name; ?></a> <a class="navbar-brand" href="<?php echo $settings->name_link; ?>"><?php echo $settings->name; ?></a>
</div> </div>
<div class="navbar-collapse collapse"> <nav id="litebans-navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav"> <?php
<li><a href="index.php">Home</a></li> navbar(array(
<li><a href="bans.php">Bans</a></li> "index.php" => "Home",
<li><a href="mutes.php">Mutes</a></li> "bans.php" => "Bans",
<li><a href="warnings.php">Warnings</a></li> "mutes.php" => "Mutes",
<li><a href="kicks.php">Kicks</a></li> "warnings.php" => "Warnings",
</ul> "kicks.php" => "Kicks",
<p class="navbar-text" style="float: right; font-size:15px;">&copy; ));
<a href="https://www.spigotmc.org/resources/litebans.3715/" target="_blank">LiteBans</a> ?>
</div> <div class="nav navbar-nav navbar-right">
<a href="https://www.spigotmc.org/resources/litebans.3715/" class="navbar-text"
target="_blank">&copy; LiteBans</a>
</div>
</nav>
</div> </div>
</div> </header>
<script src="includes/js/jquery.min.js"></script>
<script src="includes/js/bootstrap.min.js"></script>

View File

@ -7,7 +7,6 @@ use PDOException;
class Page { class Page {
public function __construct($name, $header = true) { public function __construct($name, $header = true) {
if ($header) { if ($header) {
require_once './includes/head.php';
require_once './includes/header.php'; require_once './includes/header.php';
} }
require_once './includes/settings.php'; require_once './includes/settings.php';
@ -329,9 +328,10 @@ class Page {
if ($container_end) { if ($container_end) {
echo "</div></div></div>"; echo "</div></div></div>";
} }
include './includes/footer.php';
$time = microtime(true) - $this->time; $time = microtime(true) - $this->time;
echo "<!-- Page generated in $time seconds. -->"; echo "<!-- Page generated in $time seconds. -->";
include_once './includes/footer.php';
} }
public function table_begin() { public function table_begin() {

View File

@ -1,8 +1,7 @@
<?php <?php
namespace litebans; namespace litebans;
include './includes/head.php'; include_once './includes/header.php';
include './includes/header.php';
include_once './includes/settings.php'; include_once './includes/settings.php';
$settings = new Settings(false); $settings = new Settings(false);
?> ?>
@ -14,4 +13,4 @@ $settings = new Settings(false);
<div style="text-align: center;"><p>Here is where our Bans, Mutes, Warnings, and Kicks are listed.</p></div> <div style="text-align: center;"><p>Here is where our Bans, Mutes, Warnings, and Kicks are listed.</p></div>
</div> </div>
</div> </div>
<?php include './includes/footer.php'; ?> <?php include_once './includes/footer.php'; ?>