Harsh Wardhan
Identity: Distraction-Free DesignOpen SourceZero Dependencies

FocusX

Distraction-Free Pomodoro Timer Suite

Engineering Challenge

“How do you build a timer people actually enjoy using?”

Utilities•Completed•Creator•Part of 12-Days-12-Projects
DependenciesZeroVanilla JS
Time SyncEpochTab Throttling Fix
Theme ShiftDynamicState Colors
Bundle Size< 10KBInstant Load
FocusX
01 Problem Statement

Why I Built This Tool

Many timer applications suffer from intrusive popups, complex settings, and timing drift when backgrounded by modern browser tab throttling. FocusX eliminates visual noise while anchoring countdown calculations to system epoch time.

Motivation

I wanted a simple timer that loaded instantly, had no ads or bloat, and wouldn’t lose time accuracy when minimized while I was coding.

02 Implementation Details

Technical Implementation

Interesting Mechanics

Calculates remaining session time as `Math.max(0, targetEndTime - Date.now())` rather than `timeLeft--`, completely solving background tab timer throttling.

Design Approach: Zero framework overhead: leverage native Web APIs and system timestamps for high accuracy with minimal resource usage.

03 Technical Rigor

Engineering Decisions

Decision #01 • System Epoch Timestamping vs Sequential `setInterval`
Problem:

Browsers throttle `setInterval` callbacks in background tabs, causing conventional timers to lose minutes of accuracy.

Decision:

Anchored remaining time calculations to `targetEndTime - Date.now()` epoch difference instead of incrementing tick counters.

Tradeoff:

Slightly more complex math on pause/resume state handling.

Outcome:

Achieved 100% timing accuracy even when backgrounded for hours.

04 Execution Obstacles

Challenges & Solutions

Smooth State Transitions Without CSS Libraries

Issue: Creating smooth background theme shifts without external CSS framework utilities required lightweight custom transitions.

Decision/Solution: Wrote clean CSS custom properties with hardware-accelerated color transitions.

Future Improvements

What's Next

Custom audio alert chime options
Web Worker background timer thread
Keyboard shortcut triggers
Retrospective Summary

Key Takeaways

Takeaway #01

Relying on system epoch timestamps is mandatory for reliable client-side chronometers.

Takeaway #02

Removing dependencies produces lightning-fast user utilities.

Continue Exploring

Related Engineering Projects