트럼프 카드 J·Q·K·조커에 실제 카드 그림: Dmitry Fomin의 English pattern 그림카드 12장과 Atlas 조커 2장(Wikimedia Commons, CC0)을 그림 부분만 잘라 WebP 14장(약 250KB, 따로 받는 파일)으로 넣고, 그림카드는 왼쪽 위를 비운 테두리 안에 그려 큰 모서리 글자를 그대로 둠. 포커·원카드·구십구 규칙에 출처 한 줄, 게임 문서 §9 반영
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
/** Trump card drawn in SVG (no image assets). Big corner index for readability on PC and phones. */
|
||||
/**
|
||||
* Trump card drawn in SVG. Big corner index for readability on PC and phones. Number cards and the back are drawn here;
|
||||
* J/Q/K and the two jokers show real card artwork by Dmitry Fomin (Wikimedia Commons, CC0 — ./court/ATTRIBUTION.txt),
|
||||
* bundled from our own origin as small WebP files that load only when such a card is on screen.
|
||||
*/
|
||||
import type { CSSProperties } from 'react';
|
||||
|
||||
/** Credit for the court/joker artwork (CC0 needs none, but we say thanks); shown in the rules of the games using these cards. */
|
||||
export const PLAYING_CARD_CREDIT =
|
||||
'트럼프 그림카드(J·Q·K)·조커 그림: Dmitry Fomin — Wikimedia Commons "SVG English pattern playing cards", "Atlas deck joker", CC0 1.0(퍼블릭 도메인). 그림 부분만 잘라 작게 줄여 썼어요.';
|
||||
|
||||
/**
|
||||
* URL of the court/joker picture ("JS".."KC", "X1" black joker, "X2" red joker). Vite turns this pattern into hashed
|
||||
* /assets/ files; in tests it is just a file URL.
|
||||
*/
|
||||
export const courtSrc = (id: string): string => new URL(`./court/${id}.webp`, import.meta.url).href;
|
||||
|
||||
const SUIT_SYMBOL: Record<string, string> = { S: '♠', H: '♥', D: '◆', C: '♣' };
|
||||
const SUIT_KO: Record<string, string> = { S: '스페이드', H: '하트', D: '다이아', C: '클로버' };
|
||||
const RANK_LABEL: Record<string, string> = { T: '10', J: 'J', Q: 'Q', K: 'K', A: 'A' };
|
||||
@@ -74,28 +88,26 @@ export function PlayingCard({ card, size = 'md', selected, dimmed, highlight, on
|
||||
<Tag style={{ ...common, ...btnReset }} onClick={onClick} aria-label={title ?? cardAria(card)} aria-pressed={onClick ? !!selected : undefined} title={title}>
|
||||
<svg viewBox="0 0 100 140" width={w} height={h} aria-hidden>
|
||||
<rect x="1" y="1" width="98" height="138" rx="9" fill="#fffef9" stroke={selected ? '#2563eb' : '#9ca3af'} strokeWidth={selected ? 5 : 2} />
|
||||
<text x="9" y="33" fontSize="30" fontWeight="800" fill={color} fontFamily="Pretendard Variable, sans-serif">
|
||||
{label}
|
||||
</text>
|
||||
<text x="11" y="60" fontSize="26" fill={color}>
|
||||
{sym}
|
||||
</text>
|
||||
{joker ? (
|
||||
<text x="50" y="98" fontSize="22" fontWeight="800" textAnchor="middle" fill={color}>
|
||||
JOKER
|
||||
</text>
|
||||
<image href={courtSrc(card === 'X1' ? 'X1' : 'X2')} x="22" y="30" width="72" height="104" preserveAspectRatio="xMidYMid meet" />
|
||||
) : 'JQK'.includes(rank) ? (
|
||||
<>
|
||||
<rect x="30" y="44" width="56" height="78" rx="6" fill={color} opacity="0.1" />
|
||||
<text x="58" y="100" fontSize="44" fontWeight="800" textAnchor="middle" fill={color}>
|
||||
{rank}
|
||||
</text>
|
||||
{/* picture frame like a real court card, with a notch at top-left so the big index stays readable */}
|
||||
<image href={courtSrc(rank + suit)} x="10" y="5" width="80" height="130" preserveAspectRatio="xMidYMid slice" />
|
||||
<path d="M10 5H36V65H10Z" fill="#fffef9" />
|
||||
<path d="M36 5H90V135H10V65H36Z" fill="none" stroke={color} strokeOpacity="0.55" strokeWidth="1.2" />
|
||||
</>
|
||||
) : (
|
||||
<text x="60" y="108" fontSize="54" textAnchor="middle" fill={color}>
|
||||
{sym}
|
||||
</text>
|
||||
)}
|
||||
<text x="9" y="33" fontSize="30" fontWeight="800" fill={color} fontFamily="Pretendard Variable, sans-serif">
|
||||
{label}
|
||||
</text>
|
||||
<text x="11" y="60" fontSize="26" fill={color}>
|
||||
{sym}
|
||||
</text>
|
||||
</svg>
|
||||
</Tag>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user