pkg:clod/com.clodhub/card-graphics 0.11.0 Playing card faces, backs and empty slots with deal and flip animation, for web, Apple and Android. `card-graphics` draws a 52 card pack: a face with the rank over a small suit mark in two corners and either pips laid out as on a printed card (2 to 10), a large suit mark (ace) or, when the application supplies pictures, a court picture (jack, queen, king); a back (stripes, plain, or a picture); an empty slot; a card that arrives from the deck on a schedule; and a card that turns over. The rank is printed in the player's language through a function the application passes in (J is V in French). Sizes follow the card's width, 1.4 times taller than wide. The layout of pips, the schedule of a deal and the shape of a flip are pure data (`card-model`), the same on every platform. Examples A table draws five community cards, some as empty slots; a deal sends two cards to each seat one after another from the deck's position; a showdown turns a seat's cards over; a French player sees V, D, R for jack, queen, king; a recipe with its own artwork passes `artFor` and gets pictured backs and courts, while one without gets the code-drawn cards. Package URL: pkg:clod/com.clodhub/card-graphics@0.11.0 Class: Card graphics (pkg:clod/com.clodhub/card-graphics-class@1.1.0): Card faces, backs, slots, dealing and flipping. Any component of this class can fill a recipe slot that asks for it. Category games/cards; https://clodhub.com/classes/card-graphics-class.txt; 0 other components of this class: https://clodhub.com/components.txt?class=pkg%3Aclod%2Fcom.clodhub%2Fcard-graphics-class Provides (1) - card-graphics (com.clodhub/card-graphics 1.0.0): Playing card faces, backs and empty slots, with deal and flip animation, for a 52 card pack. When the application ships artwork it names the files card-back-.png and card--jack.png, -queen.png and -king.png; artFor says where each is, or null to draw in code. Web: implementation/web/card-model.ts, cards.ts and cards.css (reads the theme's --paper, --paper-accent, --on-primary and --primary). Apple: CardModel and SwiftUI views in PlayingCard.swift. Android: CardModel and Compose functions in package com.clodhub.cards. components that use it: https://clodhub.com/components.txt?requires=com.clodhub%2Fcard-graphics Requires (1) - theme (com.clodhub/theme 1.0.0): Design tokens for colours, spacing, radii, type scale and an animated background, rendered to CSS variables, Swift constants and Kotlin constants. Web: implementation/web/tokens.ts and background.ts. Apple: ThemeTypes.swift, ThemeTokens.swift, BackgroundMath.swift, ThemeBackgroundView.swift. Android: package com.clodhub.theme. components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Ftheme Settings (3) `backStyle` is `stripes` (default), `plain` or `art`; `art` uses back pictures the application supplies and falls back to stripes where there are none. `cornerStyle` is `rounded` (default), `soft` or `square`. `cardWidth` is the default width in pixels (8 to 600), used when a call gives no width. Card colours come from the theme: `paper` (face), `paperAccent` (red suits and the back), `onPrimary` (black suits). - backStyle: string (identifier); optional, default "stripes" - cornerStyle: string (identifier); optional, default "rounded" - cardWidth: integer; optional, default 56 Depends on components: none How to use in a recipe A recipe uses it through a slot of class Card graphics (pkg:clod/com.clodhub/card-graphics-class 1.1.0), naming pkg:clod/com.clodhub/card-graphics as the slot's preferred component or substituting it for another component of the class. The recipe connects what it provides (card-graphics) to the slots that use it. It fills what the component needs (theme) from slots whose components provide it. The recipe sets backStyle, cornerStyle and cardWidth; any it leaves out takes its default. - as a slot in recipe.json components: {"id":"card-graphics","class":{"name":"pkg:clod/com.clodhub/card-graphics-class","version":"1.1.0","digest":"e241c04c17db4b4e097d269b595f599fe558f795a98b62d583838190e503852b"},"preferred":{"name":"pkg:clod/com.clodhub/card-graphics","version":"0.11.0"}} - in place of another component of the class: clod fetch card-graphics@0.11.0 --store store --from https://clodhub.com, then clod design RECIPE@VERSION --store store --answers answers.json --substitute SLOT=card-graphics@0.11.0 --out definition.json Used by recipes: pkg:clod/com.clodhub/ourpoker-recipe 0.13.0 (slot card-graphics) For developers: how an application uses it Web: link `web/cards.css` after the theme's CSS; call `cardEl(code, { settings, width, theme, artFor, rankLabel })` for a face or, with `null`, a back; `cardSlot` for an empty place; `dealPlan` or `dealRounds` to schedule a deal and `dealInto` to animate one card from the deck's offset; `flippingCard(from, to)` for a turn. Pass `artFor` to say where artwork files are (`card-back-.png`, `card--jack|queen|king.png`) or omit it to draw everything in code. Apple: compile `CardModel.swift` anywhere and `PlayingCard.swift` in UIKit targets with the theme's Swift files; set `.cardStyle(CardStyle(...))` once; use `PlayingCard`, `CardSlot`, `DealtCard`, `FlippingCard`. Android: add `CardModel.kt` and `PlayingCard.kt` to a Compose module with the theme's Kotlin files; provide `LocalCardStyle`. Which cards exist, who holds them, the logo, hand underlines, the possible-hands panel and showdown layouts stay in the recipe. Accounts and services None. Local drawing only; no accounts, network or deployment. How it is checked Node tests check that all 52 codes parse and nothing else does, pip counts equal the rank and the lower half is upside down, face models for red and black suits, ranks in another language, aces, court pictures and backs with and without artwork, settings validation, sizes, the deal schedule (three cards a second), dealing round the table, the flip curve, and the DOM produced by `cardEl`, `cardSlot`, `dealInto` and `flippingCard` (including the face swap at the half turn) against a stand-in page, and that the OpenRPC interface's card code pattern, settings, pip ranks and face model shapes match the code and every method it lists is an exported web function. The Apple check compiles and runs `tests/apple/main.swift` for macOS, comparing all 52 faces, backs, metrics, deal and flip with the TypeScript output, then type-checks all Swift with the theme's against the iOS simulator SDK. The Android check compares the same 52 faces (`tests/android/Expected.kt`); kotlinc was not available where this was written, so it has not been run, and `PlayingCard.kt` (Compose) is only compiled by the application's Gradle build. Pixels are not compared. - `node --test tests/web.test.ts` (web, required-local; tools: node 26.5) - `python3 tests/native.py apple` (apple, platform; tools: python3 3.12, swiftc 6.4, xcrun 72) - `python3 tests/native.py android` (android, platform; tools: python3 3.12, kotlinc 2.2, java 26.0) Updates Patch updates replace files only. The component keeps no data; removal deletes its files and the application's imports of them. Tags: card, cards, games, graphics Targets: client android, ios, macos, tvos, web, windows; server none Publisher: George McIntyre (george-mcintyre) Guardians: Level N Ltd (guardian key 08775f20) Source: clodhub/card-graphics release v0.11.0; digest sha256:77147d162dc6363a81aa36bf3482ee3402e07ff778e611984440ff9a653b6f5c Release: features Line 0.11: no security releases Quality: Integration-tested, certified Known vulnerabilities: none known (checked 2026-11-26 at OSV); https://clodhub.com/api/components/card-graphics/0.11.0/vulnerabilities Downloads: 1 in 30 days; 1 of this version Images (4): https://clodhub.com/images/26e2f3b87ef0903dd82cd5c49f7de1b363534f7f984c270c9713ec730750a81f.png (web, Faces, striped backs and empty board slots in the night look); https://clodhub.com/images/7932cbc409197acb849ad1706a416ef8443a216afc286829b347af146dc870c7.png (web, The same cards with plain backs in the lounge look); https://clodhub.com/images/6524ea5b24c33c7c9a0dbfdd1d589afdcf166c1b3555fc2f3678f72c4dc14b3d.png (web, Rounded, soft and square corners at three widths); https://clodhub.com/images/20446bf9265c6b516c4776feb5d737d9f037c031fcac7ba3f4bb59c0e869f51b.png (web, Ranks from ace to two in all four suits, with dimmed cards that cannot be played) Classes: https://clodhub.com/classes.txt; this component as JSON: https://clodhub.com/api/components/card-graphics/0.11.0 Bundle download: GET https://clodhub.com/api/components/card-graphics/0.11.0/bundle returns a link valid for one hour Implements: pkg:clod/com.clodhub/card-graphics-class@1.1.0 e241c04c17db4b4e097d269b595f599fe558f795a98b62d583838190e503852b com.clodhub/card-graphics 1.0.0 entry modules: android android/src/main/java, ios apple/Sources, macos apple/Sources, tvos apple/Sources, web web/index.ts, windows web/index.ts shared behaviour suites: shared Platforms: android, ios, macos, tvos, web, windows Toolchains: android >=8.0.0, ios >=17.0.0, java >=17.0.0 <27.0.0, kotlin =2.4.21, macos >=14.0.0, node >=26.5.0 <27.0.0, swift =6.4.2, tvos >=17.0.0 Frameworks: android-ui: androidx.compose.ui =1.10.0 Styles: scope global; 70 namespaces; 0 conflicts Licence: Apache-2.0; 0 upstream sources, 2 exact dependencies, 44 files (listed on the details page) Suitable for jobs: card-graphics profile any: cost none; load none; regions any; compliance none Notes: Pure library; no provider limits apply. Data migration: this component keeps no data Maintainers: Level N Ltd; https://github.com/clodhub/card-graphics/issues; updates https://github.com/clodhub/card-graphics/releases (manual) What you download card-graphics-0.11.0.tar, from release v0.11.0 of clodhub/card-graphics: 44 files - Documents and manifests (8): CONTRACT.md, INSTRUCTIONS.md, LICENCE, NOTICE, PROVENANCE.md, SOURCE.md, ... - Source code (8): android/ (2), apple/ (2), web/ (4) - Tests (12): android/ (2), apple/ (5), fake-dom.ts, fixtures/ (1), make-fixtures.ts, native.py, ... - Interface documents (2): card-graphics.json, required-theme.json - Class files: the class's interfaces and shared checks (3): card-graphics-class/ (3) - Examples (2): consumer.ts, images.ts - Images of it as built (4): corners-and-sizes.png, every-rank.png, hand-lounge.png, hand-night.png - Diagrams (5): definition.json, examples/ (1), output/ (3) Installing copies 8 of them into the application under components/card-graphics/: android 2, apple 2, web 4 Not included: the components that provide what it requires (com.clodhub/theme), each a separate download; the values of its settings, which the recipe writes; any secret The archive is a release file on the publisher's public GitHub repository; ClodHub keeps this page and a pointer to the release, not the code. clod checks the archive's sha256 fingerprint before anything is copied, and installing runs none of the package's code. Versions - 0.11.0 features (2026-11-26T11:24:50.619Z) sha256:77147d162dc6363a81aa36bf3482ee3402e07ff778e611984440ff9a653b6f5c Links Details (package foundations, upstream sources, exact dependencies, styles, class inventories, files): https://clodhub.com/components/card-graphics/details.txt?version=0.11.0 Page: https://clodhub.com/components/card-graphics; JSON: https://clodhub.com/api/components/card-graphics/0.11.0; connections diagram: https://clodhub.com/api/components/card-graphics/0.11.0/connections.svg Copyright Level N Ltd 2026