
Time Tracking Dashbooard using JS
Design comparison
Solution retrospective
I'm proud that I used JavaScript for this project
What challenges did you encounter, and how did you overcome them?I had issues with fetching the json file. But with time, I was able to resolve it
What specific areas of your project would you like help with?JavaScript
Community feedback
- @khatri2002Posted 2 months ago
Hi! The developed solution looks good! It is well-implemented.
Suggestions for Improvement:
-
Replace
li
Click with abutton
Element:
You've used the<li>
element directly to render the textDaily
,Weekly
, andMonthly
, and you're handling theonClick
event on these<li>
elements.While this works, it's more appropriate to use a
button
element since these are interactive and trigger actions (switching views).Why is a Button Element Important?
- Semantic Accessibility: Buttons are designed for interaction, making the solution more semantically correct and accessible for screen readers.
- Keyboard Navigation: Buttons are inherently focusable and operable using keyboard events (
Enter
/Space
), improving usability for users who navigate without a mouse. - CSS Styling Consistency: Buttons come with built-in pseudo-classes like
:active
,:focus
, etc., which are helpful for styling states like hover or active.
-
Highlight the Active Option:
Currently, you're updating the data when a user clicks on any option, which is great. However, you should also visually indicate which option is active. A clear visual cue allows users to understand the current state and which view is being displayed.- Add a CSS class (e.g.,
.active
) to the button when clicked. - Remove the class from all other buttons to ensure only one is highlighted.
- By default,
Daily
should be active on page load.
- Add a CSS class (e.g.,
The overall solution is solid! Keep up the great work! 🚀
0 -
Please log in to post a comment
Log in with GitHubJoin 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