@johnmorrisdotca/fuda-cards 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -7
- package/dist/choice.d.ts +38 -0
- package/dist/choice.js +77 -0
- package/dist/collection-element.d.ts +19 -0
- package/dist/collection-element.js +225 -23
- package/dist/collection.d.ts +17 -1
- package/dist/collection.js +23 -1
- package/dist/element.d.ts +8 -0
- package/dist/element.js +27 -2
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1 -0
- package/dist/stack.d.ts +2 -0
- package/dist/stack.js +1 -1
- package/dist/wear.d.ts +104 -0
- package/dist/wear.js +268 -0
- package/dist/zoom.d.ts +7 -0
- package/dist/zoom.js +16 -4
- package/docs/collection-displays.md +8 -1
- package/docs/wear.md +66 -0
- package/package.json +2 -1
package/docs/wear.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Wear: cards that are not perfect
|
|
2
|
+
|
|
3
|
+
`wear` draws a card as it looks after use: corners that are soft, rounded, chipped or folded, whitening on the edges, creases, scratches, specks, staining, yellowing and a print that sits off centre. It is off by default: a card with no `wear` attribute (or `wear="perfect"`) is drawn exactly as before and never loads the wear code.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<fuda-card title="Rookie" wear="lightly-played" wear-seed="7"></fuda-card>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
A card's wear is fixed by its preset and its seed, so a card looks the same every time it is drawn and on every device: the same seed lays the same marks, another seed lays others. Nothing is random at draw time and nothing animates.
|
|
10
|
+
|
|
11
|
+
## Attributes
|
|
12
|
+
|
|
13
|
+
| Attribute | Meaning |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `wear` | A preset's id (below), or a number from 0 to 1 for all the levels at once. Empty or `perfect`: no wear. |
|
|
16
|
+
| `wear-seed` | The seed, a whole number. Default 1. |
|
|
17
|
+
| `wear-corners`, `wear-edges`, `wear-surface`, `wear-creases` | One level on its own, 0 to 1, over the preset's. |
|
|
18
|
+
|
|
19
|
+
In script: `card.wear = 'near-mint'`; the options object has `wear`, `wearSeed`, `wearCorners`, `wearEdges`, `wearSurface` and `wearCreases`. The package exports the data without touching the DOM: `wearPresets`, `wearPreset(id)`, `wearLevels(options)`, `wearLayout(levels, seed)` (where every mark lies), `wearOutline(layout, face)` and `wearOverlaySvg(layout, face)`. The code is a separate module (`dist/wear.js`) that `<fuda-card>` loads with a dynamic `import()` only when a card asks for wear.
|
|
20
|
+
|
|
21
|
+
## What real wear looks like, and where the words come from
|
|
22
|
+
|
|
23
|
+
Grading looks at four things: **centering, corners, edges and surface**, with creases, scratches, tears and staining counted as wear. The Wikipedia article on trading cards (section Value, Condition) lists the scale from pristine through mint, near mint, excellent, very good and good to poor, and says that "centering, corners, edges and surface are taken into consideration for imperfections".
|
|
24
|
+
|
|
25
|
+
The five terms most used for cards sold singly are near mint, lightly played, moderately played, heavily played and damaged. A guide that states its own conventions ("marketplace conventions, not official grades", Rare Candy, Pokémon card condition guide) describes them like this, and the presets follow it:
|
|
26
|
+
|
|
27
|
+
- **Near mint**: corners "sharp, no rounding or fraying"; edges "crisp, no whitening or chipping"; no scratch lines; no creases or staining.
|
|
28
|
+
- **Lightly played**: "very slight corner rounding"; "edge whitening on one or two sides"; scratch lines "you'd only notice if you tilted the card".
|
|
29
|
+
- **Moderately played**: corners "clearly soft or rounded"; whitening "consistent around multiple sides"; "obvious scratch lines"; still no creases or bends.
|
|
30
|
+
- **Heavily played**: "corners that have lost their shape entirely"; "heavy whitening on all four edges", possible chipping; "deep scratches"; minor bends or creases.
|
|
31
|
+
- **Damaged**: "punched corners"; "visible creases, hard bends, tears"; "water staining".
|
|
32
|
+
|
|
33
|
+
For the numbered scale, a third-party summary of PSA's standards (cardgrading.app, which says it is not PSA) lists, for the top grades, "factory-sharp points on every corner" at 10, "one corner is allowed to have very slight wear" at 9, "multiple corners with light wear" at 8, "moderate corner wear" at 7, "rounded corners" at 5, and creases and staining at 4 and below; and, for centering, front tolerances widening from 55/45 at 10 to 85/15 at 5. Older cards are held to a softer standard (Wikipedia, same section).
|
|
34
|
+
|
|
35
|
+
**What was not read.** The grading companies' own pages (PSA, Beckett, SGC) and TCGplayer's condition guide returned HTTP 403 to the tools used, so the numbers above come from the secondary sources named, not from the graders. The preset levels are this package's reading of those words, not a grade: no preset is "a PSA 7". The grading companies' names and grades are not used in any preset.
|
|
36
|
+
|
|
37
|
+
## Presets
|
|
38
|
+
|
|
39
|
+
Each level runs from 0 (none) to 1 (the worst the preset names). Levels never fall from one preset to the next (a test checks it).
|
|
40
|
+
|
|
41
|
+
| Id | Name | Corners | Edges | Surface | Creases | Toning | Centering | In plain words |
|
|
42
|
+
|---|---|---|---|---|---|---|---|---|
|
|
43
|
+
| `perfect` | Perfect | 0 | 0 | 0 | 0 | 0 | 0 | No imperfections. Draws nothing. |
|
|
44
|
+
| `mint` | Mint | 0.05 | 0.05 | 0.06 | 0 | 0 | 0.1 | Nothing to the naked eye; a flaw or two only on close inspection. |
|
|
45
|
+
| `near-mint` | Near mint | 0.18 | 0.2 | 0.2 | 0 | 0 | 0.2 | Sharp corners, a trace of edge whitening, a few light scratches. |
|
|
46
|
+
| `lightly-played` | Lightly played | 0.38 | 0.45 | 0.4 | 0 | 0.05 | 0.3 | Very slight corner rounding, whitening on one or two edges, scratches seen when tilted. |
|
|
47
|
+
| `moderately-played` | Moderately played | 0.62 | 0.68 | 0.62 | 0.08 | 0.15 | 0.45 | Soft or rounded corners, whitening on several edges, obvious scratches, some gloss lost. |
|
|
48
|
+
| `heavily-played` | Heavily played | 0.82 | 0.9 | 0.85 | 0.3 | 0.3 | 0.6 | Corners that have lost their shape, heavy whitening, deep scratches, minor creases. |
|
|
49
|
+
| `damaged` | Damaged | 1 | 1 | 1 | 0.85 | 0.5 | 0.8 | Chipped and folded corners, hard creases, staining. |
|
|
50
|
+
|
|
51
|
+
## How each kind of wear is drawn
|
|
52
|
+
|
|
53
|
+
- **Corners.** Each corner has its own severity, from the level and the seed: sharp (a speck of whitening), soft (a larger radius), rounded, chipped (a jagged notch) or folded (a dog-ear that shows the back of the card). A card has at most one folded and two chipped corners; real damage rarely lands on all four. The outline of each face is a mask, so the drop shadow follows it. The back is the front seen from behind, so its corners are the front's mirrored.
|
|
54
|
+
- **Edges.** Small cream flecks of bare stock along the four edges, longer and deeper with more wear.
|
|
55
|
+
- **Surface.** Thin light scratches and dark or light specks. They lie over the face and its shine.
|
|
56
|
+
- **Creases.** Slightly curved lines with a light side and a shadow side; a heavy one also breaks the print (a dashed cream line). None below `moderately-played`.
|
|
57
|
+
- **Toning and staining.** A yellow-brown darkening towards the edges and, from heavy wear, a soft stain.
|
|
58
|
+
- **Centering.** The print sits off centre by up to 7 px across and 5 px down (at 300 px wide) at full level, so one border is wider than the other.
|
|
59
|
+
|
|
60
|
+
## Limits
|
|
61
|
+
|
|
62
|
+
- The 3D edge planes (the card's thickness) keep the perfect card's outline; at 0.3 mm that is about 1 px. A chipped or folded corner shows the thickness's normal corner behind it.
|
|
63
|
+
- Warping and bending of the whole card, rubbed foil patterns, dents and tears across the card are not drawn.
|
|
64
|
+
- Cards under the top one of a `stack` are drawn without wear; only the live top card is worn.
|
|
65
|
+
- `<fuda-collection>` draws the caller's pictures, so it does not apply wear; scans that are already worn show their own wear.
|
|
66
|
+
- Headless Chromium only; not checked on a real phone, Safari or Firefox.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/fuda-cards",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Fuda Cards: collectible card frames for images and interactive 3D content.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"docs/collection-input.md",
|
|
36
36
|
"docs/framework-integration.md",
|
|
37
37
|
"docs/materials.md",
|
|
38
|
+
"docs/wear.md",
|
|
38
39
|
"assets/README.md"
|
|
39
40
|
],
|
|
40
41
|
"engines": {
|