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

What is Framer? Join the Community
Return to index
Michael DeFazio
Posted Mar 10 - Read on Facebook

Hi everyone. This is more of a coffeescript question than a framer question.

I am learning more and more coffeescript as I continue to use framer. But one hurdle are classes in coffeescript, which I would assume is also maybe one of the most useful parts of coffeescript. I'm struggling to understand them and how to implement them to make my code more efficient

Is there a resource for how classes are used specific to framer prototypes? Or a framer example?



Benjamin Den Boer

Hey Michael DeFazio β€” this Tasks Prototype example may be helpful for you:

So, every single "task" in a list of tasks has to have a checkmark, right? And certain interactions β€” what happens when I tap a checkmark? Plus, I want a few of these, not just one. So I could manually create my layers, add checkmark layers as child layers to each of these manually... or, I could create a "Class" β€” define all child layers and interactions there, and then whenever I create another, it contains all of those predefined properties. :-)

Marc Krenn

pinging Krijn in hope he explains his thinking behind his Watchlist proto:

Yes, making us all look like effing beginners also comes with some responsibilities! ;)

Jordan Robert Dobson

Also you may want to decide what type of class you want as well. Is it for creating instance or just a collection of similar functions.

Krijn Rijshouwer

Haha, no problem πŸ‘ŠπŸ» . Writing it down in a little explanation:
1 β†’ When
2 β†’ How

Will send it in a bit!

Marcelo Eduardo Oliveira

Sharing also a simple component I use all the time, with all the dirty you can expect ;)

I like this example because a button is something that not only showcases how you can extend Layer but also give you hints on how you would use it to create new, even more complex Classes ( components )

Krijn Rijshouwer

So, in the Pdf added below I will try to explain classes in a very simple yet still very limited way. I notice that it’s pretty hard to write it down without going in depth and by making many nice examples and stuff so I will try to do a Medium post on this very soon. But for now…

Read the entire post on Facebook