From ccceacba0795f1bcc3e066a41892ed096c0e1a88 Mon Sep 17 00:00:00 2001 From: Moepchi Date: Sat, 22 Aug 2026 23:17:31 +0200 Subject: [PATCH] Polish landing navigation and section motion --- web/src/landing.css | 12 ++++++++++++ web/src/landing.tsx | 17 ++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/web/src/landing.css b/web/src/landing.css index c1af104..23f2586 100644 --- a/web/src/landing.css +++ b/web/src/landing.css @@ -98,3 +98,15 @@ @media(max-width:800px){.community-grid{grid-template-columns:1fr}.community-grid>a{min-height:190px}.community-grid p{min-height:auto}} @media(max-width:600px){.community{padding:72px 0}.community-grid{margin-top:28px}.community-note{align-items:flex-start;text-align:left}} + +/* Floating navigation and scroll-aware section state */ +.nav{position:sticky;z-index:50;top:12px;height:64px;margin-top:12px;padding:0 16px;border:1px solid #ffffff17;border-radius:14px;background:#07131bd9;box-shadow:0 15px 45px #0005,inset 0 1px #ffffff08;backdrop-filter:blur(18px) saturate(135%);-webkit-backdrop-filter:blur(18px) saturate(135%)}.nav .brand img{transition:transform .3s ease,box-shadow .3s ease}.nav .brand:hover img{transform:rotate(-5deg) scale(1.06);box-shadow:0 0 22px #31cdf535}.nav nav{height:100%;align-items:center}.nav nav a{position:relative;display:flex;height:100%;align-items:center;transition:color .22s ease}.nav nav a:after{content:"";position:absolute;left:50%;right:50%;bottom:-1px;height:2px;border-radius:99px;background:#3bd3fa;box-shadow:0 0 12px #3bd3fa;transition:left .25s ease,right .25s ease}.nav nav a:hover:after,.nav nav a.active:after{left:0;right:0}.nav nav a.active{color:#e9f8fe}.nav-github{transition:color .22s ease,border-color .22s ease,background .22s ease,transform .22s ease}.nav-github:hover{transform:translateY(-1px);border-color:#3bd2f74a;background:#26c9f20c} + +/* Staggered motion for the newer landing-page sections */ +.connect-steps article,.github-metrics article,.browser-table article,.community-grid>a{opacity:0;transform:translateY(22px);transition:opacity .55s ease,transform .6s cubic-bezier(.2,.75,.25,1),border-color .25s ease,background .25s ease}.is-visible .connect-steps article,.is-visible .github-metrics article,.is-visible .browser-table article,.is-visible .community-grid>a{opacity:1;transform:none}.is-visible .connect-steps article:nth-child(2),.is-visible .github-metrics article:nth-child(2),.is-visible .browser-table article:nth-child(2),.is-visible .community-grid>a:nth-child(2){transition-delay:90ms}.is-visible .connect-steps article:nth-child(3),.is-visible .github-metrics article:nth-child(3),.is-visible .browser-table article:nth-child(3),.is-visible .community-grid>a:nth-child(3){transition-delay:180ms}.is-visible .browser-table article:nth-child(4){transition-delay:270ms}.github-metrics article>span{transform-origin:center;transition:transform .3s ease}.github-metrics article:hover>span{transform:rotate(-8deg) scale(1.22)}.github-metrics article{transition-property:opacity,transform,border-color,background}.github-metrics article:hover{border-color:#39d4f83c;background:#0a1a23}.browser-table article{transition-property:opacity,transform,background}.browser-table article:hover{background:#0c1b24}.browser-logo{transition:transform .3s cubic-bezier(.2,.8,.2,1),box-shadow .3s ease}.browser-table article:hover .browser-logo{transform:rotate(-7deg) scale(1.09);box-shadow:0 0 22px #39d6f425}.community.is-visible:before{animation:community-glow 8s ease-in-out infinite}.community-note span{animation:community-pulse 2.1s ease-in-out infinite}@keyframes community-glow{0%,100%{transform:translate(0,0) scale(1)}50%{transform:translate(-35px,24px) scale(1.08)}}@keyframes community-pulse{0%,100%{opacity:.45;transform:scale(.8)}50%{opacity:1;transform:scale(1.2)}} + +@media(max-width:900px){.nav{top:8px;margin-top:8px}} +@media(max-width:600px){.nav{height:58px;padding:0 10px;border-radius:12px}.nav .brand{font-size:18px}.nav .brand img{width:31px;height:31px}} +@media(prefers-reduced-motion:reduce){.nav .brand img,.nav nav a:after,.nav-github,.connect-steps article,.github-metrics article,.browser-table article,.community-grid>a,.github-metrics article>span,.browser-logo,.community.is-visible:before,.community-note span{animation:none;transition:none}.connect-steps article,.github-metrics article,.browser-table article,.community-grid>a{opacity:1;transform:none}} + +body{overflow-x:hidden}.landing{overflow:visible}.is-visible .community-grid>a:hover{transform:translateY(-6px)} diff --git a/web/src/landing.tsx b/web/src/landing.tsx index b737a40..e0a1422 100644 --- a/web/src/landing.tsx +++ b/web/src/landing.tsx @@ -86,6 +86,7 @@ function Landing() { const [copied, setCopied] = useState(false); const [phoneStyle] = useState(detectPhoneStyle); const [installMethod, setInstallMethod] = useState(0); + const [activeNav, setActiveNav] = useState(""); const [githubStats, setGithubStats] = useState({ stars: null, release: null, updated: null }); const copyInstallCommand = () => { @@ -130,11 +131,25 @@ function Landing() { return () => observer.disconnect(); }, []); + useEffect(() => { + const sections = ["features", "architecture", "install"] + .map(id => document.getElementById(id)) + .filter((section): section is HTMLElement => section !== null); + const observer = new IntersectionObserver( + entries => entries.forEach(entry => { + if (entry.isIntersecting) setActiveNav(entry.target.id); + }), + { rootMargin: "-28% 0px -58%", threshold: 0 }, + ); + sections.forEach(section => observer.observe(section)); + return () => observer.disconnect(); + }, []); + return
WebSpeak3 - +
GitHub ↗