add active page, color to archives
This commit is contained in:
@ -991,7 +991,7 @@ table.alt tfoot {
|
||||
|
||||
/* Panel */
|
||||
.panel {
|
||||
padding: 4em 4em 2em 4em;
|
||||
padding: 4em 4em 4em 4em;
|
||||
transform: translateY(100vh);
|
||||
transition: transform 0.5s ease;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
@ -1650,4 +1650,8 @@ body.is-preload #main .thumb {
|
||||
|
||||
#footer p.copyright a {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
a.active-year {
|
||||
color: #ff629e;
|
||||
}
|
2
assets/css/main.min.css
vendored
2
assets/css/main.min.css
vendored
File diff suppressed because one or more lines are too long
@ -1127,7 +1127,7 @@ table.alt tfoot {
|
||||
/* Panel */
|
||||
|
||||
.panel {
|
||||
padding: 4em 4em 2em 4em;
|
||||
padding: 4em 4em 4em 4em;
|
||||
-moz-transform: translateY(100vh);
|
||||
-webkit-transform: translateY(100vh);
|
||||
-ms-transform: translateY(100vh);
|
||||
@ -2061,4 +2061,7 @@ body.is-preload #main .thumb {
|
||||
|
||||
#footer p.copyright a {
|
||||
color: inherit;
|
||||
}
|
||||
a.active-year{
|
||||
color: #ff629e;
|
||||
}
|
@ -15,6 +15,15 @@ if (is_dir($archivesPath)) {
|
||||
}
|
||||
rsort($years, SORT_NUMERIC);
|
||||
}
|
||||
|
||||
$currentYear = null;
|
||||
$requestUri = $_SERVER['REQUEST_URI'];
|
||||
|
||||
if (preg_match('#^/archives/(\d{4})/#', $requestUri, $matches)) {
|
||||
$currentYear = $matches[1];
|
||||
} elseif (basename($_SERVER['SCRIPT_NAME']) === 'index.php') {
|
||||
$currentYear = date('Y');
|
||||
}
|
||||
?>
|
||||
|
||||
<footer id="footer" class="panel">
|
||||
@ -45,7 +54,8 @@ if (is_dir($archivesPath)) {
|
||||
<section>
|
||||
<h2>Archives</h2>
|
||||
<?php foreach ($years as $year): ?>
|
||||
<h2><a href="/archives/<?= $year ?>/"><?= $year ?></a></h2>
|
||||
<?php $class = ($year == $currentYear) ? ' class="active-year"' : ''; ?>
|
||||
<h2><a href="/archives/<?= $year ?>/"<?= $class ?>><?= $year ?></a></h2>
|
||||
<?php endforeach; ?>
|
||||
</section>
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . '/inc/base/copyright.php'; ?>
|
||||
|
Reference in New Issue
Block a user