Claude Code · Claude Opus 5.5 · React (TSX)
결과 코드펼치기
import { useEffect, useRef } from "react";
const COLORS = ["#7c3aed", "#db2777", "#0891b2"];
/** Three dots in violet, pink and teal that hop in turn, like a message being sent */
export default function SendingDots() {
const dots = useRef<(HTMLSpanElement | null)[]>([]);
useEffect(() => {
if (matchMedia("(prefers-reduced-motion: reduce)").matches) return;
const animations = dots.current.map((dot, i) =>
dot?.animate([{ transform: "translateY(0)" }, { transform: "translateY(-8px)" }, { transform: "translateY(0)" }], {
duration: 900,
delay: i * 150,
iterations: Infinity,
easing: "ease-in-out",
}),
);
return () => animations.forEach((a) => a?.cancel());
}, []);
return (
<section className="grid w-full place-items-center bg-[#fbfbfc] px-4 py-28">
<span role="status" aria-label="보내는 중" className="inline-flex gap-2">
{COLORS.map((color, i) => (
<span
key={color}
ref={(el) => {
dots.current[i] = el;
}}
className="size-3.5 rounded-full"
style={{ background: color }}
/>
))}
</span>
</section>
);
}
적용 사이트 0
이 블록이 실제로 쓰인 사이트입니다.
아직 등록된 사이트가 없습니다. 이 블록을 쓴 사이트가 있다면 알려 주세요.
재현 후기
v1 · 0개아직 이 버전의 프롬프트로 직접 만들어 본 사람이 없습니다. 첫 번째로 재현해 보세요.