Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 3 years ago

Responsive web app using CSS Grid, Flexbox and JavaScript

Dmitryβ€’375
@dmitrymitenkoff
A solution to the Time tracking dashboard challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


This has been a fun and challenging project. It's the first time I've used Parcel and new Dart Sass. I'm not an expert in Sass but I'm keen to learn more about using "@use" & "@forward" syntax - so any feedback would be appreciated. Also, if anyone could point me to a good, preferably written, tutorial on a workflow using Parcel, I'd really appreciate that too as I feel in this project I've guessed my way through a lot of Parcel-related stuff. Thanks guys!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Amonβ€’2,560
    @A-amon
    Posted over 3 years ago

    Hello! I gotta say, your code is neat and clean πŸ˜‰

    Here are some suggestions you might find helpful:

    • The .daily, .weekly, .monthly li elements should be/have an interactive element. πŸ–± They can be button or a. In my solution, I used button and gave them the role="tab". 😁 You can check out accessible tabs if you want to use the same approach. πŸ˜€
    • I believe the images for each .stats aren't that important to be made known to screen readers. Hence, instead of "Icon play", etc. , you can leave it empty alt="". You can read this. πŸ™Œ
    • I noticed most of the lines in your JS are similar. For e.g. populateMonthly(), populateWeekly() and populateDaily(), you can create a function populateStats() for e.g., to do all three. The difference in these functions lies in timeframes.weekly.current where the weekly could be replaced with daily or monthly. This can be passed as argument to the newly created populateStats(). πŸ˜‰
    function populateStats(timeframe) {
      let datacounter = 0;
      cards.forEach(card => {
        const workHours = card.querySelector('.stats__hrs--num');
        const prevWeekHrs = card.querySelector('.stats__prev__hrs');
        workHours.textContent = data[datacounter].timeframes[timeframe].current;
        prevWeekHrs.textContent = data[datacounter].timeframes[timeframe].previous;
        datacounter++;
      });
    }
    

    The code might or might not work. You'll have to test it out and make changes accordingly. πŸ˜‚

    • forEach comes with index, so you don't have to manually create a datacounter variable to do it. forEach
    cards.forEach((card, index) => {
      ...
    })
    

    By the way, I finally know what to put into typography.scss, thanks to you! πŸ˜€ Awesome work~

    Marked as helpful
  • Dmitryβ€’375
    @dmitrymitenkoff
    Posted over 3 years ago

    Hey Amon, Thanks very much for your detailed feedback. I refactored the JS function as you suggested - thanks for that as I'd spent ages trying to figure that out!

    Cheers:)

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
Β© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up β€œinvalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub