From bd8cf3c0e363a358bee8506077ce97c8598b338f Mon Sep 17 00:00:00 2001 From: rumetsasmaz Date: Sun, 15 Nov 2026 12:13:57 +0300 Subject: [PATCH 1/2] Menu band: one piece across rows, no flicker at row edges, calmer glide - rounded corners only at the band's real ends, so the pieces in two rows join flat while it travels - a new row is taken only once the pointer is 6 px inside it - less stretch and lean, slightly quicker settle Co-Authored-By: Claude Opus 5.5 --- web/src/reactbits/FlowingMenu.tsx | 11 ++++++++--- web/src/reactbits/flowingmenu.css | 3 +-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/web/src/reactbits/FlowingMenu.tsx b/web/src/reactbits/FlowingMenu.tsx index 8d2dfe8..37bc799 100644 --- a/web/src/reactbits/FlowingMenu.tsx +++ b/web/src/reactbits/FlowingMenu.tsx @@ -36,7 +36,7 @@ interface Metric { height: number; } -export function FlowingMenu({ items, active, label, duration = 0.5, stretch = 0.6, magnet = 0.22 }: { +export function FlowingMenu({ items, active, label, duration = 0.42, stretch = 0.3, magnet = 0.08 }: { items: FlowItem[]; /** the row whose details are open: the band rests there */ active: string | null; @@ -70,7 +70,9 @@ export function FlowingMenu({ items, active, label, duration = 0.5, stretch = 0. return; } row.band.style.visibility = "visible"; - row.band.style.clipPath = `inset(${(b.top - m.top).toFixed(2)}px 0px ${(m.top + m.height - b.bottom).toFixed(2)}px 0px round 12px)`; + const topR = b.top >= m.top - 0.5 ? 12 : 0; + const botR = b.bottom <= m.top + m.height + 0.5 ? 12 : 0; + row.band.style.clipPath = `inset(${(b.top - m.top).toFixed(2)}px 0px ${(m.top + m.height - b.bottom).toFixed(2)}px 0px round ${topR}px ${topR}px ${botR}px ${botR}px)`; }); }; @@ -229,7 +231,10 @@ export function FlowingMenu({ items, active, label, duration = 0.5, stretch = 0. const list = listRef.current; if (list) cursorY.current = e.clientY - list.getBoundingClientRect().top; const k = rowAt(e.clientY); - if (k >= 0 && k !== band.current.index) goTo(k, halfOf(e.clientY, k)); + const m = k >= 0 ? metrics.current[k] : null; + const y = cursorY.current ?? 0; + const inside = !!m && y - m.top >= 6 && m.top + m.height - y >= 6; + if (k >= 0 && k !== band.current.index && (inside || band.current.index < 0)) goTo(k, halfOf(e.clientY, k)); else kick(); }; const onPointerLeave = (e: ReactPointerEvent) => { diff --git a/web/src/reactbits/flowingmenu.css b/web/src/reactbits/flowingmenu.css index 1b091f4..d088cfd 100644 --- a/web/src/reactbits/flowingmenu.css +++ b/web/src/reactbits/flowingmenu.css @@ -181,8 +181,7 @@ z-index: 1; visibility: hidden; pointer-events: none; - border-radius: 12px; - background: #e9eef5; + background: #e8edf4; color: #0b1018; will-change: clip-path; } From 20f7c3523d81f4a82f95461954a5f1d254309b09 Mon Sep 17 00:00:00 2001 From: rumetsasmaz Date: Sun, 15 Nov 2026 12:24:05 +0300 Subject: [PATCH 2/2] Menu: a thin see-through frame marks the open row The open row and its details sit in a soft 1 px frame that fades and scales in; the dividers next to it step aside. The white band now only follows the pointer instead of parking on the open row. Co-Authored-By: Claude Opus 5.5 --- web/src/reactbits/FlowingMenu.tsx | 7 ++----- web/src/reactbits/flowingmenu.css | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/web/src/reactbits/FlowingMenu.tsx b/web/src/reactbits/FlowingMenu.tsx index 37bc799..90be51f 100644 --- a/web/src/reactbits/FlowingMenu.tsx +++ b/web/src/reactbits/FlowingMenu.tsx @@ -5,7 +5,7 @@ * the pointer ("magnet"), and every row shows an inverted copy of itself where the band covers * it (clip-path). Changes from the original: no marquee, images or intro sweep; each row shows * our own content (index, title, a line, a value); a row with details opens them in place - * under it (motion height), and the band rests on the open row when the pointer leaves; @hugeicons replaced by the project's Icon; plain CSS in reactbits.css + * under it (motion height) inside a thin see-through frame that marks the open row; @hugeicons replaced by the project's Icon; plain CSS in reactbits.css * (.fm-*). Reduced motion: the band jumps instead of gliding. */ import { useEffect, useLayoutEffect, useRef, type PointerEvent as ReactPointerEvent, type ReactNode } from "react"; @@ -160,8 +160,6 @@ export function FlowingMenu({ items, active, label, duration = 0.42, stretch = 0 kick(); }; const release = (toward: "top" | "bottom") => { - // the open topic keeps the band - if (activeRef.current >= 0) return goTo(activeRef.current, toward); const b = band.current; if (!b.shown) return; const point = toward === "top" ? b.toTop : b.toBottom; @@ -218,8 +216,7 @@ export function FlowingMenu({ items, active, label, duration = 0.42, stretch = 0 const goRef = useRef({ goTo, release }); goRef.current = { goTo, release }; useEffect(() => { - if (activeIndex >= 0) goRef.current.goTo(activeIndex, "center"); - else if (band.current.index >= 0 && cursorY.current === null) goRef.current.release("bottom"); + if (band.current.index >= 0 && cursorY.current === null) goRef.current.release("bottom"); }, [activeIndex]); useEffect(() => { const l = loop.current; diff --git a/web/src/reactbits/flowingmenu.css b/web/src/reactbits/flowingmenu.css index d088cfd..7ecf309 100644 --- a/web/src/reactbits/flowingmenu.css +++ b/web/src/reactbits/flowingmenu.css @@ -16,10 +16,36 @@ } .fm-item { position: relative; + isolation: isolate; border-radius: 12px; animation: fm-in 0.6s var(--ease) both; } +/* the open row: a thin see-through frame around the row and its details */ +.fm-item::after { + content: ""; + position: absolute; + inset: 0; + z-index: -1; + border-radius: 14px; + border: 1px solid rgba(255, 255, 255, 0.14); + background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); + opacity: 0; + transform: scale(0.985); + transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); + pointer-events: none; +} +.fm-item.active::after { + opacity: 1; + transform: none; +} +/* the dividers next to the frame step aside */ +.fm-item.active::before, +.fm-item.active + .fm-item::before { + opacity: 0; +} .fm-item + .fm-item::before { + transition: opacity 0.3s; content: ""; position: absolute; top: 0; @@ -223,6 +249,9 @@ } @media (prefers-reduced-motion: reduce) { + .fm-item::after { + transition: none; + } .fm-item, .fm-item + .fm-item::before { animation: none;