BlueGit

timfa filemanager

Files

filemanager / public / drag-move.css

drag-move.css

formatting
timfa Tim Falken · pushed by timfa · 6 months ago
68827177 History
drag-move.css 9.3 KiB Download Raw
1/* =========================================================
2 DRAG-MOVE & ICON PREVIEW — real-icon lift styles
3 ========================================================= */
4
5/* Item being actively dragged: lifted shadow + accent border */
6.file-item.dragging {
7 box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
8 border-color: var(--accent, #5b7fff) !important;
9 z-index: 9999;
10 cursor: grabbing !important;
11}
12
13/* Folder highlighted while a dragged item hovers over it */
14.file-item.drop-target .icon {
15 filter: drop-shadow(0 0 6px var(--accent, #5b7fff)) brightness(1.25);
16}
17
18.drag-parent-target {
19 position: fixed;
20 left: 16px;
21 top: 68px;
22 z-index: 10002;
23 display: inline-flex;
24 align-items: center;
25 gap: 0.45rem;
26 padding: 0.45rem 0.65rem;
27 border: 1px solid var(--border, #2e3247);
28 border-radius: 8px;
29 background: var(--surface, #1a1d27);
30 color: var(--text, #e8eaf0);
31 pointer-events: auto;
32 user-select: none;
33 box-shadow: 0 6px 18px rgba(0, 0, 0, 0.42);
34}
35
36.drag-parent-target .up {
37 color: var(--accent, #5b7fff);
38 font-weight: 700;
39}
40
41.drag-parent-target .label {
42 font-size: 0.82rem;
43}
44
45.drag-parent-target.active {
46 border-color: var(--accent, #5b7fff);
47 box-shadow: 0 0 0 2px rgba(91, 127, 255, 0.22), 0 8px 20px rgba(0, 0, 0, 0.5);
48}
49
50.crumb-drop-target.active {
51 color: var(--accent, #5b7fff) !important;
52 text-decoration: underline;
53 text-underline-offset: 0.2rem;
54}
55
56/* ---- drop animation: rises, spins, falls into folder ---- */
57/* --dx / --dy : current viewport X/Y of the item when released */
58/* --fall-x / --fall-y : viewport position of the target folder */
59@keyframes drag-rise-spin-fall {
60 0% {
61 transform: translate(var(--dx), var(--dy)) scale(1) rotate(0deg);
62 opacity: 1;
63 }
64
65 20% {
66 transform: translate(var(--dx), calc(var(--dy) - 40px)) scale(1.05) rotate(60deg);
67 opacity: 1;
68 }
69
70 60% {
71 transform: translate(var(--fall-x), calc(var(--fall-y) - 20px)) scale(0.5) rotate(200deg);
72 opacity: 0.9;
73 }
74
75 100% {
76 transform: translate(var(--fall-x), var(--fall-y)) scale(0.05) rotate(360deg);
77 opacity: 0;
78 }
79}
80
81.file-item.dropping {
82 animation: drag-rise-spin-fall 0.45s cubic-bezier(0.4, 0, 0.8, 1) forwards;
83 pointer-events: none;
84}
85
86/* ---- bounce animation on the target folder ---- */
87@keyframes folder-bounce {
88 0% {
89 transform: translateY(0);
90 }
91
92 30% {
93 transform: translateY(8px);
94 }
95
96 65% {
97 transform: translateY(-4px);
98 }
99
100 85% {
101 transform: translateY(2px);
102 }
103
104 100% {
105 transform: translateY(0);
106 }
107}
108
109.file-item.folder-bounce {
110 animation: folder-bounce 0.4s ease-out forwards;
111}
112
113/* =========================================================
114 EXPANDED PREVIEW TILE
115 The real .file-item element scales up in place to fill the
116 viewport — no separate overlay.
117 ========================================================= */
118
119/* Dimming backdrop behind the expanded tile */
120.preview-backdrop {
121 position: fixed;
122 inset: 0;
123 z-index: 9999;
124 background: rgba(8, 9, 14, 0.82);
125 opacity: 0;
126 transition: opacity 0.3s ease;
127 pointer-events: none;
128}
129
130.preview-backdrop.visible {
131 opacity: 1;
132 pointer-events: all;
133}
134
135/* .file-item in expanded preview state */
136.file-item.file-item--preview {
137 background: var(--surface, #1a1d27) !important;
138 border: 2px solid var(--preview-accent, var(--border, #2e3247)) !important;
139 border-radius: 12px !important;
140 cursor: default !important;
141 user-select: text;
142 display: flex !important;
143 flex-direction: column !important;
144 overflow: hidden;
145 padding: 0 !important;
146 gap: 0 !important;
147 z-index: 10000;
148}
149
150.file-item.file-item--preview .icon {
151 width: 100% !important;
152 height: auto !important;
153 position: relative;
154 flex: 1;
155 min-height: 0;
156 display: flex !important;
157 align-items: center;
158 justify-content: center;
159 overflow: auto;
160 padding: 1rem 1rem 0.75rem;
161 box-sizing: border-box;
162}
163
164.file-item.file-item--preview .icon .preview-expand-outline {
165 position: absolute;
166 left: 50%;
167 top: 50%;
168 width: min(72%, 640px);
169 height: min(72%, 640px);
170 transform: translate(-50%, -50%);
171 opacity: 0.18;
172 pointer-events: none;
173 z-index: 1;
174 filter: drop-shadow(0 0 10px var(--preview-accent, transparent));
175}
176
177.file-item.file-item--preview .icon .preview-expand-content {
178 position: relative;
179 z-index: 2;
180 width: 100%;
181 height: 100%;
182 min-height: 0;
183 display: flex;
184 align-items: center;
185 justify-content: center;
186}
187
188.file-item.file-item--preview .icon .preview-expand-content--video {
189 align-self: stretch;
190 overflow: hidden;
191}
192
193/* Keep preview media constrained within the expanded icon */
194.file-item.file-item--preview .icon .preview-media {
195 max-width: 100%;
196 max-height: 100%;
197 width: auto;
198 height: auto;
199 object-fit: contain;
200}
201
202.file-item.file-item--preview .icon .preview-video-js {
203 width: 100% !important;
204 height: 100% !important;
205 max-height: 100%;
206 background: transparent;
207}
208
209.file-item.file-item--preview .icon .preview-video-js .vjs-tech {
210 object-fit: contain;
211}
212
213.file-item.file-item--preview .icon .preview-frame {
214 width: 100%;
215 height: 100%;
216 border: none;
217 border-radius: 8px;
218 background: #fff;
219}
220
221.file-item.file-item--preview .icon .preview-text {
222 width: 100%;
223 min-height: auto;
224 flex: 1;
225 align-self: stretch;
226}
227
228.file-item.file-item--preview .icon .preview-audio {
229 width: min(640px, 95%);
230}
231
232.file-item.file-item--preview .icon .preview-unsupported {
233 color: var(--text-muted);
234 font-size: 0.95rem;
235 max-width: 56ch;
236 text-align: center;
237}
238
239/* Filename bar shown at top of expanded preview */
240.preview-expand-title {
241 padding: 0.7rem 3.5rem 0.7rem 1rem;
242 font-size: 0.95rem;
243 color: var(--text);
244 border-bottom: 1px solid var(--border);
245 white-space: nowrap;
246 overflow: hidden;
247 text-overflow: ellipsis;
248 flex-shrink: 0;
249}
250
251/* Close button (×) — top-right corner */
252.preview-expand-close {
253 position: absolute;
254 top: 8px;
255 right: 8px;
256 width: 30px;
257 height: 30px;
258 background: rgba(20, 25, 40, 0.8);
259 color: #d6deef;
260 border: 1px solid rgba(255, 255, 255, 0.15);
261 border-radius: 50%;
262 cursor: pointer;
263 font-size: 1.2rem;
264 z-index: 10001;
265 display: flex;
266 align-items: center;
267 justify-content: center;
268 line-height: 1;
269 padding: 0;
270 transition: background 0.15s ease;
271 flex-shrink: 0;
272}
273
274.preview-expand-close:hover {
275 background: rgba(255, 255, 255, 0.14);
276}
277
278/* Action row below the preview content */
279.preview-expand-actions {
280 display: flex;
281 justify-content: flex-end;
282 gap: 0.65rem;
283 padding: 0 1rem 1rem;
284 border-top: 1px solid rgba(46, 50, 71, 0.9);
285 background: linear-gradient(180deg, rgba(26, 29, 39, 0) 0%, rgba(26, 29, 39, 0.92) 42%);
286 flex-shrink: 0;
287}
288
289.preview-expand-download,
290.preview-expand-share {
291 background: var(--accent, #5b7fff);
292 color: #fff;
293 border: none;
294 border-radius: 6px;
295 padding: 7px 18px;
296 cursor: pointer;
297 font-size: 0.9rem;
298 transition: opacity 0.15s ease;
299 flex-shrink: 0;
300}
301
302.preview-expand-download:hover {
303 opacity: 0.85;
304}
305
306.preview-expand-share {
307 background: rgba(20, 25, 40, 0.84);
308 color: #fff;
309 border: 1px solid rgba(255, 255, 255, 0.18);
310 border-radius: 6px;
311 padding: 7px 14px;
312}
313
314.preview-expand-share:hover {
315 opacity: 0.85;
316}
317
318@media (max-width: 700px) {
319 .preview-expand-actions {
320 justify-content: stretch;
321 padding: 0 0.75rem 0.75rem;
322 }
323
324 .preview-expand-download,
325 .preview-expand-share {
326 flex: 1;
327 justify-content: center;
328 }
329}
330
331/* Spinner shown inside the expanded tile while content is loading */
332.preview-loading-spinner {
333 width: 40px;
334 height: 40px;
335 border: 3px solid rgba(255, 255, 255, 0.12);
336 border-top-color: rgba(255, 255, 255, 0.7);
337 border-radius: 50%;
338 animation: preview-spin 0.7s linear infinite;
339}
340
341@keyframes preview-spin {
342 to {
343 transform: rotate(360deg);
344 }
345}
346
347.move-modal {
348 width: min(92vw, 760px);
349 max-height: min(86vh, 760px);
350 display: flex;
351 flex-direction: column;
352 gap: 0.6rem;
353}
354
355.move-tree {
356 border: 1px solid var(--border, #2e3247);
357 border-radius: 10px;
358 padding: 0.55rem;
359 max-height: min(58vh, 480px);
360 overflow: auto;
361 background: var(--bg, #0f1117);
362}
363
364.move-node {
365 margin-left: 0.25rem;
366}
367
368.move-node-row {
369 display: flex;
370 align-items: center;
371 gap: 0.35rem;
372 margin: 0.14rem 0;
373}
374
375.move-toggle {
376 width: 26px;
377 min-width: 26px;
378 height: 26px;
379 padding: 0;
380 display: inline-flex;
381 align-items: center;
382 justify-content: center;
383}
384
385.move-node-label {
386 display: inline-flex;
387 align-items: center;
388 justify-content: flex-start;
389 min-height: 28px;
390 width: auto;
391 padding: 0.2rem 0.5rem;
392 background: transparent;
393 border: 1px solid transparent;
394 color: var(--text, #e8eaf0);
395}
396
397.move-node-label:hover {
398 border-color: var(--border, #2e3247);
399 background: rgba(255, 255, 255, 0.03);
400}
401
402.move-node-label.selected {
403 border-color: var(--accent, #5b7fff);
404 background: rgba(91, 127, 255, 0.12);
405}
406
407.move-children {
408 margin-left: 1.2rem;
409 border-left: 1px dashed var(--border, #2e3247);
410 padding-left: 0.5rem;
411}
412
413.move-empty {
414 color: var(--text-muted, #7880a0);
415 font-size: 0.85rem;
416 margin: 0.2rem 0 0.4rem 0.2rem;
417}