Skip to content

Instantly share code, notes, and snippets.

@celsowhite
Created March 20, 2022 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save celsowhite/7617ab506e53de833bef901eee5e035a to your computer and use it in GitHub Desktop.
Save celsowhite/7617ab506e53de833bef901eee5e035a to your computer and use it in GitHub Desktop.
Marquee
<div class="hero__marquee marquee">
<div class="marquee__text">
<!-- HTML Markup -->
</div>
<div class="marquee__text">
<!-- HTML Markup -->
</div>
<div class="marquee__text">
<!-- HTML Markup -->
</div>
</div>
/*-------------------------------
Marquee
-------------------------------*/
// Structure
.marquee {
display: flex;
width: 100%;
overflow: hidden;
}
// Text
.marquee__text {
white-space: nowrap;
animation-duration: 30s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-name: marquee--left;
}
/*-------------------------------
Animation
-------------------------------*/
@keyframes marquee--left {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(-100%, 0);
}
}
@keyframes marquee--right {
0% {
transform: translate(-100%, 0);
}
100% {
transform: translate(0%, 0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment