styling, navigation bar, theming, article lists, page routing.

This commit is contained in:
Joshua Ashton
2025-03-20 19:54:37 -06:00
parent 5af0547864
commit c0fc9e9d00
28 changed files with 489 additions and 95 deletions
-1
View File
@@ -1,4 +1,3 @@
<foot></foot>
</body>
</html>
+15 -2
View File
@@ -3,8 +3,21 @@
<head>
<link href="css/base.css" rel="stylesheet" type="text/css">
<link href="css/text.css" rel="stylesheet" type="text/css">
<link href="css/images.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://nerdfonts.com/assets/css/webfont.css">
<?php
if ($_SESSION['theme'] == 'dark') {
echo '
<link href="css/dark.css" rel="stylesheet" type="text/css">
';
} elseif ($_SESSION['theme'] == 'light') {
echo '
<link href="css/light.css" rel="stylesheet" type="text/css">
';
}
?>
<script src="js/theme-toggle.js"></script>
</head>
<body>
<?php include 'nav.php'; ?>
+28
View File
@@ -0,0 +1,28 @@
<?php
$current_page = $_SERVER['SCRIPT_NAME'];
$nav = '
<nav>
<div class="row_no_margin">
<div class="site_navigation">
<ul>
<li><a href="/index.php"' . ($current_page == '/index.php' ? ' class="underline"' : '') . '>Home</a></li>
<li><a href="/articles.php"' . ($current_page == '/articles.php' ? ' class="underline"' : '') . '>Articles</a></li>
</ul>
</div>
<form method="post">
';
$theme_toggle = '';
if ($_SESSION['theme'] == 'dark')
$theme_toggle = 'light';
else
$theme_toggle = 'dark';
$nav .= '
<button id="theme-toggle" value="' . $theme_toggle . '" name="theme" onchange="this.form.submit()"><i class="nf ' . ($theme_toggle == 'dark' ? 'nf-oct-moon' : 'nf-oct-sun') . '"></i></button>
</form>
</div>
</nav>
';
echo $nav;