caroso1222 / notyf

👻 A minimalistic, responsive, vanilla JavaScript library to show toast notifications.
https://carlosroso.com/notyf/
MIT License
2.66k stars 197 forks source link

[ Feature Request ] Pause on hover #110

Open AbrahemAlhofe opened 3 years ago

AbrahemAlhofe commented 3 years ago

Purpose

This feature will lets the user to read the long notification's message

Behavior

If we have put the duration 4 seconds, and the user hovered the notification on the third second the Notyf will clear the timer, later when the user leaves the notification, Notyf will resume the timer from the last second it stopped at, this second would be the third second until the end of duration ( 4 seconds )

Implementation

  1. if duration not zero, create "Timer" class what will handle duration properties
  2. then make "NotyfView" trigger "mouseover" and "mouseleave" event
  3. on "mouseover" call Timer.pause() method
  4. on "mouseleave" call Timer.resume() method
  5. on "Timer" finished remove the notification
stanciupaul commented 2 years ago

Any news on this?

naveen168 commented 1 year ago

Any update on this issue?