Created
March 20, 2022 12:08
-
-
Save celsowhite/7617ab506e53de833bef901eee5e035a to your computer and use it in GitHub Desktop.
Marquee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*------------------------------- | |
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