How to achieve the animation of numbers flying after likes?
I originally wanted to post the code, but it’s a bit long and troublesome
My cooking is to give the number that pops up and gets bigger to a p
Then add animation style to this p
It’s a bit troublesome to extract the js file. Let me show you my css`/Like/@-webkit-keyframes niceIn {
0% { opacity: 1; -webkit-transform: scale(1); transform: scale(1) } 50% { opacity: 1; -webkit-transform: scale(1.5); transform: scale(1.5) } 70% { -webkit-transform: scale(.8); transform: scale(.8) } 100% { opacity: 1; -webkit-transform: scale(1); transform: scale(1) }
}@keyframes niceIn {
0% { opacity: 1; -webkit-transform: scale(1); -ms-transform: scale(1); transform: scale(1) } 50% { opacity: 1; -webkit-transform: scale(1.5); -ms-transform: scale(1.5); transform: scale(1.5) } 70% { -webkit-transform: scale(.8); -ms-transform: scale(.8); transform: scale(.8) } 100% { opacity: 1; -webkit-transform: scale(1); -ms-transform: scale(1); transform: scale(1) }
}
@-o-keyframes niceIn{
0% { opacity: 1; -o-transform: scale(1); transform: scale(1) } 50% { opacity: 1; -o-transform: scale(1.5); transform: scale(1.5) } 70% { -o-transform: scale(.8); transform: scale(.8) } 100% { opacity: 1; -o-transform: scale(1); transform: scale(1) }
@-moz-keyframes niceIn{
0% { opacity: 1; -moz-transform: scale(1); transform: scale(1) } 50% { opacity: 1; -moz-transform: scale(1.5); transform:scale(1.5) } 70% { -o-transform: scale(.8); transform: scale(.8) } 100% { opacity: 1; -moz-transform: scale(1); transform: scale(1) }
}.niceIn {
-webkit-animation:niceIn 0.8s .2s ease; -moz-animation:niceIn 0.8s .2s ease; -o-animation:niceIn 0.8s .2s ease; animation:niceIn 0.8s .2s ease;
}`
Write the animation style, click to switch the class of this style when finished
Click to trigger animation. Animation can be realized using CSS3 animation
I originally wanted to post the code, but it’s a bit long and troublesome
My cooking is to give the number that pops up and gets bigger to a p
Then add animation style to this p
It’s a bit troublesome to extract the js file. Let me show you my css
`
/Like/
@-webkit-keyframes niceIn {
}
@keyframes niceIn {
}
@-o-keyframes niceIn{
}
@-moz-keyframes niceIn{
}
.niceIn {
}
`
Write the animation style, click to switch the class of this style when finished
Click to trigger animation. Animation can be realized using CSS3 animation