06노이즈 그레인
아주 작은 repeating-conic-gradient 타일을 촘촘히 반복시키고 background-position 을 steps() 로 매 프레임 건너뛰게 해 필름 그레인처럼 지글거리는 질감을 만든다.
쓰임다크 히어로 텍스처 오버레이, 프리미엄 카드 배경 노이즈
repeating-conic-gradientsteps()background-position

<main class="stage">
<p class="hint">프리미엄 카드</p>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: $dur-loop; // 그레인 지글거림이 한 바퀴 도는 시간
$easing: steps(40); // 프레임을 건너뛰어야 그레인처럼 보인다 (부드러운 이징 금지)
$color: $stage-ink; // 그레인 점 색
// ── 데모 무대 ──────────────────────────────────────────
@include stage($stage-yellow);
.stage {
position: relative;
overflow: hidden;
}
// 아주 작은 conic-gradient 타일을 반복시키고 background-position 을 steps() 로 매 프레임 건너뛴다
.stage::before {
content: "";
position: absolute;
inset: 0;
background-image: repeating-conic-gradient(from 0deg, rgba($color, .55) 0deg 90deg, transparent 90deg 180deg);
background-size: 3px 3px;
opacity: .35;
animation: grain $duration $easing infinite;
}
.hint {
position: relative;
margin: 0;
padding: 10px 20px;
border-radius: $r-pill;
background: rgba($stage-ink, .12);
color: $stage-ink;
font: 700 clamp(14px, 4vw, 18px)/1.3 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}
@keyframes grain {
from { background-position: 0 0; }
to { background-position: 117px 69px; }
}
@media (prefers-reduced-motion: reduce) {
.stage::before { animation: none; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #ffd23f;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.stage {
position: relative;
overflow: hidden;
}
.stage::before {
content: "";
position: absolute;
inset: 0;
background-image: repeating-conic-gradient(from 0deg, rgba(23, 20, 26, 0.55) 0deg 90deg, transparent 90deg 180deg);
background-size: 3px 3px;
opacity: 0.35;
animation: grain 2s steps(40) infinite;
}
.hint {
position: relative;
margin: 0;
padding: 10px 20px;
border-radius: 999px;
background: rgba(23, 20, 26, 0.12);
color: #17141a;
font: 700 clamp(14px, 4vw, 18px)/1.3 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}
@keyframes grain {
from {
background-position: 0 0;
}
to {
background-position: 117px 69px;
}
}
@media (prefers-reduced-motion: reduce) {
.stage::before {
animation: none;
}
}import type { CSSProperties, ReactNode } from "react";
import styles from "./NoiseGrainBg.module.scss";
export type NoiseGrainBgProps = {
children?: ReactNode;
/** 그레인 지글거림이 한 바퀴 도는 시간 (기본 2000ms) */
duration?: number;
/** 그레인 점 색 */
color?: string;
className?: string;
};
type Vars = CSSProperties & { "--duration"?: string; "--color"?: string };
export default function NoiseGrainBg({
children,
duration = 2000,
color = "#17141a",
className = "",
}: NoiseGrainBgProps) {
const vars: Vars = { "--duration": `${duration}ms`, "--color": color };
return (
<div className={`${styles.stage} ${className}`} style={vars}>
<div className={styles.grain} aria-hidden="true" />
{children}
</div>
);
}06 노이즈 그레인 — 측정 누적면적 99.705% · 움직인 프레임 21/23GODRICH 원작 · zip 에 SCSS·React 포함 · CSS 배경 애니메이션 9종 — 한 줄 복붙으로
이 데모가 속한 글
CSS 배경 애니메이션 9종 — 한 줄 복붙으로CSS 배경 애니메이션은 히어로 섹션이나 카드 뒤에서 이미지 파일 없이 그라데이션·격자·점·노이즈 같은 패턴을 계속 움직이게 만드는 기법입니다. 아홉 개를 모았는데, 그중 하나는 커서를 따라가는 스포트라이트라 마우스 이 글의 데모 전부 보기


