Skip to content

Edge-Drop is a clipboard shelf on the edge of your screen. Hover to open it. Drag files and images into any app, click to copy text and links. Free and open-source for Windows.

fix(ui): synchronize opening/closing panel transitions for 100% fluid 60fps animations

Deepender25c313e350bb96
diff --git a/src/components/Panel.tsx b/src/components/Panel.tsx
index 3493994..d58ed0a 100644
--- a/src/components/Panel.tsx
+++ b/src/components/Panel.tsx
@@ -281,14 +281,14 @@ export function Panel() {
transition={
open
? {
- scaleX: { type: 'spring', stiffness: 380, damping: 24, mass: 0.75 },
- scaleY: { type: 'spring', stiffness: 340, damping: 26, mass: 0.8 },
- opacity: { duration: 0.12, ease: 'easeOut' }
+ scaleX: { duration: 0.28, ease: [0.16, 1, 0.3, 1] },
+ scaleY: { duration: 0.28, ease: [0.16, 1, 0.3, 1] },
+ opacity: { duration: 0.16, ease: 'easeOut' }
}
: {
- scaleX: { duration: 0.15, ease: [0.22, 1, 0.36, 1] },
- scaleY: { duration: 0.15, ease: [0.22, 1, 0.36, 1] },
- opacity: { duration: 0.08, ease: 'easeOut' }
+ scaleX: { duration: 0.28, ease: [0.22, 1, 0.36, 1] },
+ scaleY: { duration: 0.28, ease: [0.22, 1, 0.36, 1] },
+ opacity: { duration: 0.24, ease: [0.22, 1, 0.36, 1] }
}
}
>
@@ -357,7 +357,7 @@ export function Panel() {
{settingsOpen ? (
<motion.div
key="settings"
- initial={{ opacity: 0, x: isRight ? -8 : 8 }}
+ initial={{ opacity: 1, x: isRight ? -8 : 8 }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: isRight ? 8 : -8 }}
transition={{ type: 'spring', stiffness: 500, damping: 32, mass: 0.5 }}
@@ -370,7 +370,7 @@ export function Panel() {
) : (
<motion.div
key="list"
- initial={{ opacity: 0, x: isRight ? 8 : -8 }}
+ initial={{ opacity: 1, x: isRight ? 8 : -8 }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: isRight ? -8 : 8 }}
transition={{ type: 'spring', stiffness: 500, damping: 32, mass: 0.5 }}
diff --git a/src/hooks/useEdgeHover.ts b/src/hooks/useEdgeHover.ts
index 86b75d2..adaded1 100644
--- a/src/hooks/useEdgeHover.ts
+++ b/src/hooks/useEdgeHover.ts
@@ -148,7 +148,7 @@ export function useEdgeHover(): void {
interactiveTimer = window.setTimeout(() => {
interactiveTimer = undefined
if (!useStore.getState().open) edge.setInteractive(false)
- }, 180)
+ }, 300)
}
const closePanel = () => {
diff --git a/src/styles/panel.css b/src/styles/panel.css
index 83d6b70..a9f4853 100644
--- a/src/styles/panel.css
+++ b/src/styles/panel.css
@@ -87,10 +87,9 @@
/* CSS transition for clip-path (Framer Motion can't interpolate calc() properly).
cubic-bezier(0.22, 1, 0.36, 1) is an exponential ease-out — fast initial
velocity that decelerates to zero, giving the panel a crisp "snapping open"
- feel without overshoot or bounce. 0.46s is just long enough to be readable
- at 60Hz without feeling sluggish on fast hardware. */
+ feel without overshoot or bounce. 0.28s matches Framer Motion's exit curve 1-to-1. */
.blade-container {
- transition: clip-path 0.46s cubic-bezier(0.22, 1, 0.36, 1);
+ transition: clip-path 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Parent container solid block extension to prevent screen edge blur transparency */