Giter Site home page Giter Site logo

time_tracking_dashboard's Introduction

Frontend Mentor - Time tracking dashboard solution

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.

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
  • See hover states for all interactive elements on the page
  • Switch between viewing Daily, Weekly, and Monthly stats

Screenshot

Desktop view:

desktop-view

Mobile view:

mobile-view-1 mobile-view-2

Links

My process

Built with

What I learned

I learned quite a bit of CSS Grid usage and how easy it is to make a responsive website with it! Check out below the layout for this particular website, simplified of course:

Just a few items with a wrapper that serves as the grid container

<div class="wrapper">
    <div class="tall">
            
    </div>
    <div class="first">

    </div>
    <div class="second">

    </div>
    <div class="third">

    </div>
    <div class="fourth">

    </div>
</div>

The CSS styling:

/*
  For the desktop view, there are 4 columns and two rows. Each area is 200px by 200px.
*/
.wrapper {
    display: grid;
    grid-template-columns: repeat(4, 200px);
    grid-template-rows: repeat(2, 200px);
}

/*
  The tall grid item takes up two areas
*/
.tall {
    background-color: red;
    grid-row-start: 1;
    grid-row-end: 3;
}

.first {
    background-color: blue;
}

.second {
    background-color: brown;
}

.third {
    background-color: black;
}

.fourth {
    background-color: yellow;
}

/*
  For screen widths smaller than 500px, we display a one column and 6 rows grid. Areas are the same size.
*/
@media screen and (max-width: 500px) {
    .wrapper {
        display: grid;
        grid-template-columns: repeat(1, 200px);
        grid-template-rows: repeat(6, 200px);
    }

 /*
   Just for a bit of fun, I shortened the tall grid item to half the size of the other squares
 */
    .tall {
        background-color: red;
        height: 100px;
        grid-row-start: 1;
        grid-row-end: 2;
    }

    .first {
        background-color: blue;
    }

    .second {
        background-color: brown;
    }

    .third {
        background-color: black;
    }

    .fourth {
        background-color: yellow;
    } 
}
  • Desktop view:
    • Now, we can see that in the desktop view, the grid items are layed out side by side, with the exception of the tall one, standing from top to bottom:
  • Mobile view:
    • When viewing on mobile, the grid items stack on top of eachother. This is all done by just changing the number of columns and rows with a media query!

example-mobile-view example-desktop-view

Continued development

Next thing i'm going to work on is building some functionality on websites with JavaScript. Might come back to this project and add the JS component that I didin't manage to do.

Useful resources

  • https://css-tricks.com/ - This website is a blast for learning CSS styling stuff. I learned almost everything about CSS grid from here. Definitely worth a look.

Author

time_tracking_dashboard's People

Contributors

maoaii avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.