Questions tagged [css-animations]

CSS animations make it possible to animate transitions from one CSS style configuration to another. CSS module describes a way for authors to animate the values of CSS properties over time, using keyframes. The behavior of these keyframe animations can be controlled by specifying their duration, number of repeats, and repeating behavior.

CSS animations make it possible to animate transitions from one CSS style configuration to another. Animations consist of two components, a style describing the CSS animation and a set of keyframes that indicate the start and end states of the animation's style, as well as possible intermediate waypoints.

Properties

  • animation-delay

  • animation-direction

  • animation-duration

  • animation-iteration-count

  • animation-name

  • animation-play-state

  • animation-timing-function

  • animation-fill-mode

Animations are similar to in that they change the presentational value of CSS properties over time. The principal difference is that while transitions trigger implicitly when property values change, animations are explicitly executed when the animation properties are applied.

Example

p {
  animation-duration: 3s;
  animation-name: slidein;
}
@keyframes slidein {
  from {
    margin-left: 100%;
    width: 300%; 
  }

  to {
    margin-left: 0%;
    width: 100%;
  }
}

References

7488 questions
63
votes
10 answers

Trigger CSS Animations in JavaScript

I don't know how to use JQuery, so I need a method which could trigger an animation using JavaScript only. I need to call/trigger CSS Animation when the user scrolls the page. function start() { document.getElementById('logo').style.animation…
Sid
  • 633
  • 1
  • 5
  • 6
61
votes
6 answers

Activate CSS3 animation when the content scrolls into view

I have a bar chart that animates with CSS3 and the animation currently activates as the page loads. The problem I have is that the given bar chart is placed off screen due to lots of content before it so by the time a user scrolls down to it, the…
Kevin Jung
  • 2,973
  • 7
  • 32
  • 35
54
votes
3 answers

Can we modify a Font Awesome spin speed?

I have a spinning gear on my website displayed with this code: Personally, I think that…
FlipFloop
  • 1,233
  • 1
  • 14
  • 25
48
votes
2 answers

angular 2 animation vs css animation - when to use what?

I'm currently trying out angular2's animation and I was wondering what specific advantage they bring over standard css animations/transitions. e.g. a typical material designed card and hover effects with the box shadows. Most css frameworks use…
Han Che
  • 8,239
  • 19
  • 70
  • 116
47
votes
6 answers

How to make a smooth dashed border rotation animation like 'marching ants'

I'm working on a css animation that uses 'cogs and chains', but am unable to create a 'smooth' border rotation sequence. You can see in this fiddle How (currently) I'm using a pseudo element to generate a 'rotation' effect. This is done by…
jbutler483
  • 24,074
  • 9
  • 92
  • 145
47
votes
5 answers

How to Animate Gradients using CSS

I want to move my gradient that has multiple colors smoothly but the problem is that the animation is not smooth. It just changes its position at every step.