-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Get canvas mouse move event listener function to work when text is above it, keep text selectable. #76
Comments
You can alter the script.js to listen to mousemove on the overlay layer instead of the canvas |
I had the same question and someone helped me. You can check out his work. |
Thanks I'll try to leverage this. Very much appreciated. |
Thanks for the replies! I managed to get the particles to animate below the page elements using the JavaScript and min .js file @networkmrt provided. However, I'm not able to get the event listener to work with the original version of the fluid GL JS file. How do I tweak the code so it works with the original script.js file? I can't modify the webgl-fluid.umd.min.js because its minified. This works:
This does not work:
What am I doing wrong? :S |
Have you discovered what was your problem? |
您好,我已经收到你的信件!我会及时阅读并作出回应!
|
So I spent yesterday playing with the code trying to achieve this, and I think I achieved it :
|
您好,我已经收到你的信件!我会及时阅读并作出回应!
|
This animation not working on mobile, how to solve this issue? any reference please send me urgent |
您好,我已经收到你的信件!我会及时阅读并作出回应!
|
This animation not working on mobile, how to solve this issue? any reference please send me urgent. Anyone please help me out |
|
thanks bro it really helped |
Hi everyone, I have a canvas that is running the Web GL Fluid particle animation. The problem I'm having is that if the canvas is below a object the mousemove event for the canvas stops firing.
If I use css such as "pointer-events: none;" on the object that's covering the canvas the animation will work but then I can't select text or use buttons in the object. How do I get the canvas to fire its mouseover animation even when objects are covering it all while being able to interact with the those objects. Is there is a way to add to or adjust the canvas mouse event listener so it fires when objects are over it? This is the current code for the canvas mousemove listener:
canvas.addEventListener('mousemove', function (e) { var pointer = pointers[0]; if (!pointer.down) return; var posX = scaleByPixelRatio(e.offsetX); var posY = scaleByPixelRatio(e.offsetY); updatePointerMoveData(pointer, posX, posY); console.log('over the canvas'); });
Here are examples sites that have canvas mouseover interaction below selectable text:
https://advanced.team/
https://www.vantajs.com/
Sample in code pen:
https://codepen.io/chriscalabrese/pen/RwjmNZW
Thanks!
The text was updated successfully, but these errors were encountered: