This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Billy Roh
Posted Jul 25 - Read on Facebook

Is it possible to set different curve, time, and repeat values for different states of the same layer?

eg.
myLayer.states.add
state1: {opacity: 0} # I want a curve, time, repeat for this state...
state2: {opacity: 1} # ...that is different from those of this state

6 Comments

Elliott Kember

myLayer.on Events.StateWillSwitch, (oldState, newState) -> myLayer.states.animationOptions = {...}

Elliott Kember

I have a better idea!

stateAnimationOptions = {'default-hidden': {time: 0.1}, 'hidden-default': {time: 0.5}}

myLayer.on Events.StateWillSwitch, (oldState, newState) ->
myLayer.states.animationOptions = stateAnimationOptions["#{oldState}-#{newState}"]

Elliott Kember

- except you'd want to merge those hashes rather than just assign animationOptions and blow away any other animationOptions values.

Billy Roh

Ooh, this is awesome. Thanks so much!!

Elliott Kember

a pleasure! I'll keep playing with that gist.

Read the entire post on Facebook