@johnmorrisdotca/dougu-sports 0.33.0 → 1.1.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSES/README.md +2 -11
  3. package/NOTICE.md +7 -5
  4. package/README.md +77 -25
  5. package/dist/element.js +18 -7
  6. package/dist/emblems/ball/ball.baseball.vintage.d.ts +3 -3
  7. package/dist/emblems/ball/ball.baseball.vintage.js +4 -4
  8. package/dist/emblems/ball/ball.basketball3x3.js +1 -1
  9. package/dist/emblems/ball/ball.index.d.ts +1 -1
  10. package/dist/emblems/ball/ball.index.js +1 -1
  11. package/dist/emblems/ball/ball.plastic.js +8 -10
  12. package/dist/emblems/ball/ball.soccer.vintage.js +3 -3
  13. package/dist/emblems/emblem.descriptions.js +24 -0
  14. package/dist/emblems/emblem.equipment.d.ts +1 -1
  15. package/dist/emblems/emblem.equipment.js +4 -4
  16. package/dist/emblems/emblem.ids.d.ts +25 -4
  17. package/dist/emblems/emblem.ids.js +16 -4
  18. package/dist/emblems/emblem.lathe.d.ts +4 -2
  19. package/dist/emblems/emblem.lathe.js +7 -5
  20. package/dist/emblems/emblem.named.js +30 -0
  21. package/dist/emblems/emblem.registry.js +6 -0
  22. package/dist/emblems/gear/gear.combat.d.ts +36 -0
  23. package/dist/emblems/gear/gear.combat.js +83 -0
  24. package/dist/emblems/gear/gear.index.d.ts +1 -1
  25. package/dist/emblems/gear/gear.index.js +3 -2
  26. package/dist/emblems/lathe.extras.js +2 -0
  27. package/dist/emblems/trophy/africa-cup-of-nations.d.ts +9 -0
  28. package/dist/emblems/trophy/africa-cup-of-nations.js +42 -0
  29. package/dist/emblems/trophy/ryder-cup.d.ts +9 -0
  30. package/dist/emblems/trophy/ryder-cup.js +44 -0
  31. package/dist/emblems/trophy/walter-a-brown-trophy.d.ts +9 -0
  32. package/dist/emblems/trophy/walter-a-brown-trophy.js +42 -0
  33. package/dist/emblems-entry.d.ts +1 -1
  34. package/dist/emblems-entry.js +2 -2
  35. package/dist/index.d.ts +4 -0
  36. package/dist/index.js +4 -0
  37. package/dist/revisions.json +1 -0
  38. package/dist/version.d.ts +1 -1
  39. package/dist/version.js +1 -1
  40. package/package.json +4 -2
package/CHANGELOG.md CHANGED
@@ -6,6 +6,27 @@ All notable changes to this project are written here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ - Add two turnable championship trophies: the 2002 Africa Cup of Nations trophy and the original Walter A. Brown Trophy.
10
+ - Cite primary sources for 3x3 basketball and vintage ball specifications, and distinguish the practice baseballs' illustrative slot dimensions from published measurements.
11
+
12
+ ## [1.1.0] - 2026-12-06
13
+
14
+ A minor version: it adds five emblems and changes no drawing that 1.0.0 gave.
15
+
16
+ - Add `trophy:ryder-cup` and four pieces of combat-sport gear: `gear:boxing-glove`, `gear:mma-glove`, `gear:wrestling-mat` and `gear:wrestling-ring`. The four sports now return their gear from `sportEquipment`.
17
+ - Keep autoplay paused on `<dougu-emblem>` attribute changes when the element is out of view or the reader prefers reduced motion.
18
+ - Add Japanese reference pages and bilingual gallery descriptions for awards, medals, crests and the championship pennant.
19
+ - Correct the catalogue counts, sport list, entry point examples and artwork credits.
20
+
21
+ ## [1.0.0] - 2026-12-03
22
+
23
+ This is the first stable version. From here the package follows semantic versioning: a patch fixes without changing any drawing, a minor adds emblems and options and redraws emblems (always listed here and in `revisions.json`), and a major removes an id or an export or breaks the API. An emblem id is never removed. To keep an emblem looking exactly as it does, pin an exact version: old versions stay on npm and on the CDN.
24
+
25
+ - **A revision for each emblem and brand mark.** Every emblem has a fixed drawing under its id, so `pnpm revisions` counts a revision from a fingerprint of the drawing `renderEmblem` gives for the id (and of `makerLogo` and `teamLogo` for the marks of `/brands`, as `maker:<id>` and `team:<id>`), kept in `scripts/revisions.json`: a redrawn emblem takes the next revision, and nothing else changes one. Every id starts at revision 1, and its `revisedIn` is 1.0.0, the first release to keep a ledger (the 0.x drawings are not fingerprinted).
26
+ - **`revisions.json`.** The package ships `@johnmorrisdotca/dougu-sports/revisions.json`: for every id its current revision, the version that revision first shipped in, and its history.
27
+ - **Ids that never go.** An emblem id is never removed or renamed so that it stops working. `RENAMED_IDS` in `/emblems` lists the ids that were renamed (the era balls, which early versions published under their year), each reading as the emblem that replaced it, as `EMBLEM_ALIASES` already did. `pnpm revisions` stops if a released id is neither an emblem nor renamed.
28
+ - **Versions.** The package follows semantic versioning as set out above, in the README's *Versions*, in `CONTRIBUTING.md` and in the upgrading guide (English and Japanese). The CDN address of the README's module example points at `@1`.
29
+
9
30
  ## [0.33.0] - 2026-11-04
10
31
 
11
32
  "Put it in your page" is the family's embed panel (MODULES-351). No change to the package's drawings.
@@ -1,14 +1,5 @@
1
1
  # Licences
2
2
 
3
- The code of this package is under the MIT licence: [MIT.txt](MIT.txt), the same text as [../LICENSE](../LICENSE).
3
+ The code and artwork in this package are under the MIT licence. [MIT.txt](MIT.txt) contains the same text as [the root licence](../LICENSE).
4
4
 
5
- Art taken from another project keeps its own licence, and that licence's text is kept in this folder, named for the licence, as soon as an emblem that uses it ships. [../NOTICE.md](../NOTICE.md) says which emblem comes from which source, under which licence, and what credit it asks for.
6
-
7
- | File | Licence | Covers |
8
- | --- | --- | --- |
9
- | [MIT.txt](MIT.txt) | MIT | The code of the package, and the art drawn for it (`source` `ours`, `generated` or `drawn`) |
10
- | [Apache-2.0.txt](Apache-2.0.txt) | Apache License 2.0 | Material Symbols (Google: sixteen icons), the Noto emoji shapes (Google) and Pictogrammers Material Design Icons (the line versions of some gear), where an emblem is taken from them |
11
- | [CC-BY-3.0.txt](CC-BY-3.0.txt) | Creative Commons Attribution 3.0 | game-icons.net icons (the baseball glove), each credited to its author in NOTICE.md |
12
- | [upstream/](upstream/) | Each upstream's own licence file, as found in its repository | Noto Emoji `2D/svg`, Pictogrammers MDI, game-icons.net |
13
-
14
- A source that is not in the table is not used: a new one is added here and to NOTICE.md in the same change as the emblem that needs it.
5
+ [NOTICE.md](../NOTICE.md) lists the references for facts about sports equipment. [The trophy source table](../docs/likeness-sources.md) lists reference photographs and their licences. The published SVG artwork is drawn for this package.
package/NOTICE.md CHANGED
@@ -9,10 +9,12 @@ The made-up maker marks and team logos (`@johnmorrisdotca/dougu-sports/brands`)
9
9
  ## How the art is made
10
10
 
11
11
  - The trophies, medals, crests, awards and sport pictograms are drawn in SVG by hand in a simplified, generic form. No real trophy, medal, logo, mark or engraving was copied or traced, and no photograph was traced (photographs were looked at, never copied).
12
+ - The Africa Cup of Nations trophy's globe uses selected coastline points read from [Natural Earth land data](https://www.naturalearthdata.com/downloads/110m-physical-vectors/110m-land/), which is [in the public domain](https://www.naturalearthdata.com/about/terms-of-use/).
12
13
  - The balls (`src/emblems/ball/`) are drawn by this package's own code: a rotation, a projection and our own geometry (a seam curve, the truncated icosahedron, an octahedron and an icosahedron, a layout of curved panels, a fitted basketball channel). The vintage, era-style and patterned balls ([docs/vintage-balls.md](docs/vintage-balls.md)) are our own graphics laid on those constructions (shapes placed on the sphere, rows of stitches, a lace, scuffs): the shop-wall patterns and the era styles were suggested by photographs the package's author supplied, which were looked at and not copied or traced, and no real ball's pattern, mark or name is used. The volleyballs take only three colours from a country's flag, and draw no flag.
13
14
  - The printed pucks (`puck:*`, `src/emblems/ball/ball.puck.print.ts`) are our own drawings: the maple leaf, the flags of the Canadian and United States patterns and the stars are drawn from simple geometry, the lettering is a stroke alphabet adapted from the block letters of the author's own senshu-jerseys (same author, same MIT licence, no font file), and the signature is made by a seeded pen, so it is no real person's. Photographs of souvenir pucks were looked at for what such a puck shows (a flag, a name, a number, a signature, a ring of words) and nothing was copied or traced. No team's or league's logo or wordmark, no maker's mark and no real player's name is used.
14
15
  - The made-up logos (`src/brands/`) are our own geometry: polygons, arcs and spirals worked out for this package and tuned by eye, with wordmarks set in our own stroke alphabet (`brand.letters.ts`, no font file). No real logo was traced, and no real mark was used as a base; the notes in `docs/brands.md` say what each was held against.
15
16
  - The gear (`src/emblems/gear/`) is drawn by us from a list of parts (a path, a colour, how it reads as a line); the bow, the arrow and the other tapering shapes are made by a small function of ours (`swell`), and the rest are paths written for this package.
17
+ - The [combat sports references](docs/references.md#combat-sports-gear) name the rules used for the boxing and MMA gloves, wrestling mat and professional wrestling ring.
16
18
  - The demo's podium shows the round flags of Japan, France and Italy from [Hata](https://github.com/johnmorrisdotca/hata) 1.5.0 (`demo/flags-data.ts`, made by `scripts/make-flags.mjs`; a development dependency of the demo, never of the package). Hata's manifest lists each of the three as public domain, so no credit is required.
17
19
  - The backgrounds behind the README pictures and the demo's preview (`scripts/family-backgrounds.ts`, version 1.0.0) are the family's shared module, copied byte for byte from taisen-brackets: twenty-five backgrounds drawn in code from gradients, patterns and paths, all by this package's author, none traced from a picture, a poster, a logo, a trophy or a photograph (MIT). It is tooling: the package ships none of it, and no emblem is drawn on a background.
18
20
  - The Japanese words for the Japanese items are the ones the sports' governing bodies use in their own rules and equipment lists (kendo, judo, kyudo and karate federations and the sumo association); the bodies' names and marks are not used in any id, title or drawing.
@@ -30,12 +32,12 @@ Each ball's `size.rule` names the rule; the table gives the document and where i
30
32
  | `ball:soccer`, `ball:soccer-colour`, `ball:soccer-26`, `ball:soccer-18`, `ball:soccer-14`, `ball:soccer-12`, `ball:soccer-6`, `ball:soccer-orange`, `ball:soccer-26-orange`, `ball:soccer-18-orange`, `ball:soccer-14-orange`, `ball:soccer-12-orange`, `ball:soccer-6-orange`, `ball:soccer-yellow`, `ball:soccer-26-yellow`, `ball:soccer-18-yellow`, `ball:soccer-14-yellow`, `ball:soccer-12-yellow`, `ball:soccer-6-yellow`, `ball:soccer-1960-32-panel-leather`, `ball:soccer-retro-pentagons`, `ball:soccer-retro-leaves`, `ball:soccer-retro-rosette`, `ball:soccer-retro-pinwheel`, `ball:soccer-retro-kites`, `ball:soccer-14-panel-double-border`, `ball:soccer-8-panel-plain`, `ball:soccer-6-panel-bands`, `ball:soccer-6-panel-diamonds`, `ball:soccer-20-panel-dots`, `ball:soccer-training-high-vis`, `ball:soccer-stars-blue`, `ball:soccer-stars-red`, `ball:soccer-stars-night`, `ball:soccer-hexagons-cyan`, `ball:soccer-hexagons-magenta`, `ball:soccer-hexagons-lime`, `ball:soccer-flames-fire`, `ball:soccer-flames-ice`, `ball:soccer-flames-toxic`, `ball:soccer-chevrons-red`, `ball:soccer-chevrons-green`, `ball:soccer-chevrons-blue`, `ball:soccer-swirl-blue`, `ball:soccer-swirl-red`, `ball:soccer-swirl-teal`, `ball:soccer-metallic-gold`, `ball:soccer-metallic-silver`, `ball:soccer-metallic-cobalt` | IFAB Laws of the Game, Law 2 The Ball, section 2.1 Qualities and measurements | https://www.theifab.com/laws/latest/the-ball/ |
31
33
  | `ball:futsal` | Futsal Laws of the Game 2025/26, Law 2 The Ball, section 1 Qualities and measurements (circumference 62-64 cm, 400-440 g, 0.6-0.9 atm, bounce 50-65 cm from 2 m) | https://digitalhub.fifa.com/m/20d52e6779b53321/original/FUTSAL-Laws-of-the-Game-2025-2026.pdf |
32
34
  | `ball:beach-soccer` | Beach Soccer Laws of the Game 2024-25, Law 2 The Ball, section 1 Qualities and measurements (circumference 68-70 cm, 400-440 g, 0.4-0.6 atm); the 2021/22 edition has the same figures | https://www.the-aiff.com/media/uploads/2024/11/Beach-Soccer-Laws-of-the-Game-2024-25.pdf |
33
- | `ball:soccer-1870-hand-stitched`, `ball:soccer-1900-laced`, `ball:soccer-1930-18-panel`, `ball:soccer-1950-12-panel` | Laws of the Game of the Football Association, revised 1872: a sphere 27 to 28 inches round (no mass given: the early figures could not be confirmed in a primary text); read in Wikipedia's account of the 1872 revision (secondary) | https://en.wikipedia.org/wiki/Ball_(association_football) |
35
+ | `ball:soccer-1870-hand-stitched`, `ball:soccer-1900-laced`, `ball:soccer-1930-18-panel`, `ball:soccer-1950-12-panel` | IFAB Laws of the Game 1903/04, Law 1, The Ball (27 to 28 inches of circumference, used as the reference size for the four drawings) | https://downloads.theifab.com/downloads/laws-of-the-game-1903-04?l=en#page=4 |
34
36
  | `ball:teqball` | FITEQ Official Rules and Regulations of Teqball 2026, Rule 3 The Official Ball, 3.1.1-3.1.6 | https://cdn.buttercms.com/s6Mb1gRkRJuFP38kpMTh |
35
37
  | `ball:basketball` | FIBA Basketball Equipment 2026, Rule 2 Basketballs, 2.4 and Table 1 (size 7 = men's competitions) | https://assets.fiba.basketball/image/upload/documents-corporate-fiba-official-rules-2026-equipment-v1-0.pdf |
36
38
  | `ball:basketball-6` | FIBA Basketball Equipment 2026, Rule 2 Basketballs, 2.4 and Table 1 (size 6 = women's competitions) | https://assets.fiba.basketball/image/upload/documents-corporate-fiba-official-rules-2026-equipment-v1-0.pdf |
37
- | `ball:basketball-3x3` | FIBA 3x3 Official Equipment & Software Appendix to the 3x3 Official Rules (Dec 2024 update), Table 1 and section 5.7 (as quoted by balls.com) (not read in the primary text: see the ball's note) | https://fiba3x3.com/docs/equipment-and-software-appendix-to-the-3x3-official-rules.pdf |
38
- | `ball:baseball`, `ball:baseball-lemon-peel`, `ball:baseball-red-blue`, `ball:baseball-black-red`, `ball:baseball-vintage-leather` | Official Baseball Rules, Rule 3.01 The Ball (the lemon-peel ball is drawn at today's size: no rule fixed the ball in the 1850s and 1860s) | https://mktg.mlbstatic.com/mlb/official-information/2026-official-baseball-rules.pdf |
39
+ | `ball:basketball-3x3` | FIBA 3x3 Equipment & Software Appendix to the 3x3 Official Rules (December 2024), section 5.7 and Table 1 (720 to 740 mm, 580 to 620 g, two principal contrasting colours) | https://fiba3x3.basketball/docs/equipment-and-software-appendix-to-the-3x3-official-rules.pdf#page=10 |
40
+ | `ball:baseball`, `ball:baseball-lemon-peel`, `ball:baseball-red-blue`, `ball:baseball-black-red`, `ball:baseball-vintage-leather` | Official Baseball Rules, Rule 3.01 The Ball (today's ball size is the reference for the vintage drawings) | https://mktg.mlbstatic.com/mlb/official-information/2026-official-baseball-rules.pdf |
39
41
  | `ball:softball-11-optic` | WBSC Official Rules of Softball Slow Pitch 2026-2029, Appendix 3 (Ball Standards), B.2 and the 'Ball standards' table: the 27.9 cm (11 in) ball, circumference 27.6 to 28.3 cm, 166.5 to 173.6 g, white or yellow optic, red stitch (read in the full text, 2026-10-14) | https://static.wbsc.org/uploads/federations/0/cms/documents/5f45c5e4-54ed-3659-8116-4d7cb5051f69.pdf |
40
42
  | `ball:softball` | WBSC Official Rules of Softball Slow Pitch 2026-2029, Appendix 3 (Ball Specifications), B. Dimensions and Specifications and 'Ball standards' table; Fast Pitch 2026-2029 Appendix 3 gives the same 12 in ball | https://static.wbsc.org/uploads/federations/0/cms/documents/5f45c5e4-54ed-3659-8116-4d7cb5051f69.pdf |
41
43
  | `ball:tennis` | ITF Rules of Tennis, Rule 3 The Ball and Appendix I The Ball (a)-(c) | https://www.itftennis.com/media/7221/2026-rules-of-tennis-english.pdf |
@@ -52,8 +54,8 @@ Each ball's `size.rule` names the rule; the table gives the document and where i
52
54
  | `ball:gaelic-football` | GAA Official Guide Part 2, Rules of Specification, Rule 4.4(ii) | https://www.galwaygaa.ie/wp-content/uploads/2026/02/Official-Guide-Part-2.pdf |
53
55
  | `ball:netball` | World Netball Rules of Netball, Rule 1 (Equipment: Ball), item 15 a-d | https://netballhamilton.org.nz/media/1997/world-netball-rules-book-2024.pdf |
54
56
  | `ball:pickleball-outdoor`, `ball:pickleball-indoor` | USA Pickleball Equipment Standards Manual (Jan 2025, Revision 3.0), 2.D.1 Design, 2.D.3 Size, 2.D.4 Weight, 2.D.8 Design (holes); USA Pickleball 2026 Official Rulebook rule 3.C Ball Specifications | https://equipment.usapickleball.org/docs/Equipment-Standards-Manual.pdf |
55
- | `ball:plastic-baseball-slotted` | English Wikipedia, the article on the hollow plastic practice ball with eight oblong holes (accessed 2026-10-21): hollow plastic, wall at most 1/8 in (3.2 mm), eight oblong holes of 0.75 in (19 mm) on one half only, about the size of a regulation baseball; the size is a baseball's, from Official Baseball Rules, Rule 3.01 The Ball | no link: the article is titled with the maker's registered trademark, which this package does not use |
56
- | `ball:plastic-baseball-practice`, `-white`, `-orange` | The same English Wikipedia article on the hollow plastic practice ball (accessed 2026-10-21) for the material and the wall; Official Baseball Rules, Rule 3.01, for the size. The number, size and layout of the slots (about 22 by 14 mm, oval), and the two tones, are drawn from product photographs looked at and never copied or traced; no maker's name or mark is used | https://en.wikipedia.org/wiki/Wiffle_ball |
57
+ | `ball:plastic-baseball-slotted` | Official Baseball Rules, Rule 3.01 The Ball, for the reference diameter. The count, size and layout of the slots and the wall thickness are drawing choices; no primary source confirms them. No maker's name or mark is used in the drawing. | [Official Baseball Rules](https://mktg.mlbstatic.com/mlb/official-information/2026-official-baseball-rules.pdf), [United States patent 2,776,139](https://patents.google.com/patent/US2776139A/en) |
58
+ | `ball:plastic-baseball-practice`, `-white`, `-orange` | Official Baseball Rules, Rule 3.01 The Ball, for the reference diameter. The slot count, dimensions, layout and colours describe the drawing. No maker's name or mark is used in the drawing. | https://mktg.mlbstatic.com/mlb/official-information/2026-official-baseball-rules.pdf |
57
59
  | `ball:squash` and its coloured dots | World Squash 'Specifications for Squash Balls' (Recommended standards approved by the WSF; updated WSF AGM 2021, rebranded 2025), sections 1-3 and Notes 2-4 | https://www.worldsquash.sport/wp-content/uploads/2025/07/211127_Ball-Specifications.pdf |
58
60
  | `ball:racquetball` | USA Racquetball Rules, Rule 2.2 Ball Specifications (a)-(b); Rule 2.3 Ball Selection | https://www.usaracquetball.com/play/rules/2-courts-and-equipment |
59
61
  | `ball:lacrosse` | World Lacrosse Rules of Men's Field Lacrosse 2025-2027 (Ver 1.0), Section 2 Equipment, Rule 14 The Ball, 14.1 | https://www.bclacrosse.com/Referees%20and%20Officials/World%20Lacrosse%20Men's%20Field%20Rule%20Book.pdf |
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <h1 align="center">Dougu Sports <sub>道具</sub></h1>
4
4
 
5
5
  <p align="center"><strong>Sports emblems as SVG strings, with optional 3D turning.</strong><br>
6
- The ball and the gear of every sport, trophies, medals, crests and the icon of every sport, each one a function that returns SVG: in polished metal, in one line, or in flat colour, light and dark, any size, any tint. Turn one about its axis and it is another string. Each emblem is its own module, so a page that wants one trophy takes one trophy. MIT, with no dependencies.</p>
6
+ Trophies, medals, crests, sport icons, balls and gear, each one a function that returns SVG: in polished metal, in one line, or in flat colour, light and dark, any size, any tint. Turn one about its axis and it is another string. Each emblem is its own module, so a page that wants one trophy takes one trophy. MIT, with no dependencies.</p>
7
7
 
8
8
  <p align="center">
9
9
  <a href="https://github.com/johnmorrisdotca/dougu-sports/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/johnmorrisdotca/dougu-sports/actions/workflows/ci.yml/badge.svg"></a>
@@ -39,14 +39,14 @@ The ball and the gear of every sport, trophies, medals, crests and the icon of e
39
39
  <p align="center">
40
40
  <picture>
41
41
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/famous-desk-dark.webp">
42
- <img alt="Thirty-six famous trophies on royal purple, each with its name under it: the FIFA World Cup, the Stanley Cup, the Lombardi Trophy, the Larry O'Brien trophy, the Grey Cup, the FA Cup, the America's Cup, the Ashes urn and the Webb Ellis Cup among them, then the baseball awards and the NHL's Hart, Vezina, Norris and Calder trophies." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/famous-desk-light.webp" width="760">
42
+ <img alt="Forty famous trophies on royal purple, each with its name under it: the FIFA World Cup, the Stanley Cup, the Lombardi Trophy, the Larry O'Brien trophy, the Grey Cup, the FA Cup, the America's Cup, the Ryder Cup, the Ashes urn and the Webb Ellis Cup among them, then the baseball awards and the NHL's Hart, Vezina, Norris and Calder trophies." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/famous-desk-light.webp" width="760">
43
43
  </picture>
44
44
  </p>
45
45
 
46
46
  <p align="center">
47
47
  <picture>
48
48
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/gear-desk-dark.webp">
49
- <img alt="Thirty-six pieces of gear in four rows of nine: hockey stick and skate, a goalie mask, field hockey, lacrosse and hurling sticks, a cricket bat and wicket, a baseball bat and glove, a football helmet and goalposts, a basketball hoop, a volleyball net, rackets and paddles, a curling broom, skates, swim goggles, starting blocks, a baton, a javelin, a hurdle, and the kendo, sumo, judo, kyudo and karate gear of Japan." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/gear-desk-light.webp" width="760">
49
+ <img alt="Forty pieces of gear in four rows of ten: hockey stick and skate, a goalie mask, field hockey, lacrosse and hurling sticks, a cricket bat and wicket, a baseball bat and glove, a football helmet and goalposts, a basketball hoop, a volleyball net, rackets and paddles, a curling broom, skates, swim goggles, starting blocks, a baton, a javelin, a hurdle, Japanese budo gear, a boxing glove, an MMA glove, a wrestling mat and a professional wrestling ring." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/gear-desk-light.webp" width="760">
50
50
  </picture>
51
51
  </p>
52
52
 
@@ -63,7 +63,7 @@ The ball and the gear of every sport, trophies, medals, crests and the icon of e
63
63
 
64
64
  ## The best of it
65
65
 
66
- - **66 famous trophies**, each a close likeness measured on a photograph and carrying no lettering, logo or mark: the Stanley Cup, the FIFA World Cup, the Lombardi Trophy, the Larry O'Brien trophy, the Grey Cup and the rest ([famous trophies](./docs/famous-trophies.md)).
66
+ - **70 famous trophies**, each a close likeness measured on a photograph and carrying no lettering, logo or mark: the Stanley Cup, the FIFA World Cup, the Lombardi Trophy, the Larry O'Brien trophy, the Grey Cup and the rest ([famous trophies](./docs/famous-trophies.md)).
67
67
 
68
68
  <p align="center">
69
69
  <picture>
@@ -72,7 +72,14 @@ The ball and the gear of every sport, trophies, medals, crests and the icon of e
72
72
  </picture>
73
73
  </p>
74
74
 
75
- - **118 balls and implements in 3D**, from the 32-panel soccer ball to the pucks and the curling stone, that roll as they turn ([gallery](./docs/gallery.md), [vintage and era-style balls](./docs/vintage-balls.md)).
75
+ <p align="center">
76
+ <picture>
77
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/championship-trophies-dark.webp">
78
+ <img alt="Two views each of the Africa Cup of Nations trophy with its golden globe and the Walter A. Brown Trophy with its wide silver bowl." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/championship-trophies-light.webp" width="520">
79
+ </picture>
80
+ </p>
81
+
82
+ - **121 balls and implements in 3D**, from the 32-panel soccer ball to the pucks and the curling stone, that roll as they turn ([gallery](./docs/gallery.md), [vintage and era-style balls](./docs/vintage-balls.md)).
76
83
 
77
84
  <p align="center">
78
85
  <picture>
@@ -106,7 +113,7 @@ The ball and the gear of every sport, trophies, medals, crests and the icon of e
106
113
  </picture>
107
114
  </p>
108
115
 
109
- - **Trophies, medals, crests and the icon of every sport**, in metal, one line or flat colour, light and dark.
116
+ - **Trophies, medals, crests and sport pictograms**, in metal, one line or flat colour, light and dark.
110
117
 
111
118
  <p align="center">
112
119
  <picture>
@@ -115,11 +122,11 @@ The ball and the gear of every sport, trophies, medals, crests and the icon of e
115
122
  </picture>
116
123
  </p>
117
124
 
118
- - **71 pieces of gear**, among them the Japanese sports and budo ([Japanese sports](./docs/japanese-sports.md)).
125
+ - **75 pieces of gear**, among them the Japanese sports and budo ([Japanese sports](./docs/japanese-sports.md)).
119
126
 
120
127
  - **On a phone**, and **turned by hand**: drag, arrow keys or the automatic turn ([turning](./docs/turning.md)).
121
128
 
122
- > **Status: preview.** 346 emblems: 90 trophies, 6 awards, 6 medals, 4 crests, a pictogram for each of the 42 sports, 118 balls and implements drawn in 3D, 8 printed pucks ([docs/pucks.md](./docs/pucks.md)), 71 pieces of gear (among them the Japanese sports and budo, [docs/japanese-sports.md](./docs/japanese-sports.md)) and a championship pennant; [docs/layout.md](./docs/layout.md) says where each goes. All of it is drawn for this package: no art is copied from another project.
129
+ > **356 emblems** in nine groups: 93 trophies, 6 awards, 6 medals, 4 crests, a pictogram for each of the 42 sports, 121 balls and implements drawn in 3D, 8 printed pucks ([docs/pucks.md](./docs/pucks.md)), 75 pieces of gear (among them the Japanese sports and budo, [docs/japanese-sports.md](./docs/japanese-sports.md)) and a championship pennant; [docs/layout.md](./docs/layout.md) says where each goes. All of it is drawn for this package: no art is copied from another project.
123
130
 
124
131
  ## In 30 seconds
125
132
 
@@ -143,11 +150,11 @@ Put the string in a page (`element.innerHTML = svg`), write it to a file, or sen
143
150
  - **Sports sites** that mark a champion, a result or a list with a trophy, a medal or a crest, without licensing a logo.
144
151
  - **Scoreboards and brackets** that want a generic emblem for a team that has no logo, tinted in the team's colour.
145
152
  - **Anyone building a game or a card** who needs a ball or a piece of gear for a sport, in one style that matches the rest.
146
- - **Pages that care about weight**: one emblem is one module, 2 to 7 kB gzipped with the renderer for its kind (a medal about 4.5, a turning cup about 7, an icon 2 to 3.6), and the package says `"sideEffects": false`.
153
+ - **Pages that care about weight**: one emblem is one module, 2 to 7 kB gzipped with the renderer for its kind (a medal about 4.5, a turning cup about 7, an icon 2 to 3.6), and the package declares a side effect only for the element registration.
147
154
 
148
155
  ## Features
149
156
 
150
- - **Equipment first (道具 is the word for it)**: 118 balls and implements drawn in 3D, from the 32-panel soccer ball to the 26, 18, 14, 12 and 6 panel constructions, vintage leather balls, era-style and shop-wall soccer balls, baseballs of other threads, volleyballs in national colours ([docs/vintage-balls.md](./docs/vintage-balls.md)), futsal, beach soccer and the pucks and stones, each with its official size, 8 printed pucks (a flag, a leaf, stars and stripes, a player's number, a made-up signature, your own picture: [docs/pucks.md](./docs/pucks.md)), and 42 pieces of gear (sticks, rackets, helmets, skates, nets, and the Japanese budo kit) drawn to match; see [docs/gallery.md](./docs/gallery.md).
157
+ - **Equipment first (道具 is the word for it)**: 121 balls and implements drawn in 3D, from the 32-panel soccer ball to the 26, 18, 14, 12 and 6 panel constructions, vintage leather balls, era-style and shop-wall soccer balls, baseballs of other threads, volleyballs in national colours ([docs/vintage-balls.md](./docs/vintage-balls.md)), futsal, beach soccer and the pucks and stones, each with its size reference, 8 printed pucks (a flag, a leaf, stars and stripes, a player's number, a made-up signature, your own picture: [docs/pucks.md](./docs/pucks.md)), and 75 pieces of gear (sticks, rackets, helmets, skates, nets, and the Japanese budo kit) drawn to match; see [docs/gallery.md](./docs/gallery.md).
151
158
  - **Three styles** for every emblem: `metal` (polished metal: a gradient, a highlight and a soft rim of reflected light, edged in a darker tone of its own metal, with no heavy outline), `line` (one clean outline in the page's text colour, made to read at 14 pixels) and `color` (flat fills); see [Theming](#theming).
152
159
  - **Size, tint, accent and theme** as options: a tint recolours the main part (a medal's metal, a crest's colour, a ball's patches; not the body of a golf ball or a baseball, whose colour the sport fixes), an accent the second colour (a ribbon, a crest's band, the pennants), a theme sets the ink for light, dark or either.
153
160
  - **Turning**: `emblemFrame` and `ballFrame` return the emblem at an angle, in plain SVG: every emblem turns, a ball rolls, a cup keeps its outline and moves its light, and everything flat (a medal, a crest, a banner, gear, a bat, a crown, a sport's icon) flips like a coin with a solid edge, a back of its own and its ribbon or pole seen from behind; `bindTurn` lets a drag, the arrow keys or an auto-turn do the turning in a page; see [docs/turning.md](./docs/turning.md).
@@ -210,7 +217,9 @@ The alias is a name in your `package.json` only: the same package, the same code
210
217
  | `@johnmorrisdotca/dougu-sports/brands` | Experimental, designs will change: twelve made-up maker marks and ten made-up team logos as SVG (`makerLogo`, `teamLogo`, `makerBall`, `renderMakerBall`, the groups to place in a drawing and the data); see [docs/brands.md](./docs/brands.md) |
211
218
  | `@johnmorrisdotca/dougu-sports/element` | `<dougu-emblem>`, the tag that draws an emblem in any page, still or turning (the only entry with a side effect: it registers the tag) |
212
219
  | `@johnmorrisdotca/dougu-sports/turn` | `emblemFrame`, `ballFrame` and `bindTurn`; `bindTurn` with an emblem object takes nothing else with it |
213
- | `@johnmorrisdotca/dougu-sports/<group>/<name>` | One emblem, alone: `trophy/hockey-cup`, `medal/gold`, `crest/shield`, `sport/nhl`, `award/crown`, `ball/soccer`, `pennant/championship`, `gear/<name>` |
220
+ | `@johnmorrisdotca/dougu-sports/revisions.json` | Drawing revisions and release history by id |
221
+ | `@johnmorrisdotca/dougu-sports/<group>/<name>` | One emblem, such as `trophy/hockey-cup`, `medal/gold`, `crest/shield`, `sport/nhl`, `award/crown` or `pennant/championship` |
222
+ | `@johnmorrisdotca/dougu-sports/ball/ball.<family>`, `@johnmorrisdotca/dougu-sports/gear/gear.<family>` | Balls and gear by family, such as `ball/ball.soccer` and `gear/gear.sticks` |
214
223
 
215
224
  ### One emblem and nothing else
216
225
 
@@ -221,7 +230,16 @@ console.log(TROPHY_HOCKEY_CUP.id); // trophy:hockey-cup
221
230
  console.log(TROPHY_HOCKEY_CUP.svg({ size: 24 }).includes('width="24"')); // true
222
231
  ```
223
232
 
224
- A bundler that imports this module takes the cup and the renderer for a body of revolution, and no other emblem: the package's `sideEffects` names only `./dist/element.js`, and each constant is marked pure. `test/size.test.ts` bundles one item with esbuild and holds it to a limit for its kind (a ball 7.6 kB, a medal or a crest 4.6 kB, a cup 7.1 kB gzipped, most of that the renderer); `pnpm test:package` does the same from the packed tarball.
233
+ A bundler that imports this module takes the cup and the renderer for a body of revolution, and no other emblem: the package's `sideEffects` names only `./dist/element.js`, and each constant is marked pure. `test/size.test.ts` bundles one item with esbuild and holds it to a limit for its kind (a ball 7.6 KiB, a medal or a crest 5.8 KiB, a cup 7.5 KiB gzipped, most of that the renderer); `pnpm test:package` does the same from the packed tarball.
234
+
235
+ For balls and gear, use the family module and import the constant you want.
236
+
237
+ ```js
238
+ import { BALL_SOCCER } from "@johnmorrisdotca/dougu-sports/ball/ball.soccer";
239
+ import { GEAR_HURLEY } from "@johnmorrisdotca/dougu-sports/gear/gear.sticks";
240
+
241
+ console.log(BALL_SOCCER.id, GEAR_HURLEY.id); // ball:soccer gear:hurley
242
+ ```
225
243
 
226
244
  ### Put it in your page
227
245
 
@@ -286,7 +304,7 @@ export function DouguEmblem({ emblem = "trophy:stanley-cup", size = 200 }: { emb
286
304
  ```html
287
305
  <span id="trophy"></span>
288
306
  <script type="module">
289
- import { renderEmblem } from "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/dougu-sports@0/emblems";
307
+ import { renderEmblem } from "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/dougu-sports@1/emblems";
290
308
  document.getElementById("trophy").innerHTML = renderEmblem("trophy:hockey-cup", { size: 40 });
291
309
  </script>
292
310
  ```
@@ -469,7 +487,7 @@ console.log(nhl.ball, nhl.trophy); // ball:puck trophy:hockey-cup
469
487
  console.log(nhl.gear.join(" ")); // gear:hockey-stick gear:hockey-skate gear:goalie-mask gear:goal-net
470
488
  ```
471
489
 
472
- Each of the 38 sports has a trophy, most have a ball and gear, and a sport in the Games has a medal; every id is one `renderEmblem` draws.
490
+ Each of the 42 sports has a trophy, most have a ball and gear, and a sport in the Games has a medal; every id is one `renderEmblem` draws.
473
491
 
474
492
  ### A podium and an award case
475
493
 
@@ -521,17 +539,17 @@ An emblem is a small object: `id`, `en` and `ja` names, a `source` (who drew it)
521
539
 
522
540
  | Group | What it holds | Folder |
523
541
  | --- | --- | --- |
524
- | `award` | Five awards: a medal, a badge, a crown, a star, a shield | `src/emblems/award/` |
525
- | `trophy` | Twenty-four trophies: ten that stand for a league's cup in a generic form (a tall banded cup, a ring of pennants round a baseball, a football on a stand, a ball over a net, a wide two-handled bowl, a globe held up by spiral figures, a gilt dish, a lidded cup with a pineapple, an urn, a gilded cup), plain cups, bowls and dishes, a plaque, a belt, a wreath, a rosette, a championship ring, a rafter banner, a phoenix-handled sumo cup and a championship banner | `src/emblems/trophy/` |
542
+ | `award` | Six awards including a medal, a badge, a crown, a star, a shield and a ribbon | `src/emblems/award/` |
543
+ | `trophy` | 93 trophies, including 70 [named trophies](./docs/famous-trophies.md) and ten that stand for a league's cup in a generic form (a tall banded cup, a ring of pennants round a baseball, a football on a stand, a ball over a net, a wide two-handled bowl, a globe held up by spiral figures, a gilt dish, a lidded cup with a pineapple, an urn, a gilded cup), plain cups, bowls and dishes, a plaque, a belt, a wreath, a rosette, a championship ring, a rafter banner, a phoenix-handled sumo cup and a championship banner | `src/emblems/trophy/` |
526
544
  | `medal` | Gold, silver and bronze medals on a ribbon of five stripes, and a badge for each of the first three places | `src/emblems/medal/` |
527
545
  | `crest` | Four generic crests, tinted by a team's colours, with its letters | `src/emblems/crest/` |
528
- | `ball` | 118 balls and implements, in 3D, each with its official size: soccer (in 32, 26, 18, 14, 12 and 6 panels, in three colourways, with futsal and beach soccer; [docs/soccer-balls.md](./docs/soccer-balls.md); and vintage leather, era-style and patterned balls, [docs/vintage-balls.md](./docs/vintage-balls.md)), basketball, baseball, tennis, rugby, the footballs, golf, the puck, the curling stone and the rest | `src/emblems/ball/` |
546
+ | `ball` | 121 balls and implements in 3D, each with a size reference: soccer (in 32, 26, 18, 14, 12 and 6 panels, in three colourways, with futsal and beach soccer; [docs/soccer-balls.md](./docs/soccer-balls.md); and vintage leather, era-style and patterned balls, [docs/vintage-balls.md](./docs/vintage-balls.md)), basketball, baseball, tennis, rugby, the footballs, golf, the puck, the curling stone and the rest | `src/emblems/ball/` |
529
547
  | `puck` | 8 printed pucks: the same puck with a print on its top face that turns with it (a flag and CANADA, a red leaf, stars and stripes, a player's name and number, a made-up signature, a souvenir), and a `face` option for any picture, emblem or flag code; [docs/pucks.md](./docs/pucks.md) | `src/emblems/ball/ball.puck.print.ts` |
530
- | `gear` | 67 pieces of equipment: sticks, rackets, skates, a glove, a helmet, nets and posts, a javelin, starting blocks, and for the Japanese sports a war fan, a sumo belt, a bamboo sword, a kendo helmet, the judo suit (white and blue, laid flat and folded, and from behind with its back number), the belts of every grade (white to red, the red-and-white belt, the women's black belt and the two-colour belts) and the six steps of tying one, a long bow, an arrow and a karate suit | `src/emblems/gear/` |
548
+ | `gear` | 75 pieces of equipment: sticks, rackets, skates, a glove, a helmet, nets and posts, a javelin, starting blocks, and for the Japanese sports a war fan, a sumo belt, a bamboo sword, a kendo helmet, the judo suit (white and blue, laid flat and folded, and from behind with its back number), the belts of every grade (white to red, the red-and-white belt, the women's black belt and the two-colour belts) and the six steps of tying one, a long bow, an arrow and a karate suit | `src/emblems/gear/` |
531
549
  | `sport` | One pictogram for each of the forty-two sports | `src/emblems/sport/` |
532
550
  | `pennant` | A felt championship pennant on a dowel, with a stitched edge, lettered with its words and its year | `src/emblems/pennant/` |
533
551
 
534
- The forty-two sports the ball, gear and sport emblems are made for are `SPORT_NAMES` (the five Japanese ones, sumo, kendo, judo, kyudo and karate, have a pictogram and their gear, and no ball; the four combat sports, MMA, boxing, wrestling and professional wrestling, have a pictogram and no ball or gear yet): NFL, CFL, IFAF, NHL, NBA, MLB, soccer, curling, tennis, volleyball, badminton, pickleball, table tennis, padel, squash, racquetball, sepak takraw, teqball, roundnet, netball, swimming, water polo, diving, artistic swimming, lacrosse, rugby, Australian football, Gaelic games, cricket, field hockey, handball, athletics and skating. How the trophies are drawn, and what each stands for, is in [docs/emblems.md](./docs/emblems.md); the balls and the gear are described in [src/emblems/README.md](./src/emblems/README.md).
552
+ The forty-two sports the ball, gear and sport emblems are made for are `SPORT_NAMES` (the five Japanese ones, sumo, kendo, judo, kyudo and karate, have a pictogram and their gear, and no ball; the four combat sports, MMA, boxing, wrestling and professional wrestling, have a pictogram and a piece of gear): NFL, CFL, IFAF, NHL, NBA, MLB, soccer, curling, tennis, volleyball, badminton, pickleball, table tennis, padel, squash, racquetball, sepak takraw, teqball, roundnet, netball, swimming, water polo, diving, artistic swimming, lacrosse, rugby, Australian football, Gaelic games, cricket, field hockey, handball, athletics, skating, sumo, kendo, judo, kyudo, karate, MMA, boxing, wrestling and professional wrestling. How the trophies are drawn, and what each stands for, is in [docs/emblems.md](./docs/emblems.md); the balls and the gear are described in [src/emblems/README.md](./src/emblems/README.md).
535
553
 
536
554
  ## API
537
555
 
@@ -559,7 +577,7 @@ The forty-two sports the ball, gear and sport emblems are made for are `SPORT_NA
559
577
  | `EMBLEMS` | Every emblem as markup in the metal style at 64 pixels, by id |
560
578
  | `EMBLEM_TABLE` | Every emblem object, by id |
561
579
  | `TROPHY_HOCKEY_CUP`, `MEDAL_GOLD`, `CREST_SHIELD`, `SPORT_NHL`, `BALL_SOCCER`, `GEAR_HURLEY`... | Each emblem as a constant, named by its id in capitals (`trophy:hockey-cup`); [docs/gallery.md](./docs/gallery.md) ([日本語](./docs/gallery.ja.md)) lists every emblem and states the rule for its constant and the module that takes it alone |
562
- | `EMBLEM_IDS`, `EMBLEM_GROUPS`, `EMBLEM_FOLDERS`, `EMBLEM_ALIASES` | Every id, the groups, the folder of each group's art, and the short names (`cup` for `trophy:cup`) |
580
+ | `EMBLEM_IDS`, `EMBLEM_GROUPS`, `EMBLEM_FOLDERS`, `EMBLEM_ALIASES`, `RENAMED_IDS` | Every id, the groups, the folder of each group's art, the short names (`cup` for `trophy:cup`), and the ids that were renamed and still work |
563
581
  | `AWARD_IDS`, `TROPHY_IDS`, `MEDAL_IDS`, `CREST_IDS`, `BALL_IDS`, `PUCK_IDS`, `GEAR_IDS`, `SPORT_IDS`, `PENNANT_IDS` | The ids of each group |
564
582
  | `MEDAL_KINDS`, `CREST_SHAPES` | The kinds of medal, and the shapes of crest |
565
583
  | `SPORT_NAMES` | The forty-two sports |
@@ -610,11 +628,33 @@ In the `metal` and `color` styles a trophy, a medal or a crest is edged by a dar
610
628
 
611
629
  The metals are `METALS` (gold `#d9a620`, silver `#aeb6c0`, bronze `#b8733a`); each is shaded with a dark edge, a bright band, the metal, a darker side and a faint light from the rim, which holds on both pages. The `line` style has no fill, so it takes only the ink. For a ball and a piece of gear, `color` is the same shaded drawing as `metal`.
612
630
 
631
+ ## Versions
632
+
633
+ From 1.0.0 the package follows [semantic versioning](https://semver.org/):
634
+
635
+ | Version | What changes in it |
636
+ | --- | --- |
637
+ | Patch (1.0.**1**) | Fixes that do not change any drawing. |
638
+ | Minor (1.**1**.0) | New emblems and options, and emblems redrawn. A redrawn emblem is always named in the [changelog](./CHANGELOG.md) and its `revision` goes up in `revisions.json`. |
639
+ | Major (**2**.0.0) | Removing an emblem id or an export, or a breaking change to the API. |
640
+
641
+ An emblem id is a promise: it is never removed, and never renamed so that it stops working. If an emblem is renamed, the old id reads as the emblem it became everywhere an id is taken, and `RENAMED_IDS` lists them (the era balls that early versions published under their year are the ones so far).
642
+
643
+ Each emblem, and each fictional maker mark and team logo of `/brands`, has a `revision` (1, 2, 3 and on) that goes up when its drawing changes, and `revisedIn`, the version where the current drawing first shipped. `@johnmorrisdotca/dougu-sports/revisions.json` holds both for every id, with every revision before. A change to a renderer that moves many emblems gives each of them a new revision.
644
+
645
+ ```js no-run
646
+ const address = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/dougu-sports@1/dist/revisions.json";
647
+ const file = await (await fetch(address)).json();
648
+ console.log(file.items["trophy:hockey-cup"].revision, file.items["trophy:hockey-cup"].revisedIn);
649
+ ```
650
+
651
+ If your pages need an emblem to look exactly as it does today, pin an exact version (`"@johnmorrisdotca/dougu-sports": "1.0.0"`, or `dougu-sports@1.0.0` in a CDN address) rather than a range or `@1`. Old versions stay on npm and on the CDN. The package does not keep old drawings inside itself.
652
+
613
653
  ## Limits
614
654
 
615
655
  - A turn is drawn in plain SVG, not in 3D: a cup keeps its silhouette and moves its light, handles and seams; a medal is squeezed; a ball is projected from its own geometry, panel by panel, and has no grain while it turns. Gear, icons and pictograms flip like a coin, with the back as a mirror of the front and a thin rim; a pennant's back is its own drawing; one turn (`src/emblems/emblem.flip.ts`) does it for all of them.
616
656
  - A tint is one colour, the main one, and an accent a second. A golf ball and a baseball are white by the rules of their sports, so they ignore `tint` (a baseball takes `paint`, as the custom balls do); every other ball takes it. The pieces of a trophy that are another metal (the gilt of a plate, the green bands of a globe, the black foot of a cup) keep their own colour.
617
- - The trophies are generic: each is drawn for this package in a simplified form that a reader knows at a glance, and none is traced from a photograph or carries a name, a mark or an engraving.
657
+ - Generic trophies use simplified shapes. Named trophies use proportions measured from reference photographs. The default trophy drawings omit lettering, marks and engravings.
618
658
  - A trophy in the metal style is about 3 to 4.5 kB of markup, a medal or a crest about 1 to 2 kB, a line drawing about 1 to 2.5 kB; a ball in 3D is 5 to 13 kB, and a piece of gear is 1 to 4 kB, drawn in layers.
619
659
  - The size is a number of pixels up to 4096; the drawing is a vector at any size.
620
660
  - No emblem carries a real league's, team's or federation's mark.
@@ -662,7 +702,7 @@ Every emblem is drawn for this package, and nothing is copied from another proje
662
702
  ### The family
663
703
 
664
704
  <!-- family:start (made by scripts/family-readme.mjs from scripts/family-template.mjs; change those, not this) -->
665
- Dougu Sports is one of thirty-two packages, each made for the same site, each at
705
+ Dougu Sports is one of forty-one packages, each made for the same site, each at
666
706
  [github.com/johnmorrisdotca](https://github.com/johnmorrisdotca) or [github.com/spxis](https://github.com/spxis). The code of every one is MIT.
667
707
 
668
708
  **Games — board**
@@ -675,6 +715,7 @@ Dougu Sports is one of thirty-two packages, each made for the same site, each at
675
715
 
676
716
  **Games — cards & tiles**
677
717
 
718
+ - [Fuda Cards](https://github.com/johnmorrisdotca/fuda-cards) (札): collectible card frames with a true thickness, foil, stacks, wear and a binder, as two web components. [Demo](https://johnmorrisdotca.github.io/fuda-cards/).
678
719
  - [Hitotsu](https://github.com/johnmorrisdotca/hitotsu) (一つ): a colour-card shedding game for two to eight, with the house rules people play. [Demo](https://johnmorrisdotca.github.io/hitotsu/).
679
720
  - [Jarajara](https://github.com/johnmorrisdotca/jarajara) (ジャラジャラ): mahjong tiles drawn as SVG, stacked layouts, and the matching solitaire Awase. [Demo](https://johnmorrisdotca.github.io/jarajara/).
680
721
  - [Kumimoji](https://github.com/johnmorrisdotca/kumimoji) (組み文字): a crossword tile race, in English and Japanese kana. [Demo](https://johnmorrisdotca.github.io/kumimoji/).
@@ -701,19 +742,30 @@ Dougu Sports is one of thirty-two packages, each made for the same site, each at
701
742
 
702
743
  - [Bushu](https://github.com/johnmorrisdotca/bushu) (部首): find a kanji by the parts it is made of. [Demo](https://johnmorrisdotca.github.io/bushu/).
703
744
  - [Hikidashi](https://github.com/johnmorrisdotca/hikidashi) (引き出し): a drawer of small Japanese text tools: era dates, kanji numerals, readings and sentence difficulty. [Demo](https://johnmorrisdotca.github.io/hikidashi/).
745
+ - [Jisho](https://github.com/johnmorrisdotca/jisho) (辞書): words of Japanese looked up by reading or written form, and the grades, JLPT levels, readings and look-alike pairs of 2,999 kanji. [Demo](https://johnmorrisdotca.github.io/jisho/).
704
746
  - [Kotoba](https://github.com/johnmorrisdotca/kotoba) (言葉): word lists and word-game rules in English, French, German and Japanese. [Demo](https://johnmorrisdotca.github.io/kotoba/).
705
747
 
748
+ **Space Program X**
749
+
750
+ - [Chikyu Earth](https://github.com/johnmorrisdotca/chikyu-earth) (地球): a line-drawn globe that turns at the Earth's own rate, with an optional realistic Earth from space and markers for any place. [Demo](https://johnmorrisdotca.github.io/chikyu-earth/).
751
+ - [Hoshi Stars](https://github.com/johnmorrisdotca/hoshi-stars) (星): the stars you can see without a telescope, with names, colours and distances, the constellations with their lines and boundaries, and the Messier objects, drawn on any of seven sky maps. [Demo](https://johnmorrisdotca.github.io/hoshi-stars/).
752
+ - [Uchusen Rockets](https://github.com/johnmorrisdotca/uchusen-rockets) (宇宙船): rockets drawn from sourced sizes, as line drawings and 3D views you can take apart and turn, with a check that a rocket really goes together. [Demo](https://johnmorrisdotca.github.io/uchusen-rockets/).
753
+ - [Wakusei Planets](https://github.com/johnmorrisdotca/wakusei-planets) (惑星): the Sun, the planets and their moons, as line drawings, shaded drawings and painted surface maps, with their real sizes, tilt and rotation. [Demo](https://johnmorrisdotca.github.io/wakusei-planets/).
754
+
706
755
  **Geography & data**
707
756
 
708
757
  - [address-plus](https://github.com/johnmorrisdotca/address-plus) (アドレスプラス): parse and format addresses in the United States, Canada, Japan, Australia, France, Germany and the United Kingdom. [Demo](https://johnmorrisdotca.github.io/address-plus/).
709
758
  - [Chizu](https://github.com/johnmorrisdotca/chizu) (地図): maps of the world and of countries' regions, in English and Japanese, with a quiz and callouts. [Demo](https://johnmorrisdotca.github.io/chizu/).
759
+ - [Hako Devices](https://github.com/johnmorrisdotca/hako-devices) (箱): line drawings and 3D views of computers, phones, consoles and NAS boxes, from published sizes. [Demo](https://johnmorrisdotca.github.io/hako-devices/).
710
760
  - [Hata](https://github.com/johnmorrisdotca/hata) (旗): country and regional flags as SVG, at their true proportions and keyed by ISO code. [Demo](https://johnmorrisdotca.github.io/hata/).
761
+ - [Koyomi Calendars](https://github.com/johnmorrisdotca/koyomi-calendars) (暦): calendar-page icons and whole months as SVG, in light and dark, with page-turning from one day to the next. [Demo](https://johnmorrisdotca.github.io/koyomi-calendars/).
711
762
  - [Kuni](https://github.com/johnmorrisdotca/kuni) (国): countries and their regions, with ISO codes and names in English and Japanese. [Demo](https://johnmorrisdotca.github.io/kuni/).
712
763
 
713
764
  **Sports**
714
765
 
715
766
  - [Dougu Sports](https://github.com/johnmorrisdotca/dougu-sports) (道具): sports emblems as SVG: trophies, medals, crests, and the ball and gear of every sport, with optional 3D turning. [Demo](https://johnmorrisdotca.github.io/dougu-sports/).
716
767
  - [Kyogijo Stadiums](https://github.com/johnmorrisdotca/kyogijo-stadiums) (競技場): sports fields, rinks, courts and ballparks drawn to scale as SVG, with each team and the score on them. [Demo](https://johnmorrisdotca.github.io/kyogijo-stadiums/).
768
+ - [Meigen Sports](https://github.com/johnmorrisdotca/meigen-sports) (名言): sports quotations and on-this-day history. [Demo](https://johnmorrisdotca.github.io/meigen-sports/).
717
769
  - [Senshu Jerseys](https://github.com/johnmorrisdotca/senshu-jerseys) (選手): sports jerseys, sweaters, kits, caps, helmets and retired-number banners as SVG, front and back, with optional 2.5D turning. [Demo](https://johnmorrisdotca.github.io/senshu-jerseys/).
718
770
  - [Taisen Brackets](https://github.com/johnmorrisdotca/taisen-brackets) (対戦): a sport-agnostic tournament bracket, drawn as SVG, from a list of ties. [Demo](https://johnmorrisdotca.github.io/taisen-brackets/).
719
771
 
@@ -722,7 +774,7 @@ Dougu Sports is one of thirty-two packages, each made for the same site, each at
722
774
  - [REST in Pieces](https://github.com/spxis/rest-in-pieces) (レスト・イン・ピーシーズ): seeded test data and REST APIs for frontend development, with latency and error drills. [Demo](https://spxis.github.io/rest-in-pieces/).
723
775
 
724
776
 
725
- **This package is Dougu Sports.** The demos of all thirty-two share one header and footer, so each links the rest.
777
+ **This package is Dougu Sports.** The demos of all forty-one share one header and footer, so each links the rest.
726
778
  <!-- family:end -->
727
779
 
728
780
  ## Development
@@ -748,8 +800,8 @@ See [CHANGELOG.md](./CHANGELOG.md), which has every release from 0.0.1 with its
748
800
 
749
801
  ## Credits
750
802
 
751
- The medal and the soccer ball are drawn for this package. Every other source is credited in [NOTICE.md](./NOTICE.md).
803
+ The artwork is drawn for this package. [NOTICE.md](./NOTICE.md) lists the sources for dimensions and other facts, and [the trophy source table](./docs/likeness-sources.md) records visual references.
752
804
 
753
805
  ## Licence
754
806
 
755
- The code, and the art drawn for this package, are [MIT](./LICENSE). Art taken from another project keeps its own licence, named in [NOTICE.md](./NOTICE.md), with its text in [LICENSES/](./LICENSES/).
807
+ The code and artwork are [MIT](./LICENSE).
package/dist/element.js CHANGED
@@ -32,6 +32,7 @@ export class DouguEmblem extends Base {
32
32
  #stage;
33
33
  #turner;
34
34
  #watch;
35
+ #visible = true;
35
36
  #resume = false;
36
37
  #queued = false;
37
38
  /** The controller of the turning while the emblem is turnable and drawn, or `undefined`: its angles, `play()`, `pause()` and `setAngles()`. */
@@ -43,12 +44,12 @@ export class DouguEmblem extends Base {
43
44
  this.#draw();
44
45
  if (typeof IntersectionObserver === "function") {
45
46
  this.#watch = new IntersectionObserver((seen) => {
46
- const visible = seen[seen.length - 1]?.isIntersecting !== false;
47
- if (!visible && this.#turner?.playing) {
47
+ this.#visible = seen[seen.length - 1]?.isIntersecting !== false;
48
+ if (!this.#visible && this.#turner?.playing) {
48
49
  this.#turner.pause();
49
50
  this.#resume = true;
50
51
  }
51
- else if (visible && this.#resume) {
52
+ else if (this.#visible && this.#resume) {
52
53
  this.#resume = false;
53
54
  this.#turner?.play();
54
55
  }
@@ -59,6 +60,7 @@ export class DouguEmblem extends Base {
59
60
  disconnectedCallback() {
60
61
  this.#watch?.disconnect();
61
62
  this.#watch = undefined;
63
+ this.#visible = true;
62
64
  this.#resume = false;
63
65
  this.#turner?.destroy();
64
66
  this.#turner = undefined;
@@ -139,30 +141,39 @@ export class DouguEmblem extends Base {
139
141
  if (!ref) {
140
142
  this.#turner?.destroy();
141
143
  this.#turner = undefined;
144
+ this.#resume = false;
142
145
  stage.innerHTML = "";
143
146
  return;
144
147
  }
145
148
  const options = this.#options();
149
+ const autoplay = flag(this.getAttribute("autoplay"));
146
150
  try {
147
- if (flag(this.getAttribute("turnable")) || flag(this.getAttribute("autoplay"))) {
151
+ if (flag(this.getAttribute("turnable")) || autoplay) {
148
152
  const { yaw, pitch, roll, ...rest } = options;
149
153
  const angles = { ...(yaw === undefined ? {} : { yaw }), ...(pitch === undefined ? {} : { pitch }), ...(roll === undefined ? {} : { roll }) };
154
+ const wantsAutoPlay = autoplay && globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches !== true;
155
+ const start = wantsAutoPlay && this.#visible;
156
+ if (!autoplay)
157
+ this.#resume = false;
158
+ else if (wantsAutoPlay && !this.#visible)
159
+ this.#resume = true;
150
160
  if (this.#turner) {
151
161
  this.#turner.update(ref, rest);
152
162
  if (Object.keys(angles).length > 0)
153
163
  this.#turner.setAngles(angles);
154
- if (flag(this.getAttribute("autoplay")) && !this.#turner.playing)
164
+ if (start && !this.#turner.playing)
155
165
  this.#turner.play();
156
- else if (!flag(this.getAttribute("autoplay")) && this.#turner.playing)
166
+ else if (!autoplay && this.#turner.playing)
157
167
  this.#turner.pause();
158
168
  }
159
169
  else
160
- this.#turner = bindTurn(stage, ref, { ...rest, ...angles, autoPlay: flag(this.getAttribute("autoplay")) });
170
+ this.#turner = bindTurn(stage, ref, { ...rest, ...angles, autoPlay: start });
161
171
  this.dataset["state"] = "live";
162
172
  return;
163
173
  }
164
174
  this.#turner?.destroy();
165
175
  this.#turner = undefined;
176
+ this.#resume = false;
166
177
  const turned = options.yaw !== undefined || options.pitch !== undefined || options.roll !== undefined;
167
178
  stage.innerHTML = turned ? emblemFrame(ref, options) : renderEmblem(ref, options);
168
179
  this.dataset["state"] = "still";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The 1850s and 1860s: a cover of four pieces sewn along four seams that run from one point to the opposite one, like the peel of a lemon, in aged leather with a dark thread. No rule fixed the ball then, so it is drawn at the size of today's.
2
+ * The 1850s and 1860s: four seams run from one point to the opposite one, like the peel of a lemon, in aged leather with a dark thread. The drawing uses today's ball size.
3
3
  * @example
4
4
  * ```ts
5
5
  * import { BALL_BASEBALL_LEMON_PEEL } from "@johnmorrisdotca/dougu-sports";
@@ -8,7 +8,7 @@
8
8
  */
9
9
  export declare const BALL_BASEBALL_LEMON_PEEL: import("./ball.core.ts").Piece<import("./ball.engine.ts").BallSpec>;
10
10
  /**
11
- * The figure-8 seam stitched with alternate red and blue stitches (the American League's laces, in the recollection of a 1930s player).
11
+ * The figure-8 seam stitched with alternate red and blue stitches, using the colours of early American League balls.
12
12
  * @example
13
13
  * ```ts
14
14
  * import { BALL_BASEBALL_RED_BLUE } from "@johnmorrisdotca/dougu-sports";
@@ -17,7 +17,7 @@ export declare const BALL_BASEBALL_LEMON_PEEL: import("./ball.core.ts").Piece<im
17
17
  */
18
18
  export declare const BALL_BASEBALL_RED_BLUE: import("./ball.core.ts").Piece<import("./ball.engine.ts").BallSpec>;
19
19
  /**
20
- * The figure-8 seam stitched with alternate black and red stitches (the National League's laces, in the same recollection).
20
+ * The figure-8 seam stitched with alternate black and red stitches, using the colours of early National League balls.
21
21
  * @example
22
22
  * ```ts
23
23
  * import { BALL_BASEBALL_BLACK_RED } from "@johnmorrisdotca/dougu-sports";
@@ -8,7 +8,7 @@ import { gores } from "./ball.tilings.js";
8
8
  import { BALL_BASEBALL } from "./ball.baseball.js";
9
9
  const SIZE = BALL_BASEBALL.size;
10
10
  /**
11
- * The 1850s and 1860s: a cover of four pieces sewn along four seams that run from one point to the opposite one, like the peel of a lemon, in aged leather with a dark thread. No rule fixed the ball then, so it is drawn at the size of today's.
11
+ * The 1850s and 1860s: four seams run from one point to the opposite one, like the peel of a lemon, in aged leather with a dark thread. The drawing uses today's ball size.
12
12
  * @example
13
13
  * ```ts
14
14
  * import { BALL_BASEBALL_LEMON_PEEL } from "@johnmorrisdotca/dougu-sports";
@@ -19,7 +19,7 @@ export const BALL_BASEBALL_LEMON_PEEL = /* @__PURE__ */ defineBall({
19
19
  id: "ball:baseball-lemon-peel",
20
20
  en: "Baseball, lemon-peel",
21
21
  ja: "レモンピール型野球ボール",
22
- size: { ...SIZE, rule: "Official Baseball Rules, Rule 3.01 The Ball (today's size; no rule fixed the ball in the 1850s and 1860s)", note: "Drawn at the size of today's ball. Diameter worked out from the middle of the circumference range." },
22
+ size: { ...SIZE, rule: "Official Baseball Rules, Rule 3.01 The Ball (today's size)", note: "Drawn at the size of today's ball. Diameter worked out from the middle of the circumference range." },
23
23
  spec: {
24
24
  view: { yaw: 18, pitch: 30, roll: -10 },
25
25
  base: "#e1cfa6",
@@ -40,7 +40,7 @@ const STITCH = { count: 108, half: 0.075, width: 0.85, lean: 0.032 };
40
40
  const WHITE = "#f4f0e6";
41
41
  const common = { size: SIZE, base: WHITE, b: 0.4, view: { yaw: 18, pitch: 28, roll: -10 }, mat: { gloss: 0.3, shade: "#4a3a2a", grain: { f: 1.4, a: 0.12 } }, groove: "#8a7a62" };
42
42
  /**
43
- * The figure-8 seam stitched with alternate red and blue stitches (the American League's laces, in the recollection of a 1930s player).
43
+ * The figure-8 seam stitched with alternate red and blue stitches, using the colours of early American League balls.
44
44
  * @example
45
45
  * ```ts
46
46
  * import { BALL_BASEBALL_RED_BLUE } from "@johnmorrisdotca/dougu-sports";
@@ -49,7 +49,7 @@ const common = { size: SIZE, base: WHITE, b: 0.4, view: { yaw: 18, pitch: 28, ro
49
49
  */
50
50
  export const BALL_BASEBALL_RED_BLUE = /* @__PURE__ */ seamedBall({ ...common, id: "ball:baseball-red-blue", en: "Baseball, red and blue", ja: "赤青の縫い糸の野球ボール", stitch: { ...STITCH, colour: "#c4262e", colour2: "#2257a8" } });
51
51
  /**
52
- * The figure-8 seam stitched with alternate black and red stitches (the National League's laces, in the same recollection).
52
+ * The figure-8 seam stitched with alternate black and red stitches, using the colours of early National League balls.
53
53
  * @example
54
54
  * ```ts
55
55
  * import { BALL_BASEBALL_BLACK_RED } from "@johnmorrisdotca/dougu-sports";
@@ -13,6 +13,6 @@ export const BALL_BASKETBALL_3X3 = /* @__PURE__ */ defineBall({
13
13
  id: "ball:basketball-3x3",
14
14
  en: "Basketball, 3x3",
15
15
  ja: "3x3バスケットボール",
16
- size: { extentMm: 232.4, diameterMm: 232.4, circumferenceMm: 730.0, massG: [580, 620], rule: "FIBA 3x3 Official Equipment & Software Appendix to the 3x3 Official Rules (Dec 2024 update), Table 1 and section 5.7 (as quoted by balls.com)", note: "Not read in the FIBA 3x3 equipment appendix itself (fiba3x3.com refused the request); the figures are those a ball retailer prints from it: the circumference of a size 6 with the weight of a size 7. Diameter worked out from the middle of the circumference range." },
16
+ size: { extentMm: 232.4, diameterMm: 232.4, circumferenceMm: 730.0, massG: [580, 620], rule: "FIBA 3x3 Equipment & Software Appendix to the 3x3 Official Rules (December 2024), section 5.7 and Table 1", note: "Table 1 gives a circumference of 720 to 740 mm and a mass of 580 to 620 g. Diameter worked out from the middle of the circumference range." },
17
17
  spec: basketballSpec("#e0701f", "#2b2d33"),
18
18
  });
@@ -15,7 +15,7 @@ export declare function renderBall(name: string, options?: PieceOptions): string
15
15
  * of a turntable. The grain stays out of a turning ball. Every ball is drawn in true 3D: the seams, panels and marks are on the sphere and turn with it.
16
16
  * @example
17
17
  * ```ts
18
- * import { ballFrame } from "@johnmorrisdotca/kyogijo-stadiums/balls";
18
+ * import { ballFrame } from "@johnmorrisdotca/dougu-sports/ball/ball.index";
19
19
  * const frames = [0, 60, 120, 180, 240, 300].map((yaw) => ballFrame("soccer", { yaw, size: 48 }));
20
20
  * console.log(frames.length, frames[0].startsWith("<svg"));
21
21
  * // 6 true
@@ -59,7 +59,7 @@ export function renderBall(name, options) {
59
59
  * of a turntable. The grain stays out of a turning ball. Every ball is drawn in true 3D: the seams, panels and marks are on the sphere and turn with it.
60
60
  * @example
61
61
  * ```ts
62
- * import { ballFrame } from "@johnmorrisdotca/kyogijo-stadiums/balls";
62
+ * import { ballFrame } from "@johnmorrisdotca/dougu-sports/ball/ball.index";
63
63
  * const frames = [0, 60, 120, 180, 240, 300].map((yaw) => ballFrame("soccer", { yaw, size: 48 }));
64
64
  * console.log(frames.length, frames[0].startsWith("<svg"));
65
65
  * // 6 true