File tree Expand file tree Collapse file tree 5 files changed +16
-11
lines changed Expand file tree Collapse file tree 5 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 32
32
33
33
/* Drop preview/placeholder */
34
34
.svelte-dnd-placeholder {
35
- opacity : 0.3 ;
36
35
border : 2px dashed # 9e9e9e ;
37
36
}
38
37
39
38
/* Visual feedback for touch interactions */
40
39
.svelte-dnd-touch-feedback {
41
- opacity : 0.7 ;
42
40
box-shadow : 0 4px 8px rgba (0 , 0 , 0 , 0.1 );
43
41
border-color : # 2196f3 ;
44
42
}
Original file line number Diff line number Diff line change 91
91
{#each tasksByStatus as { status, items }}
92
92
<div class =" w-80 flex-none" >
93
93
<div
94
- class =" rounded-xl bg-white p-4 shadow-sm ring-1 ring-gray-200"
94
+ class =" rounded-xl bg-gray-100 p-4 shadow-sm ring-1 ring-gray-200"
95
95
use:droppable ={{
96
96
// The container is the status of the task. e.g. 'todo', 'in-progress', 'done'
97
97
container : status ,
120
120
animate:flip ={{ duration : 200 }}
121
121
in:fade ={{ duration : 150 }}
122
122
out:fade ={{ duration : 150 }}
123
- class =" cursor-move rounded-lg bg-white p-3 shadow-sm ring-1 ring-gray-200
124
- transition-all duration-200 hover:shadow-md hover:ring-2 hover:ring-blue-200 svelte-dnd-touch-feedback "
123
+ class =" svelte-dnd-touch-feedback cursor-move rounded-lg bg-white p-3 shadow-sm ring-1
124
+ ring-gray-200 transition-all duration-200 hover:shadow-md hover:ring-2 hover:ring-blue-200"
125
125
>
126
126
<div class =" mb-2 flex items-start justify-between gap-2" >
127
127
<h3 class =" font-medium text-gray-900" >
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import { draggable , droppable , type DragDropState } from ' $lib/index.js' ;
3
+ import { flip } from ' svelte/animate' ;
4
+ import { fade } from ' svelte/transition' ;
3
5
import ' $lib/styles/dnd.css' ;
4
6
5
7
interface ImageItem {
34
36
<div
35
37
use:droppable ={{ container : index .toString (), callbacks : { onDrop : handleDrop } }}
36
38
class =" relative"
39
+ animate:flip ={{ duration : 200 }}
37
40
>
38
41
<div
39
42
use:draggable ={{
40
43
container : index .toString (),
41
44
dragData : image
42
45
}}
43
- class =" group relative h-[300px] w-[200px] cursor-move overflow-hidden rounded-xl
44
- transition-transform hover:scale-105 svelte-dnd-touch-feedback"
46
+ in:fade ={{ duration : 150 }}
47
+ out:fade ={{ duration : 150 }}
48
+ class =" svelte-dnd-touch-feedback group relative h-[300px] w-[200px] cursor-move overflow-hidden
49
+ rounded-xl transition-transform hover:scale-105"
45
50
>
46
51
<img
47
52
src ={image .url }
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import { droppable , draggable , type DragDropState } from ' $lib/index.js' ;
3
3
import { fade } from ' svelte/transition' ;
4
+ import { flip } from ' svelte/animate' ;
4
5
import ' $lib/styles/dnd.css' ;
5
6
6
7
interface Item {
122
123
container : groupIndex .toString (),
123
124
callbacks : { onDrop : handleGroupDrop }
124
125
}}
126
+ animate:flip ={{ duration : 200 }}
125
127
>
126
128
<div
127
129
use:draggable ={{
128
130
container : groupIndex .toString (),
129
131
dragData : group
130
132
}}
131
- class =" rounded-xl bg-white p-4 shadow-sm ring-1 ring-gray-200 svelte-dnd-touch-feedback "
133
+ class =" svelte-dnd-touch-feedback rounded-xl bg-white p-4 shadow-sm ring-1 ring-gray-200"
132
134
in:fade ={{ duration : 150 }}
133
135
out:fade ={{ duration : 150 }}
134
136
>
159
161
container : ` ${group .id }:${itemIndex } ` ,
160
162
dragData : item
161
163
}}
162
- class =" cursor-move rounded-lg bg-white p-3 shadow-sm ring-1 ring-gray-200
163
- transition-all duration-200 hover:shadow-md hover:ring-2 hover:ring-blue-200 svelte-dnd-touch-feedback "
164
+ class =" svelte-dnd-touch-feedback cursor-move rounded-lg bg-white p-3 shadow-sm ring-1
165
+ ring-gray-200 transition-all duration-200 hover:shadow-md hover:ring-2 hover:ring-blue-200"
164
166
>
165
167
<div class =" mb-2 flex items-start justify-between gap-2" >
166
168
<h3 class ="font-medium text-gray-900" >{item .title }</h3 >
Original file line number Diff line number Diff line change 58
58
</div >
59
59
60
60
<div class =" w-80" >
61
- <div class =" rounded-xl bg-white p-4 shadow-sm ring-1 ring-gray-200" >
61
+ <div class =" rounded-xl bg-gray-100 p-4 shadow-sm ring-1 ring-gray-200" >
62
62
<div class =" space-y-3" >
63
63
{#each items as item , index (item .id )}
64
64
<div
You can’t perform that action at this time.
0 commit comments