@A-amon
Posted
Hello! It's an amazing work, really! 😲
But here are some suggestions:
- Place your .container inside a
main
landmark tag. - Instead of so many arrays (dailyCurrent, dailyPrevious, weeklyCurrent, ...), you can use array to store objects. For example:
const dailyData = [
{
current: 0,
previous:0
},
...
]
- You can try using template for elements such as those cards 😉. (So the JS wouldn't be cluttered with createElement). Although you will still need to querySelector each class inside to set the values. 😂
- Instead of card0, card1, ..., why not use an array to store them? 🤔 This way, your displayCards() and removeCards() lines of code will be much lesser and less repetition.