It's flippin flipping
In our last lesson we started working in the 3D realm. We played with perspectives and flipped our boxes. In this lesson we'll continue that process as we switch our content (fake switch) in the perfect moment. This will create an illusion of a full circle when we only animated 1/2 of a circle.
Video Transcript
00:00All right, I wanted to explain the logic and to do that
00:03I'm gonna have to stand up and stop talking for a second
00:06All right, so the logic is this when we turn around in 3d space a real 3d space
00:10I'm always visible because I have a depth so
00:14You can see that I'm turning around you can see my tummy
00:18But in reality if I have this element right here, which is my hand
00:21Which is a 2d element because really HTML is 2d and I turn around
00:26One is you can see that the scar that my cake
00:30scarred me with this week, but in reality a 2d element when it reaches this area it becomes invisible and
00:36Then it then it's seen again
00:38But that now we're seeing the other side and then it continues a little bit more which I can't do it all the way
00:42And then it's invisible again
00:44So there's these two stages where our animation is invisible and what I want to do is I want to take our element from here
00:50Animate it to this place and then switch our content to be basically, you know
00:55Let me do it with a piece of paper because or let me do it with a piece of
01:00Cheap stuff. All right. So here we go
01:02so we have this element here that cost me a dollar online and
01:06We turn it around and when we get to this stage
01:09What I want to do is I want to basically flip it bring it to this state so that way I could reveal it
01:13So it looks like I'm doing a complete circle
01:16But really what I'm doing is I'm only I'm turning 90 degrees and then I'm jumping to a different spot and turning 90 degrees again
01:22So let's see it in action. We're not learning anything new from code perspective
01:26But this is a really important kind of subtle way of how great you could create really cool animations really really simply
01:32All right. So let's jump in there. Let's see how we do it
01:35Before I even change anything. I want to flip it back
01:37So we'll be able to see it as we after we change it
01:41so what I'm gonna do is I'm literally just gonna copy everything here besides our perspective and
01:47I'm gonna go ahead here and
01:50Let me just delete that perspective because we don't need to change our perspective again
01:53It's already set now what I want to do is
01:56I actually want to create a from two because if I continue the two and I say hey
02:00I want to animate to zero
02:02We're gonna have a few a few problems. Our first problem is gonna be is that we're gonna be animating backwards
02:08So if I go ahead here and I oh, let me just I didn't want to copy out to the on complete
02:13So let me just delete this on complete so we don't end up in a endless loop
02:17so I'm gonna go ahead here just click on refresh here really quickly and
02:24Now we're gonna animate our way towards that center point and in that center point
02:29We're basically going back to where we were
02:32But what I really want is I want my animation to do a complete circle
02:36I don't want it to do a backseat and turn back around
02:40Although that if we do this and we set our animation in a relatively high speed such as let's say a half a second on each
02:47Side so it's like one second from one side to the other side
02:50It's not gonna be as obvious unless you're really looking at it to see that it's actually not doing that full circle
02:57It feels almost as if you are or it doesn't feel like it matters too much
03:01But I'm all about details
03:03What I really want to do here is I don't want to go backwards because I feel that snap that we're going backwards
03:08so what I want to do is I'm gonna go ahead here instead of doing a two I'll do a from two and
03:14For our degree that is great
03:16This is exactly where we want to be in the end
03:18but what I want to do is I want to basically take our element here and as our first property I
03:24Want to change our starting point to be minus 90 degrees because minus 90 degrees is going to be exactly that point where our element
03:32Is invisible?
03:33But it's in the other side making it us continue in the right direction because we want to go in the right direction
03:41So if I save this and I go back and I click on refresh
03:44We're gonna see that now we're gonna have our animation go through that full cycle
03:49And it's not gonna feel like it's bouncing backwards. You're gonna have this feeling of a complete circle
03:55Although what we did was just a quarter of a circle twice
03:58Now one one more thing that we could do to this just to really really polish this up and complete it in a nice way
04:04Is get rid of our no ease because once we're on our way back and are on our way back
04:09We probably want to ease because we want to ease to its final destination and that could give that little bit more of extra
04:16And by the way, because we we saw the quadric at ease was the default and we're fine with the quadric ease. I
04:23Think we are at least and this change and shift in speed is a perfect timing for us to change our speed
04:29I believe and we'll see that. Yeah, that was that worked really nicely
04:32So it created a more detailed animation that feels a little bit more organic now
04:37Obviously, there's more things that we could have done in this to make it a little bit more interesting
04:41Among them maybe adding a slight delays or they're happening like a cards like cards unfolding with a little bit of delay between them
04:48But I'll leave that to you guys to do because this is the stuff that will probably play around with when we move to tween
04:54Max because in tween max we're gonna have that capability much more easily accessible with less code
04:59So that's it for 3d transformations or at least the transform trans 3d transformations for our object
05:07We have a few more loose ends that we want to tie up and among them. I want to just
05:12go back to our
05:15We're creating these transform perspectives and we could also define them directly in our CSS
05:20Or if we want we could set a default value by setting the CSS plugin default
05:27Transform perspective. I'm not going to use it
05:29But what I'll do is I'll post it right here into the commenting area so you could play around with it yourself
05:34But by doing that you wouldn't need to set and configure each element that you're animating now
05:39I encourage you to do a completely fresh new animation
05:42Delete all the content from the stage put around put a few boxes on the screen
05:46That's going to give you a better feel of how it actually works. All right, so that's it for this lecture
05:52We'll see you in the next lecture as we get closer to wrapping up our conversation about CSS and the CSS plugin
05:59for this course
