05빙글빙글 도는(くるくる)
`.o-kuru`는 rotate 360도를 구간마다 다른 cubic-bezier로 이어붙여, 일정한 linear 회전보다 한 박자씩 튕기는 듯한 새로고침 아이콘을 만듭니다.
쓰임새로고침 버튼, 로딩 아이콘, 동기화 아이콘
rotate 360deg구간별 easing1.6s

<main class="stage">
<button class="icon o-kuru is-demo" type="button" aria-label="새로고침">
<svg viewBox="0 0 24 24" width="28" height="28" aria-hidden="true"><path d="M20 12a8 8 0 1 1-2.34-5.66" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/><path d="M20 4v5h-5" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
<span class="tag">빙글빙글</span>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: 1.6s;
$easing: cubic-bezier(.65, 0, .35, 1);
$color: $subject-cream;
// ── 데모 무대 ───────────────────────────────
@include stage($stage-ink);
.stage { position: relative; }
.icon {
width: 60px;
height: 60px;
border: 0;
border-radius: 50%;
display: grid;
place-items: center;
background: rgba(255, 247, 230, .1);
color: $color;
cursor: pointer;
}
.tag {
position: absolute;
top: $sp-4;
right: $sp-4;
padding: $sp-1 $sp-3;
border-radius: $r-sm;
background: rgba(255, 255, 255, .12);
color: $subject-cream;
font-weight: 700;
font-size: 12px;
line-height: 1;
font-family: inherit;
letter-spacing: .04em;
}
// ── linear 대신 구간마다 다른 지점을 지나게 해 한 박자 튕기는 듯한 회전을 만든다 ─────
.o-kuru {
animation: o-kuru $duration $easing infinite;
}
@keyframes o-kuru {
0% { transform: rotate(0deg); }
55% { transform: rotate(230deg); }
80% { transform: rotate(330deg); }
100% { transform: rotate(360deg); }
}
// ── 접근성 ──────────────────────────────────────────
@media (prefers-reduced-motion: reduce) {
.o-kuru { animation: none; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #17141a;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.stage {
position: relative;
}
.icon {
width: 60px;
height: 60px;
border: 0;
border-radius: 50%;
display: grid;
place-items: center;
background: rgba(255, 247, 230, 0.1);
color: #fff7e6;
cursor: pointer;
}
.tag {
position: absolute;
top: 16px;
right: 16px;
padding: 4px 12px;
border-radius: 8px;
background: rgba(255, 255, 255, 0.12);
color: #fff7e6;
font-weight: 700;
font-size: 12px;
line-height: 1;
font-family: inherit;
letter-spacing: 0.04em;
}
.o-kuru {
animation: o-kuru 1.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes o-kuru {
0% {
transform: rotate(0deg);
}
55% {
transform: rotate(230deg);
}
80% {
transform: rotate(330deg);
}
100% {
transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: reduce) {
.o-kuru {
animation: none;
}
}import type { CSSProperties, MouseEvent } from "react";
import styles from "./SpinRefreshIcon.module.scss";
export type SpinRefreshIconProps = {
label?: string;
/** 한 바퀴 도는 데 걸리는 시간 (기본 1600ms) */
duration?: number;
easing?: string;
color?: string;
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
};
type Vars = CSSProperties & {
"--duration"?: string;
"--easing"?: string;
"--color"?: string;
};
export default function SpinRefreshIcon({
label = "새로고침",
duration = 1600,
easing = "cubic-bezier(.65,0,.35,1)",
color = "#fff7e6",
onClick,
}: SpinRefreshIconProps) {
const vars: Vars = {
"--duration": `${duration}ms`,
"--easing": easing,
"--color": color,
};
return (
<button type="button" className={styles.icon} style={vars} aria-label={label} onClick={onClick}>
<svg viewBox="0 0 24 24" width="28" height="28" aria-hidden="true">
<path d="M20 12a8 8 0 1 1-2.34-5.66" fill="none" stroke="currentColor" strokeWidth={2.4} strokeLinecap="round" />
<path d="M20 4v5h-5" fill="none" stroke="currentColor" strokeWidth={2.4} strokeLinecap="round" strokeLinejoin="round" />
</svg>
</button>
);
}05 빙글빙글 도는(くるくる) — 측정 누적면적 0.403% · 움직인 프레임 23/23GODRICH 원작 · zip 에 SCSS·React 포함 · CSS 통통 튀는 애니메이션 9종 — 한 줄 복붙으로
이 데모가 속한 글
CSS 통통 튀는 애니메이션 9종 — 한 줄 복붙으로CSS 통통 튀는 애니메이션은 요소를 그냥 나타나게 하지 않고 뜨고, 튕기고, 떨고, 흔들리게 만들어 살아 있는 느낌을 주는 움직임입니다. 흔한 영어 이름 대신 둥실둥실·포용·푸루푸루 같은 의성어로 아홉 개를 골랐고 이 글의 데모 전부 보기


