Thanks, now it could import it however the effect still doesn't work no idea why. The point would be that as I scroll the video stays at the same place but gets scaled up and the opacity decreases revealing what is behind it (which is basically the black background-color of the "body" in css).
<!DOCTYPE html>
<html lang="en">
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="module" src="main.js"></script>
</head>
<body>
<div class="video-container">
<video autoplay loop muted controls="true" autoplay="autoplay" src="Rolls.mp4" type="video/mp4" id="rollsvid"></video>
</div>
</body>
</html>
my css is the same as before
import gsap from "https://cdn.skypack.dev/gsap";
import ScrollTrigger from "https://cdn.skypack.dev/gsap/ScrollTrigger";
console.log(gsap.version); // -> 3.12.2
console.log(ScrollTrigger.version); // -> 3.12.2
gsap.registerPlugin(ScrollTrigger);
gsap.to("#rollsvid", {
scrollTrigger: {
trigger: ".video-container",
start: "top top",
end: "bottom bottom",
scrub: 1,
},
scale: 2,
opacity: 0,
});
as I told you I am a real noobie in this yet. I do not know maybe the video should get pinned or something. It doesn't write me any errors anymore but still the desired effect doesn't work. What should I add or correct in my code that it does the effect what i described above? Thanks a lot for the help in advance!