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.

feat(shelf): blue light for drops, pins and stacking; a steady drop zone

Deepender254f1a46a4e18e
diff --git a/src/components/Panel.tsx b/src/components/Panel.tsx
index 8bfa273..1e6536a 100644
--- a/src/components/Panel.tsx
+++ b/src/components/Panel.tsx
@@ -679,6 +679,7 @@ export function Panel() {
)}
</AnimatePresence>
</div>
+ <PinGlow isHorizontal={isHorizontal} />
<DropOverlay isHorizontal={isHorizontal} />
<SplitDropZone
stickPosition={settings.stickPosition || (isRight ? 'right' : 'left')}
@@ -757,6 +758,18 @@ function TrayArrowIcon() {
* over the shelf, and on a drop it takes the item in (the well tightens, the
* arrow sinks into the tray) before handing over to the new card.
*/
+/**
+ * A pin or unpin lights the shelf from the side the card goes to: pinned cards lead the list (its left
+ * in the top dock, its top in the side docks), an unpinned one goes back the other way. Once per change.
+ */
+function PinGlow({ isHorizontal }: { isHorizontal: boolean }) {
+ const glow = useStore((s) => s.pinGlow)
+ if (!glow) return null
+ const pin = glow.kind === 'pin'
+ const from = isHorizontal ? (pin ? 'left' : 'right') : (pin ? 'top' : 'bottom')
+ return <div key={glow.at} className={`pin-glow from-${from}`} aria-hidden="true" />
+}
+
function DropOverlay({ isHorizontal }: { isHorizontal: boolean }) {
const { t } = useTranslation()
const open = useStore((s) => s.open)
diff --git a/src/store/appStore.ts b/src/store/appStore.ts
index ed44b02..c22f646 100644
--- a/src/store/appStore.ts
+++ b/src/store/appStore.ts
@@ -112,6 +112,8 @@ interface AppState {
*/
externalDrag: boolean
setExternalDrag: (active: boolean) => void
+ /** The last pin or unpin, for its light along the shelf's edge (Panel's PinGlow); `at` replays it. */
+ pinGlow: { kind: 'pin' | 'unpin'; at: number } | null
/** In-app drag: the card a drop would stack the dragged card into. */
dropTargetId: string | null
setDropTargetId: (id: string | null) => void
@@ -295,6 +297,7 @@ export const useStore = create<AppState>((set, get) => ({
setExternalDrag: (externalDrag) => {
if (get().externalDrag !== externalDrag) set({ externalDrag })
},
+ pinGlow: null,
dropTargetId: null,
setDropTargetId: (dropTargetId) => {
if (get().dropTargetId !== dropTargetId) set({ dropTargetId })
@@ -617,7 +620,8 @@ export const useStore = create<AppState>((set, get) => ({
async togglePin(id, pinned) {
// Optimistic: flip locally, then let the pushed list confirm.
set({
- items: get().items.map((it) => (it.id === id ? { ...it, pinned } : it))
+ items: get().items.map((it) => (it.id === id ? { ...it, pinned } : it)),
+ pinGlow: { kind: pinned ? 'pin' : 'unpin', at: Date.now() }
})
const items = await edge.setPinned(id, pinned)
const current = get().items
diff --git a/src/styles/item.css b/src/styles/item.css
index 2eccd16..fd253bc 100644
--- a/src/styles/item.css
+++ b/src/styles/item.css
@@ -3106,6 +3106,23 @@ html[data-motion='reduce'] .file-stack-folder {
transform: scale(1.04);
}
}
+/* the drop zone's blue light, rising from the bottom of the card it would stack into */
+.drop-target-ring::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ border-radius: inherit;
+ pointer-events: none;
+ background: radial-gradient(
+ ellipse 80% 45% at 50% 100%,
+ rgba(10, 132, 255, 0.36) 0%,
+ rgba(10, 132, 255, 0.24) 28%,
+ rgba(10, 132, 255, 0.12) 52%,
+ rgba(10, 132, 255, 0.05) 72%,
+ rgba(10, 132, 255, 0.014) 88%,
+ rgba(10, 132, 255, 0) 100%
+ );
+}
.item.is-drag-source::after {
content: '';
position: absolute;
diff --git a/src/styles/panel.css b/src/styles/panel.css
index 80f1fac..7a76368 100644
--- a/src/styles/panel.css
+++ b/src/styles/panel.css
@@ -296,8 +296,10 @@ rect.dashed-outline-shape {
/* Drop zone for drags from other apps (DropOverlay): solid black over the
whole shelf (nothing shows through), a dashed well, and the tray icon on its
- own. The well's dashes light up once the drag is over the shelf, and it
- tightens as it takes the drop. */
+ own. The well comes in at its size as the shelf opens; once the drag is over
+ the shelf its dashes brighten softly (no change of size: a step from the edge
+ into the shelf, where the zone turns over, read as a pop), and it tightens as
+ it takes the drop. */
.drop-overlay {
position: absolute;
inset: 0;
@@ -310,6 +312,30 @@ rect.dashed-outline-shape {
.drop-overlay.is-horizontal {
padding: 10px 12px 12px;
}
+/* A soft blue light rising from the bottom of the drop zone, in the edge light's blue, gone before 30% of
+ the zone's height; the shelf is otherwise unchanged. An ellipse wider than the shelf, so its sides fall
+ off softly too, with an eased falloff (no visible gradient band). It comes up with the zone and grows a
+ little brighter once the drag is over the shelf. Behind the well (painted first). */
+.drop-overlay::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ pointer-events: none;
+ background: radial-gradient(
+ ellipse 75% 30% at 50% 100%,
+ rgba(10, 132, 255, 0.34) 0%,
+ rgba(10, 132, 255, 0.24) 28%,
+ rgba(10, 132, 255, 0.13) 52%,
+ rgba(10, 132, 255, 0.06) 72%,
+ rgba(10, 132, 255, 0.016) 88%,
+ rgba(10, 132, 255, 0) 100%
+ );
+ opacity: 0.7;
+ transition: opacity 260ms cubic-bezier(0.22, 1, 0.36, 1);
+}
+.drop-overlay.is-over::before {
+ opacity: 1;
+}
.drop-well {
flex: 1;
min-width: 0;
@@ -321,12 +347,15 @@ rect.dashed-outline-shape {
padding: 16px;
position: relative;
border-radius: 16px;
- --dash-color: rgba(255, 255, 255, 0.38);
+ --dash-color: rgba(255, 255, 255, 0.55);
text-align: center;
- transform: scale(0.98);
transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
animation: drop-well-in 300ms cubic-bezier(0.22, 1, 0.36, 1);
}
+/* the well's dashes brighten over a longer, even ease than other dashed outlines */
+.drop-well .dashed-outline-shape {
+ transition: stroke 360ms cubic-bezier(0.25, 0.1, 0.25, 1);
+}
.drop-overlay.is-horizontal .drop-well {
flex-direction: row;
gap: 14px;
@@ -338,8 +367,7 @@ rect.dashed-outline-shape {
}
}
.drop-overlay.is-over .drop-well {
- --dash-color: rgba(255, 255, 255, 0.7);
- transform: scale(1);
+ --dash-color: rgba(255, 255, 255, 0.78);
}
.drop-overlay.is-accepted .drop-well {
--dash-color: rgba(255, 255, 255, 0.9);
@@ -357,6 +385,7 @@ rect.dashed-outline-shape {
}
.drop-overlay.is-over .drop-icon .drop-arrow {
transform: translateY(1.5px);
+ transition-duration: 360ms;
}
.drop-overlay.is-accepted .drop-icon .drop-arrow {
transform: translateY(4px);
@@ -380,6 +409,140 @@ rect.dashed-outline-shape {
color: rgba(255, 255, 255, 0.5);
}
[data-motion='reduce'] .dashed-outline-shape,
+/* Pin / unpin (PinGlow): the shelf's edge light (the split zone's: a bright hairline with a short blue
+ falloff, faded at its ends) along the inside edge the card went to. It switches on from the middle out
+ and fades, once, and keeps off the cards. */
+.pin-glow {
+ position: absolute;
+ z-index: 310;
+ pointer-events: none;
+ opacity: 0;
+}
+.pin-glow.from-top,
+.pin-glow.from-bottom {
+ left: 0;
+ right: 0;
+ height: 48px;
+ -webkit-mask-image: linear-gradient(to right, transparent, #000 24%, #000 76%, transparent);
+ mask-image: linear-gradient(to right, transparent, #000 24%, #000 76%, transparent);
+ animation: pin-glow-across 820ms cubic-bezier(0.22, 1, 0.36, 1);
+}
+.pin-glow.from-left,
+.pin-glow.from-right {
+ top: 0;
+ bottom: 0;
+ width: 48px;
+ -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 76%, transparent);
+ mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 76%, transparent);
+ animation: pin-glow-along 820ms cubic-bezier(0.22, 1, 0.36, 1);
+}
+.pin-glow.from-top {
+ top: 0;
+ transform-origin: center top;
+ background: linear-gradient(
+ to bottom,
+ rgba(222, 240, 255, 1) 0,
+ rgba(222, 240, 255, 0.95) 1.5px,
+ rgba(10, 132, 255, 0.85) 3px,
+ rgba(10, 132, 255, 0.55) 6px,
+ rgba(10, 132, 255, 0.32) 11px,
+ rgba(10, 132, 255, 0.17) 18px,
+ rgba(10, 132, 255, 0.08) 27px,
+ rgba(10, 132, 255, 0.03) 37px,
+ rgba(10, 132, 255, 0) 48px
+ );
+}
+.pin-glow.from-bottom {
+ bottom: 0;
+ transform-origin: center bottom;
+ background: linear-gradient(
+ to top,
+ rgba(222, 240, 255, 1) 0,
+ rgba(222, 240, 255, 0.95) 1.5px,
+ rgba(10, 132, 255, 0.85) 3px,
+ rgba(10, 132, 255, 0.55) 6px,
+ rgba(10, 132, 255, 0.32) 11px,
+ rgba(10, 132, 255, 0.17) 18px,
+ rgba(10, 132, 255, 0.08) 27px,
+ rgba(10, 132, 255, 0.03) 37px,
+ rgba(10, 132, 255, 0) 48px
+ );
+}
+.pin-glow.from-left {
+ left: 0;
+ transform-origin: left center;
+ background: linear-gradient(
+ to right,
+ rgba(222, 240, 255, 1) 0,
+ rgba(222, 240, 255, 0.95) 1.5px,
+ rgba(10, 132, 255, 0.85) 3px,
+ rgba(10, 132, 255, 0.55) 6px,
+ rgba(10, 132, 255, 0.32) 11px,
+ rgba(10, 132, 255, 0.17) 18px,
+ rgba(10, 132, 255, 0.08) 27px,
+ rgba(10, 132, 255, 0.03) 37px,
+ rgba(10, 132, 255, 0) 48px
+ );
+}
+.pin-glow.from-right {
+ right: 0;
+ transform-origin: right center;
+ background: linear-gradient(
+ to left,
+ rgba(222, 240, 255, 1) 0,
+ rgba(222, 240, 255, 0.95) 1.5px,
+ rgba(10, 132, 255, 0.85) 3px,
+ rgba(10, 132, 255, 0.55) 6px,
+ rgba(10, 132, 255, 0.32) 11px,
+ rgba(10, 132, 255, 0.17) 18px,
+ rgba(10, 132, 255, 0.08) 27px,
+ rgba(10, 132, 255, 0.03) 37px,
+ rgba(10, 132, 255, 0) 48px
+ );
+}
+/* from the middle out, then the falloff draws in as it fades */
+@keyframes pin-glow-across {
+ 0% {
+ opacity: 0;
+ transform: scale(0.35, 0.7);
+ }
+ 30% {
+ opacity: 1;
+ transform: none;
+ }
+ 100% {
+ opacity: 0;
+ transform: scale(1, 0.75);
+ }
+}
+@keyframes pin-glow-along {
+ 0% {
+ opacity: 0;
+ transform: scale(0.7, 0.35);
+ }
+ 30% {
+ opacity: 1;
+ transform: none;
+ }
+ 100% {
+ opacity: 0;
+ transform: scale(0.75, 1);
+ }
+}
+@keyframes pin-glow-plain {
+ 0%,
+ 100% {
+ opacity: 0;
+ }
+ 30% {
+ opacity: 1;
+ }
+}
+[data-motion='reduce'] .pin-glow {
+ animation-name: pin-glow-plain;
+}
+
+[data-motion='reduce'] .drop-overlay::before,
[data-motion='reduce'] .drop-well,
[data-motion='reduce'] .drop-icon,
[data-motion='reduce'] .drop-icon .drop-arrow {
diff --git a/tests/dragExperience.test.ts b/tests/dragExperience.test.ts
index 1cd413d..3a8ecce 100644
--- a/tests/dragExperience.test.ts
+++ b/tests/dragExperience.test.ts
@@ -205,7 +205,10 @@ describe('drag looks', () => {
expect(well).not.toMatch(/background|border:/)
const icon = panelCss.match(/\.drop-icon \{([^}]*)\}/)![1]
expect(icon).not.toMatch(/background|box-shadow|border/)
- expect(panelCss).toContain('.drop-overlay.is-over .drop-well {\n --dash-color: rgba(255, 255, 255, 0.7);\n transform: scale(1);\n}')
+ // over the shelf the dashes brighten softly, with no change of size from the zone at the edge (a pop)
+ expect(panelCss).toContain('.drop-overlay.is-over .drop-well {\n --dash-color: rgba(255, 255, 255, 0.78);\n}')
+ expect(well).toContain('--dash-color: rgba(255, 255, 255, 0.55);')
+ expect(well).not.toMatch(/transform: scale/)
expect(panelCss).toMatch(/\.drop-overlay\.is-accepted \.drop-well \{[^}]*transform: scale\(0\.97\);/)
expect(panelCss).toContain('.drop-overlay.is-horizontal .drop-well {\n flex-direction: row;')
// shown as soon as a drag from another app is on, not only once it is over the window