Principle - Creating Custom Animations

NorthGrid
26 followers
10 Video Views·Oct 27, 2022
Hello and welcome to Sketch Together.
My name is Pablo Stanley and this is a crash course on Principle for Mac.
Principle is a great tool for creating user interface animations and prototypes.
On this session we're going to have an intro to the animation panel
where we're going to be able to use different keyframes, different types of easing and even
and even some delays between screens and objects and makes animation pretty cool.
So enough talk, let's go ahead and do that.
So on this lecture we're going to learn about creating custom animations
and we're going to do this by connecting two screens, two artboards
and we're going to make this card grow into a detail screen, full screen like this.
Their elements are the same, well almost the same
and we're going to make custom animations between them.
So I have a Sketch file here, if you don't have it go to your resources
or to the descriptions of this video and then you'll find the Sketch file there
so you can play around with it and I'm going to go to Principle
and here on Principle I'm going to create a new file and I'm going to import my Sketch file.
So here I have it here, I have both artboards and now I can start adding events.
So to create an animation between these two screens.
So I'm going to add an event to this whole card and I'm going to when it's tapped
it will go to the next screen and then I'm going to do the opposite from here
when you tap on this square I'm going to add a tap
that will take you back to the previous screen
and right now because I named these different layers
for example this one is called Image Big and this one over here is also called Image Big.
Obviously this one is called Hello and over here is called Hello 2
and all these for example Title, Title is over here.
So Principle by default is going to create animations
between the screens of these elements that are named the same.
So if I click on them it creates an animation of those two
and if I want to edit the animations that Principle created
I can just tap on this arrow that was created between the screens
and then here I can use different keyframes to delay the animations
or I can also change the by default it gives you an ease in ease out
easing and I can change it to spring to linear or to none.
So yeah that gives me a lot of control and I can make them even a little bit slower
if I want to just by dragging different keyframes
and I can do this individually by each screen and each property on each layer.
Okay so now that I have this it looks up it's starting to look good
but obviously there are some elements that are not being animated.
The problem here is that for example this card is only here but it's not over here
so it just disappears and when you go back from this screen to this screen
the card just appear out of nowhere.
So what we have to do is create a dummy so on this screen too this same card.
So I'm going to copy it and over here on this artwork I'm going to paste it
I'm going to move it outside the screen and that way when I create the animation
now it looks like that card is going away it's going outside the screen.
That's perfect that's what I wanted and also
I can see how the header just appears and disappears
and if I want to create a smaller transition I can just choose this header
and I'm going to copy it and over here I'm going to paste the two
I'm going to put it outside but also I'm going to change the opacity of it to zero
and if I preview it I'm going to make this preview a little bit bigger so we can see it.
I can see now that it's coming from the top and also hiding when I go to the detail page
and also I can see that the description on this screen it just appears out of nowhere
so what I can do is the same now from this screen
from this artwork I'm going to copy it and I'm going to paste it over here
and over here I'm going to change the opacity of it to zero
and now it should create a transition between them so it creates a nice transition
but I also want it to move a little bit so I'm going to move it like 30 pixels down
and then it just appears and I'm also going to delay that transition
so I'm going to select the animation between this screen and this screen
I'm going to select it right by going here on this arrow
and I'm going to select the copy layer this one
and I'm going to change this by creating a delay
and I'm going to move all these keyframes a little bit to the right
so the animation starts after all these animations are almost finished
so let me zoom this so we can see it in action
and you know what I'm going to actually put it like this
so we can I'm going to grow it and now I can see it
see how the animation occurred after the other animations almost were almost finished
and that way it just creates a nice transition
and I'm going to go back and I'm going to do this the opposite on this transition
on this transition the copy layer I'm going to make it disappear right away
one of the first things that disappears
so I'm going to do this by selecting these keyframes
and making them a little bit making the animation a little bit faster
so I preview I go to my preview and it just disappears really quickly
that way the card that appears from the bottom appears once the copy has disappeared too
and now I want to right now it's making all the animations
using an ease in ease out which is nice
but sometimes I want something a little bit fancier like a spring animation
so for example this hello I want it to bounce once it appears
and this and it disappears once it grows and it shrinks
so I can do this by going here for example here
and then here instead of the default animation I'm going to select all these
and I'm going to from default I'm going to choose spring
and now I'm going to do the same with the other animation
the one that comes from the from the cards to the full screen
I'm going to do the same with this guy
this guy is selected and then I select all these keyframes
and then I'm going to say instead of default I'm going to select spring
and I'm going to preview it
now see how it bounces once it appears
which is pretty cool pretty nice and sometimes that's what I want
so there you have it that's the basics on creating custom animations
by using keyframes easing curves and springs which creates really cool effects
