Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Countdown Feature with Input Number of Seconds #3520

Open
SpiralAgent234 opened this issue Jan 24, 2025 · 0 comments
Open

Create Countdown Feature with Input Number of Seconds #3520

SpiralAgent234 opened this issue Jan 24, 2025 · 0 comments

Comments

@SpiralAgent234
Copy link

Is your feature request related to a problem? Please describe.

Currently, the application lacks a countdown feature that allows users to input a specific number of seconds and initiate a countdown.

Describe the solution you'd like

Implement a countdown function that accepts an input number of seconds and displays the countdown on the screen. This will enhance user interaction and provide a useful utility within the app.

Code Example

function startCountdown(seconds) {
    let remainingTime = seconds;
    const intervalId = setInterval(() => {
        console.log(remainingTime);
        remainingTime--;
        if (remainingTime < 0) {
            clearInterval(intervalId);
            console.log('Countdown finished!');
        }
    }, 1000);
}

Describe alternatives you've considered

Using a simple timer, but this lacks the flexibility of user input for countdown duration.

Additional context

This feature will provide users with a simple and effective countdown tool within the application.

Related Issues/PRs

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant