Vanilla-tilt.js making trouble! Help!

Yep, that could be, another question sorry :laughing: How can I et the video pop out a bit to create a parallax effect. I tried it with transform: translateZ(20px) and I added
transform-style: preserve-3d and
transform: perspective(1000px) to my tilt element but nothing happens…

You would add translateZ to the iframe and preserve-3d and perspective(1000px) to the .box. You also have to remove the backdrop-filter on the tilt element (github issue).


But this effect doesn’t work well with the YouTube player because the tilt effect doesn’t work when hovering on the iframe. I guess for an auto-playing looping video you can set pointer-events: none, but that isn’t really a great user experience, especially not when the video has music. Autoplaying videos with music and no controls are just annoying.

Here is an example. I replaced your video with one that does not have audio, if you want to do it with your video you should use the API (docs untested example code) and mute or lower the audio on the video.
https://codepen.io/lasjorg/pen/xxgKaZm

1 Like

Wow nice thanks! So, I’ve got another question for you… If you want to look at my recently released question. It is about activating the camera when a button is clicked. So, I managed to do that it activates when loading or refreshing the page but I don’t manage to only make it activate on click. If you want to help, feel free to do. :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.