diff --git a/apps/web/src/components/cards/HwatuCard.tsx b/apps/web/src/components/cards/HwatuCard.tsx index fcefb5e..592bd43 100644 --- a/apps/web/src/components/cards/HwatuCard.tsx +++ b/apps/web/src/components/cards/HwatuCard.tsx @@ -1,7 +1,8 @@ /** * Hwatu card: the real 48-card hwatu artwork from Wikimedia Commons "SVG Hwatu" (Marcus Richert after Louie Mantia Jr., * CC BY-SA 4.0 — ./hwatu/ATTRIBUTION.txt, docs/games/seotda.md "화투 그림"), bundled from our own origin (no external - * URLs). A small month badge stays on top so beginners can read the card at a glance; + * URLs). A small month badge stays on top so beginners can read the card at a glance (섯다 instead draws a big outlined + * number in the bottom-left corner, which stays visible when cards overlap); * 쌍피 / bonus cards get their value tag (고스톱). The back and the bonus cards are drawn here. */ import type { CSSProperties } from 'react'; @@ -70,6 +71,15 @@ function BonusFace({ w, h, value }: { w: number; h: number; value: number }) { ); } +/** Dark outline around white text (8 directions + soft shadow), readable on both the white and black parts of a card. */ +const cornerOutline = (t: number): string => + [ + [-t, -t], [0, -t], [t, -t], [-t, 0], [t, 0], [-t, t], [0, t], [t, t], + ] + .map(([x, y]) => `${x}px ${y}px 0 #111827`) + .concat('0 1px 3px rgba(0,0,0,0.6)') + .join(', '); + export function HwatuCard({ card, size = 'md', @@ -78,6 +88,7 @@ export function HwatuCard({ dimmed, highlight, showMonth = true, + monthStyle = 'badge', onClick, className, style, @@ -91,6 +102,8 @@ export function HwatuCard({ highlight?: boolean; /** Small month number badge (on by default). */ showMonth?: boolean; + /** 'badge': small dark circle top-right. 'corner': big white outlined number bottom-left (섯다). */ + monthStyle?: 'badge' | 'corner'; onClick?: () => void; className?: string; style?: CSSProperties; @@ -142,7 +155,27 @@ export function HwatuCard({ ) : ( )} - {showMonth && card.month > 0 && ( + {showMonth && card.month > 0 && monthStyle === 'corner' && ( + + {card.month} + + )} + {showMonth && card.month > 0 && monthStyle === 'badge' && ( {seat.cards.map((c, i) => isCard(c) ? ( - + ) : ( ), @@ -298,6 +298,7 @@ function MySeat({ seat, view: v, players, deadline, winner, setRef, phone }: { s key={c.key} card={c} width={w} + monthStyle="corner" className="anim-deal" highlight={!!v.myChosen?.includes(c.id) || (!v.myChosen && v.myOpened === c.id)} dimmed={(!!v.myChosen && !v.myChosen.includes(c.id)) || seat.folded} @@ -566,7 +567,7 @@ function OpenBox({ view: v, me, act, pending }: { view: SeotdaView; me: string;

{cards.map((c) => ( - setPick(c.id)} /> + setPick(c.id)} /> ))}