From f26b72c406a285c21eca90ac38b25ed501ba6789 Mon Sep 17 00:00:00 2001
From: pancakes
Date: Fri, 12 Sep 2025 15:04:24 +1000
Subject: [PATCH] Add Navbar
---
.../Components/Layout/MainLayout.razor | 7 ++-
PancakesWeb/Components/UI/Navbar.razor | 23 +++++++
PancakesWeb/Components/UI/Navbar.razor.css | 63 +++++++++++++++++++
PancakesWeb/wwwroot/style.css | 15 +++++
4 files changed, 107 insertions(+), 1 deletion(-)
create mode 100644 PancakesWeb/Components/UI/Navbar.razor
create mode 100644 PancakesWeb/Components/UI/Navbar.razor.css
diff --git a/PancakesWeb/Components/Layout/MainLayout.razor b/PancakesWeb/Components/Layout/MainLayout.razor
index c0c77b3..7ef0b71 100644
--- a/PancakesWeb/Components/Layout/MainLayout.razor
+++ b/PancakesWeb/Components/Layout/MainLayout.razor
@@ -1,7 +1,12 @@
-@inherits LayoutComponentBase
+@using PancakesWeb.Components.UI
+@inherits LayoutComponentBase
Skip to main content
+
+
@Body
diff --git a/PancakesWeb/Components/UI/Navbar.razor b/PancakesWeb/Components/UI/Navbar.razor
new file mode 100644
index 0000000..efc6303
--- /dev/null
+++ b/PancakesWeb/Components/UI/Navbar.razor
@@ -0,0 +1,23 @@
+@using PancakesWeb.Data
+
+
\ No newline at end of file
diff --git a/PancakesWeb/Components/UI/Navbar.razor.css b/PancakesWeb/Components/UI/Navbar.razor.css
new file mode 100644
index 0000000..52aab4c
--- /dev/null
+++ b/PancakesWeb/Components/UI/Navbar.razor.css
@@ -0,0 +1,63 @@
+.nav-content {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: end;
+ gap: 1rem;
+
+ margin: 0 0 2rem;
+ padding: 1rem;
+
+ list-style: none;
+}
+
+.nav-item {
+ display: inline-flex;
+ align-items: center;
+}
+
+.brand {
+ margin-right: auto;
+}
+
+.brand .nav-img {
+ height: 2em;
+
+ border-radius: var(--radius);
+}
+
+.nav-link {
+ display: inline-flex;
+ flex-direction: row;
+ align-items: center;
+ gap: 0.5rem;
+
+ text-decoration-line: none;
+}
+
+.nav-link:hover {
+ text-decoration-line: underline;
+}
+
+.nav-img {
+ aspect-ratio: 1;
+ height: 1.5em;
+ object-fit: contain;
+}
+
+.nav-img.invert-icon {
+ filter: invert() hue-rotate(180deg);
+}
+
+@media screen and (max-width: 768px) {
+ /* Hide labels while still being accessible by screen readers */
+ .nav-link.can-hide-label {
+ gap: 0;
+ }
+
+ .can-hide-label .nav-label {
+ width: 0;
+ height: 0;
+ overflow: hidden;
+ }
+}
\ No newline at end of file
diff --git a/PancakesWeb/wwwroot/style.css b/PancakesWeb/wwwroot/style.css
index 8944870..a65cdeb 100644
--- a/PancakesWeb/wwwroot/style.css
+++ b/PancakesWeb/wwwroot/style.css
@@ -30,6 +30,7 @@
--font-mono: monospace;
/* Layout variables */
+ --container-width: 768px;
--radius: 0.5rem;
font-family: var(--font-main), sans-serif;
@@ -49,4 +50,18 @@ body {
color-scheme: light dark;
background-color: var(--background);
color: var(--text);
+}
+
+a {
+ color: var(--accent);
+}
+
+a:visited {
+ color: var(--accent);
+}
+
+.container {
+ margin-left: auto;
+ margin-right: auto;
+ max-width: var(--container-width);
}
\ No newline at end of file