ShreyanshIITK20 / Time-tracking-dashboard

Frontend web development challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frontend Mentor - Time tracking dashboard solution

Design preview for the Time tracking dashboard coding challenge

This is a solution to the Time tracking dashboard challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects and collaborate with greatest developers around the world.

Table of contents

Overview

The challenge

Users should be able to:

  • View the optimal layout for the site depending on their device's screen size (solution is created for best viewing on Desktop size-1440px and Mobile size-375px)
  • See hover states for all interactive elements on the page
  • Switch between viewing Daily, Weekly, and Monthly stats

Screenshot

Javascript functionality to extract JSON data Custom CSS HTML structure

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • CSS Grid
  • Javascript ES6
  • Desktop-first workflow

What I learned

This project was mainly based on the use of CSS grid boxes, a feature I never used before to handle layouts. For such purposes, I always chose Bootstrap's grid system and its cards, but I took this as a challenge to work entirely with CSS and don't depend on Bootstrap's classes. Since this was my first work with grid systems, it was kinda hard to adapt to its working and syntax initially. Secondly, I took the optional challenge to use data.json as my primary data file wherein I struggled a lot to fetch the contents and use them dynamically in my HTML file. For this, I used fetch() and forEach looping, alongside with restructured data file.

<div class="wrapper">
.wrapper{
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 1em;
    /* grid-auto-rows: minmax(250px,auto); */
    color: white;
}
.child{
    display: grid;
    grid-template-columns: 1fr;
}
containers.forEach(function(container){
        var containerClass = '.'+container.title
        $(containerClass+" .content_value").html(container['timeframes'][clickedState]['current']+" hrs")
        $(containerClass+" .content_prev").html(prevName + container['timeframes'][clickedState]['previous']+" hrs")
      })

Continued development

While working on this project I used raw HTML and CSS to develop the frontend, but later realised the need of using ReactJS's components which could have made everything so much smoother and simpler since most of the code I wrote in HTML was redundant with minor changes. I will try to work on similar projects using React to increase the efficiency of my code.

Useful resources

Author

About

Frontend web development challenge


Languages

Language:HTML 47.5%Language:CSS 35.3%Language:JavaScript 17.3%