Closed j1sun closed 3 years ago
Began refactoring by making TimerButton a web component
Plan: Begin separating each class in main.js
into its own components file, and update index.html
accordingly with the new component. The goal is to make sure each component is individually controlled. Note that an underscore before a method indicates that the method is private. Below are the specifications for each component:
Do this last and keep in main.js, as it is not a web component. The primary controller. Handles big events in timer by calling on its child components at the right times.
The timer text that counts down from 25:00. This timer inherently doesn't automatically start or stop itself. Like a countdown timer that ticks forever (almost like a pomodoro timer), this timer can be started, stopped, and set to a particular time.
The timer button that runs the app. Already a component.
Deprecated. Rather than holding TimerInfoSessions and TimerInfoProgress, just remove it in favor of the two components below.
The indicator for the number of timer sessions. Currently pending on whether it should hold the current number of sessions.
The progress bar for the timer and already a component. Similar to TimerText in functionality: it can start, stop, update, be set, etc.
Handles the settings page and dispatches events indicating updates and resets.
The initial splash screen.
A generic confirmation dialog. -constructor(): Initializes the confirmation dialog based on the existing template.
TODO
With the minimum viable product complete, we need to refactor and document the codebase to ensure it's clean.
Plan: Begin separating each class in
main.js
into its own components file, and updateindex.html
accordingly with the new component. The goal is to make sure each component is individually controlled. Note that an underscore before a method indicates that the method is private. Below are the specifications for each component:TimerApp
Do this last and keep in main.js, as it is not a web component. The primary controller. Handles big events in timer by calling on its child components at the right times.
TimerText
The timer text that counts down from 25:00. This timer inherently doesn't automatically start or stop itself. Like a countdown timer that ticks forever (almost like a pomodoro timer), this timer can be started, stopped, and set to a particular time.
TimerButton
The timer button that runs the app. Already a component.
TimerInfo
Deprecated. Rather than holding TimerInfoSessions and TimerInfoProgress, just remove it in favor of the two components below.
TimerSessions
The indicator for the number of timer sessions. Currently pending on whether it should hold the current number of sessions.
TimerProgress
The progress bar for the timer and already a component. Similar to TimerText in functionality: it can start, stop, update, be set, etc.
TimerSettings
Handles the settings page and dispatches events indicating updates and resets.
TimerSplash
The initial splash screen.
ConfirmDialog
A generic confirmation dialog. -constructor(): Initializes the confirmation dialog based on the existing template.
TaskList
TODO
Document code:
Checklist: