A lightweight image animation effect with threejs.
Visit the live demo here
var myAnimation = new ImageEffect({
parent: '.container',
image: 'https://picsum.photos/1280/720',
});
Name | type | Default |
---|---|---|
parent | null | Query Selector |
image | null | Image to animate |
Name | type | Default |
---|---|---|
image1 | =image | Image 1 |
image2 | =image | image 2 |
mask | =image | mask for the animation |
myAnimation.animateCircle(speed, intensity);
Animate in circlemyAnimation.animateToTop(speed);
Animate to the topmyAnimation.animateToBottom(speed);
Animate to the bottommyAnimation.animateToLeft(speed)
Animate to the leftmyAnimation.animateToRight(speed)
Animate to the rightmyAnimation.stopAnimation()
Clear the AnimationmyAnimation.resetAnimate(duration)
Reset with an animationmyAnimation.reset()
Reset without an animationmyAnimation.updateImage(image1, image2, mask)
Change the image
- hover-effect - Based on this code