I'm trying to make a text transition with CSS where the texts should be alternating, should appear slowly, disappear and change text. And this should be infinite.
I'm trying to do the following, but the speed at which the text appears is not the same as it makes it appear, so it's giving a strange effect.
This is the code:
#hello {
animation: pulse 6s linear infinite;
}
@keyframes pulse {
0% {
opacity: 0;
}
10% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
}
#hello:after {
content: '';
animation: spin 50s linear infinite;
}
@keyframes spin {
0% {
content: 'This is the first text';
}
25% {
content: 'The second text';
}
50% {
content: 'Other text';
}
75% {
content: 'Another example text';
}
100% {
content: 'This is the last text';
}
}
How can I make this transition work correctly? I'm having a little trouble with this, thanks if anyone can help me