File tree 2 files changed +16
-1
lines changed 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,11 @@ function deleteTodo(e) {
47
47
//delete
48
48
if ( item . classList [ 0 ] === "trash-btn" ) {
49
49
const todo = item . parentElement ;
50
- todo . remove ( ) ;
50
+ //Animation
51
+ todo . classList . add ( "fall" ) ;
52
+ todo . addEventListener ( "transitionend" , function ( ) {
53
+ todo . remove ( ) ;
54
+ } ) ;
51
55
}
52
56
//check mark
53
57
if ( item . classList [ 0 ] === "complete-btn" ) {
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ form button:hover {
68
68
display : flex;
69
69
justify-content : space-between;
70
70
align-items : center;
71
+ transition : all 0.5s ease;
71
72
}
72
73
73
74
.todo li {
@@ -96,3 +97,13 @@ form button:hover {
96
97
.fa-check {
97
98
pointer-events : none;
98
99
}
100
+
101
+ .completed {
102
+ text-decoration : line-through;
103
+ opacity : 0.5 ;
104
+ }
105
+
106
+ .fall {
107
+ transform : translateY (8rem ) rotateZ (20deg );
108
+ opacity : 0 ;
109
+ }
You can’t perform that action at this time.
0 commit comments