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

What is Framer? Join the Community
Return to index
Niels van Hoorn
Posted Oct 01 - Read on Facebook

Hey everyone,

We’ve been working on a new API for handling states and animations, and we love for you to try it out! It will be automatically available in new projects created with the latest beta.

This is how you define a state animation in the new API:

layer = new Layer
layer.states.a = x: 200
layer.animate “a”

You can find all the changes listed here: https://github.com/koenbok/Framer/pull/420
The old API should keep working, but please try to upgrade some old projects to see if we haven’t missed anything. To do so, choose “Update Framer Library” from the File menu.

Beware that there are two breaking changes, so be sure to update that in your code after you upgrade your project.:

layer.states.current has been renamed to layer.states.current.name
layer.states.previous has been renamed to layer.states.previous.name

8 Comments

Elliot Nolten

This looks nice 👍🏽

German Bauer

Looking forward to this. This looks clean and obvious.

Marc Krenn

.
RIP
properties
2014-2016

Chris Wang

Finally!!! Now each state animation can have its own duration and easing!

Nikhil Venkatesh

Yaay! Much easier! Can't wait to try this out.

German Bauer

Are there already some good meaty examples exercising best practices with the cleaned up API ?

German Bauer

BTW in the wiki cycling actions is both referred to as layer.statesCycle() and layer.stateCycle(), is there a difference?

Dmitry Sholkov

wow that looks awesome. Looking forward to this. Something I was struggling with for a while was:

I love states, however didn't find a way to assign different delays/animation properties for different values. ex( animate x:200 for 1 sec, animate fade in for 0.5 sec with delay 0.5 sec)

They only way I found so far is to run animate for different properties at the same time. But I wish there was a way to do that with states. Code could get so much cleaner. It's basically a preferred workflow of someone coming from AE prototyping to Framer.

Am I missing something there, if not, is it something you will look into?

Read the entire post on Facebook