How to control the speed
The speed is determined by the animation property in the .marquee-text class. The duration is set in seconds (280s). Adjust this value to speed up or slow down the animation. For instance:Example:
.marquee-text { animation: float 280s linear infinite; /* CONTROL THE SPEED */ }Example: To make the text move faster, reduce the duration:
.marquee-text { animation: float 140s linear infinite; /* CONTROL THE SPEED */ }How to change direction left-right
The direction is controlled by the @keyframes float section in the CSS. There are two main setups:- For LEFT TO RIGHT movement
@keyframes float {
ย ย ย ย ย ย 0% {
ย ย ย ย ย ย ย ย transform: translateX(0);ย
ย ย ย ย ย ย }
ย ย ย ย ย ย 100% {
ย ย ย ย ย ย ย ย transform: translateX(-550%); /* CHANGE FLOAT DIRECTION */
ย ย ย ย ย ย }
ย ย ย ย }
- For RIGHT TO LEFTmovement
@keyframes float {
ย ย ย ย ย ย 0% {
ย ย ย ย ย ย ย ย transform: translateX(-550%);ย
ย ย ย ย ย ย }
ย ย ย ย ย ย 100% {
ย ย ย ย ย ย ย ย transform: translateX(0); /* CHANGE FLOAT DIRECTION */
ย ย ย ย ย ย }
ย ย ย ย }
That's all you need to change! Just swap these values (-550%) (0) to change direction. Everything else in the code can stay the same.