Day 63: CSS Animation (Cont'd)

Hello! Another day to keep it going. Let’s see how far consistency can keep me. Today, I am continuing with learning CSS Animation by building a Ferris Wheel. Here are the 10 steps I took today.

  • Started off by learning about keyframes rules. It is used to define the flow of CSS Animation. Created a @keyframes rule named wheel.

Day 63 no1ab.png

  • Created a 0% rule within the @keyframes wheel rule. The properties I set in this nested selector will apply at the beginning of your animation.

Day 63 no2ab.png

  • Gave the 0% rule a transform property set to rotate(0deg).

Day 63 no3ab.png

  • Then gave the @keyframes wheel rule a 100% selector. Within that, I set the transform to rotate(360deg). By doing this, the animation will now complete a full rotation.

Day 63 no4ab.png

  • Gave the .wheel selector an animation-name property set to wheel and set the .wheel selector to have an animation-duration property of 10s. Day 63 no5ab.png

P.S The pictures where taking while the wheel was spinning.

  • The Ferris wheel should never stop, so set the .wheel selector to have an animation-iteration-count (sets how many times the animation should repeat)of infinite. Set the animation-timing-function (sets how the animation should progress over time) to linear in the .wheel selector. P.S The pictures where taking while the wheel was spinning.

Day 63 no6ab.png

  • Created another @keyframes rule with the name cabins. Used the same properties as the @keyframes wheel, copying both the 0% and 100% rules, but set the transform property of the 100% selector to rotate(-360deg).

Day 63 no7ab.png

  • I set the animation property of the .cabin rule to cabins 10s linear infinite. This will set the animation-name, animation-duration, animation-timing-function, and animation-iteration-count properties in that order.

Day 63 no8ab.png

  • Replaced linear to ease-in-out in the .cabin selector. This is to make the cabin animation seem more like a natural swinging motion.

Day 63 no9ab.png

  • In the 0% selector of the @keyframes cabins, I set the background-color to yellow. At 0% its yellow, at 100% its red, in between it is Orange. Day 63 no10ab.png I had so much fun doing this. I wish I could do a video recording for you guys, but I don’t know how to do that. Tell me what you think. I look forward to your feedbacks. See you tomorrow.