- Joined
- May 19, 2023
- Messages
- 4
- Reaction score
- 0
I am coding a website and I found this cool effects (https://github.com/codrops/SegmentEffect/) on GitHub and I was wondering, how could I make the image and the text appear exactly like that without having to press the "Show effect" button. I am wondering more specifically for the "index5.html" page.
I tried this code on the <script> section of "index5.html" and I managed to load the function without the need of the "Show effect" button, but the distortion effect is not working for some reason
I hope someone can help me, it seems pretty easy for someone experienced, but I don't really have the knowledge to understand all the code.
I tried this code on the <script> section of "index5.html" and I managed to load the function without the need of the "Show effect" button, but the distortion effect is not working for some reason
HTML:
<script>
(function() {
var headline = document.querySelector('.trigger-headline'),
segmenter = new Segmenter(document.querySelector('.segmenter'), {
pieces: 8,
positions: [
{top: 0, left: 0, width: 100, height: 100},
{top: 0, left: 0, width: 100, height: 100},
{top: 0, left: 0, width: 100, height: 100},
{top: 0, left: 0, width: 100, height: 100},
{top: 0, left: 0, width: 100, height: 100},
{top: 0, left: 0, width: 100, height: 100},
{top: 0, left: 0, width: 100, height: 100},
{top: 0, left: 0, width: 100, height: 100},
{top: 0, left: 0, width: 100, height: 100}
],
shadows: false,
parallax: true,
parallaxMovement: {min: 10, max: 30},
animation: {
duration: 2500,
easing: 'easeOutExpo',
delay: 0,
opacity: .1,
translateZ: {min: 10, max: 25}
},
onReady: function() {
headline.classList.remove('trigger-headline--hidden');
}
});
segmenter.animate();
})();
</script>
I hope someone can help me, it seems pretty easy for someone experienced, but I don't really have the knowledge to understand all the code.