I want to animate text from top to bottom on a slider. Here is the css that I use to animate it:
Html:
<p class="rg5 slideInDown" id="text-animation">mobile</p>
CSS
.rg5 {
font-family: roboto sans-serif;;
font-size: 52px;
color: #ffffff;
margin-bottom: 10%;
line-height: 1;
text-transform: uppercase;
transition: 1s ease-in-out;
animation: slidein 5s infinite;
-webkit-transition: 1s ease-in-out;
-moz-transition: 1s ease-in-out;
-o-transition: 1s ease-in-out;
-webkit-animation: slidein 5s infinite;
-moz-animation: slidein 5s infinite;
-o-animation: slidein 5s infinite;
animation-fill-mode: forwards;
}
.slidein {
-moz-animation-duration: 5s;
-webkit-animation-duration: 5s;
animation-duration: 5s;
-moz-animation-name: slidein;
-webkit-animation-name: slidein;
animation-name: slidein;
-moz-animation-iteration-count: 3;
-webkit-animation-iteration-count: 3;
animation-iteration-count: 3;
-moz-animation-direction: alternate;
-webkit-animation-direction: alternate;
animation-direction: alternate;
}
@-moz-keyframes slidein {
from {
-moz-transform: translate(1,-30em) scale(1.2);
}
to {
-moz-transform: translate(1em,1) scale(1.2);
}
}
@-webkit-keyframes slidein {
from { -webkit-transform: translate(0s,-20em) scale(1.2);
}
to { -webkit-transform: translate(0em,0) scale(1.2);
}
}
@keyframes slidein {
from {
transform: translate(0,-20em) scale(1.2);
}
to {
transform: translate(0em,0) scale(1.2);
}
}
It works great when it slides from top to bottom, but there should be a 15-second gap between animations.
source
share