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
2
votes
3 answers

Transform Rotate Menu Item Circular Menu

I have modified a circular menu that I found on this pen But I am having trouble rotating the menu items around the main circle. By default of this pen, the button's bottom part is perpendicular to it's relative position, but since I changed them…
Selim Balci
  • 940
  • 2
  • 11
  • 26
2
votes
1 answer

Random CSS animation time on each iteration

Trying to set a random animation time on each iteration. I set a CSS custom property --animation-time changed randomly each animation iteration with JS. let square = document.getElementById('square'); let…
aitor
  • 2,281
  • 3
  • 22
  • 44
2
votes
2 answers

Why does an element still take up space even when height is 0?

Here's the demo: https://codepen.io/jchi2241/pen/dEzMZo?editors=1100 I am hiding the
    with a max-height of 0 when the sibling input element is unchecked, and setting the
      max-height to 10em when checked. I am using max-height specifically to…
jchi2241
  • 2,032
  • 1
  • 25
  • 49
2
votes
1 answer

How to target an item for animation when it hits the WayPoint div

I am hoping you can help me out with understanding how jQuery Waypoints works. The Goal Scroll down to the specified div with id of #targetPoint Once hit, trigger animation for element #smooth-logo ** Animations should not trigger they hit the…
Birdie Golden
  • 505
  • 6
  • 20
2
votes
0 answers

CSS animation glitch when reversing the animation via JS midway

I am having an issue stopping a CSS animation at about 75% of the way complete and then reversing its order and then continuing it using JS. If you run the snippet below and you'll see that you can easily stop and reverse the animation of the cube…
Jack
  • 1,893
  • 1
  • 11
  • 28
2
votes
1 answer

Reverse css keyframe animation

I've written a css animation using keyframes for svg path path { animation: anim 1s linear; animation-fill-mode: forwards; } @keyframes anim { 50% { d: path('M20 20 L 20 20'); } 100% { d: path('M10 10 L 30 30'); …
Jeanluca Scaljeri
  • 26,343
  • 56
  • 205
  • 333
2
votes
1 answer

CSS rotate does not animate after keyframe rotate-animation

i want to "chain" 2 css animations after each other. The first plays on page load and is a css animation that rotates a cube by some degrese. As a second animation i want to rotate that cube even further when the user presses a button (add class to…
Julian Orth
  • 320
  • 1
  • 11
2
votes
1 answer

How to create a rain effect that is triggered by an event?

I'm trying to make an image fall, similar to a rain effect, but I only want it triggered by an event listener. Currently, I'm appending a div and animating the falling effect, but each additional event trigger is then appended below/next to the…
2
votes
1 answer

Display a W with an effect of fade out

I want to display a W with an effect of fade out when my W will be written entirely. I do not know if I got tangled in my Keyframes .anim { transform: rotate(90deg); } #global { width: 70px; margin:…
Mercer
  • 9,736
  • 30
  • 105
  • 170
2
votes
1 answer

Disable a transition while an animation is running

Demo of the problem: https://jsfiddle.net/t0qsek8n/1/
Test text
.test { position: relative; top: 0px; border: 1px solid #ccc; animation: test 5s; transition: top 1s; } @keyframes test { 0% { …
Roman Zino
  • 23
  • 4
2
votes
2 answers

How to smooth out a CSS gradient transition?

I am creating an interactive touchscreen display using a program called Intuiface and have created some background tiles/squares that I want to make look 'alive' by transitioning slowly between colours. I have used a linear-gradient transition in…
david_10001
  • 492
  • 1
  • 6
  • 22
2
votes
1 answer

CSS3 animation not working inside Angular component

Can't for the life of me figure out why this isn't triggering as it's a rather simple thing. I have an Angular component that simply contains the following: Click In the corresponding component's CSS, I have this: @keyframes…
AlexM
  • 459
  • 5
  • 15
2
votes
1 answer

CSS animation - 0 to 100 and back to 0

I set a div of a dropdown to have an animation as below and this happens when div opens up: .locationDropdownList { position: absolute; top: 83px; width: 100%; background: white; z-index: 1000; padding: 0 1rem 1rem 1rem; animation:…
drifterOcean19
  • 372
  • 5
  • 24
2
votes
1 answer

Slide down/up animation

In this snippet, using keyframes and animation and display none/block, the div animates to slide down on hover. h1 { padding: 20px; } div { width: 100%; background: pink; padding: 20px; display: none; } body:hover div { …
user1642919
  • 23
  • 1
  • 2
  • 5
2
votes
2 answers

Animated dots with css, making them move forever

I can't seem to make this animation move forever without adding more dots in span. I would like the amount of dots not to be dependent on the "loading-dots" class, as it is adding more dots increases the duration but its a pain. Could it be possible…
user1839688
  • 23
  • 1
  • 5
1 2 3
99
100