Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Todo-app use javascritp css and html

hassan ABD 865

@hassanabd22

Desktop design screenshot for the Todo app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
3intermediate
View challenge

Design comparison


SolutionDesign

Community feedback

Ivan 2,630

@isprutfromua

Posted

Hi there. You did a good job 😎

keep improving your programming skills🛠️

your solution looks great, however, if you want to improve it, you can follow these recommendation:

don't use onclick . There may be specific use cases for it, but if you are not 100% sure you have that use case, then you do not and should not use inline events.

btn.onclick = function darkMode() 

avoid classes expressions. It will be better if you check the mode by value in the local storage

document.body.classList.contains('light-mode')

don't repeat yourself . The code is very similar, you can simplify the logic with ternary operators

        images.src = './images/icon-moon.svg';
        bgImg.src ='./images/bg-desktop-light.jpg';
    } else {
        images.src = './images/icon-sun.svg';
        bgImg.src ='./images/bg-desktop-dark.jpg';

I hope my feedback will be helpful. You can mark it as useful if so 👍 it is not difficult for you, but I understand that my efforts have been appreciated

Good luck and fun coding 🤝⌨️

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord