@@ -7,10 +7,23 @@ import { Suit as SuitT } from '@/game/card';
77 the classical Liberation/Times-style suits desktop Chrome rendered.
88 Filled with currentColor so red/black inherits from .card--red/black. */
99
10- const PATHS : Record < Exclude < SuitT , 'c' > , string > = {
10+ // Each suit is one path so it paints in a single fill operation. This matters
11+ // for the semi-transparent foundation hint: the club's three lobes and stem
12+ // overlap, and as separate shapes their alpha would stack into darker seams.
13+ // As subpaths of one <path> the overlaps union (nonzero fill rule) and the
14+ // glyph reads at a uniform opacity, like the other suits.
15+ const PATHS : Record < SuitT , string > = {
1116 h : 'M50 86 C50 86 10 60 10 32 C10 18 21 8 33 8 C41 8 47 13 50 21 C53 13 59 8 67 8 C79 8 90 18 90 32 C90 60 50 86 50 86 Z' ,
1217 d : 'M50 6 L86 50 L50 94 L14 50 Z' ,
1318 s : 'M50 6 C50 6 12 36 12 60 C12 74 22 83 33 83 C40 83 46 80 50 75 C49 84 45 92 38 95 L62 95 C55 92 51 84 50 75 C54 80 60 83 67 83 C78 83 88 74 88 60 C88 36 50 6 50 6 Z' ,
19+ // Three round lobes (top, left, right; the side lobes just touch and the top
20+ // lobe overlaps each enough to leave no gap) plus a stem that bridges the gap
21+ // above the side-lobe touch point and flares to a wider foot.
22+ c :
23+ 'M28 28 A22 22 0 1 0 72 28 A22 22 0 1 0 28 28 Z' +
24+ 'M6 55 A22 22 0 1 0 50 55 A22 22 0 1 0 6 55 Z' +
25+ 'M50 55 A22 22 0 1 0 94 55 A22 22 0 1 0 50 55 Z' +
26+ 'M44 46 L44 82 C44 90 36 94 22 96 L78 96 C64 94 56 90 56 82 L56 46 Z' ,
1427} ;
1528
1629export function Suit ( { suit, className } : { suit : SuitT ; className ?: string } ) {
@@ -22,21 +35,7 @@ export function Suit({ suit, className }: { suit: SuitT; className?: string }) {
2235 aria-hidden = "true"
2336 focusable = "false"
2437 >
25- { suit === 'c' ? (
26- // Three round lobes, sized so the side lobes just touch each other
27- // (they read as two distinct circles, not a merged oval) and the top
28- // lobe overlaps each side lobe enough to leave no visible gap. The
29- // stem path bridges the small gap above the side-lobe touch point
30- // and flares out to a wider foot at the bottom.
31- < >
32- < circle cx = "50" cy = "28" r = "22" />
33- < circle cx = "28" cy = "55" r = "22" />
34- < circle cx = "72" cy = "55" r = "22" />
35- < path d = "M44 46 L44 82 C44 90 36 94 22 96 L78 96 C64 94 56 90 56 82 L56 46 Z" />
36- </ >
37- ) : (
38- < path d = { PATHS [ suit ] } />
39- ) }
38+ < path d = { PATHS [ suit ] } />
4039 </ svg >
4140 ) ;
4241}
0 commit comments