Skip to content

Arjun-B-J/lockin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lockin

A green-themed focus timer that runs as a standalone Windows app. Wall-clock based (survives sleep), Picture-in-Picture mini mode for "always on top," and local auto-export to disk so you can run pandas analytics on your own focus data.

Built single-file, single-afternoon, no build step, no dependencies.

lockin screenshot

Full app screenshot (timer + stats dashboard): screenshot-full.png


Features

Timer

  • Wall-clock based — uses real timestamps, not tick counts. Laptop sleeps mid-session? On wake, the timer fast-forwards to the right remaining time; if sleep crossed the planned end, the session auto-completes and prompts for a note.
  • Picture-in-Picture mini window — floats on top of other apps via the Document Picture-in-Picture API. Click ✕ to send back to the main window.
  • Session presets — Deep (50/10), Pomodoro (25/5), Sprint (90/15), Quick (15/3), plus tunable focus and break minutes.
  • Per-session notes — modal pops at the end of each focus block. What did you actually do?
  • Distraction tap — log a distraction mid-session without stopping the timer. Tracks how often you slip.
  • Daily goal + progress bar — set hours/day; bar fills as you focus.
  • Pomodoro chain with milestone unlocks — 🔥 at 4 sessions, ⚡ at 8, 💎 at 12.
  • Procedural ambient noise — brown / pink / white / rain, all generated locally via the Web Audio API. No audio files, no network.
  • Alarm chimes — gentle 3-tone end-of-focus, urgent 5-beep end-of-break.

Stats dashboard

  • 🔥 Streak — current and longest, with a 14-day amber dot history.
  • 🏆 Personal bests — longest session, biggest day, biggest week (with dates).
  • 📊 Last 30 days — bar chart, today's bar highlighted lime.
  • 📅 Year view — GitHub-style 53×7 calendar heatmap, 5 intensity levels.
  • ⏰ Focus by hour of day — 7×24 grid that surfaces your best focus windows ("Best hour: 17:00").
  • 📵 Distractions trend — 14-day line chart, gradient from orange (high) to green (low).

Auto-export to disk (analytics-ready)

Connect a folder once via the File System Access API. Every session save mirrors to:

<your folder>/
  sessions.jsonl       # one JSON per line, append-only — analytics source of truth
  state.json           # full state snapshot, restorable
  daily/
    2026-05-07.md      # human-readable per-day summary
    2026-05-08.md

Then:

import pandas as pd

df = pd.read_json('sessions.jsonl', lines=True)
df['startedAt'] = pd.to_datetime(df['startedAt'])

# Daily focus totals
df.groupby(df['startedAt'].dt.date)['durationMinutes'].sum()

# Focus by hour of day
df.groupby(df['startedAt'].dt.hour)['durationMinutes'].sum()

# Distraction rate per session
(df['distractions'] / (df['durationMinutes'] / 60)).describe()

Stack

Pure HTML / CSS / JS. ~1500 lines. No build step, no node_modules, no backend.

Concern API
Primary state localStorage
Directory handle persistence IndexedDB
Wall-clock timing Date.now() math (not setInterval counts)
Alarms + ambient noise Web Audio API (OscillatorNode, BufferSource w/ procedural noise generation)
Floating mini window Document Picture-in-Picture API
Auto-export to disk File System Access API
All charts Inline SVG (calendar heatmap, hour heatmap, line chart, bar chart)

Run

Windows — double-click launch.bat. Opens in Chrome's --app= mode for a clean standalone window with normal Windows title bar (close, minimize, maximize). Falls back to Edge, then default browser.

Anywhere else — open index.html in any modern browser.

For Picture-in-Picture and auto-export, use Chrome or Edge (Chromium).


Why

Built mid-prep for a 2026 SDE-2/3 interview season — needed something to lock in for 6+ hours a day with: visible progress, distraction self-awareness, and data I could actually slice in pandas afterward. Existing Pomodoro apps were either too cute or too closed.


License

MIT

About

A green-themed focus timer for Windows: wall-clock based, Picture-in-Picture mini mode, distraction tracking, and File System Access auto-export for pandas analytics. No build, no deps.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors