Added navbar.

This commit is contained in:
sarah committed 2026-08-19 19:31:45 +02:00
1 parent 22662dd928
commit 0593a33649
4 files changed
+139 -7

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
<?php
$NavbarPages = [
"Home" => "/",
"Sarahtonin" => "/Pages/Sarahtonin.html"
];
?>
<nav class="Navbar" aria-label="Main navigation">
<?php foreach ($NavbarPages as $NavbarPage => $NavbarHref): ?>
<a
class="NavbarLink"
href="<?= htmlspecialchars($NavbarHref, ENT_QUOTES, "UTF-8") ?>"
aria-label="<?= htmlspecialchars($NavbarPage, ENT_QUOTES, "UTF-8") ?>"
title="<?= htmlspecialchars($NavbarPage, ENT_QUOTES, "UTF-8") ?>"
<?= ($PageTitle ?? "") === $NavbarPage ? 'aria-current="page"' : "" ?>
>
<img
class="NavbarIcon"
src="/Assets/Img/<?= rawurlencode($NavbarPage) ?>.png"
alt=""
>
</a>
<?php endforeach; ?>
</nav>
+2 -6
View File
@@ -10,6 +10,8 @@ $PageTitle = "Home";
<?php require __DIR__ . "/Bits/Head.php"; ?>
<body>
<?php require __DIR__ . "/Bits/Navbar.php"; ?>
<main class="MainContainer">
<h1>Welcome</h1>
@@ -18,12 +20,6 @@ $PageTitle = "Home";
Feel free to browse around as much as you want.
</p>
<p>
If you want to access <strong>other links</strong>, you probably need to join my tailscale network.
<br>
Also, this is simply the homepage. You can use the <strong>navbar</strong> to the right to navigate around.
</p>
<p>
<b>
Have fun snooping!
+2
View File
@@ -10,6 +10,8 @@ $PageTitle = "Sarahtonin";
<?php require __DIR__ . "/Bits/Head.php"; ?>
<body>
<?php require __DIR__ . "/Bits/Navbar.php"; ?>
<main class="MainContainer">
<h1>About me</h1>
+109 -1
View File
@@ -48,6 +48,13 @@ body {
margin: 0;
padding: 2rem;
display: grid;
grid-template-columns: minmax(0, 800px) auto;
justify-content: center;
align-items: start;
gap: 1rem;
min-height: 100vh;
font-family: inherit;
color: inherit;
}
@@ -58,8 +65,12 @@ body {
}
.MainContainer {
grid-column: 1;
grid-row: 1;
width: 100%;
max-width: 800px;
margin: 0 auto;
margin: 0;
padding: 2rem;
color: var(--Text);
@@ -182,3 +193,100 @@ input, button, textarea, select {
font-family: inherit;
color: inherit;
}
.Navbar {
grid-column: 2;
grid-row: 1;
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 0.5rem;
position: sticky;
top: 2rem;
align-self: start;
background-color: var(--Base);
border: 4px solid var(--Mauve);
}
.NavbarLink {
display: block;
width: 4rem;
height: 4rem;
padding: 0.4rem;
line-height: 0;
text-decoration: none;
background-color: var(--Mantle);
border: 3px solid var(--Surface2);
box-shadow: 3px 3px 0 var(--Crust);
}
.NavbarLink:hover {
background-color: var(--Surface0);
border-color: var(--Sky);
transform: translate(1px, 1px);
box-shadow: 2px 2px 0 var(--Crust);
}
.NavbarLink:focus-visible {
outline: 3px solid var(--Yellow);
outline-offset: 3px;
}
.NavbarLink[aria-current="page"] {
background-color: var(--Surface1);
border-color: var(--Mauve);
}
.NavbarLink[aria-current="page"]:hover {
background-color: var(--Surface2);
border-color: var(--Lavender);
}
.NavbarIcon {
display: block;
width: 100%;
height: 100%;
object-fit: contain;
image-rendering: pixelated;
}
@media (max-width: 700px) {
body {
grid-template-columns: minmax(0, 1fr);
gap: 1rem;
padding: 1rem;
}
.Navbar {
grid-column: 1;
grid-row: 1;
flex-direction: row;
width: 100%;
top: 0;
overflow-x: auto;
z-index: 1;
}
.NavbarLink {
flex: 0 0 3.5rem;
width: 3.5rem;
height: 3.5rem;
}
.MainContainer {
grid-column: 1;
grid-row: 2;
}
}