Please tell me how to make that the animation was not smooth but clear. At once the text disappeared and immediately appeared.
I don’t need smooth animation!
EDIT: Right now the text goes out smoothly! I need the text to go out not smoothly, but sharply!
div {
font-size: 100px;
animation: time_block 1s infinite;
transition: 0ms;
}
@keyframes time_block {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
<div>TEST</div>
2
Answers
You should start at opacity 0. Then you can use
animation-direction:alternate
to make the animation go from 0 to 1 and then back to 0.You can increase the animation time to 2 or 3 secs and add the forwards value to animation-fill-mode so that it retains the values set by the final keyframe after the animation is completed.
Here is the code :
Hope this helps you.