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

feat: pause/resume timer #1928

Merged
merged 4 commits into from
Nov 18, 2024
Merged

feat: pause/resume timer #1928

merged 4 commits into from
Nov 18, 2024

Conversation

ken7253
Copy link
Contributor

@ken7253 ken7253 commented Nov 1, 2024

This Pull Request adds a time pause function to the UI for Presenter.

Motivation

https://x.com/_yuheiy/status/1851861256283795513

Because he wanted a timer stop feature on slidev and I wanted the same feature.

Reason for code change

- const now = useTimestamp({
-   interval: 1000,
- })
+ const { counter, reset, pause, resume } = useInterval(1000, { controls: true })

Hook was changed because it did not resume from the stop position when resumed.

Copy link

netlify bot commented Nov 1, 2024

Deploy Preview for slidev ready!

Name Link
🔨 Latest commit 95450a0
🔍 Latest deploy log https://app.netlify.com/sites/slidev/deploys/67277f433679490008f3c81b
😎 Deploy Preview https://deploy-preview-1928--slidev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ken7253 ken7253 marked this pull request as ready for review November 1, 2024 16:08
@KermanX KermanX changed the title feat: Timer stop feat: pause/resume timer Nov 3, 2024
Copy link

pkg-pr-new bot commented Nov 3, 2024

Open in Stackblitz

create-slidev

pnpm add https://pkg.pr.new/slidevjs/slidev/create-slidev@1928

@slidev/parser

pnpm add https://pkg.pr.new/slidevjs/slidev/@slidev/parser@1928

@slidev/client

pnpm add https://pkg.pr.new/slidevjs/slidev/@slidev/client@1928

@slidev/cli

pnpm add https://pkg.pr.new/slidevjs/slidev/@slidev/cli@1928

create-slidev-theme

pnpm add https://pkg.pr.new/slidevjs/slidev/create-slidev-theme@1928

@slidev/types

pnpm add https://pkg.pr.new/slidevjs/slidev/@slidev/types@1928

commit: 95450a0

@KermanX KermanX self-assigned this Nov 3, 2024
Copy link
Member

@KermanX KermanX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

In the latest commit I moved the composable to the composables directory, and updated the UI:

(When hovering the timer)
image

@KermanX KermanX removed their assignment Nov 14, 2024
@antfu antfu merged commit 3ba948c into slidevjs:main Nov 18, 2024
20 checks passed
@ken7253 ken7253 deleted the feature/timer-stop branch November 18, 2024 13:08
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

Successfully merging this pull request may close these issues.

3 participants