Git Product home page Git Product logo

Comments (7)

scriptex avatar scriptex commented on August 19, 2024 1

Hello and thanks for reporting this. It was in the pipeline for way too long :)

TL;DR

See 665e671


You can now remove event listeners set by AnimateMe by calling unbind on the instance.
You can also remove the classnames that AnimateMe set to your HTML elements by calling destroy.

This is all in the README now.

To use these new methods, please update to the latest version by either downloading or reinstalling via NPM/Yarn.

Can you please let me know if this works for you?

from animateme.

mrcoles avatar mrcoles commented on August 19, 2024 1

Sorry, it wasn’t exactly clear what I was describing. I want the extension to be able to disable AnimateMe if it’s running on a site while it’s doing a screen capture, and if possible it could re-enable it once the screen capture is done. The custom events on window approach would work well (for sites that are using it and have updated to the latest version)!

from animateme.

mrcoles avatar mrcoles commented on August 19, 2024 1

Cool, thank you for being so responsive! Just to see if I’m getting this right…

  1. I would trigger 'animateme:destroy' before I was to disable it
  2. can I trigger 'animateme:start' once I’m done to re-enable it (will it maintain any custom settings from however it was originally initialized)?

from animateme.

scriptex avatar scriptex commented on August 19, 2024 1

Yes! :)
Just a note that It is animateme:enable instead of animateme:start.

from animateme.

mrcoles avatar mrcoles commented on August 19, 2024

Looks like a nice improvement. However, my ulterior motive for bringing this up was the desire to be able to disable AnimateMe in a decoupled manner, in order to screenshot a page across multiple scroll positions without the animations getting in the way while I scroll (for this project).

If I could do something like this, that’d be awesome.

var event = new CustomEvent('animateme__disable');
window.dispatchEvent(event);

and then in the code maybe there's something like the following inside bind:

this.win.addEventListener('animateme__disable', this.destroy.bind(this), false)

This might be too specific of a use-case, but if you don’t ask, the answer is always no 😄

from animateme.

scriptex avatar scriptex commented on August 19, 2024

Since I cannot see your initialization of AnimateMe (because it is in a private branch/fork), I am not sure what exactly is the use case so I will try to guess 🙂.

My guess is that you do not have access to the instance of AnimateMe and this is the reason why you need a custom event.

If that is not the case, you can refer to your instance and call destroy at any time. This is shown in the README.

If not, I will implement custom events for destroying and re-starting.
I am thinking of something like the code you wrote above: animateme:disable and animateme:enable.
These two events will be bound to the window object and in order to use them, you must dispatch a new event on the window object.

How does that sound?

from animateme.

scriptex avatar scriptex commented on August 19, 2024

This is now implemented and published on Github and NPM.

Please refer to the README for more info, although you already know how to do it 😄.

Let me know if there is anything else i can do for you.

from animateme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.