03원형 마스크 확장
사진 정중앙에서 시작한 원형 clip-path가 반지름 0%에서 75%까지 커지며 카메라 조리개가 열리듯 사진을 드러냅니다.
쓰임카테고리 커버 카드
clip-pathcircle()550ms

<main class="stage">
<div class="cm-frame cm-focal is-demo">
<div class="cm-photo"></div>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: $dur-enter;
$easing: $ease-out;
$color: $subject-cream;
@include stage($stage-orange);
.cm-frame {
position: relative;
width: min(260px, 78vw);
aspect-ratio: 8 / 5;
border-radius: $r-card;
overflow: hidden;
box-shadow: $shadow-raised;
background: $subject-ink; // 아직 안 드러난 부분이 보이는 바탕
}
.cm-photo {
position: absolute;
inset: 0;
background:
radial-gradient(100px circle at 60% 35%, rgba(255, 255, 255, .55), transparent 58%),
linear-gradient(150deg, $subject-blue, $color 140%);
clip-path: circle(0% at 50% 50%);
}
// 실사용: 진짜 마우스 호버 — 정중앙에서 원형 clip-path 가 커지며 조리개처럼 열린다
.cm-photo { transition: clip-path $duration $easing; }
.cm-focal:hover .cm-photo { clip-path: circle(75% at 50% 50%); }
// 데모 루프
@keyframes cm-grow {
0%, 8% { clip-path: circle(0% at 50% 50%); }
45%, 60% { clip-path: circle(75% at 50% 50%); }
95%, 100% { clip-path: circle(0% at 50% 50%); }
}
.cm-frame.is-demo .cm-photo { animation: cm-grow $dur-loop $easing infinite; }
@media (prefers-reduced-motion: reduce) {
.cm-focal:hover .cm-photo,
.cm-frame.is-demo .cm-photo {
animation: none !important;
transition: none !important;
clip-path: circle(75% at 50% 50%) !important;
}
}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);
}
.cm-frame {
position: relative;
width: min(260px, 78vw);
aspect-ratio: 8/5;
border-radius: 16px;
overflow: hidden;
box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
background: #17141a;
}
.cm-photo {
position: absolute;
inset: 0;
background: radial-gradient(100px circle at 60% 35%, rgba(255, 255, 255, 0.55), transparent 58%), linear-gradient(150deg, #2f6df6, #fff7e6 140%);
clip-path: circle(0% at 50% 50%);
}
.cm-photo {
transition: clip-path 600ms ease-out;
}
.cm-focal:hover .cm-photo {
clip-path: circle(75% at 50% 50%);
}
@keyframes cm-grow {
0%, 8% {
clip-path: circle(0% at 50% 50%);
}
45%, 60% {
clip-path: circle(75% at 50% 50%);
}
95%, 100% {
clip-path: circle(0% at 50% 50%);
}
}
.cm-frame.is-demo .cm-photo {
animation: cm-grow 2s ease-out infinite;
}
@media (prefers-reduced-motion: reduce) {
.cm-focal:hover .cm-photo,
.cm-frame.is-demo .cm-photo {
animation: none !important;
transition: none !important;
clip-path: circle(75% at 50% 50%) !important;
}
}import { CSSProperties } from "react";
import styles from "./CircleMaskGrow.module.scss";
type Vars = CSSProperties & {
"--duration"?: string;
"--easing"?: string;
"--color"?: string;
};
export interface CircleMaskGrowProps {
duration?: string;
easing?: string;
color?: string;
}
export default function CircleMaskGrow({
duration = "550ms",
easing = "ease-out",
color = "#fff7e6",
}: CircleMaskGrowProps) {
const style: Vars = {
"--duration": duration,
"--easing": easing,
"--color": color,
};
return (
<div className={styles.frame} style={style}>
<div className={styles.photo} />
</div>
);
}03 원형 마스크 확장 — 측정 누적면적 29.122% · 움직인 프레임 17/23GODRICH 원작 · zip 에 SCSS·React 포함 · CSS 이미지 슬라이드 애니메이션 9종
이 데모가 속한 글
CSS 이미지 슬라이드 애니메이션 9종사진 위에 마우스를 올리면 커튼처럼 열리거나 원이 점점 커지며 드러나는 걸 본 적 있으신가요? 이런 CSS 이미지 슬라이드 애니메이션을 한 줄 복붙으로 쓸 수 있게 아홉 가지로 모았고, 그중 하나는 자바스크립트 없이 이 글의 데모 전부 보기


