JSFiddle - React, Tailwind, and code Playground
by tjerabek
HTML
<div class="message-notification-outer">
<div class="message-notification open">
<strong class="actual-number">5</span>
</div>
</div>
tomjer
CSS
.message-notification-outer{
margin: 2em .5em 0 2em;
position: relative;
display: inline-block;
animation: bounce 5s ease-in-out infinite;
-moz-animation: bounce 5s ease-in-out infinite;
-webkit-animation: bounce 5s ease-in-out infinite;
-o-animation: bounce 5s ease-in-out infinite;
}
.message-notification{
padding: .3em .8em;
background: #666;
color: white;
font-family: Arial;
}
.message-notification .actual-number{
font-weight: bold;
}
.message-notification.open{
animation: myfirst 300ms ease-in-out;
-moz-animation: myfirst 300ms ease-in-out;
-webkit-animation: myfirst 300ms ease-in-out;
-o-animation: myfirst 300ms ease-in-out;
}
@keyframes myfirst
{
0% {transform: scale(0);}
100% {transform: scale(1);}
}
@-moz-keyframes myfirst
{
0% {-moz-transform: scale(0);}
100% {-moz-transform: scale(1);}
}
@-webkit-keyframes myfirst
{
0% {-webkit-transform: scale(0);}
100% {-webkit-transform: scale(1);}
}
@-o-keyframes myfirst
{
0% {-o-transform: scale(0);}
100% {-o-transform: scale(1);}
}
@keyframes bounce
{
0% {top: 0;}
85% {top: 0;}
90% {top: 7px;}
95% {top: -7px;}
100% {top: 0;}
}
@-moz-keyframes bounce /* Firefox */
{
0% {top: 0;}
85% {top: 0;}
90% {top: 7px;}
95% {top: -7px;}
100% {top: 0;}
}
@-webkit-keyframes bounce /* Safari and Chrome */
{
0% {top: 0;}
85% {top: 0;}
90% {top: 7px;}
95% {top: -7px;}
100% {top: 0;}
}
@-o-keyframes bounce /* Opera */
{
0% {top: 0;}
85% {top: 0;}
90% {top: 7px;}
95% {top: -7px;}
100% {top: 0;}
}