I am working on my coming soon website and I am lost here.
I want to make the page scroll from seamlessly from right to left and a readable pace, but I can't seem to get it to work.
*,
*::after,
*::before {
box-sizing: border-box;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
margin: 0;
--color-text: #dedede;
--color-bg: #060606;
color: var(--color-text);
background-color: var(--color-bg);
}
.hero {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
padding: 10vh 0 25vh;
--marquee-width: 100vw;
--offset: 20vw;
--move-initial: calc(-25% + var(--offset));
--move-final: calc(-50% + var(--offset));
--item-font-size: 8vw;
counter-reset: hero;
}
.marquee {
position: absolute;
top: 0;
left: 0;
width: var(--marquee-width);
overflow: hidden;
pointer-events: none;
mix-blend-mode: normal;
}
.marquee__inner {
width: fit-content;
display: flex;
position: relative;
transform: translate3d(var(--move-initial), -0, 0);
animation: marquee 5s linear infinite;
animation-play-state: paused;
opacity: 0;
transition: opacity 0.1s;
}
.marquee .marquee__inner {
animation-play-state: running;
opacity: 1;
transition-duration: 0.4s;
}
.marquee span {
text-align: center;
white-space: nowrap;
font-size: var(--item-font-size);
padding: 0 1vw;
font-weight: 900;
line-height: 1.15;
font-style: regular;
color: #FFFB00;
}
@keyframes marquee {
0% {
transform: translate3d(var(--move-initial), 0, 0);
}
100% {
transform: translate3d(var(--move-final), 0, 0);
}
<div>
<nav class="hero">
<div class="hero__item">
<div class="marquee">
<div class="marquee__inner" style="--tw: 189ch; --ad: 12s;">
<span>Logo Design • Brand Identity • Illustration • Icon Design • UX/UI • Logo Design
</span>
</div>
</div>
</div>
</nav>
</div>
I have tried to adjust the keyframe, and animation marquee, but I am not sure why is is not scrolling with breaks.
Here is the code on CodePenhttps://codepen.io/onuohaui/details/JjvNyaJ
Thank you in advance.