???
All checks were successful
Docker Deploy / build-and-push (push) Successful in 5m9s

This commit is contained in:
Atridad Lahiji 2025-04-28 02:18:59 -06:00
parent ae10c14cc8
commit 5a9a02b772
Signed by: atridad
SSH key fingerprint: SHA256:LGomp8Opq0jz+7kbwNcdfTcuaLRb5Nh0k5AchDDb438
3 changed files with 45 additions and 42 deletions

View file

@ -20,7 +20,10 @@ export default function Chat() {
setUsername(`User${randomNum}`); setUsername(`User${randomNum}`);
} }
const ws = new WebSocket(`ws://${globalThis.location.host}/api/chat`); const wsProtocol = window.location.protocol === "https:" ? "wss:" : "ws:";
const ws = new WebSocket(
`${wsProtocol}//${globalThis.location.host}/api/chat`,
);
ws.onopen = () => { ws.onopen = () => {
console.log("Connected to chat"); console.log("Connected to chat");

View file

@ -53,48 +53,50 @@ export default function NavigationBar({ currentPath }: NavigationBarProps) {
isScrolling.value ? "opacity-30" : "opacity-100" isScrolling.value ? "opacity-30" : "opacity-100"
} ${isVisible.value ? "translate-y-0" : "translate-y-20"}`} } ${isVisible.value ? "translate-y-0" : "translate-y-20"}`}
> >
<ul class="menu menu-horizontal bg-base-200 rounded-box p-2 shadow-lg flex flex-nowrap whitespace-nowrap overflow-x-auto"> <div class="overflow-visible">
<li class="mx-1"> <ul class="menu menu-horizontal bg-base-200 rounded-box p-2 shadow-lg flex flex-nowrap whitespace-nowrap">
<a href="/" class={currentPath === "/" ? "menu-active" : ""}> <li class="mx-1">
<div class="tooltip" data-tip="Home"> <a href="/" class={currentPath === "/" ? "menu-active" : ""}>
<LuHouse class="text-xl" /> <div class="tooltip" data-tip="Home">
</div> <LuHouse class="text-xl" />
</a> </div>
</li> </a>
</li>
<li class="mx-1"> <li class="mx-1">
<a <a
href="/posts" href="/posts"
class={isPostsPath(currentPath) ? "menu-active" : ""} class={isPostsPath(currentPath) ? "menu-active" : ""}
> >
<div class="tooltip" data-tip="Posts"> <div class="tooltip" data-tip="Posts">
<LuNotebookPen class="text-xl" /> <LuNotebookPen class="text-xl" />
</div> </div>
</a> </a>
</li> </li>
<li class="mx-1"> <li class="mx-1">
<a <a
href="/projects" href="/projects"
class={currentPath.startsWith("/projects") ? "menu-active" : ""} class={currentPath.startsWith("/projects") ? "menu-active" : ""}
> >
<div class="tooltip" data-tip="Projects"> <div class="tooltip" data-tip="Projects">
<LuCodeXml class="text-xl" /> <LuCodeXml class="text-xl" />
</div> </div>
</a> </a>
</li> </li>
<li class="mx-1"> <li class="mx-1">
<a <a
href="/chat" href="/chat"
class={currentPath.startsWith("/chat") ? "menu-active" : ""} class={currentPath.startsWith("/chat") ? "menu-active" : ""}
> >
<div class="tooltip" data-tip="Chat"> <div class="tooltip" data-tip="Chat">
<LuMessageCircle class="text-xl" /> <LuMessageCircle class="text-xl" />
</div> </div>
</a> </a>
</li> </li>
</ul> </ul>
</div>
</div> </div>
); );
} }

View file

@ -3,14 +3,12 @@ import { join } from "@std/path";
const POSTS_DIR = "./posts"; const POSTS_DIR = "./posts";
// This is what gets parsed from the post front matter
interface FrontMatter { interface FrontMatter {
title: string; title: string;
published_at: string; published_at: string;
blurb: string; blurb: string;
} }
// This is what gets used for rendering
export interface Post { export interface Post {
slug: string; slug: string;
title: string; title: string;