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

What is Framer? Join the Community
Return to index
Peter Hilgersom
Posted Jan 29 - Read on Facebook

Hi guys, I created my first little framerJS project. Really like the tool! I hope you can give me some tips based on this project. I bet I did a lot of overcoding ^_^

3 Comments

Benjamin Den Boer

Hey Peter, nice work! Your code looks clean, not a lot of overcoding at all. I can at most point out some minor nitpicks/tips:

- You don't have to define a width, height and background-color for a backgroundLayer if you intend it to fill the screen and be white: it defaults to this.

- You don't necessarily need to assign variables to all layers, nor target them within brackets. If you rename home layers to "bg", for instance, you could target the layers with "bg.search", "bg.overlay" etc. (You may still prefer the current notation, though)

- Unless you define a custom animation curve as the Framer.Defaults within your prototype, you never need to define "linear" as the animation curve - it also defaults to this.

- You could probably reduce the amount of lines of code significantly if you used states instead of individual animations for each click event.

Hope this is still somewhat helpful. :)

Peter Hilgersom

Thanks for your feedback Benjamin Den Boer! I'll look into using states. I was pretty sure there is a better way. Thanks!

Koen Bok

Goed gedaan! What Benjamin said. I would also experiment more with spring/ease curves for a less "robotic" feel.

Read the entire post on Facebook