03Vòng holographic quanh huy hiệu xác thực
Ánh sáng cầu vồng chạy vòng quanh viền huy hiệu không ngừng, dùng conic-gradient để màu đổi theo góc như lá thiếc thật.
Dùng choHuy hiệu hàng chính hãng, dấu người bán đã xác minh, tem giới hạn cho merch
conic-gradientmask: radial-gradient@keyframes rotate

<main class="stage">
<div class="v-badge">
<span class="v-badge__ring" aria-hidden="true"></span>
<span class="v-badge__inner">
<span class="v-badge__check" aria-hidden="true">✓</span>
<span class="v-badge__label">Đã xác thực</span>
</span>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-loop; // 링이 한 바퀴 도는 시간
$easing: linear;
$color: $subject-blue; // 체크 아이콘 색
@include stage($stage-orange);
.v-badge {
position: relative;
width: min(120px, 40vw);
aspect-ratio: 1;
display: grid;
place-items: center;
}
.v-badge__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% - 8px), #000 calc(100% - 8px));
mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 8px));
animation: ring-spin $duration $easing infinite;
}
.v-badge__inner {
position: relative; z-index: 1;
width: 74%; aspect-ratio: 1;
border-radius: $r-pill;
background: $stage-paper;
box-shadow: $shadow-press;
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: $sp-1;
}
.v-badge__check { font-size: 22px; line-height: 1; color: $color; }
.v-badge__label { font-size: 10px; font-weight: 700; color: $stage-ink; font-family: inherit; }
@keyframes ring-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
.v-badge__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: #ff4d1f;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.v-badge {
position: relative;
width: min(120px, 40vw);
aspect-ratio: 1;
display: grid;
place-items: center;
}
.v-badge__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% - 8px), #000 calc(100% - 8px));
mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 8px));
animation: ring-spin 2s linear infinite;
}
.v-badge__inner {
position: relative;
z-index: 1;
width: 74%;
aspect-ratio: 1;
border-radius: 999px;
background: #ffffff;
box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
}
.v-badge__check {
font-size: 22px;
line-height: 1;
color: #2f6df6;
}
.v-badge__label {
font-size: 10px;
font-weight: 700;
color: #17141a;
font-family: inherit;
}
@keyframes ring-spin {
to {
transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: reduce) {
.v-badge__ring {
animation: none;
}
}import type { CSSProperties } from "react";
import styles from "./VerifiedBadgeRing.module.scss";
export type VerifiedBadgeRingProps = {
label: string;
/** 링이 한 바퀴 도는 시간 (기본 2000ms) */
duration?: number;
easing?: string;
/** 체크 아이콘 색 */
color?: string;
};
type Vars = CSSProperties & { "--duration"?: string; "--easing"?: string; "--color"?: string };
export default function VerifiedBadgeRing({
label,
duration = 2000,
easing = "linear",
color = "#2f6df6",
}: VerifiedBadgeRingProps) {
const vars: Vars = { "--duration": `${duration}ms`, "--easing": easing, "--color": color };
return (
<div className={styles.badge} style={vars}>
<span className={styles.ring} aria-hidden="true" />
<span className={styles.inner}>
<span className={styles.check} aria-hidden="true">✓</span>
<span className={styles.label}>{label}</span>
</span>
</div>
);
}03 Vòng holographic quanh huy hiệu xác thực — Diện tích đo được 2.312% · 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 Holographic Card Effect copy-paste
Bài viết chứa demo này
9 hiệu ứng CSS Holographic Card Effect copy-pasteHiệu ứng css holographic card effect giả lập cách lá thiếc phản chiếu ánh sáng theo góc nhìn, chỉ bằng CSS — lấp lánh nh Xem tất cả demo trong bài này


