rough-notation icon indicating copy to clipboard operation
rough-notation copied to clipboard

feat: animate hide

Open BeksOmega opened this issue 7 months ago • 1 comments

Fixes: #57

This change introduces an animation to the hide() method, making the annotation disappear with a reverse animation of the show() method.

Previously, hide() would immediately remove the annotation's SVG elements from the DOM. This change modifies the hide() method to:

  • Play the show() animation in reverse.
  • Use requestAnimationFrame to ensure the animation restart is smooth.
  • Use setTimeout to remove the SVG elements only after the animation has completed. This prevents race conditions when show() is called again while a hide() animation is in progress.

Tested

Added a demo page so you can pull this down and try it as well!

Contributing

Not sure what your contribution guidelines are, but just FYI the first pass at this was done with AI. The Jules product / Google doesn't claim any copyright over code generated by Jules though.

For my ref

Task ID: https://jules.google.com/task/18159235495996926247

BeksOmega avatar Aug 09 '25 05:08 BeksOmega

I just thought about adding that. Thank you :)

Nkay avatar Aug 29 '25 07:08 Nkay