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: add a countdown on sl-alert #1899
base: next
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks for the PR! Some feedback: The timer resets on mouseover, which is desired, but it feels a bit janky. We should probably just pause the timer on mouseover and unpause it on mouseout to make it more smooth. CleanShot.2024-02-29.at.11.36.46.mp4We probably want to ensure the same border radius is being used (e.g. bottom left corner in this screenshot). I also want to get @lindsaym-fa's opinion on the design, direction (should it go RTL or LTR; should it be configurable; etc.), and any accessibility concerns she may have with such a feature. |
Cool! That's a clean effect. I'll second @claviska's recommendations and add:
|
The timer reset seemed awkward to me too, but i didn't wanted to change other things than just the countdown. For other points i'll change that no problem. |
I just amended my commit with changes.
I made my best about the border radius, but cannot be exactly the same as the top border but it seems reasonably similar to me now. |
5b2b6e2
to
c485675
Compare
Any feedback ? ^^ |
Thanks, @RoCat! I'm liking the new pause behavior and the border radius adjustment. A few things to consider:
Normally, I'd also suggest using |
commit amended with:
Got a lot of work so I couldn't have made these changes earlier. Let me know if I missed something! |
The goal is to add an optional visual effect to be able to know remaining time on toasts.
For my personal case its used on a 10s toast before a whole app refresh (after asynchronous backend stuff).
10s seemed too long to wait without a load bar.
I just added that bar using the same color than the top border as a "bottom border" of the toast.
related thread: #1618 (comment)