Comments (4)
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.
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.
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.
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)
- Domain Warping HOT 1
- Planes are missing after resize HOT 3
- Multiple ShaderPasses per Plane HOT 3
- Incorrect sampler name HOT 2
- blocked because of a disallowed MIME type HOT 4
- Copying a texture with different sourceType doesn't work HOT 4
- Make an option for a plane with rounded edges
- ShaderPass transparensy
- error occuring in curtains s
- Changing current shaders HOT 2
- Different shaders for different events HOT 2
- Creating a GSAP and CurtainJs Slider Canvas Image Issue HOT 5
- Multiple Planes issue HOT 1
- when resizing positions of planes misplaced HOT 2
- Creating a new texture or setting the source of an existing one dynamically throws a WebGL render error HOT 1
- reusing a past video texture HOT 5
- Strange behaviour on Safari ping/pong shading flowmap example HOT 4
- WebGL2 Support HOT 2
- Typescript types. HOT 2
- autoResize disabled, but right after refresh, the curtain gets resized HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from curtainsjs.