Hi everyone, let's take about interactive component knowledge a little bit further... and make this prototype that has the line that appears, that I'm mesmerized by... look, bounces back and forth, follows where we're going... let's jump in and get it working. To get started we need three separate pages... I've called mine "Today", "This Weekend", and "Newest"...
it's going to match this navigation along the top here... and I have actually just duplicated the card that we made earlier... and all I did was change the images so it looks like we're changing pages. For you, for the moment you might just put text on the page... just so you know you're jumping from different pages... what I also did was, I went and created three bits of text, that's all they are...
and a frame here, could be a rectangle... it is just a line, which we'll name... 'Command R', 'Ctrl R' on a PC, I'm going to call it "Line"... that's going to be the thing that jumps around. So first things first, is let's grab all of this... and let's convert it into a component...
let's set up the navigation to jump between them, and test that first... and what I'm going to do is I'm going to move the component off... or the main component off, because I can't - Shift E to switch to Prototype. - I can't get Today to go to itself... because it's kind of inside of itself. So what we need to do is grab this component...
main component, you can stay up there, let's give it a name, 'Shift R'... that turns on rulers... it's 'Command R', and 'Ctrl R' on a PC, let's rename this one, and go... "Nav-Sub', it's like my little sub navigation. Let's put an instance down here, 'Option' or 'Alt' dragging... and what I'll do is I'll copy and paste it on all of them...
so click you, hold 'Shift', click you, and just go 'Paste', there we go... so that's all the pages, let's test it to see if it works. I've already got my prototype open here, you, you, you, you, nothing's working... why isn't it working? Let's go back here, oh, we didn't actually add the navigation. So when Today's clicked, I'm in Prototype mode, you go there...
when Weekend is clicked, you go there, and when Newest is clicked... sometimes, if you can't see the page... because you've got so many, you can just go, actually... instead of dragging it, 'Add' an interaction... so when it's tapped I want it to navigate to... my page, called Hot and New, or just New, where is it?
Newest... up to you, same, same. Let's try it now... Today, Weekend, Newest, all right, so that parts work, test as you go... and the cool thing about doing it this way... is that we've done it to the main component...
so that the interactions are done inside that component... so that all the instances come along for the ride... rather than trying to drag them all out... but we know that, that's good practice... but we need to stop it from jumping-- we need that line to move. Now this brings up a good point...
we can change instances, we can do stuff like... the Today, I can change the text of it... so this one's going to say, "Yesterday"... so we can change the text, we can change the text color... "Great color change, Dan," that's better... so there's some things we can change about instances some things we can't.
One of them is layer order, and physical movement, watch this, if I go... all right, on this instance I want it to be here... but on this instance, where did it go? Undo, undo... undo, I did something... on this instance I want to-- double click it, great, we've got it, just move it across, we can't move it...
it's all grayed out, because the main component... is the boss of movement, and layer order... we can do topical things, like text change, and we can do color change... but some things we can't, so how do we do this? For this particular one, what we need to do, on our main component... we need multiples of this, so it doesn't actually move...
it kind of does, so I'm going to make... I'm just 'Alt' dragging out, so I've got multiples of these... I'm going to get them to line up... and we're just going to turn them on and off for each of these... I'm going to reset this one... reset all changes to get back to this...
so it kind of moves, what ends up happening is... as long as the names are the same... so we've got Line, Line, Line, that's important... if you're copying a frame, and it's got Frame 1, 2, 3, or Rectangle 1, 2, 3... rename them to be all the same, otherwise Smart Animate doesn't work, right? So what we're going to do is, say you, I can't move you, but I can turn you off...
and I don't even want to turn you off, I just want to hide you, there we go... turn the eyeball off, use your own sound effects... and for this one, when we're on the Weekend... we want this one on and these two off, so I'll speed through this. The shortcut is Command H... sorry, 'Command Shift H' on a Mac...
that's 'Ctrl Shift H' on a PC, just to automatically hide them... or you can make the nice little noise, and close the eyeball. So that's working, and as long as the name's the same... it should be working, should be, let's go... we don't, one thing we're going to do as well... is we're going to actually go to Prototype mode...
and there's a flow up here... I don't need a flow up there, I don't know how that one got there... yours might be down here, you might not have one at all... I'm going to say, actually, flow, it's going to be here, please... going to start this flow, so it jumps to the right page... and then it still doesn't work...
I know why? It's doing it, kind of, what we want to do now is Smart Animate... so which bits do we smart animate? We could do it between here... we could go through and say, Instant, change it to 'Smart Animate'... but we'd have to do it for every instance...
we can do it to this main one here, our main component, so you... it's doing it right, it's gone to the right page, but it's going Instant... yours might have defaulted to Smart Animate... kind of remembers the last thing you did... so let's go 'Smart Animate', let's go now... are you ready?
Ah, the glory, look at it, changes shape to fit under the different ones... and moves along, kind of a nice little micro interaction... to help the user know where they actually are. All right, going a bit deeper with our interactive components... adding a little bit of animation... we did a line underneath, you could obviously do a line over the top...
"Oh, good class challenge, Dan," I'll see you in the next video... actually, before we go I want to show you... well, let's just do some batteries in because that's kind of cool... but it looks way better when the easing is one of these, or a custom one... I'm going to use 'Quick'... and you can experiment with yours, let me speed through this.
Much better, that kind of like little bounce... kind of back and forth, oh, it's nice, I love it... okay, here we go... don't worry, haven't forgotten the little challenge that I've decided to do... and you're thinking, "Dan's challenge needs to be to line this up"... look, why is it so close to that side?
It's driving you mad... I didn't notice it, it's driving me mad now too... I'm going to shovel the navigation across, but I'll do that in between videos... I'll see you in the next one.