Last active
July 16, 2023 23:05
-
-
Save askdesign/940ed3b3d7df2980d8fb49cbba7fc9f3 to your computer and use it in GitHub Desktop.
A basic ticker tape (marquee text) with just CSS
https://aurooba.com/ticker-tape-marquee-css/
https://codepen.io/aurooba/full/oNQgwrx
This file contains hidden or 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
.ticker-tape-container { | |
overflow-x: hidden; | |
max-width: 700px; | |
width: 100%; | |
display: flex; | |
} | |
.ticker-tape { | |
--direction: normal; | |
--duration: 60s; | |
--delay: 0s; | |
--iteration-count: infinite; | |
display: flex; | |
gap: 1rem; | |
flex: 0 0 auto; | |
margin-right: 1rem; | |
min-width: 100%; | |
align-items: center; | |
animation: marquee var(--duration) linear var(--delay) var(--iteration-count); | |
animation-play-state: var(--play); | |
animation-delay: var(--delay); | |
animation-direction: var(--direction); | |
} | |
@keyframes scrmarqueeoll { | |
0% { | |
transform: translateX(0%); | |
} | |
100% { | |
transform: translateX(-100%); | |
} | |
} | |
/* This is just some styling to make it look presentable */ | |
.basic-styling { | |
border-radius: 10px; | |
background-color: lightblue; | |
padding: 2rem; | |
color: #010101; | |
font-size: 1.5rem; | |
font-family: sans-serif; | |
} | |
.basic-styling span { | |
padding: 0.25rem 1rem; | |
border-radius: 10px; | |
border: 2px dashed #5fb3ce; | |
background-color: #86c5da; | |
} |
This file contains hidden or 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="basic-styling ticker-tape-container"> | |
<div class="ticker-tape"> | |
<span>object complements</span> | |
<span>subject</span> | |
<span>verb</span> | |
<span>predicate</span> | |
<span>preposition</span> | |
<span>adjective</span> | |
<span>adverb</span> | |
<span>clause</span> | |
<span>conjunction</span> | |
<span>implicit object complement</span> | |
<span>postposition</span> | |
</div> | |
<div class="ticker-tape" aria-hidden="true"> | |
<span>object complements</span> | |
<span>subject</span> | |
<span>verb</span> | |
<span>predicate</span> | |
<span>preposition</span> | |
<span>adjective</span> | |
<span>adverb</span> | |
<span>clause</span> | |
<span>conjunction</span> | |
<span>implicit object complement</span> | |
<span>postposition</span> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment