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.
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
- Solution URL: https://github.com/MitaliShah/time-tracking-dashboard
- Live Site URL: https://effulgent-squirrel-fb282b.netlify.app/
- Vite
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- React - JS library
- Styled Components - For styles
I learned how to conditionally change the background-color based on the title value using styled-components
const Wrapper = styled.div`
background-color: ${(props) =>
props.title === "Work"
? "var(--work-light-red)"
: props.title === "Play"
? "var(--play-soft-blue)"
: props.title === "Study"
? "var(--study-light-red)"
: props.title === "Exercise"
? "var(--exercise-lime-green)"
: props.title === "Social"
? "var(--social-violet)"
: props.title === "Self Care"
? "var(--self-care-soft-orange)"
: null};
`;
};
- Frontend Mentor - @MitaliShah