Added CC Navbar

This commit is contained in:
CodingPhoenixx
2026-02-13 08:35:30 +01:00
parent 61ebfec1c9
commit e77894cd48
8 changed files with 170 additions and 3 deletions
+5
View File
@@ -7,6 +7,7 @@ export type Route = {
export class Router {
private routes: Route[];
private outlet: HTMLElement;
onRouteChange?: (path: string) => void;
constructor(outlet: HTMLElement, routes: Route[]) {
this.routes = routes;
@@ -26,5 +27,9 @@ export class Router {
this.outlet.append(
match ? match.view() : document.createElement('not-found-page')
);
if (this.onRouteChange) {
this.onRouteChange(path);
}
}
}