FOCUSTIMER

Focus, flow, conquer distractions, unleash productivity!

last-commit repo-top-language repo-language-count


Table of Contents


Overview

FocusTimer is a Pomodoro-style timer app that helps users stay focused and productive. With features like customizable light/dark modes, background music control, and precise timer settings, it creates an ideal work environment. Ideal for students, professionals, and anyone seeking structured work sessions with a touch of personalization.


Features

Feature Summary
⚙️ Architecture
  • Utilizes JavaScript as the primary language with CSS and HTML for styling and structure.
  • Follows a modular architecture with separate modules for timer, sounds, actions, elements, events, and state in the FocusTimer directory.
  • Implements a countdown feature in timer.js and manages user interactions in events.js, enhancing user experience and functionality.
🔩 Code Quality
  • Well-structured codebase with clear separation of concerns into different modules within the FocusTimer directory.
  • Consistent coding style and naming conventions followed throughout the project.
  • Utilizes ES6 features like modules, arrow functions, and template literals for cleaner and more readable code.
🔌 Integrations
  • Integrates audio assets for button press, kitchen timer, and background audio in the sounds.js module, enhancing user experience.
  • Interacts with DOM elements through the elements.js module to control the focus timer functionality.
  • Manages user interactions and timer actions through the events.js module, ensuring seamless integration with the UI.
🧩 Modularity
  • Follows a modular approach with separate modules for distinct functionalities like timer, sounds, actions, elements, events, and state.
  • Encapsulates related functionality within each module, promoting code reusability and maintainability.
  • Modules communicate through well-defined interfaces, reducing dependencies and enhancing scalability.
⚡️ Performance
  • Optimizes performance by efficiently updating the timer display with minutes and seconds, minimizing UI rendering overhead.
  • Utilizes state management to handle countdown logic and timer actions, ensuring smooth user experience.
  • Implements event handling for user interactions, enhancing responsiveness and interactivity.

Project Structure

└── focustimer/
    ├── assets
    │   ├── bg-audio.mp3
    │   ├── button-press.wav
    │   ├── favicon.svg
    │   └── kichen-timer.mp3
    ├── index.html
    ├── src
    │   ├── FocusTimer
    │   ├── main.js
    │   └── toggle-mode.js
    └── style.css

Project Index

FOCUSTIMER/
__root__
style.css - Define global styling and color variables for the project, including light mode adjustments
- Implement layout and styling rules for the main app components like timer and controls
- Toggle between different visual states based on user interactions, enhancing user experience and accessibility.
index.html - Implements a Pomodoro-style timer with controls for starting, pausing, resetting, and adjusting the timer
- Includes options for toggling between light and dark modes, as well as controlling background music
- The timer displays minutes and seconds, providing a focused work environment.
src
main.js - Initiates the focus timer functionality by importing and starting the timer with a specified duration
- The code sets up the core feature of the project, enabling users to engage in focused work sessions.
toggle-mode.js - Toggle mode functionality switches between light and dark modes on user interaction, updating the UI accordingly
- This feature enhances user experience by providing a customizable visual theme.
FocusTimer
timer.js - Implements a timer countdown feature that updates the display with minutes and seconds
- Handles countdown logic, including decrementing time and triggering actions when the timer reaches zero
- Utilizes state management and element manipulation for seamless user experience in the FocusTimer project.
sounds.js Define and export audio assets for button press, kitchen timer, and background audio in the FocusTimer module.
actions.js - Manages focus timer actions such as toggling running state, resetting timer, setting timer, and toggling music
- Updates UI elements and plays sounds accordingly
- Interacts with state, timer, elements, and sounds modules
- Key part of the focus timer functionality in the project architecture.
elements.js - Expose DOM elements for controlling the focus timer
- The 'elements.js' file provides access to key elements like controls, minutes, and seconds, crucial for managing the timer functionality within the project architecture.
events.js - The code in `events.js` file registers and sets controls for a focus timer
- It handles user interactions like clicking controls and setting timer minutes
- This file plays a crucial role in managing user input and updating the timer display within the project's architecture.
state.js Manages the state for the Focus Timer feature, controlling the timer duration, running status, mute setting, and countdown ID.
index.js - The `index.js` file in the `FocusTimer` module initializes and starts the timer by setting the specified minutes and seconds, updating the display, and registering control events
- This file plays a crucial role in orchestrating the timer functionality within the project architecture.

Getting Started

Prerequisites

Before getting started with focustimer, ensure your runtime environment meets the following requirements:

  • Programming Language: JavaScript

Installation

Install focustimer using one of the following methods:

Build from source:

  1. Clone the focustimer repository:
ಠ git clone https://github.com/maykbrito/focustimer
  1. Navigate to the project directory:
cd focustimer

Usage

Run focustimer using the following command:

ಠ npx lite-server

Contributing

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/maykbrito/focustimer
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph


Thanks

Your are the best ⭐️ !