08아바타 홀로그램 상태 링
프로필 아바타 테두리에 conic-gradient 링이 천천히 돌아 '프리미엄'·'온라인' 같은 특별한 상태를 표시합니다.
쓰임프리미엄 회원 아바타 테두리, 라이브 방송 중 표시, VIP 프로필 뱃지
conic-gradient 링mask: radial-gradient@keyframes rotate
<main class="stage">
<div class="avatar-wrap">
<span class="avatar-wrap__ring" aria-hidden="true"></span>
<span class="avatar-wrap__avatar" role="img" aria-label="프로필 이미지"></span>
<span class="avatar-wrap__tag">PRO</span>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-loop; // 링이 한 바퀴 도는 시간
$easing: linear;
$color: $subject-blue; // 아바타 배경 그라디언트 색
@include stage($stage-paper);
.avatar-wrap {
position: relative;
width: min(108px, 36vw);
aspect-ratio: 1;
display: grid;
place-items: center;
}
.avatar-wrap__ring {
position: absolute; inset: 0;
border-radius: $r-pill;
background: conic-gradient(from 0deg, #dcb9d1, #b9d9dc, #c8dcb9, #dcdab9, #dcb9d1);
-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
animation: ring-spin $duration $easing infinite;
}
.avatar-wrap__avatar {
position: relative; z-index: 1;
width: 76%; aspect-ratio: 1;
border-radius: $r-pill;
background: linear-gradient(155deg, $color 0%, $stage-ink 100%);
}
.avatar-wrap__tag {
position: absolute; bottom: -2px; right: 2px; z-index: 2;
font-size: 9px; font-weight: 800; color: $stage-ink;
background: $stage-paper; padding: $sp-1 $sp-2; border-radius: $r-pill;
box-shadow: $shadow-press;
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
.avatar-wrap__ring { animation: none; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #ffffff;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.avatar-wrap {
position: relative;
width: min(108px, 36vw);
aspect-ratio: 1;
display: grid;
place-items: center;
}
.avatar-wrap__ring {
position: absolute;
inset: 0;
border-radius: 999px;
background: conic-gradient(from 0deg, #dcb9d1, #b9d9dc, #c8dcb9, #dcdab9, #dcb9d1);
-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
animation: ring-spin 2s linear infinite;
}
.avatar-wrap__avatar {
position: relative;
z-index: 1;
width: 76%;
aspect-ratio: 1;
border-radius: 999px;
background: linear-gradient(155deg, #2f6df6 0%, #17141a 100%);
}
.avatar-wrap__tag {
position: absolute;
bottom: -2px;
right: 2px;
z-index: 2;
font-size: 9px;
font-weight: 800;
color: #17141a;
background: #ffffff;
padding: 4px 8px;
border-radius: 999px;
box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}
@keyframes ring-spin {
to {
transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: reduce) {
.avatar-wrap__ring {
animation: none;
}
}import type { CSSProperties } from "react";
import styles from "./AvatarStatusRing.module.scss";
export type AvatarStatusRingProps = {
alt: string;
tag: string;
/** 링이 한 바퀴 도는 시간 (기본 2000ms) */
duration?: number;
easing?: string;
/** 아바타 배경 그라디언트 색 */
color?: string;
};
type Vars = CSSProperties & { "--duration"?: string; "--easing"?: string; "--color"?: string };
export default function AvatarStatusRing({
alt,
tag,
duration = 2000,
easing = "linear",
color = "#2f6df6",
}: AvatarStatusRingProps) {
const vars: Vars = { "--duration": `${duration}ms`, "--easing": easing, "--color": color };
return (
<div className={styles.wrap} style={vars}>
<span className={styles.ring} aria-hidden="true" />
<span className={styles.avatar} role="img" aria-label={alt} />
<span className={styles.tag}>{tag}</span>
</div>
);
}08 아바타 홀로그램 상태 링 — 측정 누적면적 1.451% · 움직인 프레임 23/23GODRICH 원작 · zip 에 SCSS·React 포함 · CSS 홀로그램 카드 효과 9가지 — 스티커·뱃지·티켓
이 데모가 속한 글
CSS 홀로그램 카드 효과 9가지 — 스티커·뱃지·티켓CSS 홀로그램 효과는 각도에 따라 빛이 다르게 반사되는 홀로그램 재질을, CSS 그라디언트와 애니메이션만으로 흉내 내는 기법입니다. 포켓몬 카드처럼 빛나는 표면을 눈으로는 자주 보지만 막상 코드로 옮기려면 막막한 이 글의 데모 전부 보기


