06Dual direction rows
Two tracks share the same animation, but one runs animation-direction: reverse so the rows visibly cross each other.
Best forDecorative hero backdrops, keyword walls
animation-direction: reverse두 트랙교차 흐름

<main class="stage">
<div class="marquee">
<div class="marquee__row marquee__row--fwd">
<div class="marquee__track">
<span class="marquee__chip">DESIGN</span>
<span class="marquee__chip">MOTION</span>
<span class="marquee__chip">LAYOUT</span>
<span class="marquee__chip" aria-hidden="true">DESIGN</span>
<span class="marquee__chip" aria-hidden="true">MOTION</span>
<span class="marquee__chip" aria-hidden="true">LAYOUT</span>
</div>
</div>
<div class="marquee__row marquee__row--rev">
<div class="marquee__track">
<span class="marquee__chip">CSS</span>
<span class="marquee__chip">SCSS</span>
<span class="marquee__chip">REACT</span>
<span class="marquee__chip" aria-hidden="true">CSS</span>
<span class="marquee__chip" aria-hidden="true">SCSS</span>
<span class="marquee__chip" aria-hidden="true">REACT</span>
</div>
</div>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-loop;
$easing: linear;
$color: $stage-ink;
@include stage($stage-yellow);
.marquee { width: min(320px, 84vw); display: grid; gap: 12px; }
.marquee__row { overflow: hidden; }
.marquee__track {
display: flex;
width: max-content;
animation-duration: $duration;
animation-timing-function: $easing;
animation-iteration-count: infinite;
}
.marquee__row--fwd .marquee__track { animation-name: marquee-scroll; }
// 같은 애니메이션을 그대로 쓰되 animation-direction 만 뒤집는다 — 별도 keyframes 를 만들 필요가 없다
.marquee__row--rev .marquee__track { animation-name: marquee-scroll; animation-direction: reverse; }
.marquee__chip {
margin-right: 12px; // 트랙의 gap 대신 — 세트 폭이 정확히 절반이 되어 -50% 이음새가 0px 이 된다
flex-shrink: 0;
display: grid;
place-items: center;
height: 32px;
padding: 0 14px;
border-radius: $r-pill;
background: $color;
color: $stage-yellow;
font-weight: 700; font-size: 12px; line-height: 1; font-family: inherit;
letter-spacing: .04em;
}
@keyframes marquee-scroll {
from { transform: translateX(0); }
to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
.marquee__track { animation: none; transform: translateX(0); }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #ffd23f;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.marquee {
width: min(320px, 84vw);
display: grid;
gap: 12px;
}
.marquee__row {
overflow: hidden;
}
.marquee__track {
display: flex;
width: max-content;
animation-duration: 2s;
animation-timing-function: linear;
animation-iteration-count: infinite;
}
.marquee__row--fwd .marquee__track {
animation-name: marquee-scroll;
}
.marquee__row--rev .marquee__track {
animation-name: marquee-scroll;
animation-direction: reverse;
}
.marquee__chip {
margin-right: 12px;
flex-shrink: 0;
display: grid;
place-items: center;
height: 32px;
padding: 0 14px;
border-radius: 999px;
background: #17141a;
color: #ffd23f;
font-weight: 700;
font-size: 12px;
line-height: 1;
font-family: inherit;
letter-spacing: 0.04em;
}
@keyframes marquee-scroll {
from {
transform: translateX(0);
}
to {
transform: translateX(-50%);
}
}
@media (prefers-reduced-motion: reduce) {
.marquee__track {
animation: none;
transform: translateX(0);
}
}import type { CSSProperties } from "react";
import styles from "./DualDirectionMarquee.module.scss";
export type DualDirectionMarqueeProps = {
forward?: string[];
reverse?: string[];
duration?: number;
easing?: string;
color?: string;
};
type Vars = CSSProperties & { "--duration"?: string; "--easing"?: string; "--color"?: string };
function Row({ items, reverse }: { items: string[]; reverse?: boolean }) {
return (
<div className={styles.row}>
<div className={reverse ? `${styles.track} ${styles.reverse}` : styles.track}>
{items.map((it) => (
<span key={it} className={styles.chip}>{it}</span>
))}
{items.map((it) => (
<span key={"dup-" + it} className={styles.chip} aria-hidden="true">{it}</span>
))}
</div>
</div>
);
}
export default function DualDirectionMarquee({
forward = ["DESIGN", "MOTION", "LAYOUT"],
reverse = ["CSS", "SCSS", "REACT"],
duration = 12000,
easing = "linear",
color = "#17141a",
}: DualDirectionMarqueeProps) {
const vars: Vars = { "--duration": `${duration}ms`, "--easing": easing, "--color": color };
return (
<div className={styles.marquee} style={vars}>
<Row items={forward} />
<Row items={reverse} reverse />
</div>
);
}06 Dual direction rows — Measured area 14.222% · moving frames 23/23Original by GODRICH · SCSS and React ship in the zip · 9 CSS Marquee Infinite Loop — No JS, Scroll-Driven
The post this demo lives in
9 CSS Marquee Infinite Loop — No JS, Scroll-DrivenA css marquee infinite loop is a row of duplicated content — logos, a price ticker, a headline — that slides on repeat u See all demos in this post
If you like this effect - similar demos
Scroll06 Direction enter & exitScroll Trigger Animation: 9 Engines, No GSAP
Scroll07 Friction decel — once the input value stops, a speed value slows gradually by a friction valueScroll Inertia CSS — 9 Value Patterns
Scroll03 Direction reverse — the particle flow's direction value flips the instant the scroll-direction value switches from down to upMoving Particles Background CSS: 9 Scroll Scenes