mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Show the rail highlight at icon size when a first panel opens
Opening a panel from the labelled rail folds its pills to icons over a few frames, and the highlight faded in at a pill's width and then shrank, as did the open button's own fill. The highlight now appears only once the open button is an icon again (square), its size changes at once rather than easing, and the open button carries no fill of its own. Co-authored-by: Sameh Khamis <[email protected]>
This commit is contained in:
1 parent
9261279639
commit
129b35e470
3 files changed
+13
-5
No files matched your search
@@ -83,6 +83,11 @@ export function installRailEdgeScroll(doc = globalThis.document) {
|
||||
const railBox = rail.getBoundingClientRect();
|
||||
const box = on.getBoundingClientRect();
|
||||
const shown = gliding.has(rail);
|
||||
// A rail opening its first panel folds its labelled pills to icons, the
|
||||
// buttons shrinking over a few frames; the highlight waits until the open
|
||||
// button is an icon again (square) rather than fading in at a pill's
|
||||
// width and then shrinking.
|
||||
if (!shown && (rail.classList.contains('ui-rail--expanded') || box.width > box.height + 2)) return;
|
||||
// Appearing from nothing: jump into place, then fade in.
|
||||
rail.classList.toggle('ui-rail--glide-jump', !shown);
|
||||
rail.style.setProperty('--rail-glide-x', `${box.left - railBox.left - rail.clientLeft}px`);
|
||||
|
||||
Reference in new issue
Block a user