I have a picture. I need to make an animation on which a check mark appears frame by frame
How can I do that?
body { font-family: sans-serif; font-size: .9em; } .example-1 { position: relative; width: 50px; height: 50px; box-sizing: border-box; border: 5px solid #ddaa55; border-radius: 50%; } .example-1:after { content: ''; position: absolute; left: 0; top: -10px; width: 0; height: 50px; background: url(http://iconspot.ru/files/175351.png) 0 0 no-repeat; background-size: cover; transition: width .5s; } .example-1:hover:after { width: 50px; } .example-2 { position: relative; width: 50px; height: 50px; box-sizing: border-box; border: 5px solid #ddaa55; border-radius: 50%; } .example-2:after { content: ''; position: absolute; left: 0; top: -10px; width: 50px; height: 50px; background: url(http://iconspot.ru/files/175351.png) 0 0 no-repeat; background-size: cover; animation: .5s linear 0s infinite alternate check; } @keyframes check { from { width: 0; } to: { width: 50px; } }
<p>ΠΡΠΈ ΠΏΠΎΠΌΠΎΡΠΈ <code>transition</code>. ΠΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΠΏΡΠΈ ΡΠΌΠ΅Π½Π΅ ΡΠΎΡΡΠΎΡΠ½ΠΈΡ ΠΈ Ρ Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ΠΌ ΠΊΠ»Π°ΡΡΠ° (Π½Π°Π²Π΅Π΄ΠΈΡΠ΅ ΠΊΡΡΡΠΎΡ):</p> <div class="example-1"></div> <p>ΠΡΠΈ ΠΏΠΎΠΌΠΎΡΠΈ <code>animation</code>. ΠΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΠΊΠ°ΠΊ ΠΏΡΠΈ ΡΠΌΠ΅Π½Π΅ ΡΠΎΡΡΠΎΡΠ½ΠΈΡ ΠΈΠ»ΠΈ Ρ Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ΠΌ ΠΊΠ»Π°ΡΡΠ°, ΡΠ°ΠΊ ΠΈ Π±Π΅Π· ΠΊΠ°ΠΊΠΎΠ³ΠΎ-Π»ΠΈΠ±ΠΎ ΡΠΎΠ±ΡΡΠΈΡ:</p> <div class="example-2"></div>
infinite
parameter. And read the article, the link to which I gave in the answer. It tells in detail about the various options for the application of animation and the necessary gender-based prefixes of properties for better browser support. - Konstantin BasharkevichSource: https://ru.stackoverflow.com/questions/555345/
All Articles