1- <div >
1+ <style >
2+ .todo {
3+ display : grid ;
4+ grid-template-columns : 2rem 1fr 2rem ;
5+ grid-gap : 0.5rem ;
6+ align-items : center ;
7+ margin : 0 0 0.5rem 0 ;
8+ padding : 0.5rem ;
9+ background-color : white ;
10+ border-radius : 8px ;
11+ filter : drop-shadow (2px 4px 6px rgba (0 , 0 , 0 , 0.1 ));
12+ transform : translate (-1px , -1px );
13+ transition : filter 0.2s , transform 0.2s ;
14+ }
15+
16+ .todo button {
17+ width : 2em ;
18+ height : 2em ;
19+ border : none ;
20+ background-color : transparent ;
21+ background-position : 50% 50% ;
22+ background-repeat : no-repeat ;
23+ }
24+
25+ .todo input {
26+ flex : 1 ;
27+ padding : 0.5em 2em 0.5em 0.8em ;
28+ border-radius : 3px ;
29+ }
30+
31+ button .toggle {
32+ border : 1px solid rgba (0 , 0 , 0 , 0.2 );
33+ border-radius : 50% ;
34+ box-sizing : border-box ;
35+ background-size : 1em auto ;
36+ }
37+
38+ .text {
39+ position : relative ;
40+ display : flex ;
41+ align-items : center ;
42+ flex : 1 ;
43+ }
44+
45+ .save {
46+ position : absolute ;
47+ right : 0 ;
48+ opacity : 0 ;
49+ background-image : url (" data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.5 2H3.5C2.67158 2 2 2.67157 2 3.5V20.5C2 21.3284 2.67158 22 3.5 22H20.5C21.3284 22 22 21.3284 22 20.5V3.5C22 2.67157 21.3284 2 20.5 2Z' fill='%23676778' stroke='%23676778' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M17 2V11H7.5V2H17Z' fill='white' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M13.5 5.5V7.5' stroke='%23676778' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M5.99844 2H18.4992' stroke='%23676778' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E%0A" );
50+ }
51+
52+ .todo input :focus + .save ,
53+ .save :focus {
54+ transition : opacity 0.2s ;
55+ opacity : 1 ;
56+ }
57+
58+ .delete {
59+ background-image : url (" data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.5 5V22H19.5V5H4.5Z' fill='%23676778' stroke='%23676778' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M10 10V16.5' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M14 10V16.5' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2 5H22' stroke='%23676778' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M8 5L9.6445 2H14.3885L16 5H8Z' fill='%23676778' stroke='%23676778' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E%0A" );
60+ opacity : 0.2 ;
61+ }
62+
63+ .delete :hover ,
64+ .delete :focus {
65+ transition : opacity 0.2s ;
66+ opacity : 1 ;
67+ }
68+
69+ /* TODO: Uncomment when the API endpoints are available
70+ .done {
71+ transform: none;
72+ opacity: 0.4;
73+ filter: drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.1));
74+ }
75+
76+ .done .toggle {
77+ background-image: url("data:image/svg+xml,%3Csvg width='22' height='16' viewBox='0 0 22 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.5 1.5L7.4375 14.5L1.5 8.5909' stroke='%23676778' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
78+ } */
79+ </style >
80+
81+ <div class =" todo" >
282 <form action =" " method =" " >
383 <input type =" hidden" name =" done" value =" " />
4- <button aria-label =" Mark done/not done" >Done/NotDone </button >
84+ <button aria-label =" Mark done/not done" class = " toggle " > </button >
585 </form >
686
7- <form action =" " method =" " >
87+ <form action =" " method =" " class = " text " >
888 <input type =" text" />
9- <button aria-label =" Save todo" >Save </button >
89+ <button aria-label =" Save todo" class = " save " > </button >
1090 </form >
1191
1292 <form action =" " method =" " >
13- <button aria-label =" Delete todo" >Delete </button >
93+ <button aria-label =" Delete todo" class = " delete " > </button >
1494 </form >
1595</div >
0 commit comments