04모서리 브래킷 프레임
카드 네 귀퉁이에 짧게 접힌 브래킷 네 개가 평소엔 안쪽에 작게 붙어 있다가, 호버하면 카드 테두리 쪽으로 자라나 카메라 포커스처럼 카드를 감싼다.
쓰임선택 가능한 이미지 카드, 갤러리 그리드
transform: scaleopacity.corner 4개

<main class="stage">
<article class="card is-demo" tabindex="0">
<span class="corner corner--tl" aria-hidden="true"></span>
<span class="corner corner--tr" aria-hidden="true"></span>
<span class="corner corner--bl" aria-hidden="true"></span>
<span class="corner corner--br" aria-hidden="true"></span>
<span class="card__media" aria-hidden="true"></span>
<div class="card__body">
<h3 class="card__title">가을 컬렉션</h3>
</div>
</article>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-quick; // 브래킷이 자라는 시간
$easing: $ease-out;
$color: $subject-blue; // 브래킷 색
@include stage($stage-paper);
.stage { padding: clamp(8px, 2.4vw, 16px); }
.card {
position: relative;
width: min(150px, 48vw);
aspect-ratio: 4 / 3;
border-radius: $r-card;
overflow: hidden;
background: $stage-ink;
outline: none;
cursor: pointer;
}
.card__media {
position: absolute; inset: 0;
background: linear-gradient(155deg, $color 0%, $stage-ink 100%);
}
.card__body {
position: absolute; left: 0; right: 0; bottom: 0;
padding: $sp-2 $sp-3;
}
.card__title { margin: 0; font-weight: 700; font-size: clamp(11px, 3.2vw, 13px); line-height: 1.3; font-family: inherit; color: $stage-paper; }
.corner {
position: absolute;
width: $sp-4;
height: $sp-4;
border: 2px solid $color;
opacity: 0;
z-index: 2;
transition: transform $duration $easing, opacity $duration $easing;
}
.corner--tl { top: $sp-2; left: $sp-2; border-right: none; border-bottom: none; transform: translate($sp-2, $sp-2); }
.corner--tr { top: $sp-2; right: $sp-2; border-left: none; border-bottom: none; transform: translate(-$sp-2, $sp-2); }
.corner--bl { bottom: $sp-2; left: $sp-2; border-right: none; border-top: none; transform: translate($sp-2, -$sp-2); }
.corner--br { bottom: $sp-2; right: $sp-2; border-left: none; border-top: none; transform: translate(-$sp-2, -$sp-2); }
.card:hover .corner,
.card:focus-visible .corner,
.card:active .corner {
opacity: 1;
transform: translate(0, 0);
}
.card.is-demo .corner { animation: frame-loop $dur-loop $easing infinite; }
@keyframes frame-loop {
0%, 15% { opacity: 0; }
45%, 75% { opacity: 1; transform: translate(0, 0); }
100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
.corner { transition: none; }
.card.is-demo .corner { animation: none; opacity: 1; transform: translate(0, 0); }
}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);
}
.stage {
padding: clamp(8px, 2.4vw, 16px);
}
.card {
position: relative;
width: min(150px, 48vw);
aspect-ratio: 4/3;
border-radius: 16px;
overflow: hidden;
background: #17141a;
outline: none;
cursor: pointer;
}
.card__media {
position: absolute;
inset: 0;
background: linear-gradient(155deg, #2f6df6 0%, #17141a 100%);
}
.card__body {
position: absolute;
left: 0;
right: 0;
bottom: 0;
padding: 8px 12px;
}
.card__title {
margin: 0;
font-weight: 700;
font-size: clamp(11px, 3.2vw, 13px);
line-height: 1.3;
font-family: inherit;
color: #ffffff;
}
.corner {
position: absolute;
width: 16px;
height: 16px;
border: 2px solid #2f6df6;
opacity: 0;
z-index: 2;
transition: transform 220ms ease-out, opacity 220ms ease-out;
}
.corner--tl {
top: 8px;
left: 8px;
border-right: none;
border-bottom: none;
transform: translate(8px, 8px);
}
.corner--tr {
top: 8px;
right: 8px;
border-left: none;
border-bottom: none;
transform: translate(-8px, 8px);
}
.corner--bl {
bottom: 8px;
left: 8px;
border-right: none;
border-top: none;
transform: translate(8px, -8px);
}
.corner--br {
bottom: 8px;
right: 8px;
border-left: none;
border-top: none;
transform: translate(-8px, -8px);
}
.card:hover .corner,
.card:focus-visible .corner,
.card:active .corner {
opacity: 1;
transform: translate(0, 0);
}
.card.is-demo .corner {
animation: frame-loop 2s ease-out infinite;
}
@keyframes frame-loop {
0%, 15% {
opacity: 0;
}
45%, 75% {
opacity: 1;
transform: translate(0, 0);
}
100% {
opacity: 0;
}
}
@media (prefers-reduced-motion: reduce) {
.corner {
transition: none;
}
.card.is-demo .corner {
animation: none;
opacity: 1;
transform: translate(0, 0);
}
}import type { CSSProperties } from "react";
import styles from "./CornerFrameCard.module.scss";
export type CornerFrameCardProps = {
title: string;
/** 브래킷이 자라는 시간 (기본 220ms) */
duration?: number;
easing?: string;
/** 브래킷 색 */
color?: string;
};
type Vars = CSSProperties & { "--duration"?: string; "--easing"?: string; "--color"?: string };
export default function CornerFrameCard({
title,
duration = 220,
easing = "ease-out",
color = "#2f6df6",
}: CornerFrameCardProps) {
const vars: Vars = { "--duration": `${duration}ms`, "--easing": easing, "--color": color };
return (
<article className={styles.card} style={vars} tabIndex={0}>
<span className={`${styles.corner} ${styles.tl}`} aria-hidden="true" />
<span className={`${styles.corner} ${styles.tr}`} aria-hidden="true" />
<span className={`${styles.corner} ${styles.bl}`} aria-hidden="true" />
<span className={`${styles.corner} ${styles.br}`} aria-hidden="true" />
<span className={styles.media} aria-hidden="true" />
<div className={styles.body}>
<h3 className={styles.title}>{title}</h3>
</div>
</article>
);
}04 모서리 브래킷 프레임 — 측정 누적면적 0.773% · 움직인 프레임 13/23GODRICH 원작 · zip 에 SCSS·React 포함 · CSS 카드 효과 9가지 — 호버 인터랙션 모음
이 데모가 속한 글
CSS 카드 효과 9가지 — 호버 인터랙션 모음CSS 카드 효과는 마우스를 올리거나 카드를 선택했을 때 상품·포스트 카드가 살짝 움직이면서 정보를 더 보여주는 짧은 시각 변화입니다. 상품·포스트 카드에 바로 붙일 수 있는 아홉 가지를 실제로 렌더링해서 모았고, 이 글의 데모 전부 보기


