I'm trying to create a pulsating, looping animation effect using framer.js I've loaded an image into a layer and I'd like to scale it up and down continuously. I can't figure out how to scale it down and loop through the animation indefinitely. This is what I currently have:
imageLayer = new Layer({x:0, y:0, width:128, height:128, image:"images/icon.png"})
imageLayer.center()
animationA = new Animation({
layer: imageLayer,
properties: {scale: 2.0},
curve: "ease-in-out"
})
animationA.start()
solved it like this:
imageLayer = new Layer({x:0, y:0, width:128, height:128, image:"images/icon.png"})
imageLayer.x = 100
imageLayer.y = 100
animationA = new Animation({
layer: imageLayer,
properties: {scale: 2.0},
curve: "linear",
time: 0.4
})
animationB = new Animation({
layer: imageLayer,
properties: {scale: 1.0},
curve: "linear",
time: 0.2
})
animationA.start()
animationA.on(Events.AnimationEnd, function() {
animationB.start()
});
animationB.on(Events.AnimationEnd, function() {
animationA.start()
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With