1
0

Highlight active tab

This commit is contained in:
Mike Schwörer 2018-01-03 01:03:43 +01:00
parent 17a81b9fea
commit 9bc4267c6a
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
7 changed files with 15 additions and 8 deletions

View File

@ -98,6 +98,8 @@ body {
#headerdiv .tabrow .tab:hover { #headerdiv .tabrow .tab:hover {
cursor: pointer; cursor: pointer;
background-color: #555; } background-color: #555; }
#headerdiv .tabrow .tab_active {
background-color: #422; }
#headerdiv .tabrow .tab_split { #headerdiv .tabrow .tab_split {
flex: auto; } flex: auto; }
#headerdiv .tabrow .tab_github { #headerdiv .tabrow .tab_github {

View File

@ -51,6 +51,8 @@
} }
} }
.tab_active { background-color: #422; }
.tab_split { .tab_split {
flex: auto; flex: auto;
} }

View File

@ -4,11 +4,11 @@
</div> </div>
<div class="tabrow"> <div class="tabrow">
<a class="tab" href="/">Home</a> <a class="tab <?php if ($HEADER_ACTIVE === 'home') echo 'tab_active'; ?>" href="/">Home</a>
<a class="tab" href="/blog/1/Project_Euler_with_Befunge">Project Euler</a> <a class="tab <?php if ($HEADER_ACTIVE === 'euler') echo 'tab_active'; ?>" href="/blog/1/Project_Euler_with_Befunge">Project Euler</a>
<a class="tab" href="/blog">Blog</a> <a class="tab <?php if ($HEADER_ACTIVE === 'blog') echo 'tab_active'; ?>" href="/blog">Blog</a>
<a class="tab" href="/programs">Programs</a> <a class="tab <?php if ($HEADER_ACTIVE === 'programs') echo 'tab_active'; ?>" href="/programs">Programs</a>
<a class="tab" href="/about">About</a> <a class="tab <?php if ($HEADER_ACTIVE === 'about') echo 'tab_active'; ?>" href="/about">About</a>
<div class="tab_split" ></div> <div class="tab_split" ></div>
<a class="tab tab_github" href="https://github.com/Mikescher/">Github</a> <a class="tab tab_github" href="https://github.com/Mikescher/">Github</a>
</div> </div>

View File

@ -75,6 +75,9 @@ $pathparts = preg_split('@/@', $path, NULL, PREG_SPLIT_NO_EMPTY);
$partcount = count($pathparts); $partcount = count($pathparts);
global $OPTIONS; global $OPTIONS;
global $HEADER_ACTIVE;
$HEADER_ACTIVE = 'none';
foreach ($URL_RULES as $rule) foreach ($URL_RULES as $rule)
{ {

View File

@ -17,7 +17,7 @@ $allposts = Blog::listAllOrderedDescending();
<body> <body>
<div id="mastercontainer"> <div id="mastercontainer">
<?php include (__DIR__ . '/../fragments/header.php'); ?> <?php $HEADER_ACTIVE='blog'; include (__DIR__ . '/../fragments/header.php'); ?>
<div id="content" class="content-responsive"> <div id="content" class="content-responsive">

View File

@ -36,7 +36,7 @@ if ($post === NULL) httpError(404, 'blogpost not found');
<body> <body>
<div id="mastercontainer"> <div id="mastercontainer">
<?php include (__DIR__ . '/../fragments/header.php'); ?> <?php $HEADER_ACTIVE = ($post['type']==='euler' && $subview==='') ? 'euler' : 'none'; include (__DIR__ . '/../fragments/header.php'); ?>
<div id="content" class="content-responsive"> <div id="content" class="content-responsive">

View File

@ -11,7 +11,7 @@
<body> <body>
<div id="mastercontainer"> <div id="mastercontainer">
<?php include (__DIR__ . '/../fragments/header.php'); ?> <?php $HEADER_ACTIVE='home'; include (__DIR__ . '/../fragments/header.php'); ?>
<div id="content" class="content-responsive"> <div id="content" class="content-responsive">