Highlight active tab
This commit is contained in:
parent
17a81b9fea
commit
9bc4267c6a
@ -98,6 +98,8 @@ body {
|
||||
#headerdiv .tabrow .tab:hover {
|
||||
cursor: pointer;
|
||||
background-color: #555; }
|
||||
#headerdiv .tabrow .tab_active {
|
||||
background-color: #422; }
|
||||
#headerdiv .tabrow .tab_split {
|
||||
flex: auto; }
|
||||
#headerdiv .tabrow .tab_github {
|
||||
|
@ -51,6 +51,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
.tab_active { background-color: #422; }
|
||||
|
||||
.tab_split {
|
||||
flex: auto;
|
||||
}
|
||||
|
@ -4,11 +4,11 @@
|
||||
</div>
|
||||
|
||||
<div class="tabrow">
|
||||
<a class="tab" href="/">Home</a>
|
||||
<a class="tab" href="/blog/1/Project_Euler_with_Befunge">Project Euler</a>
|
||||
<a class="tab" href="/blog">Blog</a>
|
||||
<a class="tab" href="/programs">Programs</a>
|
||||
<a class="tab" href="/about">About</a>
|
||||
<a class="tab <?php if ($HEADER_ACTIVE === 'home') echo 'tab_active'; ?>" href="/">Home</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 <?php if ($HEADER_ACTIVE === 'blog') echo 'tab_active'; ?>" href="/blog">Blog</a>
|
||||
<a class="tab <?php if ($HEADER_ACTIVE === 'programs') echo 'tab_active'; ?>" href="/programs">Programs</a>
|
||||
<a class="tab <?php if ($HEADER_ACTIVE === 'about') echo 'tab_active'; ?>" href="/about">About</a>
|
||||
<div class="tab_split" ></div>
|
||||
<a class="tab tab_github" href="https://github.com/Mikescher/">Github</a>
|
||||
</div>
|
||||
|
@ -75,6 +75,9 @@ $pathparts = preg_split('@/@', $path, NULL, PREG_SPLIT_NO_EMPTY);
|
||||
$partcount = count($pathparts);
|
||||
|
||||
global $OPTIONS;
|
||||
global $HEADER_ACTIVE;
|
||||
|
||||
$HEADER_ACTIVE = 'none';
|
||||
|
||||
foreach ($URL_RULES as $rule)
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ $allposts = Blog::listAllOrderedDescending();
|
||||
<body>
|
||||
<div id="mastercontainer">
|
||||
|
||||
<?php include (__DIR__ . '/../fragments/header.php'); ?>
|
||||
<?php $HEADER_ACTIVE='blog'; include (__DIR__ . '/../fragments/header.php'); ?>
|
||||
|
||||
<div id="content" class="content-responsive">
|
||||
|
||||
|
@ -36,7 +36,7 @@ if ($post === NULL) httpError(404, 'blogpost not found');
|
||||
<body>
|
||||
<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">
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<body>
|
||||
<div id="mastercontainer">
|
||||
|
||||
<?php include (__DIR__ . '/../fragments/header.php'); ?>
|
||||
<?php $HEADER_ACTIVE='home'; include (__DIR__ . '/../fragments/header.php'); ?>
|
||||
|
||||
<div id="content" class="content-responsive">
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user