Files
dbx/docs/components/landing/LandingNav.tsx
T
t8y2 5cbb659d54 feat: redesign docs landing hero with Tailwind migration
- Migrate landing CSS from raw classes to Tailwind v4 utilities (~1180 → ~680 lines)
- Add @theme block with landing design tokens
- Shrink download button, add OS auto-detection
- Nav bar transparent at top, glass effect on scroll
- Adjust hero spacing, title size, background color
- Remove white background from logo and favicon
- Force subtitle to single line on desktop
2026-05-16 16:03:04 +08:00

27 lines
598 B
TypeScript

'use client';
import { useEffect, useRef } from 'react';
export function LandingNav({ children }: { children: React.ReactNode }) {
const ref = useRef<HTMLElement>(null);
useEffect(() => {
const node = ref.current;
if (!node) return;
function onScroll() {
node!.classList.toggle('is-scrolled', window.scrollY > 60);
}
onScroll();
window.addEventListener('scroll', onScroll, { passive: true });
return () => window.removeEventListener('scroll', onScroll);
}, []);
return (
<nav ref={ref} className="landing-nav">
{children}
</nav>
);
}