Put a portal on the angled piece of wall that doesn't have a pellet bouncing on it, then put another portal on the angled piece of wall that does have a pellet bouncing on it. This will start the platforms moving.
Ride the platform, crouching to pass under the pneumatic thing, hop onto the grating, and continue riding the platform until you get to the little side room with a button in it. Go into that side room and create a portal on the wall in here. Then press the button and look through the door that opened. Shoot a portal of the other color onto the wall behind the little door. It isn't open long enough for you to get through riding the platform.
When you see the platform passing by the portal, step through onto it. When you see the bouncing pellet, shoot a portal onto the wall that it keeps hitting, then when it goes through, make a portal of the color that it's going through on a part of the wall behind you. In other words, you need to make the pellet come out somewhere other than where you're about to go through. Because you can't jump high enough to avoid the pellet.
Now that you're past the pellet, the platform takes you to where you can see a big wall blocking where the platform will take you. In order not to be pushed off of it, make a portal on the wall just beyond the blocking wall, and make a portal of the other color on a wall that you can reach, or on the blocking wall itself (so that you go through the portal instead of having the wall push you into the pit). You should be able to hop onto the platform as it goes under the blocking wall.
Now you see a sign on the wall promising delicious cake. Yay! But as you turn the corner, there's actually a big pit of fire. Boo!
Just because the computer expects you to die doesn't mean that you have to. In fact, since you have the portal gun, it's pretty easy to escape a fiery demise. Just shoot a portal on the wall above the ledge that overlooks the fiery pit, and then shoot a portal onto a side wall of the pit. You will be able to jump through the portal as long as you make it low enough.
Once you do that, you're standing on the ledge and it might seem like there's nowhere to go from here, but in fact, there is a ledge above the pit that you can reach if you shoot a portal as far up on the wall as you can, and then make a portal on the floor and another as you fall from the wall portal, giving you enough momentum to get onto that ledge.
Now it's time to find out where these vent rooms take you....