.wrapper {
width: 100%;
height: 100vh;
background-color: #333;
}
.content {
width: 100%;
height: 100vh;
clip-path: polygon(45% 45%, 55% 45%, 55% 55%, 45% 55%);
}
View Compiled
console.clear();
gsap.registerPlugin(ScrollSmoother, ScrollTrigger);
ScrollSmoother.create({
smooth: 1,
effects: true
});
gsap
.timeline({
scrollTrigger: {
trigger: ".wrapper",
start: "top top",
end: "+=100%",
pin: true,
scrub: true
}
})
.to(".content", {
clipPath: "polygon(0% 45%, 100% 45%, 100% 55%, 0% 55%)"
})
.to(".content", {
clipPath: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)"
});
View Compiled