05아이콘 글로우 링
아이콘을 감싼 `.ring--a`·`.ring--b` 두 원이 반 주기씩 어긋나 scale 로 커지며 opacity 가 0 까지 옅어지는 걸 반복해, 신호가 퍼져나가는 것처럼 보인다.
쓰임알림·활성 상태 아이콘, 라이브 인디케이터
animation-delaybox-shadow 링scale · opacity
<main class="stage is-demo">
<span class="icon-wrap" aria-hidden="true">
<span class="ring ring--a"></span>
<span class="ring ring--b"></span>
<span class="icon"></span>
</span>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: $dur-loop; // 2s — 링 한 번 퍼지는 시간
$easing: ease-out;
$color: #ffb020; // 네온 앰버 (알림)
@include stage($stage-ink);
.icon-wrap { position: relative; width: 72px; height: 72px; display: grid; place-items: center; }
.icon {
width: 30px; height: 30px; border-radius: 50%;
background: $color;
box-shadow: 0 0 $sp-2 $color, 0 0 $sp-6 rgba($color, .6);
}
.ring {
position: absolute; inset: 0;
border-radius: 50%;
border: 2px solid $color;
opacity: 0;
}
// transform·opacity 만 — 이 항목은 순수하게 원칙대로다
.stage.is-demo .ring--a { animation: ring $duration $easing infinite; }
.stage.is-demo .ring--b { animation: ring $duration $easing infinite; animation-delay: $duration * .5; }
@keyframes ring {
0% { transform: scale(.7); opacity: .8; }
70% { transform: scale(1.7); opacity: 0; }
100% { transform: scale(1.7); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
.stage.is-demo .ring--a, .stage.is-demo .ring--b { animation: none; opacity: 0; }
}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);
}
.icon-wrap {
position: relative;
width: 72px;
height: 72px;
display: grid;
place-items: center;
}
.icon {
width: 30px;
height: 30px;
border-radius: 50%;
background: #ffb020;
box-shadow: 0 0 8px #ffb020, 0 0 24px rgba(255, 176, 32, 0.6);
}
.ring {
position: absolute;
inset: 0;
border-radius: 50%;
border: 2px solid #ffb020;
opacity: 0;
}
.stage.is-demo .ring--a {
animation: ring 2s ease-out infinite;
}
.stage.is-demo .ring--b {
animation: ring 2s ease-out infinite;
animation-delay: 1s;
}
@keyframes ring {
0% {
transform: scale(0.7);
opacity: 0.8;
}
70% {
transform: scale(1.7);
opacity: 0;
}
100% {
transform: scale(1.7);
opacity: 0;
}
}
@media (prefers-reduced-motion: reduce) {
.stage.is-demo .ring--a, .stage.is-demo .ring--b {
animation: none;
opacity: 0;
}
}import type { CSSProperties } from "react";
import styles from "./IconGlowRing.module.scss";
export type IconGlowRingProps = {
/** 링 한 번 퍼지는 시간 (기본 2000ms) */
duration?: number;
color?: string;
};
export default function IconGlowRing({ duration = 2000, color = "#ffb020" }: IconGlowRingProps) {
const vars: CSSProperties = { "--duration": `${duration}ms`, "--color": color } as CSSProperties;
return (
<span className={styles.wrap} style={vars} aria-hidden="true">
<span className={`${styles.ring} ${styles.ringA}`} />
<span className={`${styles.ring} ${styles.ringB}`} />
<span className={styles.icon} />
</span>
);
}05 아이콘 글로우 링 — 측정 누적면적 6.007% · 움직인 프레임 23/23GODRICH 원작 · zip 에 SCSS·React 포함 · CSS 글로우 효과 9종 — 네온사인처럼 빛나는 버튼과 텍스트
이 데모가 속한 글
CSS 글로우 효과 9종 — 네온사인처럼 빛나는 버튼과 텍스트CSS 글로우 효과는 버튼이나 글자 주위에 빛이 번지는 것처럼 보이게 만드는 장식이다. 네온사인처럼 빛나 보이지만 이미지나 동영상이 아니라 코드 몇 줄로 만든다. 한 줄 복붙으로 그대로 옮겨 쓸 수 있는 CSS 글로 이 글의 데모 전부 보기


