06パーツ分解・組み立て
4枚に重なった部品がスクロールに従って四方へ散らばり中身を見せてから、再び一か所に集まって完成品として重なります。
使いどころハードウェアやキット、レイヤー構造を説明する製品詳細や、中に何が入っているかを見せる紹介区間
animation-timeline: scroll()translaterotate

<main class="stage">
<div class="ex is-demo">
<div class="ex__scroller">
<div class="ex__pad">
<div class="ex__pin">
<div class="ex__stack">
<div class="ex__part ex__part--1"><span class="ex__tag">上板</span></div>
<div class="ex__part ex__part--2">
<svg viewBox="0 0 256 256" width="16" height="16" aria-hidden="true"><g fill="currentColor"><path d="M200 48H56a8 8 0 0 0-8 8v144a8 8 0 0 0 8 8h144a8 8 0 0 0 8-8V56a8 8 0 0 0-8-8m-48 104h-48v-48h48Z" opacity=".2"/><path d="M152 96h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8m-8 48h-32v-32h32Zm88 0h-16v-32h16a8 8 0 0 0 0-16h-16V56a16 16 0 0 0-16-16h-40V24a8 8 0 0 0-16 0v16h-32V24a8 8 0 0 0-16 0v16H56a16 16 0 0 0-16 16v40H24a8 8 0 0 0 0 16h16v32H24a8 8 0 0 0 0 16h16v40a16 16 0 0 0 16 16h40v16a8 8 0 0 0 16 0v-16h32v16a8 8 0 0 0 16 0v-16h40a16 16 0 0 0 16-16v-40h16a8 8 0 0 0 0-16m-32 56H56V56h144z"/></g></svg>
<span class="ex__tag">基板</span>
</div>
<div class="ex__part ex__part--3"><span class="ex__tag">フレーム</span></div>
<div class="ex__part ex__part--4"><span class="ex__tag">底板</span></div>
</div>
</div>
</div>
</div>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: 1s; // alternate 라 한 바퀴(분해 → 조립)는 2s
// 가운데가 가장 빠른 곡선 — 대표 이미지가 반쯤 벌어진(이름표도 보이는) 장면으로 뽑힌다
$easing: cubic-bezier(.5, 0, .5, 1);
$color: $subject-ink;
@include stage($stage-yellow);
.ex {
--h: clamp(148px, 58vh, 176px);
width: min(340px, 92vw);
}
.ex__scroller {
height: var(--h);
overflow-y: auto;
scrollbar-width: none;
&::-webkit-scrollbar { display: none; }
}
// ⚠ 여기는 padding-bottom 이 아니라 height 다. sticky 가 붙어 있을 수 있는 범위는 부모의
// **콘텐츠 박스**라, padding 으로만 늘린 자리는 안 쳐준다 — 창이 곧바로 위로 흘러나간다 (실측)
.ex__pad { height: calc(var(--h) * 2.2); }
.ex__pin {
position: sticky;
top: 0;
display: grid;
place-items: center;
height: var(--h);
}
.ex__stack {
position: relative;
width: 184px;
height: 120px;
}
.ex__part {
position: absolute;
top: 48px;
left: 0;
display: flex;
align-items: center;
justify-content: center;
gap: $sp-2;
width: 184px;
height: 24px;
border: 2px solid $color;
border-radius: $r-sm;
background: $subject-cream;
color: $color;
animation-duration: 1s;
animation-timing-function: $easing;
animation-fill-mode: both;
animation-timeline: scroll(nearest block);
}
// ── 실제 동작: 스크롤 진행이 곧 분해 정도. 네 판이 서로 다른 방향으로 벌어진다 ──
.ex__part--1 { animation-name: ex-p1; background: $subject-pink; }
.ex__part--2 { animation-name: ex-p2; }
.ex__part--3 { animation-name: ex-p3; }
.ex__part--4 { animation-name: ex-p4; background: $subject-sky; }
@keyframes ex-p1 {
from { transform: translate(0, -6px) rotate(0deg); }
to { transform: translate(-16px, -54px) rotate(-7deg); }
}
@keyframes ex-p2 {
from { transform: translate(0, -2px) rotate(0deg); }
to { transform: translate(12px, -18px) rotate(4deg); }
}
@keyframes ex-p3 {
from { transform: translate(0, 2px) rotate(0deg); }
to { transform: translate(-12px, 18px) rotate(-4deg); }
}
@keyframes ex-p4 {
from { transform: translate(0, 6px) rotate(0deg); }
to { transform: translate(16px, 54px) rotate(7deg); }
}
// 이름표는 판이 벌어진 만큼만 보인다 — 포개져 있을 땐 글자가 겹치지 않는다
.ex__tag {
font-size: 11px;
line-height: 14px;
font-weight: 700;
opacity: 0;
animation-name: ex-tag;
animation-duration: 1s;
animation-timing-function: linear;
animation-fill-mode: both;
animation-timeline: scroll(nearest block);
}
@keyframes ex-tag {
0%, 10% { opacity: 0; }
38%, 100% { opacity: 1; }
}
// ── 격자 미리보기 루프 — 같은 분해를 시간으로 돌렸다 되감는다 ──
.ex.is-demo .ex__part,
.ex.is-demo .ex__tag {
animation-duration: $duration;
animation-direction: alternate;
animation-iteration-count: infinite;
animation-timeline: auto;
}
@media (prefers-reduced-motion: reduce) {
.ex__part { animation: none !important; }
.ex__part--1 { transform: translate(-16px, -54px); }
.ex__part--2 { transform: translate(12px, -18px); }
.ex__part--3 { transform: translate(-12px, 18px); }
.ex__part--4 { transform: translate(16px, 54px); }
.ex__tag { animation: none !important; opacity: 1; }
}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);
}
.ex {
--h: clamp(148px, 58vh, 176px);
width: min(340px, 92vw);
}
.ex__scroller {
height: var(--h);
overflow-y: auto;
scrollbar-width: none;
}
.ex__scroller::-webkit-scrollbar {
display: none;
}
.ex__pad {
height: calc(var(--h) * 2.2);
}
.ex__pin {
position: sticky;
top: 0;
display: grid;
place-items: center;
height: var(--h);
}
.ex__stack {
position: relative;
width: 184px;
height: 120px;
}
.ex__part {
position: absolute;
top: 48px;
left: 0;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
width: 184px;
height: 24px;
border: 2px solid #17141a;
border-radius: 8px;
background: #fff7e6;
color: #17141a;
animation-duration: 1s;
animation-timing-function: cubic-bezier(0.5, 0, 0.5, 1);
animation-fill-mode: both;
animation-timeline: scroll(nearest block);
}
.ex__part--1 {
animation-name: ex-p1;
background: #ff9ebb;
}
.ex__part--2 {
animation-name: ex-p2;
}
.ex__part--3 {
animation-name: ex-p3;
}
.ex__part--4 {
animation-name: ex-p4;
background: #6ec8ff;
}
@keyframes ex-p1 {
from {
transform: translate(0, -6px) rotate(0deg);
}
to {
transform: translate(-16px, -54px) rotate(-7deg);
}
}
@keyframes ex-p2 {
from {
transform: translate(0, -2px) rotate(0deg);
}
to {
transform: translate(12px, -18px) rotate(4deg);
}
}
@keyframes ex-p3 {
from {
transform: translate(0, 2px) rotate(0deg);
}
to {
transform: translate(-12px, 18px) rotate(-4deg);
}
}
@keyframes ex-p4 {
from {
transform: translate(0, 6px) rotate(0deg);
}
to {
transform: translate(16px, 54px) rotate(7deg);
}
}
.ex__tag {
font-size: 11px;
line-height: 14px;
font-weight: 700;
opacity: 0;
animation-name: ex-tag;
animation-duration: 1s;
animation-timing-function: linear;
animation-fill-mode: both;
animation-timeline: scroll(nearest block);
}
@keyframes ex-tag {
0%, 10% {
opacity: 0;
}
38%, 100% {
opacity: 1;
}
}
.ex.is-demo .ex__part,
.ex.is-demo .ex__tag {
animation-duration: 1s;
animation-direction: alternate;
animation-iteration-count: infinite;
animation-timeline: auto;
}
@media (prefers-reduced-motion: reduce) {
.ex__part {
animation: none !important;
}
.ex__part--1 {
transform: translate(-16px, -54px);
}
.ex__part--2 {
transform: translate(12px, -18px);
}
.ex__part--3 {
transform: translate(-12px, 18px);
}
.ex__part--4 {
transform: translate(16px, 54px);
}
.ex__tag {
animation: none !important;
opacity: 1;
}
}// 실제 동작은 CSS 만: 부품마다 animation-timeline: scroll() 이 걸려 있어 스크롤 진행이 곧 분해 정도다.
var r = document.querySelector('.ex');
var s = r.querySelector('.ex__scroller');
function stopDemo(){ r.classList.remove('is-demo'); }
r.addEventListener('pointerdown', stopDemo);
s.addEventListener('scroll', stopDemo, { passive: true });import type { CSSProperties, ReactNode } from "react";
import styles from "./ExplodedParts.module.scss";
export type ExplodedPartsProps = {
parts?: string[];
preview?: boolean;
duration?: number;
easing?: string;
color?: string;
};
type Vars = CSSProperties & { "--duration"?: string; "--easing"?: string; "--color"?: string };
const IconCpu = (): ReactNode => (
<svg viewBox="0 0 256 256" width="16" height="16" aria-hidden="true"><g fill="currentColor"><path d="M200 48H56a8 8 0 0 0-8 8v144a8 8 0 0 0 8 8h144a8 8 0 0 0 8-8V56a8 8 0 0 0-8-8m-48 104h-48v-48h48Z" opacity=".2"/><path d="M152 96h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8m-8 48h-32v-32h32Zm88 0h-16v-32h16a8 8 0 0 0 0-16h-16V56a16 16 0 0 0-16-16h-40V24a8 8 0 0 0-16 0v16h-32V24a8 8 0 0 0-16 0v16H56a16 16 0 0 0-16 16v40H24a8 8 0 0 0 0 16h16v32H24a8 8 0 0 0 0 16h16v40a16 16 0 0 0 16 16h40v16a8 8 0 0 0 16 0v-16h32v16a8 8 0 0 0 16 0v-16h40a16 16 0 0 0 16-16v-40h16a8 8 0 0 0 0-16m-32 56H56V56h144z"/></g></svg>
);
export default function ExplodedParts({
parts = ["Top plate", "Board", "Frame", "Base plate"],
preview = true,
duration = 1000,
easing = "cubic-bezier(.5, 0, .5, 1)",
color = "#17141a",
}: ExplodedPartsProps): ReactNode {
const vars: Vars = { "--duration": `${duration}ms`, "--easing": easing, "--color": color };
const cls = preview ? `${styles.ex} ${styles.isDemo}` : styles.ex;
return (
<div className={cls} style={vars}>
<div className={styles.scroller}>
<div className={styles.pad}>
<div className={styles.pin}>
<div className={styles.stack}>
{parts.map((p: string, i: number): ReactNode => (
<div className={`${styles.part} ${styles[`part${i + 1}`]}`} key={p}>
{i === 1 ? <IconCpu /> : null}
<span className={styles.tag}>{p}</span>
</div>
))}
</div>
</div>
</div>
</div>
</div>
);
}06 パーツ分解・組み立て — 計測 累積面積 18.662% · 動いたフレーム 23/23GODRICH オリジナル · SCSS と React は zip に同梱 · スクロールテリング 作り方 9選 — コピペOKのCSS
このデモが属する記事
スクロールテリング 作り方 9選 — コピペOKのCSSスクロールテリングとは、スクロール位置を時計の代わりに使い、ひとつの区間の中で場面を順番に切り替える組み立て方です。ここにある9つは効果の違いではなく、場面の組み立て方そのものが違います。 この記事のデモをすべて見る


