feat: add background audio Pomodoro prototype - #10
Open
foxhub2020 wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bounty Solution Submission
Problem Statement
This solves #1 by providing a minimal single-page Pomodoro timer prototype that keeps accurate time while inactive and schedules a Web Audio chime that can play when Chrome backgrounds or minimizes the tab.
Solution Approach
The solution is a dependency-free single HTML page. It validates a minutes-only input, displays an MM:SS countdown, and uses a wall-clock deadline instead of interval counting so inactive-tab throttling does not create timer drift. The Start click creates and resumes Web Audio inside Chrome's required user gesture, plays a near-silent unlock pulse, and schedules the completion chime on the AudioContext clock before the page goes into the background.
Technical Implementation
submissions/pomodoro-background-audio-foxhub2020/index.htmldirectly in Chrome desktop or serve the repository with any static file server.Testing Evidence
Evidence files:
submissions/pomodoro-background-audio-foxhub2020/evidence/selftest.pngsubmissions/pomodoro-background-audio-foxhub2020/evidence/running.pngsubmissions/pomodoro-background-audio-foxhub2020/evidence/complete.pngDemo Evidence
Choose ONE:
submissions/pomodoro-background-audio-foxhub2020/evidence/demo.webmSetup Instructions
Step-by-step instructions to run your code:
submissions/pomodoro-background-audio-foxhub2020/index.htmlin recent Chrome desktop.http://localhost.index.html?selftest=1.1, press Start while the tab is active, then switch to another tab or app until the timer completes.Database Setup
Not applicable.
Architectural Decisions
AudioContext.currentTimeimmediately after Start, so completion audio does not depend on throttled background JavaScript timers.Date.now()and a stored deadline, so inactive tabs catch up accurately.Bun/Yarn Justification
Not applicable. No package manager is used because the bounty deliverable is a dependency-free single HTML file.
Pre-submission Checklist:
I confirm this submission meets all requirements and is ready for review.
Closes #1
@adrianmurage