diff --git a/artifacts/skillguard/public/opengraph.jpg b/artifacts/skillguard/public/opengraph.jpg index 48325ff..b94562a 100644 Binary files a/artifacts/skillguard/public/opengraph.jpg and b/artifacts/skillguard/public/opengraph.jpg differ diff --git a/artifacts/skillguard/src/components/public-layout.tsx b/artifacts/skillguard/src/components/public-layout.tsx index cf2e14b..6dd2634 100644 --- a/artifacts/skillguard/src/components/public-layout.tsx +++ b/artifacts/skillguard/src/components/public-layout.tsx @@ -3,13 +3,29 @@ import { Shield, Search, ShieldCheck, Settings, LayoutDashboard } from "lucide-r import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; -const NAV = [ - { href: "/", label: "Katalog", match: (l: string) => l === "/" }, - { href: "/pruefen", label: "Skill prüfen", match: (l: string) => l.startsWith("/pruefen") }, -]; +const CATALOG_ANCHOR_ID = "skill-katalog"; + +function scrollToCatalog(attempts = 20) { + const el = document.getElementById(CATALOG_ANCHOR_ID); + if (el) { + el.scrollIntoView({ behavior: "smooth", block: "start" }); + } else if (attempts > 0) { + requestAnimationFrame(() => scrollToCatalog(attempts - 1)); + } +} export function PublicLayout({ children }: { children: React.ReactNode }) { - const [location] = useLocation(); + const [location, setLocation] = useLocation(); + + const handleCatalogClick = (e: React.MouseEvent) => { + e.preventDefault(); + if (location === "/") { + scrollToCatalog(); + } else { + setLocation("/"); + scrollToCatalog(); + } + }; return (