-
Notifications
You must be signed in to change notification settings - Fork 43
added dark and light mode button #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| let output = document.getElementById("output"); | ||
| let out = document.getElementById("out") | ||
| let flag=0 | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to add empty lines. |
||
| const geolocation = () => { | ||
| if (navigator.geolocation) { | ||
| navigator.geolocation.getCurrentPosition(rit, fileit); | ||
|
|
@@ -47,4 +49,21 @@ const fileit = (error) => { | |
| output.innerHTML = "Unknown Error please try again"; | ||
| break; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| const changeBodyBg = () => { | ||
| if(!flag) | ||
| {document.body.style.background = 'black'; | ||
| document.getElementById("title").style.color = 'white'; | ||
| document.getElementById("myButton1").value="Light"; | ||
| document.getElementById("myButton1").style.background = 'white'; | ||
|
||
| document.getElementById("myButton1").style.color = 'black'; | ||
| flag=1;} | ||
| else | ||
| {document.body.style.background = '#eee'; | ||
| document.getElementById("title").style.color = "#7c795d"; | ||
| document.getElementById("myButton1").value="Dark"; | ||
| document.getElementById("myButton1").style.background = 'black'; | ||
| document.getElementById("myButton1").style.color = 'white'; | ||
| flag=0;} | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls intend correctly