Unverified Commit 02bc2d56 authored by rishikaponna's avatar rishikaponna Committed by GitHub
Browse files

Add files via upload

parent 36396acd
let theme = localStorage.getItem('data-theme');
const changeThemeToDark = () => {
document.getElementById("HTML").setAttribute("data-theme", "dark") // set theme to dark
localStorage.setItem("data-theme", "dark") // save theme to local storage
var image = document.getElementById('logo2');
image.src = "img/Darkmode_logo.png";
var image = document.getElementById('logo-foot');
image.src = "img/Darkmode_logo.png";
}
const changeThemeToLight = () => {
document.getElementById("HTML").setAttribute("data-theme", "light") // set theme light
localStorage.setItem("data-theme", 'light') // save theme to local storage
var image = document.getElementById('logo2');
image.src = "img/Lightmode_logo.png";
var image = document.getElementById('logo-foot');
image.src = "img/Lightmode_logo.png";
}
const checkbox = document.getElementById("checkbox");
checkbox.addEventListener('change', () => {
let theme = localStorage.getItem('data-theme'); // Retrieve saved them from local storage
if (theme ==='dark'){
changeThemeToLight()
}else{
changeThemeToDark()
}
});
function changing(){
document.getElementById("HTML").setAttribute("data-theme", localStorage.getItem('data-theme')) ;
if(localStorage.getItem('data-theme')==="dark")
{
var image = document.getElementById('logo2');
image.src = "img/Darkmode_logo.png";
var image = document.getElementById('logo-foot');
image.src = "img/Darkmode_logo.png";
document.getElementById("checkbox").checked = true;
}
else if(localStorage.getItem('data-theme')===null)
{
document.getElementById("HTML").setAttribute("data-theme", "dark") ;
var image = document.getElementById('logo2');
image.src = "img/Darkmode_logo.png";
var image = document.getElementById('logo-foot');
image.src = "img/Darkmode_logo.png";
document.getElementById("checkbox").checked = true;
}
}
\ No newline at end of file
document.getElementsByClassName('press').addEventListener('click', function(){
document.getElementById('press1').click()
})
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment