Files
joke-app/apps/web/src/games/dalmuti/quick.tsx
2026-10-06 13:35:21 +09:00

86 lines
4.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/** 달무티 30초 규칙 요약 (docs/07 §5). */
import type { QuickCard } from '../types';
const HUE: Record<number, string> = { 1: '#b7791f', 2: '#7c3aed', 3: '#4338ca', 5: '#0f766e', 7: '#4d7c0f', 9: '#c2410c', 12: '#57534e', 13: '#be185d' };
/** One card in a 40 × 56 box at (x, y). */
function Card({ n, x, y }: { n: number; x: number; y: number }) {
const c = HUE[n] ?? '#475569';
return (
<g transform={`translate(${x} ${y})`}>
<rect width={40} height={56} rx={6} fill="#fffdf7" stroke={c} strokeWidth={2.5} />
<rect width={40} height={12} rx={6} fill={c} />
<text x={20} y={40} textAnchor="middle" fontSize={n === 13 ? 20 : 24} fontWeight={900} fill={c}>
{n === 13 ? '★' : n}
</text>
</g>
);
}
function Set({ n, count, x, y }: { n: number; count: number; x: number; y: number }) {
return (
<g>
{Array.from({ length: count }, (_, i) => (
<Card key={i} n={n} x={x + i * 16} y={y} />
))}
</g>
);
}
export const quickStart: QuickCard[] = [
{
pic: (
<svg viewBox="0 0 250 120" width={250} height={120} aria-hidden>
<Card n={1} x={10} y={10} />
<Card n={5} x={70} y={10} />
<Card n={12} x={130} y={10} />
<Card n={13} x={200} y={10} />
<text x={30} y={90} textAnchor="middle" fontSize={14} fontWeight={800} fill="#15803d">좋음</text>
<text x={150} y={90} textAnchor="middle" fontSize={14} fontWeight={800} fill="#b91c1c">나쁨</text>
<text x={220} y={90} textAnchor="middle" fontSize={14} fontWeight={800} fill="#be185d">광대</text>
<path d="M40 104 H140" stroke="#374151" strokeWidth={3} markerEnd="url(#dm-q-arrow)" />
<defs>
<marker id="dm-q-arrow" viewBox="0 0 10 10" refX={8} refY={5} markerWidth={6} markerHeight={6} orient="auto">
<path d="M0 0 L10 5 L0 10 z" fill="#374151" />
</marker>
</defs>
</svg>
),
alt: '숫자 1, 5, 12 카드와 광대 카드. 1이 가장 좋고 12로 갈수록 나빠요',
title: '낮은 숫자가 좋아요',
text: '숫자 n인 카드는 n장씩 있어요. 숫자가 낮을수록 좋아요. 광대는 다른 숫자와 같이 내면 그 숫자가 돼요.',
},
{
pic: (
<svg viewBox="0 0 250 150" width={250} height={150} aria-hidden>
<Set n={9} count={3} x={10} y={10} />
<text x={125} y={44} fontSize={26} fontWeight={900} fill="#374151">→</text>
<Set n={5} count={3} x={160} y={10} />
<text x={40} y={94} textAnchor="middle" fontSize={14} fontWeight={800} fill="#374151">9 × 3장</text>
<text x={192} y={94} textAnchor="middle" fontSize={14} fontWeight={800} fill="#15803d">5 × 3장</text>
<text x={125} y={130} textAnchor="middle" fontSize={14} fontWeight={700} fill="#6b7280">같은 장수 · 더 낮은 숫자</text>
</svg>
),
alt: '9 세 장 위에 5 세 장을 내는 모습',
title: '같은 장수로 더 낮게',
text: '새로 시작하는 사람은 같은 숫자를 원하는 장수만큼 내요. 다음 사람은 같은 장수로 더 낮은 숫자를 내거나 패스해요.',
},
{
pic: (
<svg viewBox="0 0 250 130" width={250} height={130} aria-hidden>
<text x={40} y={50} textAnchor="middle" fontSize={40}>👑</text>
<text x={40} y={80} textAnchor="middle" fontSize={14} fontWeight={800} fill="#374151">대달무티</text>
<text x={210} y={50} textAnchor="middle" fontSize={40}>🧺</text>
<text x={210} y={80} textAnchor="middle" fontSize={14} fontWeight={800} fill="#374151">대농노</text>
<Card n={1} x={88} y={10} />
<Card n={2} x={122} y={10} />
<text x={125} y={92} textAnchor="middle" fontSize={22} fontWeight={900} fill="#b91c1c">← 세금</text>
<text x={125} y={120} textAnchor="middle" fontSize={13} fontWeight={700} fill="#6b7280">먼저 다 내면 다음엔 👑</text>
</svg>
),
alt: '대농노가 좋은 카드 2장을 대달무티에게 세금으로 주는 모습',
title: '먼저 털면 높은 신분',
text: '카드를 먼저 다 낸 순서로 다음 신분이 정해져요. 농노는 가장 좋은 카드를 달무티에게 세금으로 주고, 같은 장수를 돌려받아요.',
},
];