Documentation Index
Fetch the complete documentation index at: https://mintlify.com/chrisdzasc/Time-Tracking-Dashboard/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Time Tracking Dashboard comes with six default activities: Work, Play, Study, Exercise, Social, and Self Care. This guide shows you how to add custom activities with complete code examples.Default Activities
The dashboard includes these activities with predefined colors:| Activity | Background Color | CSS Variable | Defined At |
|---|---|---|---|
| Work | Orange | --orange: hsl(15, 100%, 70%) | styles.css:312-314 |
| Play | Blue | --blue: hsl(195, 74%, 62%) | styles.css:316-318 |
| Study | Pink | --pink: hsl(348, 100%, 68%) | styles.css:327-329 |
| Exercise | Green | --green: hsl(145, 58%, 55%) | styles.css:336-338 |
| Social | Purple | --purple-700: hsl(264, 64%, 52%) | styles.css:345-347 |
| Self Care | Yellow | --yellow: hsl(43, 84%, 65%) | styles.css:354-356 |
Activity Card Structure
Each activity card has the same HTML structure (index.html:47-63):
Key Elements
- Container:
<section>withactivity-cardand activity-specific class (e.g.,activity-card--work) - Icon: Background icon image positioned absolutely
- Title: Activity name in
<h2>withtext--p5-mediumclass - Current hours: Span with ID
{activity-name}-current - Previous hours: Span with ID
{activity-name}-previous
Adding a New Activity
Let’s add a “Reading” activity as a complete example.Add data to data.json
Add the new activity object to the JSON array. The activity should follow the existing structure (
data.json:1-104):Add HTML markup to index.html
Add the activity card HTML after the last activity section (after line 153):
Add CSS styling to styles.css
Add background color and icon positioning after the Self Care styles (after line 363):
Define color variable in styles.css
Add the new color to the
:root variables section (around line 26-49):Add DOM selectors to app.js
Add selectors for the new activity after the existing ones (after line 28):
Update dailyActivity function in app.js
Add code to update the Reading activity in the
dailyActivity() function (after line 58):Create an icon image
Add an icon SVG or PNG image to
./images/ named icon-reading.svg (or .png). The icon should be approximately 80x80 pixels.CSS Classes Reference
Activity Card Classes
Fromstyles.css:259-286:
Typography Classes
Used in activity cards:.text--p5-medium: Activity titles (18px, medium weight).text--p6: Secondary text (15px, regular weight).text--p6--color: Adds navy-200 color for “Last Week” text
Icon Positioning Examples
Each activity has custom icon positioning. Here are the existing patterns fromstyles.css:
Work (default positioning):
styles.css:320-325):
styles.css:358-363):
JavaScript Update Pattern
Each timeframe function follows this pattern (app.js:38-106):
- Remove active class from all buttons
- Add active class to current button
- Update
innerTextof current and previous spans - Access data by array index and timeframe name
Color Palette Suggestions
Here are color suggestions for common activities:| Activity | Suggested Color | HSL Value |
|---|---|---|
| Reading | Teal | hsl(180, 60%, 65%) |
| Cooking | Red-Orange | hsl(20, 80%, 60%) |
| Gaming | Deep Purple | hsl(270, 70%, 55%) |
| Music | Magenta | hsl(320, 75%, 60%) |
| Travel | Sky Blue | hsl(210, 70%, 60%) |
| Writing | Indigo | hsl(240, 60%, 60%) |
Removing an Activity
To remove an activity:Remove HTML section
Delete the
<section class="activity-card activity-card--{name}"> block from index.html.Remove CSS styles
Delete the
.activity-card--{name} and .activity-card__picture--{name} rules from styles.css.Common Issues
Activity card doesn’t appear
Check:- HTML is added to
index.htmlinside<main class="dashboard"> - CSS classes match the HTML exactly
- Background color is defined in
:root
Hours don’t update when switching timeframes
Check:- Span IDs in HTML match selectors in
app.js - Data exists in
data.jsonfor the activity - Array index in
app.jsmatches activity position indata.json - All three timeframe functions are updated
Icon doesn’t appear or is positioned incorrectly
Check:- Image file exists in
./images/directory - Image path in
srcattribute is correct - CSS class for icon positioning is defined
- Use browser DevTools to adjust
topandrightvalues
Reference
- Activity card HTML structure:
index.html:47-153 - Activity card CSS:
styles.css:259-363 - Background colors:
styles.css:312-356 - DOM selectors:
app.js:17-28 - Update functions:
app.js:38-106 - Data structure:
data.json:1-104