├── README.md ├── script.js ├── index.html └── style.css /README.md: -------------------------------------------------------------------------------- 1 | # Weather-App with HTML, CSS and JavaScript 2 | -------------------------------------------------------------------------------- /script.js: -------------------------------------------------------------------------------- 1 | const btn = document.getElementById("toogler"); 2 | const btn_icon = document.getElementById("toogler-icon"); 3 | const contain = document.getElementById("contain"); 4 | const wind = document.getElementById("wind") 5 | btn.onclick = function() { 6 | if(contain.getAttribute("data-theme")!="dark"){ 7 | contain.setAttribute("data-theme","dark"); 8 | btn_icon.setAttribute("class","fas fa-solid fa-sun"); 9 | wind.setAttribute("style","color: orange;") 10 | } 11 | else{ 12 | contain.setAttribute("data-theme",""); 13 | wind.setAttribute("style","color: #0f345fe3;") 14 | btn_icon.setAttribute("class","fas fa-solid fa-moon"); 15 | } 16 | } -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |