Skip to content

Commit e617ce2

Browse files
committed
[IMP] dms: animated dropzone with marching dashed border
Signed-off-by: Don Kendall <dkendall@ledoweb.com>
1 parent 04e3aab commit e617ce2

3 files changed

Lines changed: 89 additions & 4 deletions

File tree

dms/static/src/js/views/file_kanban_renderer.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@
1010
t-inherit-mode="primary"
1111
>
1212
<xpath expr="//div[hasclass('o_kanban_renderer')]" position="before">
13-
<div t-if="dragState.showDragZone" class="o_dropzone">
14-
<i class="fa fa-cloud-upload fa-10x" />
13+
<div t-if="dragState.showDragZone" class="o_dropzone o_dms_dropzone">
14+
<div class="o_dms_dropzone__icon">
15+
<i class="fa fa-cloud-upload" />
16+
</div>
17+
<div class="o_dms_dropzone__title">Drop files to upload</div>
18+
<div class="o_dms_dropzone__hint">
19+
Release to add to the current directory
20+
</div>
1521
</div>
1622
<div
1723
class="o_kanban_dms_density_toggle btn-group btn-group-sm"

dms/static/src/js/views/file_list_renderer.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@
66
t-inherit-mode="primary"
77
>
88
<xpath expr="//div[hasclass('o_list_renderer')]" position="before">
9-
<div t-if="dragState.showDragZone" class="o_dropzone">
10-
<i class="fa fa-cloud-upload fa-10x" />
9+
<div t-if="dragState.showDragZone" class="o_dropzone o_dms_dropzone">
10+
<div class="o_dms_dropzone__icon">
11+
<i class="fa fa-cloud-upload" />
12+
</div>
13+
<div class="o_dms_dropzone__title">Drop files to upload</div>
14+
<div class="o_dms_dropzone__hint">
15+
Release to add to the current directory
16+
</div>
1117
</div>
1218
</xpath>
1319
</t>

dms/static/src/scss/file_kanban.scss

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,60 @@
185185
}
186186
}
187187

188+
// ---- Animated dropzone (drag-over overlay) ----
189+
//
190+
// Replaces the default static cloud icon with a marching-dashed-border
191+
// overlay + pulsing icon + title + hint. Triggered by the renderer's
192+
// existing `dragState.showDragZone` state — no JS change.
193+
.o_dms_dropzone {
194+
display: flex;
195+
flex-direction: column;
196+
align-items: center;
197+
justify-content: center;
198+
gap: 1rem;
199+
background:
200+
linear-gradient(rgba(113, 75, 103, 0.06), rgba(113, 75, 103, 0.1)),
201+
repeating-linear-gradient(
202+
45deg,
203+
transparent,
204+
transparent 8px,
205+
rgba(113, 75, 103, 0.06) 8px,
206+
rgba(113, 75, 103, 0.06) 16px
207+
);
208+
border-radius: 8px;
209+
outline: 3px dashed var(--bs-primary, #714b67);
210+
outline-offset: -8px;
211+
animation: o_dms_dropzone_march 1s linear infinite;
212+
z-index: 10;
213+
214+
&__icon {
215+
width: 96px;
216+
height: 96px;
217+
border-radius: 50%;
218+
background: rgba(113, 75, 103, 0.12);
219+
display: flex;
220+
align-items: center;
221+
justify-content: center;
222+
animation: o_dms_dropzone_pulse 1.5s ease-in-out infinite;
223+
224+
i.fa {
225+
font-size: 3rem;
226+
color: var(--bs-primary, #714b67);
227+
}
228+
}
229+
230+
&__title {
231+
font-size: 1.2rem;
232+
font-weight: 600;
233+
color: var(--bs-primary, #714b67);
234+
}
235+
236+
&__hint {
237+
font-size: 0.85rem;
238+
color: var(--bs-secondary-color, #6c757d);
239+
}
240+
}
241+
188242
// ---- Per-extension accent palette ----
189243
//
190244
// The card derives `data-ext` from `record.name` at render time (see the
@@ -252,3 +306,22 @@
252306
--dms-accent: #ae3ec9;
253307
}
254308
}
309+
310+
@keyframes o_dms_dropzone_march {
311+
from {
312+
outline-offset: -8px;
313+
}
314+
to {
315+
outline-offset: -16px;
316+
}
317+
}
318+
319+
@keyframes o_dms_dropzone_pulse {
320+
0%,
321+
100% {
322+
transform: scale(1);
323+
}
324+
50% {
325+
transform: scale(1.08);
326+
}
327+
}

0 commit comments

Comments
 (0)