02보더 빔 타일
강조하고 싶은 타일에 마우스를 올리면 테두리를 따라 conic-gradient 빛줄기가 한 바퀴 돌아, 테두리 두께는 그대로 두고 얇은 빛만 회전합니다.
쓰임추천 요금제 카드, 신규 기능 하이라이트 타일
conic-gradientmask1.6s

<main class="stage">
<div class="bb-grid is-demo">
<div class="bb-tile bb-tile--a bb-focal">
<span class="bb-tile__tag">Featured</span>
<span class="bb-tile__sub">Pro plan</span>
</div>
<div class="bb-tile bb-tile--b">
<span class="bb-tile__tag">+12</span>
</div>
<div class="bb-tile bb-tile--c">
<span class="bb-tile__tag">Live</span>
</div>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: 1.6s;
$easing: linear;
$color: $subject-blue;
@include stage($stage-yellow);
.bb-grid {
width: min(340px, 90vw);
aspect-ratio: 340 / 190;
display: grid;
grid-template-columns: 1.2fr 1fr;
grid-template-rows: 1fr 1fr;
gap: $sp-2;
}
.bb-tile {
border-radius: $r-sm;
display: flex;
flex-direction: column;
justify-content: flex-end;
padding: $sp-3;
box-sizing: border-box;
color: $subject-cream;
background: $subject-ink;
font: 600 12px/1 -apple-system, "Segoe UI", sans-serif;
position: relative;
overflow: hidden;
}
.bb-tile--a { grid-row: 1 / 3; }
.bb-tile--b, .bb-tile--c { background: rgba(23, 20, 26, .78); }
.bb-tile__tag { font-size: 12px; opacity: .85; }
.bb-tile__sub { font-size: 18px; font-weight: 700; margin-top: $sp-1; }
// 빛줄기 — 두께 $sp-1 만큼만 링으로 보이게 mask. 회전은 transform 만 (그라디언트 각도 자체는 애니메이트하지 않는다)
.bb-focal::before {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
padding: $sp-1;
box-sizing: border-box;
background: conic-gradient(from 0deg, transparent 0 70%, $color 85%, transparent 100%);
-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
-webkit-mask-composite: xor;
mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
mask-composite: exclude;
pointer-events: none;
opacity: 0;
}
// 실사용: 진짜 마우스 호버
.bb-focal:hover::before { opacity: 1; animation: bb-spin $duration $easing infinite; }
@keyframes bb-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
// 데모 루프: is-demo 는 같은 회전을 무한 재생 (캡처용)
.bb-grid.is-demo .bb-focal::before { opacity: 1; animation: bb-spin $duration $easing infinite; }
@media (prefers-reduced-motion: reduce) {
.bb-focal:hover::before,
.bb-grid.is-demo .bb-focal::before { animation: none !important; }
}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);
}
.bb-grid {
width: min(340px, 90vw);
aspect-ratio: 340/190;
display: grid;
grid-template-columns: 1.2fr 1fr;
grid-template-rows: 1fr 1fr;
gap: 8px;
}
.bb-tile {
border-radius: 8px;
display: flex;
flex-direction: column;
justify-content: flex-end;
padding: 12px;
box-sizing: border-box;
color: #fff7e6;
background: #17141a;
font: 600 12px/1 -apple-system, "Segoe UI", sans-serif;
position: relative;
overflow: hidden;
}
.bb-tile--a {
grid-row: 1/3;
}
.bb-tile--b, .bb-tile--c {
background: rgba(23, 20, 26, 0.78);
}
.bb-tile__tag {
font-size: 12px;
opacity: 0.85;
}
.bb-tile__sub {
font-size: 18px;
font-weight: 700;
margin-top: 4px;
}
.bb-focal::before {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
padding: 4px;
box-sizing: border-box;
background: conic-gradient(from 0deg, transparent 0 70%, #2f6df6 85%, transparent 100%);
-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
-webkit-mask-composite: xor;
mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
mask-composite: exclude;
pointer-events: none;
opacity: 0;
}
.bb-focal:hover::before {
opacity: 1;
animation: bb-spin 1.6s linear infinite;
}
@keyframes bb-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.bb-grid.is-demo .bb-focal::before {
opacity: 1;
animation: bb-spin 1.6s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
.bb-focal:hover::before,
.bb-grid.is-demo .bb-focal::before {
animation: none !important;
}
}import { CSSProperties } from "react";
import styles from "./BorderBeamTile.module.scss";
type Vars = CSSProperties & {
"--duration"?: string;
"--easing"?: string;
"--color"?: string;
};
export interface BorderBeamTileProps {
duration?: string;
easing?: string;
color?: string;
}
export default function BorderBeamTile({
duration = "1.6s",
easing = "linear",
color = "#2f6df6",
}: BorderBeamTileProps) {
const style: Vars = {
"--duration": duration,
"--easing": easing,
"--color": color,
};
return (
<div className={styles.grid} style={style}>
<div className={`${styles.tile} ${styles.tileA} ${styles.focal}`}>
<span className={styles.tag}>Featured</span>
<span className={styles.sub}>Pro plan</span>
</div>
<div className={`${styles.tile} ${styles.tileB}`}>
<span className={styles.tag}>+12</span>
</div>
<div className={`${styles.tile} ${styles.tileC}`}>
<span className={styles.tag}>Live</span>
</div>
</div>
);
}02 보더 빔 타일 — 측정 누적면적 5.527% · 움직인 프레임 23/23GODRICH 원작 · zip 에 SCSS·React 포함 · 벤토 그리드 레이아웃 호버 애니메이션 9종
이 데모가 속한 글
벤토 그리드 레이아웃 호버 애니메이션 9종포트폴리오나 제품 소개 페이지에서 크고 작은 네모 칸이 사진 콜라주처럼 이어 붙은 레이아웃을 본 적 있으신가요? 이런 벤토 그리드 레이아웃에 마우스를 올렸을 때 칸마다 살짝 반응하게 만드는 CSS 코드를 아홉 가지로 이 글의 데모 전부 보기


