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

Controls don't seem to be returned #9

Closed
468 opened this issue Sep 9, 2022 · 3 comments · Fixed by #10
Closed

Controls don't seem to be returned #9

468 opened this issue Sep 9, 2022 · 3 comments · Fixed by #10
Assignees
Labels
bug Something isn't working

Comments

@468
Copy link

468 commented Sep 9, 2022

Hi,
I love this lib, the effect is great and it greatly simplifies the process of applying a glitch effect to child elements.

I am having trouble with retrieving the controls as described in the docs;

const {
    startGlitch,
    stopGlitch
} = PowerGlitch.glitch('.glitch')

glitch() does not seem to return the startGlitch/stopGlitch function, or indeed anything at all. I have tried:

  • setting to manual mode (in case this was necessary)
  • calling them asynchronously (in case it was a race condition)

But not luck. I can see the lib has been recently updated, is it a case of this feature not being implemented yet? Otherwise if it's just my end, I will investigate further and see if I can pin down what's causing it in my specific case.

Thank you

@7PH 7PH added the bug Something isn't working label Sep 9, 2022
@7PH
Copy link
Owner

7PH commented Sep 9, 2022

Hi @468 , thank you for your feedback! 😊 It's very rewarding to see other people using this lib,

The library was re-written and published yesterday under 2.0.0, which includes the glitch controls. Are you using 2.0.0? Otherwise, this will not work.

Here is an example using startGlitch:
https://jsfiddle.net/powerhat/ec0urLkp/16/

While testing it just now, I found that stopGlitch while being returned throws an error when options.timing.iterations is Infinity - I will be fixing this issue very soon and see if I can add an unit test for this.

This may be the issue that prevents you from using correctly the lib 🤔 Waiting for your response

@468
Copy link
Author

468 commented Sep 9, 2022

Ah yes, it seems like it was some sort of cache issue my end, it works nicely as long as I link directly to the new file in 2.0.0! Apologies for the false alarm, and thanks for the quick reply.

I am now running into the issue you mention now, swapping animation.finish() for animation.cancel() in stopGlitch did the trick as a quick workaround for my purposes

Thanks again for the great lib! 🙇‍♂️

@7PH 7PH closed this as completed in #10 Sep 9, 2022
7PH added a commit that referenced this issue Sep 9, 2022
#9: Fix glitch stop control when options.timing.iterations is Infinity
@7PH
Copy link
Owner

7PH commented Sep 9, 2022

Hi @468 , powerglitch@2.0.1 is published to npm and includes the fix for the mentioned issue 😊

@7PH 7PH self-assigned this Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants