Amon• 2,560
@A-amon
Posted
Hello! It's a very good job~ 😀
Here are a few tiny changes I would suggest:
- Use
<a>
or<button>
for thetime
buttons: Daily, weekly, monthly. (Those on the side) This will let screen reader users to know they are to be clicked. 😉 - Maybe you forgot to set the current
time
button's color when the page first loads. - I noticed there are repetitive Js code. Maybe, you can create a single function that can replace the showWeekly, showMonthly, etc. For example:
function showCardContent(time, data){
for (let i = 0; i < cardsTitles.length; i++) {
currents[i].innerText = data[i].current + "hrs";
prevs[i].innerText = `Last ${time}- ` + data[i].previous + "hrs";
}
/*play the animation */
addAnimationFadeIn();
}
The code above may or may not work but the general idea is there! 😁
Marked as helpful
0