jhanley634 / dojo-blackboard

An HTMX webserver for the Dojo's Tuesday night python meetups.
MIT License
3 stars 1 forks source link

37 shake timer #39

Open malpern opened 2 weeks ago

malpern commented 2 weeks ago

I added a new demo, "timer_countdown()" which counts down from 10 and plays sounds and animates when time is up. If you see any usability issues, edge cases, or have suggestions let me know.

Summary by Sourcery

Add a new timer countdown feature that includes a 10-second countdown with sound effects and animations. Update the pre-commit configuration to use the latest versions of nbstripout and pre-commit-hooks.

New Features:

Enhancements:

Build:

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This PR implements a new countdown timer demo that counts down from 10 seconds with interactive features, animations, and sound effects. The implementation includes a new HTML page with embedded JavaScript for timer functionality and CSS for styling, along with necessary backend route changes and static file serving setup.

Class Diagram for Timer Countdown Implementation

classDiagram
    class TimerCountdown {
        - int INITIAL_SECONDS
        - int INITIAL_MINUTES
        - int seconds
        - int minutes
        - bool isPaused
        - counter
        + startTimer()
        + Timer()
        + initializeTimer(elements)
        + updateTimerState(elements)
        + attachTimerClickHandler(elements)
        + updateTimerDisplay(element, mins, secs, useBlinkingColon)
        + handleSounds(action, sounds)
        + handleFinishState(elements)
        + handleFinishClick(event, elements)
        + resetTimer(elements)
    }
    note for TimerCountdown "This class handles the countdown timer logic, including state management, display updates, and sound control."

File-Level Changes

Change Details Files
Added a new countdown timer demo page with interactive features
  • Created a new HTML page with embedded timer functionality
  • Implemented pause/resume functionality with visual feedback
  • Added sound effects for ticks, pause, resume, and alarm
  • Implemented animations for timer completion including shake and glow effects
  • Added click handlers for timer control and state management
src/bboard/assets/timer_countdown.html
Updated backend to support the new timer demo
  • Added new endpoint for timer countdown demo
  • Added static file serving configuration for assets
  • Created new function to serve timer countdown HTML
src/bboard/main.py
src/bboard/demo/clock_display.py
Updated development dependencies
  • Updated nbstripout from 0.7.1 to 0.8.0
  • Updated pre-commit-hooks from v4.6.0 to v5.0.0
.pre-commit-config.yaml

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).