aboutsummaryrefslogtreecommitdiff
path: root/inc/nav.inc.php
diff options
context:
space:
mode:
authorFrankie B <floppydisk05@aol.com>2022-11-15 22:20:35 +0000
committerFrankie B <floppydisk05@aol.com>2022-11-15 22:20:35 +0000
commit41efcbfbe5be1aafea665332f55cce74b27d6a3d (patch)
tree948cd688a7530d45c00d7c79f79e50e22027d5f6 /inc/nav.inc.php
parentd750dcc4d266ed5576599fcca4c9a996efc83ec4 (diff)
Move header and footer to .inc.php
Diffstat (limited to 'inc/nav.inc.php')
-rw-r--r--inc/nav.inc.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/inc/nav.inc.php b/inc/nav.inc.php
new file mode 100644
index 0000000..7fa3348
--- /dev/null
+++ b/inc/nav.inc.php
@@ -0,0 +1,42 @@
+<script src="/res/js/themeswap.js"></script>
+<div class="header">
+ <nav>
+ <div>
+ <a href="/projects/">projects</a> |
+ <a href="https://github.com/floppydisk05?tab=repositories">repos</a> |
+ <a href="/calculators/">calculators</a> |
+ <a href="/computers/">computers</a> |
+ <a href="/bookmarks/">bookmarks</a> |
+ <a href="https://blog.diskfloppy.me/">blog</a> |
+ <a href="/guestbook/">guestbook</a>
+ </div>
+ </nav>
+ <div class="pagetree">
+ <span class="title">
+ <?php
+ $uri = $_SERVER['REQUEST_URI'];
+ if ($uri === '/') { echo '~floppydisk'; }
+ else {
+ $uri = substr(substr($uri, 1), 0, -1);
+ if (!strpos($uri, '/')) {
+ $uriArr = explode('/', $uri);
+ $link = "/";
+ $links = '<a href="/">~floppydisk</a> / ';
+ $currentDir = basename(getcwd());
+ foreach($uriArr as $page) {
+ if ($page !== $currentDir) {
+ if ($link !== '/') $link = $link . '/' . $page;
+ else $link = $link . $page;
+ $links = $links . '<a href="' . $link . '">' . $page . '</a> / ';
+ }
+ }
+ $links = substr($links, 0, -3) . ' / ' . $currentDir;
+ echo $links;
+ }
+ }
+ ?>
+
+ </span>
+ <div style="float: right;"><a onclick="javascript:toggleTheme()">dark / light mode</a></div>
+ </div> <!-- pagetree -->
+</div> <!-- header --> \ No newline at end of file