|
| 1 | +--- |
| 2 | +import { styles } from "../../lib/theme" |
| 3 | +const currentRoute = new URL(Astro.request.url).pathname |
| 4 | +const navLinks = [ |
| 5 | + { href: "/leaderboards/ranked_1v1", text: "Leaderboard" }, |
| 6 | + { href: "/stats", text: "Stats" }, |
| 7 | + { href: "/social", text: "Content" }, |
| 8 | + { href: "/api", text: "API" }, |
| 9 | + { href: "/tools", text: "Tools" }, |
| 10 | + // { href: "/creators", text: "Creators" }, |
| 11 | +] |
| 12 | +--- |
| 13 | + |
| 14 | +<div |
| 15 | + class="to-black-20 sticky top-0 z-10 h-20 w-full border-b border-white/5 bg-gradient-to-r from-black/40 via-black/25 mix-blend-screen backdrop-blur md:h-16" |
| 16 | +> |
| 17 | + <nav |
| 18 | + class:list={[ |
| 19 | + styles.layout.container, |
| 20 | + "flex flex-wrap md:flex-nowrap items-center gap-y-2 py-2 md:min-h-16 md:py-4", |
| 21 | + ]} |
| 22 | + > |
| 23 | + <a |
| 24 | + href="/" |
| 25 | + class:list={[ |
| 26 | + styles.layout.containerPadding, |
| 27 | + "basis-full whitespace-nowrap md:pr-2 text-xl font-extrabold text-white/90 md:basis-auto ", |
| 28 | + ]} |
| 29 | + > |
| 30 | + Stormgate World |
| 31 | + </a> |
| 32 | + |
| 33 | + <div |
| 34 | + class:list={[ |
| 35 | + styles.layout.containerPadding, |
| 36 | + "scrollbar-hide -ml-2 flex max-w-full flex-auto gap-1 gap-y-2 overflow-x-auto md:ml-0 md:gap-4 md:pr-7", |
| 37 | + ]} |
| 38 | + > |
| 39 | + { |
| 40 | + navLinks.map(({ href, text }) => ( |
| 41 | + <a |
| 42 | + href={href} |
| 43 | + class:list={[ |
| 44 | + "font-extrabold rounded px-2 text-sm md:text-base md:px-3 py-1 md:py-1.5", |
| 45 | + currentRoute === href ? "bg-white/5 text-white/80" : "hover:bg-white/5 text-white/60 ", |
| 46 | + ]} |
| 47 | + > |
| 48 | + {text} |
| 49 | + </a> |
| 50 | + )) |
| 51 | + } |
| 52 | + |
| 53 | + <div class="flex-auto"></div> |
| 54 | + <div>{/*search etc */}</div> |
| 55 | + </div> |
| 56 | + </nav> |
| 57 | +</div> |
0 commit comments