7PH / powerglitch

Tiny JS library to glitch anything on the web
https://7ph.github.io/powerglitch/
MIT License
767 stars 9 forks source link

Having issues using powerglitch #2

Closed DAREALYTYGRUNN1NGARK456 closed 2 years ago

DAREALYTYGRUNN1NGARK456 commented 2 years ago

I have tried to use powerglitch but it wont work you can see where i have tried it at https://Power-glitch-api.darealytygrunn1.repl.co And you can find the PowerGlitch.min.js file here https://Power-glitch-api.darealytygrunn1.repl.co/powerglitch.min.js

chrishau5 commented 2 years ago

I haven't been able to get powerglitch to work either

7PH commented 2 years ago

Hi @DAREALYTYGRUNN1NGARK456 , in your example, the script that fetches the PowerGlitch iife bundle <script src="/powerglitch.min.js"></script> points to a 404: https://power-glitch-api.darealytygrunn1.repl.co/powerglitch.min.js

Another comment on your code: const img = document.querySelector(".glitch")[0]

should be const img = document.querySelector(".glitch")

as you are using querySelector which returns null or an object, and not querySelectorAll which returns an array.

Here is a codepen example that mimics what you wants to do: https://codepen.io/7PH/pen/dymeEZZ

Note that I copied and pasted the iife bundle from master: dist/powerglitch.min.js

Hope that helps 😎

7PH commented 2 years ago

Closing this issue for now

@chrishau5 , feel free to share more information so that I can help - you can open another issue with your code if you think there might be an issue with the library