@@ -5,7 +5,13 @@ html, body {
5
5
height : 100% ;
6
6
overflow : hidden; /* Prevent outer scrollbar */
7
7
font-family : 'Arial' , sans-serif;
8
- background-color : # f0f4f8 ;
8
+ background-color : # f0f4f8 ; /* Light mode background */
9
+ transition : background-color 0.3s , color 0.3s ; /* Smooth transition */
10
+ }
11
+
12
+ body .dark-mode {
13
+ background-color : # 121212 ; /* Dark mode background */
14
+ color : # ffffff ; /* Dark mode text color */
9
15
}
10
16
11
17
/* Quiz container with scrollable content */
@@ -20,14 +26,79 @@ html, body {
20
26
overflow-y : auto; /* Scrollable content */
21
27
height : 100vh ; /* Take full height of the viewport */
22
28
box-sizing : border-box; /* Include padding and border in the element’s total width and height */
29
+ transition : background-color 0.3s , box-shadow 0.3s ; /* Smooth transition */
23
30
}
24
31
32
+ .quiz-container .dark-mode {
33
+ background-color : # 1e1e1e ; /* Dark mode container background */
34
+ }
35
+
36
+
25
37
/* Heading styling */
26
38
h1 {
27
- color : # 333 ;
39
+ color : # 333 ; /* Light mode color */
28
40
margin-top : 0 ;
29
41
}
30
42
43
+ /* Dark mode heading color */
44
+ body .dark-mode h1 {
45
+ color : # ffffff ; /* Change to white in dark mode */
46
+ }
47
+
48
+ /* Hide scrollbar */
49
+ .quiz-container ::-webkit-scrollbar {
50
+ display : none; /* Hide scrollbar for WebKit browsers */
51
+ }
52
+
53
+ .toggle-label {
54
+ display : flex;
55
+ align-items : center;
56
+ }
57
+
58
+ .toggle-label input {
59
+ display : none; /* Hide the default checkbox */
60
+ }
61
+
62
+ .toggle-switch {
63
+ width : 40px ;
64
+ height : 20px ;
65
+ background-color : # ccc ;
66
+ border-radius : 50px ;
67
+ position : relative;
68
+ margin-left : 10px ;
69
+ cursor : pointer;
70
+ transition : background-color 0.3s ;
71
+ }
72
+
73
+ .toggle-switch ::before {
74
+ content : '' ;
75
+ width : 18px ;
76
+ height : 18px ;
77
+ background-color : white;
78
+ border-radius : 50% ;
79
+ position : absolute;
80
+ left : 2px ;
81
+ bottom : 1px ;
82
+ transition : transform 0.3s ;
83
+ }
84
+
85
+ input : checked + .toggle-switch {
86
+ background-color : # 4caf50 ; /* Color when checked */
87
+ }
88
+
89
+ input : checked + .toggle-switch ::before {
90
+ transform : translateX (20px ); /* Move the toggle */
91
+ }
92
+
93
+ /* Dark mode toggle switch */
94
+ input [type = "checkbox" ]: checked + .toggle-switch {
95
+ background : # 4caf50 ; /* Color when checked */
96
+ }
97
+
98
+ input [type = "checkbox" ]: checked + .toggle-switch ::before {
99
+ transform : translateX (25px ); /* Move switch to the right */
100
+ }
101
+
31
102
/* Ensure that questions area is scrollable if necessary */
32
103
# quiz-questions {
33
104
margin : 20px 0 ;
@@ -45,7 +116,7 @@ label {
45
116
font-size : 16px ;
46
117
}
47
118
48
- /* Button styling */
119
+ /* Button styling with glowing effect */
49
120
button {
50
121
background-color : # 4caf50 ;
51
122
color : white;
@@ -55,25 +126,62 @@ button {
55
126
cursor : pointer;
56
127
font-size : 16px ; /* Optional: Increase font size for better visibility */
57
128
margin-top : 20px ; /* Add space above the button */
58
- margin-bottom : 50px ;
129
+ box-shadow : 0 0 5px rgba (76 , 175 , 80 , 0.5 ), 0 0 20px rgba (76 , 175 , 80 , 0.7 ), 0 0 30px rgba (76 , 175 , 80 , 0.9 ); /* Glowing effect */
130
+ transition : all 0.3s ease; /* Transition for smooth effects */
59
131
}
60
132
61
133
/* Button hover effect */
62
134
button : hover {
63
135
background-color : # 45a049 ;
136
+ transform : scale (1.05 ); /* Slightly increase size on hover */
137
+ box-shadow : 0 0 10px rgba (76 , 175 , 80 , 1 ), 0 0 30px rgba (76 , 175 , 80 , 1 ), 0 0 40px rgba (76 , 175 , 80 , 1 ); /* Stronger glow on hover */
64
138
}
65
139
66
140
/* Result section */
67
141
.result {
68
142
display : none; /* Initially hidden */
69
143
text-align : center;
70
144
padding : 20px ;
145
+ opacity : 0 ; /* Start invisible for fade-in effect */
146
+ transition : opacity 0.5s ease; /* Fade transition */
71
147
}
72
148
73
149
# result h2 {
74
150
font-size : 24px ;
151
+ color : # 333 ; /* Light mode result color */
152
+ }
153
+
154
+ /* Dark mode result color */
155
+ body .dark-mode # result h2 {
156
+ color : # ffffff ; /* Change to white in dark mode */
75
157
}
76
158
77
159
# result p {
78
160
font-size : 18px ;
79
161
}
162
+
163
+ /* Fade-in animation */
164
+ .fade-in {
165
+ opacity : 1 ; /* Fully visible */
166
+ }
167
+
168
+ /* Additional styles for the quiz title */
169
+ h2 {
170
+ color : # 333 ;
171
+ margin-top : 0 ;
172
+ }
173
+
174
+ /* Add some animations for the quiz container */
175
+ @keyframes fadeIn {
176
+ from {
177
+ opacity : 0 ;
178
+ }
179
+ to {
180
+ opacity : 1 ;
181
+ }
182
+ }
183
+
184
+ /* Apply animation to the quiz-container */
185
+ .quiz-container {
186
+ animation : fadeIn 1s ease-in; /* Fade in effect for quiz container */
187
+ }
0 commit comments