WIX/Corvid has this “Explore Examples” nifty item at:
www.wix.com/corvid/example/image-and-text-animation
It’s called Image and Text Animation and uses something called ‘wix-animations’ to animate images and text. The on-screen example works great. But when I set it up on a page of my WIX website, it doesn’t work. No errors - it just sets there.
The first line of code is:
import {timeline} from ‘wix-animations’
Question #1: Does ‘wix-animations’ actually exist? Is it an API? I would ask the nice folks at WIX, except I can’t figure out how. And in any case this seems to be a Corvid issue.
Question #2: Am I overlooking some obvious dumb error with my code below?
I’d really appreciate it if someone could help me with this.
import {timeline} from ‘wix-animations’
$w.onReady( function () {
const target1 = $w(‘#image13’);
const target2 = $w(‘#image12’);
const target3 = $w(‘#image11’);
const target4 = $w(‘#text1’);
$w(‘#box1’).onMouseIn(() => {
timeline()
.add(target1, {y: 40, x: -280, scale: 1, duration: 600, easing: ‘easeOutCirc’})
.add(target2, {y: 0, x: 0, scale: 1, duration: 600, easing: ‘easeOutCirc’}, 0)
.add(target3, {y: -40, x: 280, scale: 1, duration: 600, easing: ‘easeOutCirc’}, 0)
.add(target4, {y: -60, x: 0, scale: 1.15, duration: 400, easing: ‘easeOutCirc’}, 0)
.play()
})
$w(‘#box1’).onMouseOut(() => {
const reset = {y: 0, x: 0, scale: 1, duration: 600, easing: ‘easeOutCirc’};
timeline()
.add(target1, reset)
.add(target2, reset, 0)
.add(target3, reset, 0)
.add(target4, reset, 0)
.play()
})
});