Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

style(site): 升级 Header 导航栏为 Pireel 同款吸顶毛玻璃悬浮胶囊样式

tianma-if2e4a7620b725
diff --git a/apps/site/src/components/navbar/dropdown.astro b/apps/site/src/components/navbar/dropdown.astro
index 8b0e14eb..2560ead4 100644
--- a/apps/site/src/components/navbar/dropdown.astro
+++ b/apps/site/src/components/navbar/dropdown.astro
@@ -6,15 +6,15 @@ const { title, lastItem, children } = Astro.props;
<li class="relative">
<DropdownContainer class="group">
<button
- class="flex items-center gap-1 w-full lg:w-auto lg:px-3 py-2 text-gray-600 hover:text-gray-900">
+ class="flex items-center gap-1.5 w-full lg:w-auto px-3 py-1.5 text-xs font-semibold text-slate-600 hover:text-emerald-700 hover:bg-emerald-50/60 rounded-full transition-all duration-200">
<span>{title}</span>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
- stroke-width="3"
+ stroke-width="2.5"
stroke="currentColor"
- class="w-3 h-3 mt-0.5 group-open:rotate-180">
+ class="w-3 h-3 text-slate-400 group-hover:text-emerald-600 group-open:rotate-180 transition-transform duration-200">
<path
stroke-linecap="round"
stroke-linejoin="round"
@@ -24,18 +24,18 @@ const { title, lastItem, children } = Astro.props;
<DropdownItems>
<div
class:list={[
- "lg:absolute w-full lg:w-48 z-50",
+ "lg:absolute w-full lg:w-52 z-50 mt-2",
lastItem
? "lg:right-0 origin-top-right"
: "lg:left-0 origin-top-left",
]}>
<div
- class="px-3 lg:py-2 lg:bg-white lg:rounded-md lg:shadow-sm lg:border flex flex-col">
+ class="p-1.5 lg:bg-white/95 lg:backdrop-blur-md lg:rounded-2xl lg:shadow-xl lg:border lg:border-slate-200/90 flex flex-col gap-0.5">
{
children.map((item) => (
<a
href={item.path}
- class="py-1 text-gray-600 hover:text-gray-900">
+ class="px-3 py-2 text-xs font-medium text-slate-600 hover:text-emerald-700 hover:bg-emerald-50/80 rounded-xl transition-colors">
{item.title}
</a>
))
diff --git a/apps/site/src/components/navbar/navbar.astro b/apps/site/src/components/navbar/navbar.astro
index 68fde26d..48419bff 100644
--- a/apps/site/src/components/navbar/navbar.astro
+++ b/apps/site/src/components/navbar/navbar.astro
@@ -1,5 +1,4 @@
---
-import Container from "@/components/container.astro";
import Dropdown from "./dropdown.astro";
import LanguageSwitcher from "./language-switcher.astro";
import { Icon } from "astro-icon/components";
@@ -45,29 +44,79 @@ const menuitems = [
];
---
-<Container>
- <header class="flex flex-col lg:flex-row justify-between items-center my-5">
+<header class="sticky top-3 md:top-4 z-50 max-w-5xl mx-auto px-4">
+ <div class="relative rounded-full border border-slate-200/90 bg-white/85 backdrop-blur-md shadow-xs transition-all duration-300 hover:shadow-md hover:border-slate-300/90 px-4 py-2">
<Astronav>
- <div class="flex w-full lg:w-auto items-center justify-between">
- <a href={getLocalizedPath(locale, "/")} class="flex items-center gap-2 text-lg" aria-label={copy.homeAria}
- >
- <span class="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-[var(--edgeever-brand-logo-bg)]">
- <svg class="h-6 w-6" viewBox="0 0 64 64" role="img" aria-hidden="true">
+ <div class="flex items-center justify-between">
+ <!-- Logo Left -->
+ <a href={getLocalizedPath(locale, "/")} class="flex items-center gap-2 text-base select-none" aria-label={copy.homeAria}>
+ <span class="flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-[var(--edgeever-brand-logo-bg)] shadow-xs">
+ <svg class="h-5 w-5" viewBox="0 0 64 64" role="img" aria-hidden="true">
<rect x="14" y="10" width="36" height="44" rx="8" fill="var(--edgeever-brand-logo-mark)" />
<path d="M24 23h18v5H30v5h11v5H30v6h13v5H24V23Z" fill="var(--edgeever-brand-surface)" />
<path d="M19 16h26" stroke="var(--edgeever-brand-logo-accent)" stroke-width="3" stroke-linecap="round" />
</svg>
</span>
- <span>
- <span class="font-bold text-slate-800">Edge</span><span class="text-slate-500">Ever</span>
+ <span class="font-bold text-slate-800 tracking-tight text-sm md:text-base">
+ Edge<span class="text-emerald-700">Ever</span>
</span>
</a>
- <div class="block lg:hidden">
- <MenuIcon class="w-4 h-4 text-gray-800" />
+
+ <!-- Desktop Navigation Items Center -->
+ <MenuItems class="hidden lg:flex items-center gap-1">
+ <ul class="flex items-center gap-1">
+ {
+ menuitems.map((item, index) => (
+ <>
+ {item.children && (
+ <Dropdown
+ title={item.title}
+ children={item.children}
+ lastItem={index === menuitems.length - 1}
+ />
+ )}
+
+ {!item.children && (
+ <li>
+ <a
+ href={item.path}
+ class="px-3 py-1.5 text-xs font-semibold text-slate-600 hover:text-emerald-700 hover:bg-emerald-50/60 rounded-full transition-all duration-200"
+ >
+ <span>{item.title}</span>
+ </a>
+ </li>
+ )}
+ </>
+ ))
+ }
+ </ul>
+ </MenuItems>
+
+ <!-- Right Side Actions: Language Switcher & Open Source GitHub Button -->
+ <div class="hidden lg:flex items-center gap-3">
+ <LanguageSwitcher pathname={Astro.url.pathname} />
+ <a
+ href="https://github.com/tianma-if/edgeever"
+ target="_blank"
+ rel="noopener"
+ class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold text-slate-700 hover:text-emerald-700 bg-white hover:bg-emerald-50/50 border border-slate-200/90 hover:border-emerald-400 rounded-full transition-all duration-200 shadow-2xs"
+ aria-label="GitHub"
+ >
+ <Icon class="h-4 w-4 text-slate-800" name="bx:bxl-github" />
+ <span>{copy.openSource}</span>
+ </a>
+ </div>
+
+ <!-- Mobile Menu Toggle Button -->
+ <div class="flex items-center gap-2 lg:hidden">
+ <LanguageSwitcher pathname={Astro.url.pathname} compact />
+ <MenuIcon class="w-5 h-5 text-slate-700 cursor-pointer p-0.5 rounded-md hover:bg-slate-100 transition-colors" />
</div>
</div>
- <MenuItems class="hidden w-full lg:w-auto mt-2 lg:flex lg:mt-0">
- <ul class="flex flex-col lg:flex-row lg:gap-3">
+
+ <!-- Mobile Dropdown Menu -->
+ <MenuItems class="hidden w-full lg:hidden pt-3 pb-2 border-t border-slate-100 mt-2">
+ <ul class="flex flex-col gap-1">
{
menuitems.map((item, index) => (
<>
@@ -83,13 +132,9 @@ const menuitems = [
<li>
<a
href={item.path}
- class="flex lg:px-3 py-2 items-center text-gray-600 hover:text-gray-900">
- <span> {item.title}</span>
- {item.badge && (
- <span class="ml-1 px-2 py-0.5 text-[10px] animate-pulse font-semibold uppercase text-white bg-indigo-600 rounded-full">
- New
- </span>
- )}
+ class="block px-3 py-2 text-xs font-semibold text-slate-600 hover:text-emerald-700 hover:bg-emerald-50/60 rounded-xl transition-all"
+ >
+ <span>{item.title}</span>
</a>
</li>
)}
@@ -97,7 +142,7 @@ const menuitems = [
))
}
</ul>
- <div class="lg:hidden flex items-center mt-3 gap-4">
+ <div class="flex items-center mt-3 pt-2 border-t border-slate-100 gap-3">
<a
href="https://github.com/tianma-if/edgeever"
target="_blank"
@@ -108,24 +153,8 @@ const menuitems = [
<Icon class="h-4 w-4 text-slate-800" name="bx:bxl-github" />
<span>{copy.openSource}</span>
</a>
- <LanguageSwitcher pathname={Astro.url.pathname} compact />
</div>
</MenuItems>
</Astronav>
- <div>
- <div class="hidden lg:flex items-center gap-4">
- <LanguageSwitcher pathname={Astro.url.pathname} />
- <a
- href="https://github.com/tianma-if/edgeever"
- target="_blank"
- rel="noopener"
- class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold text-slate-700 hover:text-slate-900 bg-white hover:bg-slate-50 border border-slate-200 hover:border-slate-300 rounded-full transition-all duration-200 shadow-2xs"
- aria-label="GitHub"
- >
- <Icon class="h-4 w-4 text-slate-800" name="bx:bxl-github" />
- <span>{copy.openSource}</span>
- </a>
- </div>
- </div>
- </header>
-</Container>
+ </div>
+</header>