88 < style >
99 : root {
1010 --bg-color : # ffffff ;
11- --text-color : # 000000 ;
12- --nav-bg : # 222 ;
11+ --text-color : # 333 ;
12+ --nav-bg : # 333 ;
1313 --nav-text : # ffffff ;
14- --nav-hover : # 444 ;
15- --input-bg : # f0f0f0 ;
16- --input-border : # 999 ;
14+ --nav-hover : # 555 ;
15+ --input-bg : # f9f9f9 ;
16+ --input-border : # ccc ;
1717 --button-bg : # 28a745 ;
1818 --button-hover : # 218838 ;
1919 --notification-btn-bg : # 007bff ;
2020 --notification-btn-hover : # 0056b3 ;
21+ --border-radius : 8px ;
22+ --transition-speed : 0.3s ;
2123 }
2224
2325 .dark-mode {
2426 --bg-color : # 121212 ;
2527 --text-color : # ffffff ;
26- --nav-bg : # 111 ;
28+ --nav-bg : # 1f1f1f ;
2729 --nav-text : # ffffff ;
28- --nav-hover : # 333 ;
30+ --nav-hover : # 444 ;
2931 --input-bg : # 222 ;
3032 --input-border : # 555 ;
3133 --button-bg : # 1c7430 ;
3436 --notification-btn-hover : # 003d7a ;
3537 }
3638
39+ .custom-theme {
40+ --bg-color : # f0f8ff ;
41+ --text-color : # 2c3e50 ;
42+ --nav-bg : # 3498db ;
43+ --nav-text : # ffffff ;
44+ --nav-hover : # 2980b9 ;
45+ --input-bg : # ecf0f1 ;
46+ --input-border : # bdc3c7 ;
47+ --button-bg : # e74c3c ;
48+ --button-hover : # c0392b ;
49+ --notification-btn-bg : # 9b59b6 ;
50+ --notification-btn-hover : # 8e44ad ;
51+ }
52+
3753 body {
3854 font-family : "Segoe UI" , Tahoma, Geneva, Verdana, sans-serif;
3955 margin : 0 ;
4056 padding : 0 ;
4157 text-align : center;
4258 background-color : var (--bg-color );
4359 color : var (--text-color );
44- transition : background-color 0.3 s , color 0.3 s ;
60+ transition : background-color var ( --transition-speed ) , color var ( --transition-speed ) ;
4561 }
4662
4763 .nav-bar {
4864 background-color : var (--nav-bg );
49- padding : 12 px ;
65+ padding : 16 px ;
5066 display : flex;
5167 justify-content : center;
52- gap : 12px ;
68+ gap : 16px ;
69+ box-shadow : 0 2px 4px rgba (0 , 0 , 0 , 0.1 );
5370 }
5471
5572 .nav-bar button {
5673 background : none;
5774 color : var (--nav-text );
5875 border : none;
59- padding : 12px 24 px ;
76+ padding : 12px 20 px ;
6077 cursor : pointer;
61- font-size : 18 px ;
62- border-radius : 6 px ;
63- transition : background-color 0.3 s ;
78+ font-size : 16 px ;
79+ border-radius : var ( --border-radius ) ;
80+ transition : background-color var ( --transition-speed ) ;
6481 }
6582
6683 .nav-bar button : hover {
7087 .section {
7188 display : none;
7289 padding : 24px ;
73- max-width : 500 px ;
74- margin : auto;
90+ max-width : 600 px ;
91+ margin : 20 px auto;
7592 text-align : left;
7693 background : var (--input-bg );
77- border-radius : 8 px ;
78- box-shadow : 0 4px 8 px rgba (0 , 0 , 0 , 0.1 );
94+ border-radius : var ( --border-radius ) ;
95+ box-shadow : 0 4px 12 px rgba (0 , 0 , 0 , 0.1 );
7996 opacity : 0 ;
8097 transform : translateX (50px );
81- transition : transform 0.5 s , opacity 0.5 s ;
98+ transition : transform var ( --transition-speed ) , opacity var ( --transition-speed ) ;
8299 }
83100
84101 # home {
119136 right : 0 ;
120137 bottom : 0 ;
121138 background-color : # ccc ;
122- transition : 0.4 s ;
139+ transition : background-color var ( --transition-speed ) ;
123140 border-radius : 25px ;
124141 }
125142
131148 left : 4px ;
132149 bottom : 4px ;
133150 background-color : white;
134- transition : 0.4 s ;
151+ transition : transform var ( --transition-speed ) ;
135152 border-radius : 50% ;
136153 }
137154
149166 right : 20px ;
150167 background : var (--button-bg );
151168 color : white;
152- padding : 10 px 20px ;
153- border-radius : 5 px ;
169+ padding : 12 px 20px ;
170+ border-radius : var ( --border-radius ) ;
154171 display : none;
155- transition : opacity 0.5 s ease-in-out , transform 0.5 s ease-in-out ;
172+ transition : opacity var ( --transition-speed ) , transform var ( --transition-speed ) ;
156173 transform : translateY (30px );
157174 }
158175
159176 .notification .show {
160177 display : block;
161178 transform : translateY (0 );
162179 }
163-
164- .notification : hover {
165- background-color : var (--button-hover );
166- }
167-
168- .notification-btn {
169- background-color : var (--notification-btn-bg );
170- color : white;
171- padding : 10px 20px ;
172- border : none;
173- border-radius : 6px ;
174- cursor : pointer;
175- font-size : 16px ;
176- transition : background-color 0.3s , transform 0.2s ;
177- }
178-
179- .notification-btn : hover {
180- background-color : var (--notification-btn-hover );
181- transform : scale (1.05 );
182- }
183180 </ style >
184181</ head >
185182< body >
190187 < button onclick ="showSection('settings') "> Settings</ button >
191188 </ div >
192189
193- < div id ="home " class ="section "> < h1 > Welcome to Coding Hut</ h1 > < p > The best coding shop of Scratch</ p > </ div >
194- < div id ='ordering ' class ='section '> < h1 > Coding Hut Orders</ h1 > </ div >
195- < div id ='rules ' class ='section '> < h1 > Rules:</ h1 > < ol > Be respectful to customers and emploees.</ ol > </ div >
190+ < div id ="home " class ="section ">
191+ < h1 > Welcome to Coding Hut</ h1 >
192+ < p > The best coding shop of Scratch</ p >
193+ </ div >
194+ < div id ='ordering ' class ='section '>
195+ < h1 > Coding Hut Orders</ h1 >
196+ </ div >
197+ < div id ='rules ' class ='section '>
198+ < h1 > Rules:</ h1 >
199+ < ol >
200+ < li > Be respectful to customers and employees.</ li >
201+ </ ol >
202+ </ div >
196203 < div id ="settings " class ="section " style ="display:none; ">
197204 < h2 > Settings</ h2 >
198205 < div class ="settings ">
@@ -205,7 +212,14 @@ <h2>Settings</h2>
205212 </ label >
206213 < label >
207214 < span > Enable Notifications</ span >
208- < button class ="notification-btn " onclick ="enableNotifications() "> Turn On</ button >
215+ < div class ="toggle-switch ">
216+ < input type ="checkbox " id ="notificationToggle " onchange ="toggleNotifications() ">
217+ < span class ="slider "> </ span >
218+ </ div >
219+ </ label >
220+ < label >
221+ < span > Custom Theme</ span >
222+ < input type ="color " id ="customColorPicker " onchange ="changeCustomTheme() " />
209223 </ label >
210224 </ div >
211225 </ div >
@@ -229,15 +243,22 @@ <h2>Settings</h2>
229243
230244 function toggleDarkMode ( ) {
231245 document . body . classList . toggle ( 'dark-mode' ) ;
232- document . getElementById ( 'darkModeToggle' ) . checked = document . body . classList . contains ( 'dark-mode' ) ;
233246 }
234247
235- function enableNotifications ( ) {
236- let notification = document . getElementById ( 'notification' ) ;
237- notification . classList . add ( 'show' ) ;
238- setTimeout ( ( ) => {
239- notification . classList . remove ( 'show' ) ;
240- } , 2000 ) ;
248+ function toggleNotifications ( ) {
249+ const notification = document . getElementById ( 'notification' ) ;
250+ const isEnabled = document . getElementById ( 'notificationToggle' ) . checked ;
251+ if ( isEnabled ) {
252+ notification . classList . add ( 'show' ) ;
253+ setTimeout ( ( ) => {
254+ notification . classList . remove ( 'show' ) ;
255+ } , 2000 ) ;
256+ }
257+ }
258+
259+ function changeCustomTheme ( ) {
260+ const color = document . getElementById ( 'customColorPicker' ) . value ;
261+ document . documentElement . style . setProperty ( '--bg-color' , color ) ;
241262 }
242263 </ script >
243264</ body >
0 commit comments