Skip to content

An offline-first time tracker with visual insights, local storage, and intuitive tools for logging/categorizing time—no server needed, just simple, secure time management. Cybersecurity student (sophomore year) – this is my second HTML-based personal project!

Notifications You must be signed in to change notification settings

Evanluo060810/Timetracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Remade Documentation

This document outlines the comprehensive remaking process of the Time Tracker Pro project, including key improvements, technical adjustments, and design optimizations.

Background

The original project had several limitations that affected usability and deployment:

  • ES6 module syntax caused CORS errors when opening via file:// protocol
  • Modular structure complicated local deployment for non-technical users
  • Inconsistent UI components and animation effects
  • Lack of comprehensive error handling
  • Limited data export options

Core Improvements

1. Architecture Refactoring

  • Removed ES6 Modules: Replaced import/export with a global namespace (TimeTrackerApp) to eliminate CORS issues
  • Single-File JS Structure: Combined all modules (data model, UI renderer, chart manager, etc.) into one app.js file
  • Namespace Isolation: Organized code into logical modules (dataModel, uiRenderer, chartManager) to avoid variable pollution
  • Evan Watermark Integration: Added "Created by Evan" attribution in code headers and preserved Evan-prefixed IDs for all elements

2. Event Handling Optimization

  • Centralized Event Binding: Consolidated event listeners with delegated events to reduce memory usage
  • Error Boundaries: Added try-catch blocks around all event handlers for improved stability
  • Throttle for High-Frequency Events: Implemented throttle for window resize to optimize chart rendering performance
  • Simplified Event Management: Removed redundant event listeners and added proper cleanup logic

3. UI/UX Enhancement

  • Modernized Visual Design: Improved gradients, shadows, and animations for a more polished look
  • Responsive Layout Fixes: Optimized grid system and component sizing for mobile/desktop consistency
  • Smooth Animations: Added fade-in effects for cards and modal transitions
  • Accessibility Improvements: Enhanced color contrast, added tooltips, and optimized click targets
  • Consistent Component Styling: Standardized buttons, cards, and modals with unified design language

4. Data Handling & Storage

  • Robust LocalStorage Integration: Improved data persistence with validation and fallback defaults
  • Comprehensive Export Options: Added JSON/CSV export for records, categories, and goal data
  • Data Validation: Implemented input sanitization and error checking for all user inputs
  • Date Range Calculations: Enhanced date handling for time distribution and trend analysis
  • XSS Protection: Added escapeHtml method to prevent cross-site scripting vulnerabilities

5. Feature Enhancements

  • Goal Progress Visualization: Added dynamic progress bars with color-coded indicators
  • Category Distribution Stats: Improved breakdown of time usage with percentage calculations
  • Enhanced Chart Rendering: Fixed chart redraw issues and added empty state handling
  • Bulk Data Management: Optimized record/category/goal CRUD operations with batch UI updates
  • Notification System: Refined success/error messages with consistent styling and timing

Technical Details

Tech Stack

  • HTML5 (semantic markup)
  • Tailwind CSS (via CDN, custom utilities)
  • Vanilla JavaScript (ES6+, no frameworks)
  • Chart.js v4 (data visualization)
  • Font Awesome (iconography)

Key Technical Adjustments

  • Chart Rendering Fixes: Implemented chart destruction/recreation logic to resolve redraw issues
  • Event Delegation: Used parent-element event listening for dynamic content (records, categories)
  • Throttle Function: Added 300ms throttle for window resize events to improve performance
  • Modal Management: Simplified modal show/hide logic with CSS transitions
  • LocalStorage Utilities: Added data validation and fallback defaults for empty storage

Code Organization

TimeTrackerApp/├── dataModel: Manages data storage, CRUD operations, and calculations├── uiRenderer: Handles all UI rendering and DOM manipulations├── chartManager: Manages chart creation, updates, and responsiveness├── modalManager: Controls modal show/hide behavior├── notificationManager: Handles user feedback messages├── exportManager: Manages data export to JSON/CSV└── eventHandler: Centralizes all user interaction handling plaintext

Usability Improvements

  • Zero Configuration: Works immediately by double-clicking index.html
  • Simplified Workflow: Streamlined form interactions and reduced click paths
  • Visual Feedback: Added hover effects, loading states, and success/error notifications
  • Empty State Handling: Improved messaging for no records/goals/categories
  • Consistent Naming: Standardized element IDs with Evan suffix for easy identification

Known Limitations

  • Data is stored in localStorage (clearing browser data will delete records)
  • Maximum storage limit depends on browser (typically 5MB)
  • Offline use requires initial CDN resource load (Tailwind, Chart.js, Font Awesome)
  • Not optimized for extremely large datasets (1000+ records)

License

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Remade by Evan | Last updated: [Current Date]

About

An offline-first time tracker with visual insights, local storage, and intuitive tools for logging/categorizing time—no server needed, just simple, secure time management. Cybersecurity student (sophomore year) – this is my second HTML-based personal project!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published