Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

how to pause between a looping css animation?

Hi everyone,

Anybody know how to pause between a looping css animation?

@for $i from 1 through 50 { #unicorn .shard:nth-child(#{$i})::before { $ad: ($i*0.05s+0.02s); -webkit-animation: shimmer 0.8s $ad linear infinite; -moz-animation: shimmer 0.8s $ad linear infinite; animation: shimmer 0.8s $ad linear infinite; } }

@-webkit-keyframes shimmer { 0% { background: rgba(255,255,255,0);
} 35% { background: rgba(255,255,255,.2); } 100% { background: rgba(255,255,255,0);
} }

I'm able to call the "shimmer" css animation and play it infinitely but I am trying to put a pause between the loops. Should I use js?

Please help!

3 Answers

why don't you just use the library animate css?

https://daneden.github.io/animate.css/

It's so much easier to use a library than to script your own. Well unless you want to make it very very light weight.

Also you can just cut the css section you need. Then minify it. Same thing.

No I got the animation working but my question is how to make it repeat after a pause.