08ばねで跳ねて現れる空スタックカード
カードをすべてめくると空状態の案内が出て、再補充を押すと新しいカードがばねで跳ね込んできます。
使いどころカード枯渇後の再読み込み案内
REFILL_COUNTREFILL_SPRING_STIFFNESSREFILL_SPRING_DAMPING

<main class="stage">
<div class="er is-demo" id="er">
<p class="er__caption">全部スワイプするとスプリングで弾んで補充されるカード</p>
<div class="er__scene" id="erScene">
<div class="er__empty" id="erEmpty" hidden>
<p class="er__empty-text">今日のカードは全部見ました</p>
<button class="er__refill" id="erRefill" type="button">補充</button>
</div>
<div class="er__card" id="erCard" tabindex="0" role="group" aria-roledescription="スワイプカード">
<p class="er__label" id="erLabel">夕方の散歩</p>
</div>
<button class="er__btn er__btn--nope" id="erNope" type="button" aria-label="いいえ">✕</button>
<button class="er__btn er__btn--like" id="erLike" type="button" aria-label="いいね">♥</button>
</div>
<p class="er__status" id="erStatus" aria-live="polite">待機中</p>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
// 값 하나: REFILL_COUNT 장을 다 넘기면 빈 상태가 뜨고, 다시 채우면 스프링을 scale 에 적분해
// 오버슛하며 튀어 들어온다.
$duration: $dur-base;
$easing: $ease-pop;
$color: $subject-blue-deep;
@include stage($stage-ink);
.er { display: grid; gap: $sp-2; justify-items: center; width: 100%; }
.er__caption { margin: 0; font-size: 12px; font-weight: 600; color: $subject-cream; }
.er__scene {
position: relative;
width: 220px;
height: 190px;
display: grid;
place-items: center;
}
.er__card {
position: relative;
width: 160px;
height: 180px;
border-radius: $r-card;
background: linear-gradient(160deg, $subject-pink, $subject-lilac);
box-shadow: $shadow-raised;
display: grid;
place-items: center;
touch-action: none;
cursor: grab;
will-change: transform;
}
.er__card:active { cursor: grabbing; }
.er__card:focus-visible { outline: 2px solid $subject-blue-light; outline-offset: 3px; }
.er__card[hidden] { display: none; }
.er__label { margin: 0; font-size: 14px; font-weight: 700; color: $subject-ink; padding: 0 $sp-3; text-align: center; }
.er__empty {
width: 160px;
height: 180px;
border-radius: $r-card;
border: 2px dashed rgba(255, 247, 230, .4);
display: grid;
gap: $sp-3;
place-items: center;
padding: $sp-3;
text-align: center;
}
.er__empty[hidden] { display: none; }
.er__empty-text { margin: 0; font-size: 12px; color: $subject-cream; font-weight: 600; }
.er__refill {
border: 0;
border-radius: $r-pill;
padding: $sp-2 $sp-4;
background: $subject-blue-light;
color: $subject-ink;
font-size: 12px;
font-weight: 700;
cursor: pointer;
}
.er__refill:focus-visible { outline: 2px solid $subject-cream; outline-offset: 2px; }
.er__btn {
position: absolute;
bottom: $sp-3;
width: 34px;
height: 34px;
border-radius: $r-pill;
border: 0;
background: $stage-paper;
box-shadow: $shadow-press;
font-size: 15px;
line-height: 1;
cursor: pointer;
display: grid;
place-items: center;
z-index: 2;
}
.er__btn--nope { left: $sp-3; color: $error; }
.er__btn--like { right: $sp-3; color: $subject-blue-deep; }
.er__btn:focus-visible { outline: 2px solid $subject-blue-light; outline-offset: 2px; }
.er__status { margin: 0; font-size: 11px; color: $subject-cream; font-weight: 600; }
@media (max-width: 340px) {
.er { gap: $sp-2; }
.er__scene { width: 150px; height: 108px; }
.er__card { width: 78px; height: 92px; }
.er__empty { width: 78px; height: 92px; gap: $sp-1; padding: $sp-1; }
.er__empty-text { font-size: 9px; }
.er__refill { font-size: 9px; padding: $sp-1 $sp-2; }
.er__label { font-size: 10px; padding: 0 $sp-1; }
.er__btn { width: 22px; height: 22px; font-size: 11px; bottom: $sp-1; }
.er__btn--nope { left: $sp-1; }
.er__btn--like { right: $sp-1; }
}
@media (prefers-reduced-motion: reduce) {
.er__card { transition: none; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #17141a;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.er {
display: grid;
gap: 8px;
justify-items: center;
width: 100%;
}
.er__caption {
margin: 0;
font-size: 12px;
font-weight: 600;
color: #fff7e6;
}
.er__scene {
position: relative;
width: 220px;
height: 190px;
display: grid;
place-items: center;
}
.er__card {
position: relative;
width: 160px;
height: 180px;
border-radius: 16px;
background: linear-gradient(160deg, #ff9ebb, #b9a0ff);
box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
display: grid;
place-items: center;
touch-action: none;
cursor: grab;
will-change: transform;
}
.er__card:active {
cursor: grabbing;
}
.er__card:focus-visible {
outline: 2px solid #5b8cf8;
outline-offset: 3px;
}
.er__card[hidden] {
display: none;
}
.er__label {
margin: 0;
font-size: 14px;
font-weight: 700;
color: #17141a;
padding: 0 12px;
text-align: center;
}
.er__empty {
width: 160px;
height: 180px;
border-radius: 16px;
border: 2px dashed rgba(255, 247, 230, 0.4);
display: grid;
gap: 12px;
place-items: center;
padding: 12px;
text-align: center;
}
.er__empty[hidden] {
display: none;
}
.er__empty-text {
margin: 0;
font-size: 12px;
color: #fff7e6;
font-weight: 600;
}
.er__refill {
border: 0;
border-radius: 999px;
padding: 8px 16px;
background: #5b8cf8;
color: #17141a;
font-size: 12px;
font-weight: 700;
cursor: pointer;
}
.er__refill:focus-visible {
outline: 2px solid #fff7e6;
outline-offset: 2px;
}
.er__btn {
position: absolute;
bottom: 12px;
width: 34px;
height: 34px;
border-radius: 999px;
border: 0;
background: #ffffff;
box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
font-size: 15px;
line-height: 1;
cursor: pointer;
display: grid;
place-items: center;
z-index: 2;
}
.er__btn--nope {
left: 12px;
color: #c2361a;
}
.er__btn--like {
right: 12px;
color: #0a4fe8;
}
.er__btn:focus-visible {
outline: 2px solid #5b8cf8;
outline-offset: 2px;
}
.er__status {
margin: 0;
font-size: 11px;
color: #fff7e6;
font-weight: 600;
}
@media (max-width: 340px) {
.er {
gap: 8px;
}
.er__scene {
width: 150px;
height: 108px;
}
.er__card {
width: 78px;
height: 92px;
}
.er__empty {
width: 78px;
height: 92px;
gap: 4px;
padding: 4px;
}
.er__empty-text {
font-size: 9px;
}
.er__refill {
font-size: 9px;
padding: 4px 8px;
}
.er__label {
font-size: 10px;
padding: 0 4px;
}
.er__btn {
width: 22px;
height: 22px;
font-size: 11px;
bottom: 4px;
}
.er__btn--nope {
left: 4px;
}
.er__btn--like {
right: 4px;
}
}
@media (prefers-reduced-motion: reduce) {
.er__card {
transition: none;
}
}(function () {
"use strict";
// 값 하나: 카드를 REFILL_COUNT 장 다 넘기면 빈 상태가 뜨고, 다시 채우면 스프링(강성·감쇠)을
// scale 에 적분해 오버슛하며 튀어 들어온다.
var REFILL_COUNT = 3;
var REFILL_SPRING_STIFFNESS = 160;
var REFILL_SPRING_DAMPING = 12;
var RELEASE_VELOCITY_MIN = 0.38;
var EXIT_PX = 320;
var CYCLE_S = 2;
var root = document.getElementById("er");
var card = document.getElementById("erCard");
var label = document.getElementById("erLabel");
var empty = document.getElementById("erEmpty");
var refillBtn = document.getElementById("erRefill");
var status = document.getElementById("erStatus");
var btnLike = document.getElementById("erLike");
var btnNope = document.getElementById("erNope");
var reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
function seedRand(seed) {
var s = seed >>> 0;
return function () { s = (s * 1664525 + 1013904223) >>> 0; return s / 4294967296; };
}
function clamp(v, lo, hi) { return Math.max(lo, Math.min(hi, v)); }
var CARDS = ["夕方の散歩", "週末のカフェ", "宅トレ記録", "読書リスト", "旅行メモ", "朝のルーティン"];
var rand = seedRand(101);
var idx = Math.floor(rand() * CARDS.length);
var swiped = 0;
var dragging = false;
var startX = 0, lastX = 0, lastT = 0, vx = 0;
var x = 0, phase = "idle", exitDir = 1;
var scale = 1, scaleVel = 0;
function setCard() { label.textContent = CARDS[idx % CARDS.length]; }
setCard();
function render() {
var rot = clamp(x * 0.08, -20, 20);
card.style.transform = "translateX(" + x.toFixed(1) + "px) rotate(" + rot.toFixed(2) + "deg) scale(" + scale.toFixed(3) + ")";
}
function showEmpty() {
card.hidden = true;
empty.hidden = false;
status.textContent = "カードを全部見ました — 「補充」を押してみてください";
}
function refill() {
root.classList.remove("is-demo");
empty.hidden = true;
card.hidden = false;
swiped = 0;
idx += 1; setCard();
x = 0; vx = 0;
if (reduce) { scale = 1; scaleVel = 0; render(); phase = "idle"; status.textContent = "補充された"; return; }
scale = 0.2; scaleVel = 0;
phase = "refill";
status.textContent = "スプリングで弾んで入ってきています";
}
refillBtn.addEventListener("click", refill);
function nextCard() {
swiped += 1;
idx += 1; setCard();
x = 0; vx = 0; scale = 1; phase = "idle";
render();
status.textContent = "待機中";
if (swiped >= REFILL_COUNT) showEmpty();
}
function judge(velocity, dir) {
root.classList.remove("is-demo");
var flung = Math.abs(velocity) >= RELEASE_VELOCITY_MIN;
if (reduce) {
if (flung) { status.textContent = dir > 0 ? "「いいね」処理済み" : "「いいえ」処理済み"; nextCard(); }
else { x = 0; render(); status.textContent = "元の位置に戻った"; phase = "idle"; }
return;
}
if (flung) { phase = "exit"; exitDir = dir; status.textContent = dir > 0 ? "「いいね」処理済み" : "「いいえ」処理済み"; }
else { phase = "settle"; status.textContent = "元の位置に戻った"; }
}
function startDrag(clientX) {
if (card.hidden) return;
root.classList.remove("is-demo");
dragging = true; phase = "idle";
startX = clientX; lastX = clientX; lastT = performance.now(); vx = 0;
}
function moveDrag(clientX) {
if (!dragging) return;
var now = performance.now();
var dt = Math.max(now - lastT, 1);
vx = (clientX - lastX) / dt;
lastX = clientX; lastT = now;
x = clientX - startX;
render();
}
function endDrag() {
if (!dragging) return;
dragging = false;
judge(vx, x >= 0 ? 1 : -1);
}
card.addEventListener("pointerdown", function (e) { card.setPointerCapture(e.pointerId); startDrag(e.clientX); });
card.addEventListener("pointermove", function (e) { moveDrag(e.clientX); });
card.addEventListener("pointerup", endDrag);
card.addEventListener("pointercancel", endDrag);
function keyVerdict(dir) {
if (card.hidden) return;
root.classList.remove("is-demo");
x = dir * 60; render();
judge(dir * (RELEASE_VELOCITY_MIN + 0.3), dir);
}
card.addEventListener("keydown", function (e) {
if (e.key === "ArrowRight") { e.preventDefault(); keyVerdict(1); }
else if (e.key === "ArrowLeft") { e.preventDefault(); keyVerdict(-1); }
});
btnLike.addEventListener("click", function () { keyVerdict(1); });
btnNope.addEventListener("click", function () { keyVerdict(-1); });
// 스프링 방정식을 scale 에 적분한다 — 목표(1)를 넘겼다가(오버슛) 되돌아와 정착한다.
function integrateScale(dt) {
var accel = REFILL_SPRING_STIFFNESS * (1 - scale) - REFILL_SPRING_DAMPING * scaleVel;
scaleVel += accel * dt;
scale += scaleVel * dt;
if (Math.abs(1 - scale) < 0.004 && Math.abs(scaleVel) < 0.02) { scale = 1; scaleVel = 0; phase = "idle"; }
}
function step(dt) {
var dtS = Math.min(dt / 1000, 0.032);
if (phase === "exit") {
x += exitDir * Math.max(Math.abs(vx), RELEASE_VELOCITY_MIN * 1.4) * dt;
render();
if (Math.abs(x) > EXIT_PX) nextCard();
} else if (phase === "settle") {
x += (0 - x) * 0.22;
render();
if (Math.abs(x) < 0.4) { x = 0; phase = "idle"; render(); }
} else if (phase === "refill") {
integrateScale(dtS);
render();
}
}
// .is-demo 자동 시연: 실제 클릭 없이 judge()·refill() 을 같은 경로로 호출해 상태를 두 번 바꾼다.
var start = null, lastNow = 0, prevT = 0, synthPhase = "wait";
function synth(t) {
if (t > 0.35 && t < 0.65 && synthPhase === "wait") synthPhase = "swipeOut";
if (synthPhase === "swipeOut") {
var p = clamp((t - 0.35) / 0.3, 0, 1);
x = p * 140; render();
if (t >= 0.65) {
synthPhase = "afterSwipe";
swiped = REFILL_COUNT - 1;
judge(RELEASE_VELOCITY_MIN + 0.4, 1);
}
}
if (t > 1.25 && synthPhase === "afterSwipe" && !empty.hidden) { refill(); synthPhase = "done"; }
}
function loop(now) {
if (start === null) { start = now; lastNow = now; lastT = now; }
var dt = Math.min(now - lastNow, 48);
lastNow = now;
var t = ((now - start) / 1000) % CYCLE_S;
if (t < prevT) synthPhase = "wait";
prevT = t;
if (!reduce && root.classList.contains("is-demo")) synth(t);
if (!reduce) step(dt);
requestAnimationFrame(loop);
}
requestAnimationFrame(loop);
})();// EmptyStateRefillSwipeCard — vanilla 판(run/422/demo/08-swipe-deck-precision-empty-state-refill/index.html) 의 React 포트.
// 값 하나: REFILL_COUNT 번 스와이프하면 빈 상태 패널이 뜨고, "다시 채우기" 를 누르면
// scale 에 스프링(강성·감쇠)을 적분해(integrateScale) 오버슛하며 카드 더미가 튀어 들어온다.
import { useEffect, useRef, useState } from "react";
import type { PointerEvent as ReactPointerEvent } from "react";
import styles from "./EmptyStateRefillSwipeCard.module.scss";
type Box<T> = { current: T };
const REFILL_COUNT = 3;
const REFILL_SPRING_STIFFNESS = 160;
const REFILL_SPRING_DAMPING = 12;
const RELEASE_VELOCITY_MIN = 0.4;
const EXIT_PX = 320;
const CYCLE_S = 2;
const CARDS = ["아침 루틴", "저녁 산책", "주말 카페", "홈트 기록", "독서 목록", "여행 메모"];
function seedRand(seed: number) {
let s = seed >>> 0;
return function (): number {
s = (s * 1664525 + 1013904223) >>> 0;
return s / 4294967296;
};
}
function clamp(v: number, lo: number, hi: number): number {
return Math.max(lo, Math.min(hi, v));
}
export default function EmptyStateRefillSwipeCard() {
const cardRef = useRef<HTMLDivElement | null>(null);
const posRef = useRef<number>(0) as Box<number>;
const velRef = useRef<number>(0) as Box<number>;
const phaseRef = useRef<string>("idle") as Box<string>;
const exitDirRef = useRef<number>(1) as Box<number>;
const draggingRef = useRef<boolean>(false) as Box<boolean>;
const startXRef = useRef<number>(0) as Box<number>;
const lastXRef = useRef<number>(0) as Box<number>;
const lastTRef = useRef<number>(0) as Box<number>;
const swipeCountRef = useRef<number>(0) as Box<number>;
const scaleRef = useRef<number>(1) as Box<number>;
const scaleVelRef = useRef<number>(0) as Box<number>;
const idxRef = useRef<number>(Math.floor(seedRand(71)() * CARDS.length)) as Box<number>;
const frameRef = useRef<number>(0) as Box<number>;
const [label, setLabel] = useState(CARDS[idxRef.current % CARDS.length]);
const [status, setStatus] = useState("대기 중");
const [empty, setEmpty] = useState(false);
const [demo, setDemo] = useState(true);
const [reduce, setReduce] = useState(false);
function render(): void {
const card = cardRef.current;
if (!card) return;
const rot = clamp(posRef.current * 0.05, -16, 16);
card.style.transform = "translateX(" + posRef.current.toFixed(1) + "px) rotate(" + rot.toFixed(2) + "deg) scale(" + scaleRef.current.toFixed(3) + ")";
}
function nextCard(): void {
idxRef.current += 1;
swipeCountRef.current += 1;
posRef.current = 0; velRef.current = 0; phaseRef.current = "idle";
if (swipeCountRef.current >= REFILL_COUNT) {
setEmpty(true);
setStatus("카드가 소진됨 — 다시 채워 주세요");
return;
}
setLabel(CARDS[idxRef.current % CARDS.length]);
render();
setStatus("대기 중");
}
function integrateScale(dt: number): boolean {
const accel = REFILL_SPRING_STIFFNESS * (1 - scaleRef.current) - REFILL_SPRING_DAMPING * scaleVelRef.current;
scaleVelRef.current += accel * dt;
scaleRef.current += scaleVelRef.current * dt;
if (Math.abs(1 - scaleRef.current) < 0.004 && Math.abs(scaleVelRef.current) < 0.06) {
scaleRef.current = 1; scaleVelRef.current = 0;
return true;
}
return false;
}
function refill(): void {
setDemo(false);
swipeCountRef.current = 0;
idxRef.current += 1;
setLabel(CARDS[idxRef.current % CARDS.length]);
setEmpty(false);
setStatus("다시 채워짐");
if (reduce) { scaleRef.current = 1; scaleVelRef.current = 0; render(); phaseRef.current = "idle"; return; }
scaleRef.current = 0.2; scaleVelRef.current = 0;
phaseRef.current = "refilling";
render();
}
function judge(velocity: number, dir: number): void {
setDemo(false);
const flung = Math.abs(velocity) >= RELEASE_VELOCITY_MIN;
if (reduce) {
if (flung) { setStatus(dir > 0 ? "좋아요 처리됨" : "싫어요 처리됨"); nextCard(); }
else { posRef.current = 0; render(); setStatus("제자리로 돌아옴"); phaseRef.current = "idle"; }
return;
}
if (flung) {
phaseRef.current = "exit"; exitDirRef.current = dir;
setStatus(dir > 0 ? "좋아요 처리됨" : "싫어요 처리됨");
} else {
phaseRef.current = "settle";
setStatus("제자리로 돌아옴");
}
}
function startDrag(clientX: number): void {
if (empty) return;
setDemo(false);
draggingRef.current = true; phaseRef.current = "idle";
startXRef.current = clientX; lastXRef.current = clientX; lastTRef.current = performance.now(); velRef.current = 0;
}
function moveDrag(clientX: number): void {
if (!draggingRef.current) return;
const now = performance.now();
const dt = Math.max(now - lastTRef.current, 1);
velRef.current = (clientX - lastXRef.current) / dt;
lastXRef.current = clientX; lastTRef.current = now;
posRef.current = clientX - startXRef.current;
render();
}
function endDrag(): void {
if (!draggingRef.current) return;
draggingRef.current = false;
judge(velRef.current, posRef.current >= 0 ? 1 : -1);
}
function onPointerDown(e: ReactPointerEvent<HTMLDivElement>): void {
e.currentTarget.setPointerCapture(e.pointerId);
startDrag(e.clientX);
}
function onPointerMove(e: ReactPointerEvent<HTMLDivElement>): void { moveDrag(e.clientX); }
function onPointerUp(): void { endDrag(); }
function keyVerdict(dir: number): void {
if (empty) return;
setDemo(false);
posRef.current = dir * 40; render();
judge(dir * (RELEASE_VELOCITY_MIN + 0.2), dir);
}
function onKeyDown(e: any): void {
if (e.key === "ArrowRight") { e.preventDefault(); keyVerdict(1); }
else if (e.key === "ArrowLeft") { e.preventDefault(); keyVerdict(-1); }
}
function step(dt: number): void {
const dtS = Math.min(dt / 1000, 0.032);
if (phaseRef.current === "exit") {
const speed = Math.max(Math.abs(velRef.current), RELEASE_VELOCITY_MIN * 1.4);
posRef.current += exitDirRef.current * speed * dt;
render();
if (Math.abs(posRef.current) > EXIT_PX) nextCard();
} else if (phaseRef.current === "settle") {
posRef.current += (0 - posRef.current) * 0.22;
render();
if (Math.abs(posRef.current) < 0.5) { posRef.current = 0; phaseRef.current = "idle"; render(); }
} else if (phaseRef.current === "refilling") {
const done = integrateScale(dtS);
render();
if (done) phaseRef.current = "idle";
}
}
function synth(t: number, synthPhaseRef: Box<string>): void {
if (t > 0.35 && t < 0.6 && synthPhaseRef.current === "wait") synthPhaseRef.current = "swipe1";
if (synthPhaseRef.current === "swipe1") {
const p = clamp((t - 0.35) / 0.25, 0, 1);
posRef.current = p * 100; render();
if (t >= 0.6) { synthPhaseRef.current = "after1"; judge(RELEASE_VELOCITY_MIN + 0.3, 1); }
}
if (t > 1.1 && synthPhaseRef.current === "after1" && empty) { synthPhaseRef.current = "refill"; refill(); }
if (t < 0.2 && synthPhaseRef.current !== "wait" && synthPhaseRef.current !== "refill") synthPhaseRef.current = "wait";
}
useEffect(() => {
setReduce(window.matchMedia("(prefers-reduced-motion: reduce)").matches);
}, []);
useEffect(() => {
let start = 0, lastNow = 0, prevT = 0;
const synthPhaseRef: Box<string> = { current: "wait" };
function loop(now: number): void {
if (start === 0) { start = now; lastNow = now; }
const dt = Math.min(now - lastNow, 48);
lastNow = now;
const t = ((now - start) / 1000) % CYCLE_S;
if (t < prevT) synthPhaseRef.current = "wait";
prevT = t;
if (!reduce && demo) synth(t, synthPhaseRef);
if (!reduce) step(dt);
frameRef.current = requestAnimationFrame(loop);
}
frameRef.current = requestAnimationFrame(loop);
return () => cancelAnimationFrame(frameRef.current);
}, [reduce, demo, empty]);
return (
<main className={styles.stage}>
<div className={styles.er}>
<p className={styles.caption}>스프링으로 튀어 들어오는 다시 채우기</p>
<div className={styles.scene}>
{!empty && (
<div
className={styles.card}
ref={cardRef}
tabIndex={0}
role="group"
aria-roledescription="스와이프 카드"
onPointerDown={onPointerDown}
onPointerMove={onPointerMove}
onPointerUp={onPointerUp}
onKeyDown={onKeyDown}
>
<p className={styles.label}>{label}</p>
</div>
)}
{empty && (
<div className={styles.empty}>
<p className={styles.emptyText}>카드를 모두 봤어요</p>
<button className={styles.refillBtn} type="button" onClick={refill}>다시 채우기</button>
</div>
)}
{!empty && (
<>
<button className={styles.btnNope} type="button" aria-label="싫어요" onClick={() => keyVerdict(-1)}>✕</button>
<button className={styles.btnLike} type="button" aria-label="좋아요" onClick={() => keyVerdict(1)}>♥</button>
</>
)}
</div>
<p className={styles.status} aria-live="polite">{status}</p>
</div>
</main>
);
}08 ばねで跳ねて現れる空スタックカード — 計測 累積面積 42.749% · 動いたフレーム 6/23GODRICH オリジナル · SCSS と React は zip に同梱 · カード スワイプ ui 9パターン — 物理計算で仕上げる
このデモが属する記事
カード スワイプ ui 9パターン — 物理計算で仕上げるこのカード スワイプ ui には9パターンあります。指を離す速度が02番の基準に届かない瞬間、カードは飛ばずに03番のようにばねで元の位置へ戻る。最後の一枚をめくった先には08番の空のデッキだけが残る。 この記事のデモをすべて見る


