summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-10-21 21:25:57 +0900
committerAdam Malczewski <[email protected]>2026-10-21 21:25:57 +0900
commit511d415b4ec07d435ea73ab8e5421949392d922d (patch)
tree0f30294ee26225b9e6a8008dc1d9f28b0bb54972 /src
parente01e61c7a18c36d0ce8777564ebea4a59fa0a12b (diff)
downloaddispatch-web-511d415b4ec07d435ea73ab8e5421949392d922d.tar.gz
dispatch-web-511d415b4ec07d435ea73ab8e5421949392d922d.zip
feat(tabs): 0.1s phases; ease-in close, ease-in-out move, ease-out open
Diffstat (limited to 'src')
-rw-r--r--src/features/tabs/ui/tab-flip.ts18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/features/tabs/ui/tab-flip.ts b/src/features/tabs/ui/tab-flip.ts
index 53bef75..2de00ab 100644
--- a/src/features/tabs/ui/tab-flip.ts
+++ b/src/features/tabs/ui/tab-flip.ts
@@ -35,11 +35,15 @@ export interface TabFlip {
play(): void;
}
-const SHRINK = 0.05;
-const MOVE = 0.075;
-const GROW = 0.05;
-const SIZE_EASE = "power2.inOut";
-const MOVE_EASE = "power3.out";
+const SHRINK = 0.1;
+const MOVE = 0.1;
+const GROW = 0.1;
+/** Close: starts slow, finishes fast (accelerates away). */
+const SHRINK_EASE = "power2.in";
+/** Move: slow → fast → slow. */
+const MOVE_EASE = "power2.inOut";
+/** Open: starts fast, settles slowly (the mirror of close). */
+const GROW_EASE = "power2.out";
const GHOST_ATTR = "data-tab-ghost";
/** Fully clipped from the bottom edge up / fully revealed. */
const CLIP_HIDDEN = "inset(0% 0% 100% 0%)";
@@ -103,7 +107,7 @@ export function createTabFlip(getScroller: () => HTMLElement | undefined): TabFl
clipPath: CLIP_SHOWN,
duration: GROW,
delay: growAt,
- ease: SIZE_EASE,
+ ease: GROW_EASE,
clearProps: "clipPath",
},
);
@@ -211,7 +215,7 @@ function spawnGhost(scroller: HTMLElement, el: HTMLElement, isGroup: boolean): b
gsap.to(ghost, {
height: 0,
duration: SHRINK,
- ease: SIZE_EASE,
+ ease: SHRINK_EASE,
onComplete: () => ghost.remove(),
});
return true;