88
88
</ head >
89
89
90
90
< body >
91
- <!-- /* dark mode toggle & github buttons */ -->
92
- < nav >
93
- <!-- <div class="navbtn">
94
- <a class="github-button" href="https://github.com/smthari/Password-generator-using-html-css-javascript/fork"
95
- data-color-scheme="no-preference: dark; light: light; dark: dark;" data-icon="octicon-repo-forked"
96
- data-size="large" data-show-count="true"
97
- aria-label="Fork smthari/Password-generator-using-html-css-javascript on GitHub">Fork</a>
98
-
99
- <a class="github-button" href="https://github.com/smthari/Password-generator-using-html-css-javascript"
100
- data-color-scheme="no-preference: dark; light: light; dark: dark;" data-icon="octicon-star"
101
- data-size="large" data-show-count="true"
102
- aria-label="Star smthari/Password-generator-using-html-css-javascript on GitHub">Star</a>
103
-
104
- <a class="github-button" href="https://github.com/smthari"
105
- data-color-scheme="no-preference: dark; light: light; dark: dark;" data-size="large"
106
- data-show-count="true" aria-label="Follow @smthari on GitHub">Follow @smthari</a>
107
- </div> -->
108
- < div class ="theme-switch-wrapper ">
109
- < label class ="theme-switch " for ="checkbox ">
110
- < input type ="checkbox " id ="checkbox " />
111
- < div class ="slider round "> </ div >
112
- </ label >
113
- < em > Switch Theme</ em >
114
- </ div >
115
- </ nav >
116
-
117
91
< div class ="container ">
118
92
< h2 > Password Generator</ h2 >
119
93
< div class ="result-container ">
@@ -153,33 +127,6 @@ <h2>Password Generator</h2>
153
127
< script src ="script.js "> </ script >
154
128
< script async defer src ="https://buttons.github.io/buttons.js "> </ script >
155
129
< script src ="https://kit.fontawesome.com/dd8c49730d.js " crossorigin ="anonymous "> </ script >
156
- < script >
157
- /* dark mode toggle */
158
- const toggleSwitch = document . querySelector (
159
- '.theme-switch input[type="checkbox"]'
160
- ) ;
161
- const currentTheme = localStorage . getItem ( "theme" ) ;
162
-
163
- if ( currentTheme ) {
164
- document . documentElement . setAttribute ( "data-theme" , currentTheme ) ;
165
-
166
- if ( currentTheme === "dark" ) {
167
- toggleSwitch . checked = true ;
168
- }
169
- }
170
-
171
- function switchTheme ( e ) {
172
- if ( e . target . checked ) {
173
- document . documentElement . setAttribute ( "data-theme" , "dark" ) ;
174
- localStorage . setItem ( "theme" , "dark" ) ;
175
- } else {
176
- document . documentElement . setAttribute ( "data-theme" , "light" ) ;
177
- localStorage . setItem ( "theme" , "light" ) ;
178
- }
179
- }
180
-
181
- toggleSwitch . addEventListener ( "change" , switchTheme , false ) ;
182
- </ script >
183
130
</ body >
184
131
185
132
</ html >
0 commit comments