Skip to main content

Basic Usage

Create the parallax controller first:

const controller = ParallaxController.init();

Then create an element with animation effects as props:

controller.createElement({
el: document.querySelector('.your-element'),
props: {
translateY: [-100, 100],
opacity: [0.4, 1],
},
});
<div class="your-element">
<!-- children -->
</div>