Skip to main content

CSS Rotation - Animation Idea #3

  • January 25, 2022
  • 0 replies
  • 294 views

gstager
Hero III
Forum|alt.badge.img+7

In this idea - I thought I would play with some rotation.

I attempted to provide a little something extra too. A CAR! - or at least the appearance of a moving car.
Perhaps I will see about animating the entire set at some point.

Here we have three images - I am only animating two of them - of course.

Both tires are tied to the same keyframe code.

CSS Rotation

Here is the code.

/* Here is the CSS for the Branding and Look section */
/* Car Tires */

#backTire {
  width: 50px;
  height: 50px;
  left: 77px;
  top: 65px;
  position: absolute;
  animation-name: carTires;
  animation-duration: 3s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

#frontTire {
  width: 50px;
  height: 50px;
  left: 296px;
  top: 65px;
  position: absolute;
  animation-name: carTires;
  animation-duration: 3s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

@keyframes carTires
{   
    100% {transform: rotate(360deg);}
}
<!-- Here is the HTML for the widget -->

<div style="padding:20px;">

<div><img src="https://path/to/your/graphic/car.png" width="400" height="101"/></div>

<div>
<img id="backTire" src="https://path/to/your/graphic/tire.png" width="50" height="50"/></div>

<div>
<img id="frontTire" src="https://path/to/your/graphic/tire.png" width="50" height="50"/></div>

</div>

 

What are some other ideas you can think of to spice up your platform with rotation animations?

Did this post help you find an answer to your question?

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings