44 display : flex;
55 flex-direction : column;
66 align-items : center;
7- padding-top : 5 px ;
7+ padding-top : 40 px ;
88 background-color : # f8f9fa ;
9+ color : # 343a40 ;
10+ transition : background-color 0.3s ease, color 0.3s ease;
11+ }
12+
13+ body .dark-mode {
14+ background-color : # 212529 ;
15+ color : # f8f9fa ;
16+ }
17+
18+ body .dark-mode h1 {
19+ color : # f8f9fa ;
20+ }
21+
22+ .theme-toggle {
23+ position : absolute;
24+ top : 20px ;
25+ right : 20px ;
26+ }
27+
28+ .theme-toggle-label {
29+ display : inline-block;
30+ width : 50px ;
31+ height : 25px ;
32+ background : # ccc ;
33+ border-radius : 15px ;
34+ position : relative;
35+ transition : background-color 0.3s ease;
36+ cursor : pointer;
37+ }
38+
39+ .theme-toggle-label : after {
40+ content : '' ;
41+ position : absolute;
42+ top : 3px ;
43+ left : 3px ;
44+ width : 19px ;
45+ height : 19px ;
46+ background : # fff ;
47+ border-radius : 50% ;
48+ transition : 0.3s ease;
49+ }
50+
51+ .theme-toggle input [type = "checkbox" ] {
52+ height : 0 ;
53+ width : 0 ;
54+ visibility : hidden;
55+ }
56+
57+ .theme-toggle input : checked + .theme-toggle-label {
58+ background : # 6c757d ;
59+ }
60+
61+ .theme-toggle input : checked + .theme-toggle-label : after {
62+ left : calc (100% - 22px );
963}
1064
1165h1 {
12- margin-bottom : 40 px ;
66+ margin-bottom : 50 px ;
1367 color : # 343a40 ;
1468 text-align : center;
15- font-size : 2.5em ;
69+ font-size : 2.7em ;
70+ }
71+
72+ body .dark-mode h1 {
73+ color : # f8f9fa ;
1674}
1775
1876.container {
1977 background-color : # ffffff ;
20- padding : 50 px ;
21- border-radius : 12 px ;
22- box-shadow : 0 0 25 px rgba (0 , 0 , 0 , 0.2 );
78+ padding : 40 px ;
79+ border-radius : 15 px ;
80+ box-shadow : 0 0 30 px rgba (0 , 0 , 0 , 0.15 );
2381 display : flex;
2482 flex-direction : column;
25- gap : 20 px ;
26- width : 400 px ;
83+ gap : 25 px ;
84+ width : 450 px ;
2785 animation : fadeIn 0.5s ease-out;
86+ transition : background-color 0.3s ease, box-shadow 0.3s ease;
2887}
2988
30- @keyframes fadeIn {
31- from {
32- opacity : 0 ;
33- transform : translateY (-20px );
34- }
35- to {
36- opacity : 1 ;
37- transform : translateY (0 );
38- }
89+ body .dark-mode .container {
90+ background-color : # 343a40 ;
91+ box-shadow : 0 0 30px rgba (255 , 255 , 255 , 0.2 );
3992}
4093
4194.container > div {
@@ -47,17 +100,28 @@ h1 {
47100label {
48101 font-weight : 500 ;
49102 color : # 495057 ;
50- font-size : 1.1em ;
51- width : 150px ;
103+ font-size : 1.15em ;
104+ width : 160px ;
105+ transition : color 0.3s ease;
106+ }
107+
108+ body .dark-mode label {
109+ color : # ced4da ;
52110}
53111
54112input [type = "number" ] {
55- padding : 12 px ;
113+ padding : 14 px ;
56114 border : 1px solid # ced4da ;
57- border-radius : 8px ;
58- width : 220px ;
59- font-size : 1.1em ;
60- transition : background-color 0.2s ease-in-out, border-color 0.2s ease-in-out; /* Added transition for smoother highlight */
115+ border-radius : 10px ;
116+ width : 250px ;
117+ font-size : 1.15em ;
118+ transition : background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease;
119+ }
120+
121+ body .dark-mode input [type = "number" ] {
122+ background-color : # 495057 ;
123+ color : # f8f9fa ;
124+ border-color : # 6c757d ;
61125}
62126
63127input [type = "number" ]: focus {
@@ -66,30 +130,66 @@ input[type="number"]:focus {
66130 box-shadow : 0 0 0 0.2rem rgba (0 , 123 , 255 , 0.25 );
67131}
68132
133+ body .dark-mode input [type = "number" ]: focus {
134+ border-color : # 007bff ;
135+ box-shadow : 0 0 0 0.2rem rgba (0 , 123 , 255 , 0.5 );
136+ }
137+
69138.conversion-highlight {
70- background-color : # e9ecef ; /* Light gray background for highlight */
71- border-color : # 007bff !important ; /* Highlight border color */
139+ background-color : # e9ecef ;
140+ border-color : # 007bff !important ;
141+ }
142+
143+ body .dark-mode .conversion-highlight {
144+ background-color : # 6c757d ;
145+ border-color : # 007bff !important ;
146+ color : # f8f9fa ;
147+ }
148+
149+ .buttons-container {
150+ display : flex;
151+ gap : 15px ;
152+ justify-content : flex-end;
153+ margin-top : 30px ;
72154}
73155
74156button {
75- padding : 14 px 28 px ;
157+ padding : 16 px 32 px ;
76158 background-color : # 007bff ;
77159 color : white;
78160 border : none;
79- border-radius : 8 px ;
161+ border-radius : 10 px ;
80162 cursor : pointer;
81- font-size : 1.1 em ;
163+ font-size : 1.2 em ;
82164 transition : background-color 0.3s ease;
83165}
84166
167+ body .dark-mode button {
168+ background-color : # 007bff ;
169+ color : # fff ;
170+ }
171+
85172button : hover {
86173 background-color : # 0056b3 ;
87174}
88175
176+ body .dark-mode button : hover {
177+ background-color : # 0056b3 ;
178+ }
179+
89180# clearButton {
90181 background-color : # 6c757d ;
91182}
92183
184+ body .dark-mode # clearButton {
185+ background-color : # 6c757d ;
186+ color : # fff ;
187+ }
188+
93189# clearButton : hover {
94190 background-color : # 545b62 ;
191+ }
192+
193+ body .dark-mode # clearButton : hover {
194+ background-color : # 545b62 ;
95195}
0 commit comments