Giter Club home page Giter Club logo

Comments (4)

martinlaxenaire avatar martinlaxenaire commented on May 13, 2024

Hi @archimedo,

did you have a look at that pen: https://codepen.io/martinlaxenaire/pen/jeZyZM ?
You just basically need to add one plane per HTML element in your javascript and loop through them to update their mouse position uniforms. That should do the trick!

Cheers,

from curtainsjs.

archimedo avatar archimedo commented on May 13, 2024

Thank you so much for your answer and for your example, that was super useful.
Now I'm experimenting a little bit with that, trying to make it fit my image gallery, I was just wondering one thing: in my page, every picture is inside a link tag, I tried quickly to add an between the block in your codepen but it seems that the link is not working (also the cursor doesn't turn in a pointer). Is this related to the js code?
Thank you!

from curtainsjs.

archimedo avatar archimedo commented on May 13, 2024

I could fix that issue by setting the opacity to:0 instead of not displaying the image! the links now work just fine!
And I could also apply the effect to my gallery, Thank you again for your example, that helped me a lot!!

I just wanted to ask you if it's possibile to soften the effect a little bit. My gallery has rows with 3 columns so the images aren't really big, so when I hover a picture, the closest ones start to wave as well. I was looking a at the code trying figuring out where the intensity of the wave is defined but I couldn't find.

Can you help which variables should I tweak in order to make the wave effect a bit less intense?

Thank you so much!

from curtainsjs.

martinlaxenaire avatar martinlaxenaire commented on May 13, 2024

Well, there's an uniform called mouseStrength, I thought this would be pretty clear what it was doing :)

Just tweak the last line of code where the mouseStrength uniform is assigned, like that maybe:

// reassign mouse strength (you can try with different distanceFactor values)
const distanceFactor = 0.5; 
plane.uniforms.mouseStrength.value = 1 - Math.sqrt(Math.pow(mouseCoords.x, 2) + Math.pow(mouseCoords.y, 2)) * distanceFactor;

Cheers,

from curtainsjs.

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.