-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoveAnimation.css
More file actions
55 lines (53 loc) · 1.14 KB
/
MoveAnimation.css
File metadata and controls
55 lines (53 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.move-animation-overlay {
position: absolute;
inset: calc(-1 * var(--board-border, 5vmin));
pointer-events: none;
z-index: 10;
overflow: hidden;
}
.move-animation-piece {
position: absolute;
border-radius: 50%;
animation: slide-piece linear infinite;
}
@keyframes slide-piece {
/* quick fade-in at source */
0% {
transform: translate(0, 0);
opacity: 0;
}
5% {
transform: translate(0, 0);
opacity: 0.9;
}
/* pause at source */
12% {
transform: translate(0, 0);
opacity: 0.9;
animation-timing-function: ease-in-out;
}
/* arrived at destination */
38% {
transform: translate(var(--dx), var(--dy));
opacity: 0.9;
}
/* pause at destination */
45% {
transform: translate(var(--dx), var(--dy));
opacity: 0.9;
}
/* fade out */
50% {
transform: translate(var(--dx), var(--dy));
opacity: 0;
}
/* snap back invisibly */
51% {
transform: translate(0, 0);
opacity: 0;
}
100% {
transform: translate(0, 0);
opacity: 0;
}
}