Đây là hoạt ảnh cuộn vô hạn thường được sử dụng để hiển thị danh sách các logo của công ty đối tác theo vòng lặp.
animation, thao tác cuộn mượt mà hơn và có hiệu suất tốt hơn JavaScript.animation-play-state: paused).20s trong CSS animation: marquee 20s linear infinite;.<div class="w-full overflow-hidden bg-white dark:bg-zinc-950 py-10">
<style>
@keyframes marquee {
0% { transform: translateX(0); }
100% { transform: translateX(-50%); }
}
.animate-marquee {
animation: marquee 20s linear infinite;
}
.animate-marquee:hover {
animation-play-state: paused;
}
</style>
<div class="flex w-[200%] animate-marquee gap-8 items-center">
<!-- First set -->
<div class="flex-1 flex justify-around items-center font-bold text-2xl text-gray-300 dark:text-zinc-700">
<span>LOGO 1</span>
<span>LOGO 2</span>
<span>LOGO 3</span>
<span>LOGO 4</span>
<span>LOGO 5</span>
</div>
<!-- Duplicate set for infinite effect -->
<div class="flex-1 flex justify-around items-center font-bold text-2xl text-gray-300 dark:text-zinc-700">
<span>LOGO 1</span>
<span>LOGO 2</span>
<span>LOGO 3</span>
<span>LOGO 4</span>
<span>LOGO 5</span>
</div>
</div>
</div>