06책장 넘기기
카드 오른쪽 끝을 기준으로 책장을 넘기듯 회전하며 다음 카드가 드러납니다. 그림자가 함께 움직여 종이가 들리는 느낌을 줍니다.
쓰임카탈로그·포트폴리오 페이지 넘기기, 슬라이드형 소개 카드
rotateYtransform-origin: rightbox-shadow

<main class="stage">
<div class="bp-book is-demo">
<div class="bp-page-under">02</div>
<div class="bp-page">
<div class="bp-page__face bp-page__face--front">01</div>
<div class="bp-page__face bp-page__face--back">01</div>
</div>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: $dur-enter;
$easing: $ease-spring;
$color: $subject-cream;
@include stage($stage-yellow);
.bp-book {
position: relative;
width: 150px;
height: 108px;
perspective: 900px;
}
.bp-page-under,
.bp-page__face {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: $r-card;
font: 700 22px/1 -apple-system, "Segoe UI", sans-serif;
color: $subject-ink;
}
.bp-page-under { background: $color; box-shadow: $shadow-press; }
.bp-page {
position: absolute;
inset: 0;
transform-style: preserve-3d;
transform-origin: right center; // 규칙8: 오른쪽 책등 경첩 넘김
transition: transform $duration $easing, box-shadow $duration $easing;
border-radius: $r-card;
box-shadow: $shadow-raised;
}
.bp-page__face { backface-visibility: hidden; }
.bp-page__face--front { background: $color; }
.bp-page__face--back { background: rgba(23, 20, 26, .78); color: $subject-cream; transform: rotateY(180deg); }
// 데모 루프: 오른쪽 끝을 축으로 페이지가 넘어간다
@keyframes bp-turn {
0%, 30% { transform: rotateY(0); }
70%, 100% { transform: rotateY(-155deg); }
}
.bp-book.is-demo .bp-page { animation: bp-turn $duration * 2.6 $easing infinite; }
@media (prefers-reduced-motion: reduce) {
.bp-book.is-demo .bp-page { animation: none !important; transition: none !important; transform: 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);
}
.bp-book {
position: relative;
width: 150px;
height: 108px;
perspective: 900px;
}
.bp-page-under,
.bp-page__face {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: 16px;
font: 700 22px/1 -apple-system, "Segoe UI", sans-serif;
color: #17141a;
}
.bp-page-under {
background: #fff7e6;
box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}
.bp-page {
position: absolute;
inset: 0;
transform-style: preserve-3d;
transform-origin: right center;
transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
border-radius: 16px;
box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}
.bp-page__face {
backface-visibility: hidden;
}
.bp-page__face--front {
background: #fff7e6;
}
.bp-page__face--back {
background: rgba(23, 20, 26, 0.78);
color: #fff7e6;
transform: rotateY(180deg);
}
@keyframes bp-turn {
0%, 30% {
transform: rotateY(0);
}
70%, 100% {
transform: rotateY(-155deg);
}
}
.bp-book.is-demo .bp-page {
animation: bp-turn 1560ms cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}
@media (prefers-reduced-motion: reduce) {
.bp-book.is-demo .bp-page {
animation: none !important;
transition: none !important;
transform: none !important;
}
}import { CSSProperties, useState } from "react";
import styles from "./PageTurn.module.scss";
export interface PageTurnProps {
duration?: string;
easing?: string;
current?: string;
next?: string;
}
export default function PageTurn({
duration = "600ms",
easing = "cubic-bezier(.2, .8, .2, 1)",
current = "01",
next = "02",
}: PageTurnProps) {
const [turned, setTurned] = useState(false);
const style = { "--duration": duration, "--easing": easing } as CSSProperties;
return (
<div
className={styles.book}
style={style}
role="button"
tabIndex={0}
aria-pressed={turned}
onClick={() => setTurned((v) => !v)}
onKeyDown={(e: { key: string }) => (e.key === "Enter" || e.key === " ") && setTurned((v) => !v)}
>
<div className={styles.under}>{next}</div>
<div className={`${styles.page} ${turned ? styles.turned : ""}`}>
<div className={`${styles.face} ${styles.front}`}>{current}</div>
<div className={`${styles.face} ${styles.back}`}>{current}</div>
</div>
</div>
);
}06 책장 넘기기 — 측정 누적면적 16.329% · 움직인 프레임 9/23GODRICH 원작 · zip 에 SCSS·React 포함 · CSS 카드 뒤집기 애니메이션 9종 (복붙 20줄)
이 데모가 속한 글
CSS 카드 뒤집기 애니메이션 9종 (복붙 20줄)CSS 카드 뒤집기는 마우스를 올리거나 클릭했을 때 카드가 휙 돌아가거나 반으로 접히면서 반대쪽 내용을 보여주는 애니메이션입니다. 코드를 몰라도 아래 데모에 마우스를 올려보면 바로 무슨 효과인지 알 수 있습니다. 이 이 글의 데모 전부 보기


