033 chấm nảy
Ba chấm nảy lên rồi xuống lần lượt, báo hiệu trạng thái đang chờ.
Dùng choChờ nhập chat, chờ gợi ý tìm kiếm tự động
지연 0.16초점 3개translateY

<main class="stage">
<div class="dots" role="status" aria-label="Đang nhập">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: .9s; // 점 하나의 바운스 주기
$delay: .16s; // 점 사이 시차
$color: $subject-cream; // 점 색
@include stage($stage-orange);
.dots {
display: flex;
gap: clamp(8px, 3vw, 14px);
}
.dots span {
width: clamp(12px, 4vw, 18px);
height: clamp(12px, 4vw, 18px);
border-radius: 50%;
background: $color;
animation: bounce $duration ease-in-out infinite;
}
.dots span:nth-child(2) { animation-delay: $delay; }
.dots span:nth-child(3) { animation-delay: $delay * 2; }
@keyframes bounce {
0%, 80%, 100% { transform: translateY(0); opacity: .5; }
40% { transform: translateY(-14px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
.dots span { animation: none; opacity: .85; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #ff4d1f;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.dots {
display: flex;
gap: clamp(8px, 3vw, 14px);
}
.dots span {
width: clamp(12px, 4vw, 18px);
height: clamp(12px, 4vw, 18px);
border-radius: 50%;
background: #fff7e6;
animation: bounce 0.9s ease-in-out infinite;
}
.dots span:nth-child(2) {
animation-delay: 0.16s;
}
.dots span:nth-child(3) {
animation-delay: 0.32s;
}
@keyframes bounce {
0%, 80%, 100% {
transform: translateY(0);
opacity: 0.5;
}
40% {
transform: translateY(-14px);
opacity: 1;
}
}
@media (prefers-reduced-motion: reduce) {
.dots span {
animation: none;
opacity: 0.85;
}
}import type { CSSProperties } from "react";
import styles from "./DotsBounce.module.scss";
export type DotsBounceProps = {
/** 점 하나의 바운스 주기 (기본 900ms) */
duration?: number;
/** 점 사이 시차 (기본 160ms) */
delay?: number;
/** 점 색 */
color?: string;
label?: string;
};
type Vars = CSSProperties & { "--duration"?: string; "--delay"?: string; "--color"?: string };
export default function DotsBounce({
duration = 900,
delay = 160,
color = "#fff7e6",
label = "Typing",
}: DotsBounceProps) {
const vars: Vars = {
"--duration": `${duration}ms`,
"--delay": `${delay}ms`,
"--color": color,
};
return (
<div className={styles.dots} style={vars} role="status" aria-label={label}>
<span aria-hidden="true" />
<span aria-hidden="true" />
<span aria-hidden="true" />
</div>
);
}03 3 chấm nảy — Diện tích đo được 1.1% · khung hình chuyển động 23/23Nguyên tác GODRICH · SCSS và React nằm trong tệp zip · 9 hiệu ứng css loading spinner animation gọn nhẹ
Bài viết chứa demo này
9 hiệu ứng css loading spinner animation gọn nhẹCSS loading spinner animation là một khối nhỏ tự xoay, tự nảy hoặc tự đổi độ sáng bằng thuần CSS để báo cho người dùng b Xem tất cả demo trong bài này


