@johnmorrisdotca/dougu-sports 0.8.0 → 0.10.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/CHANGELOG.md +27 -0
- package/NOTICE.md +14 -0
- package/README.md +58 -26
- package/dist/brands/brand.ball.d.ts +29 -0
- package/dist/brands/brand.ball.js +23 -0
- package/dist/brands/brand.data.d.ts +47 -0
- package/dist/brands/brand.data.js +308 -0
- package/dist/brands/brand.letters.d.ts +31 -0
- package/dist/brands/brand.letters.js +88 -0
- package/dist/brands/brand.render.d.ts +47 -0
- package/dist/brands/brand.render.js +106 -0
- package/dist/brands-entry.d.ts +8 -0
- package/dist/brands-entry.js +5 -0
- package/dist/emblems/award/ribbon.d.ts +2 -0
- package/dist/emblems/award/ribbon.js +17 -0
- package/dist/emblems/ball/ball.baseball.js +2 -1
- package/dist/emblems/ball/ball.contrast.d.ts +4 -0
- package/dist/emblems/ball/ball.contrast.js +22 -0
- package/dist/emblems/ball/ball.core.d.ts +42 -0
- package/dist/emblems/ball/ball.core.js +34 -1
- package/dist/emblems/ball/ball.engine.d.ts +70 -4
- package/dist/emblems/ball/ball.engine.js +70 -20
- package/dist/emblems/ball/ball.family.seamed.d.ts +4 -0
- package/dist/emblems/ball/ball.family.seamed.js +42 -7
- package/dist/emblems/ball/ball.image.d.ts +8 -0
- package/dist/emblems/ball/ball.image.js +14 -5
- package/dist/emblems/ball/ball.index.js +2 -4
- package/dist/emblems/ball/ball.letters.d.ts +3 -0
- package/dist/emblems/ball/ball.letters.js +51 -0
- package/dist/emblems/ball/ball.print.d.ts +81 -0
- package/dist/emblems/ball/ball.print.js +268 -0
- package/dist/emblems/ball/ball.printable.d.ts +6 -0
- package/dist/emblems/ball/ball.printable.js +13 -0
- package/dist/emblems/ball/ball.region.d.ts +12 -0
- package/dist/emblems/ball/ball.region.js +94 -0
- package/dist/emblems/ball/ball.script.d.ts +15 -0
- package/dist/emblems/ball/ball.script.js +107 -0
- package/dist/emblems/ball/ball.soccer.js +7 -3
- package/dist/emblems/ball/ball.soccer.panels.d.ts +2 -0
- package/dist/emblems/ball/ball.soccer.panels.js +6 -3
- package/dist/emblems/ball/ball.soccer.size.d.ts +2 -0
- package/dist/emblems/ball/ball.soccer.size.js +8 -0
- package/dist/emblems/ball/ball.softball.js +2 -1
- package/dist/emblems/ball/ball.warp.d.ts +48 -0
- package/dist/emblems/ball/ball.warp.js +441 -0
- package/dist/emblems/emblem.core.d.ts +13 -0
- package/dist/emblems/emblem.equipment.js +3 -3
- package/dist/emblems/emblem.ids.d.ts +4 -4
- package/dist/emblems/emblem.ids.js +2 -2
- package/dist/emblems/emblem.registry.js +2 -0
- package/dist/emblems/gear/gear.index.js +2 -1
- package/dist/emblems/gear/gear.nets.d.ts +3 -0
- package/dist/emblems/gear/gear.nets.js +103 -0
- package/dist/emblems-entry.d.ts +1 -0
- package/dist/index.d.ts +6 -4
- package/dist/index.js +5 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,33 @@ All notable changes to this project are written here. The format follows
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.10.0] - 2026-10-19
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **`award:ribbon`**, a ribbon on its own (a band with two swallow-tailed ends folded behind it), drawn for this package, in metal, colour and line like the other awards. 273 emblems.
|
|
14
|
+
- **Nets and posts for three sports**, from their rulebooks' sizes (sources in NOTICE.md): `gear:takraw-net` (ISTAF Law of the Game, Regu: posts 1.55 m, net 0.7 m deep, 1.52 m at the centre), `gear:netball-post` (World Netball Rules of Netball 2024: a 3.05 m pole, a ring of 380 mm inside diameter) and `gear:teqball-table` (FITEQ Official Rules and Regulations of Teqball 2025: 3,000 mm long, surface 760 mm and 565 mm high, 900 mm with the net). They are the equipment of `sepaktakraw`, `netball` and `teqball` in `sportEquipment`. What is not to scale (a net drawn shorter, a rod drawn wider, the table's legs) is said in each file.
|
|
15
|
+
- **The demo's podium shows Hata's round flags** for Japan, France and Italy (`demo/flags-data.ts`, made by `pnpm flags`; Hata 1.5.0 is a development dependency of the demo only), in place of three flags drawn by hand. The package is unchanged.
|
|
16
|
+
- **Made-up maker and team logos (experimental, designs will change)**, in a new entry point `@johnmorrisdotca/dougu-sports/brands`: twelve fictional makers of balls and gear (`arvane`, `tarsin`, `ravelle`, `kovreth`, `dunmar`, `ostrel`, `vexlin`, `quillan`, `tenzar`, `marenko`, `halvane`, `solvik`) and ten fictional teams (`saltmere`, `greywick`, `brightwater`, `cinderfell`, `valmere`, `larkmoor`, `ironport`, `pinecrest`, `redfern`, `tarn`), as SVG. A mark stands alone and is what `makerLogo` draws by default; the name is optional (`layout: "wordmark" | "horizontal" | "stacked"`). Full colour or one colour, light or dark, with a note on the nearest real brand and how each differs. `makerLogoGroup` and `teamLogoGroup` return a `<g>` to place in another drawing; `makerBall` and `renderMakerBall` print a maker's mark on a baseball, a softball or a classic soccer ball. The set is data (`MAKERS`, `TEAMS`). The demo has a contact sheet (`brands.html`). See `docs/brands.md`.
|
|
17
|
+
|
|
18
|
+
## [0.9.0] - 2026-10-15
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **Custom balls.** The baseball, the softball and the classic soccer balls (`ball:baseball`, `ball:softball`, `ball:soccer`, `ball:soccer-orange`, `ball:soccer-yellow` and `ball:soccer-colour`) take six options, drawn on the sphere so that they curve with it, are foreshortened toward the edge, go round the limb and turn with the ball (`renderEmblem`, `emblemFrame`, `ballFrame` and `bindTurn` take them):
|
|
23
|
+
- `paint`: a colour, or `{ body, second, split, angle, stitch }`. A solid ball takes the colour, and the stitches change to a thread that shows against it (red, cream, navy or near-black). Two colours make a two-tone ball, split along the figure-eight seam (each leather piece one colour, each stitch leg the thread that shows on its own side) or in halves. On a soccer ball `body` is the hexagons and `second` the pentagons.
|
|
24
|
+
- `decal`: a logo of your own as an SVG string, a `data:` image URI or `{ svg, href, size, turn }`. An SVG is flattened and wrapped exactly (fills cut at the limb, strokes thinning as they turn away); a PNG, JPEG, GIF or WebP is laid on in small affine triangles. Made safe with an allow-list; an address on the network is refused.
|
|
25
|
+
- `stamp`: bold condensed block lettering between small stars (`UNOFFICIAL` over `DIGITAL BASEBALL` by default, the ball's own word on each ball), your own lines, ink and an optional made-up signature line with a caption.
|
|
26
|
+
- `script`: an original cursive script (waypoints drawn for this package, a thick down stroke and a hairline up stroke, a to z and our own `Baseball` and `Soccer`), where a maker's mark sits; with a small circled letter under it, or your own mark.
|
|
27
|
+
- `mark`: a letter in a circle, or an SVG of your own drawn in its place (the slot for a mark this package must not carry).
|
|
28
|
+
- `spots`: where the logo and the lettering go. The logo has the middle and the lettering the far side by default.
|
|
29
|
+
- **`printed(ball)`** (main entry) and the types `BallPaint`, `BallDecal`, `BallStamp`, `BallScript`, `BallMark`, `BallSpots` and `Spot`. The balls' own modules carry no printing code and ignore the options; the registry, `renderEmblem` and the main entry's constants are the printed ones, and `printed(BALL_BASEBALL)` gives a ball taken from its own module the printing (about 19 kB gzipped, against 8.6 kB for the plain baseball).
|
|
30
|
+
- **`docs/custom-balls.md`** and its Japanese page, the gallery's note about the options, and a "Custom ball" section in the demo: colour, two-tone, stamp lines, script word, mark and a logo picked from a file (read in the browser into a data URI), with the call that draws it.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- The ball engine can fill the disc of a ball and a region of it, and a ball's draw hook takes its paint and print options. A plain soccer ball bundled alone is 7.3 kB gzipped (was 6.5), so the size test's limit for a ball is 7.6 kB.
|
|
35
|
+
|
|
9
36
|
## [0.8.0] - 2026-10-14
|
|
10
37
|
|
|
11
38
|
### Added
|
package/NOTICE.md
CHANGED
|
@@ -4,12 +4,16 @@ The code of this package is under the MIT licence (see [LICENSE](LICENSE) and [L
|
|
|
4
4
|
|
|
5
5
|
No emblem carries the name, mark or logo of a league, a team, a federation or an event: the trophies, crests, balls and gear are descriptive and generic. That includes the Japanese items (`trophy:sumo-cup`, `trophy:championship-banner` and the `gear:*` of sumo, kendo, judo, kyudo and karate): they are original drawings of what such an object looks like, with generic ids, and carry no trophy's name, no federation's mark and no lettering unless the caller gives some.
|
|
6
6
|
|
|
7
|
+
The made-up maker marks and team logos (`@johnmorrisdotca/dougu-sports/brands`) are fictional: their names, marks, lettering and colours are invented for this package, each is noted with the real brand it is nearest to and how it differs, and none is a real company's or club's. They are under the same MIT licence. Nothing of SPX, SPXN, SPXIS or SportsInteractive is in the package.
|
|
8
|
+
|
|
7
9
|
## How the art is made
|
|
8
10
|
|
|
9
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).
|
|
10
12
|
- 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.
|
|
11
13
|
- 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
|
+
- 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.
|
|
12
15
|
- 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.
|
|
16
|
+
- 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.
|
|
13
17
|
- 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.
|
|
14
18
|
- 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.
|
|
15
19
|
|
|
@@ -67,6 +71,16 @@ Each ball's `size.rule` names the rule; the table gives the document and where i
|
|
|
67
71
|
|
|
68
72
|
Facts only: a dimension or a mass is a fact, not a work. The NHL's puck rule was not read (the NHL's site was not fetched); the puck's size is the IIHF's.
|
|
69
73
|
|
|
74
|
+
### The rulebooks the nets and posts are read from
|
|
75
|
+
|
|
76
|
+
A piece of gear claims no size of its own, but these three are drawn from the sizes a rulebook gives, where the drawing allows. Each drawing's file says what is not to scale. A size the rulebook does not give is not drawn from any source: the legs of the teqball table and the thickness of its surface are drawn by eye.
|
|
77
|
+
|
|
78
|
+
| Gear | Rulebook and rule | Read at |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `gear:takraw-net` | ISTAF Law of the Game, Sepaktakraw Regu, 2024 text (amendments approved 15 July 2023 and 8 December 2023; dated 1 January 2024): 2.1 posts 1.55 m men, 1.45 m women, radius not more than 0.04 m; 3.2 net 0.7 m wide, not shorter than 6.1 m; 3.5 net 1.52 m at the centre and 1.55 m at the posts (men) | https://img1.wsimg.com/blobby/go/b28abe2b-c8e0-4c25-b6ac-d2655417c6c3/Law%20of%20the%20Game%202024%20-%20Regu%20-.pdf |
|
|
81
|
+
| `gear:netball-post` | World Netball Rules of Netball, 2024 edition, Rule 1 Technical specifications, 1.13 (placing) and 1.14 (a pole 65-100 mm across and 3.05 m high, padding up to 50 mm; a ring of 15 mm rod with an internal diameter of 380 mm; a 150 mm bar; a net 380-457 mm long) | https://netballhamilton.org.nz/media/1997/world-netball-rules-book-2024.pdf |
|
|
82
|
+
| `gear:teqball-table` | FITEQ Official Rules and Regulations of Teqball, 2025 (effective 5 February 2025), 1.1.1-1.1.5 the table (3,000 mm long, 1,700 mm wide with the net, 900 mm high with the net, surface 760 mm at its highest and 565 mm at its lowest, 1,490 mm from the net to the lowest point) and 1.2.1-1.2.3 the net (1,700 mm wide, 20 mm thick, 140 mm above the surface) | https://cdn.buttercms.com/YBHXKq7GTv2wXkTVQbNC |
|
|
83
|
+
|
|
70
84
|
## The demo and the docs
|
|
71
85
|
|
|
72
86
|
| What | Made from | Terms |
|
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ The ball and the gear of every sport, trophies, medals, crests and the icon of e
|
|
|
52
52
|
</tr>
|
|
53
53
|
</table>
|
|
54
54
|
|
|
55
|
-
> **Status: preview.**
|
|
55
|
+
> **Status: preview.** 273 emblems: 24 trophies, 6 awards, 6 medals, 4 crests, a pictogram for each of the 38 sports, 116 balls and implements drawn in 3D, 8 printed pucks ([docs/pucks.md](./docs/pucks.md)), 70 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.
|
|
56
56
|
|
|
57
57
|
## In 30 seconds
|
|
58
58
|
|
|
@@ -85,13 +85,15 @@ Put the string in a page (`element.innerHTML = svg`), write it to a file, or sen
|
|
|
85
85
|
- **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), an accent the second colour (a ribbon, a crest's band, the pennants), a theme sets the ink for light, dark or either.
|
|
86
86
|
- **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 (gear, a bat, a crown, a sport's icon) flips like a coin; `bindTurn` lets a drag, the arrow keys or an auto-turn do the turning in a page; see [docs/turning.md](./docs/turning.md).
|
|
87
87
|
- **Engraving**: text cut into a medal, a plaque, the belt, a ring, a banner, a pennant and the plinth of a cup, from `label`, `year` and `rank` or one `engrave` string, in the ink that reads at 4.5 to 1 on the metal, and it turns with the emblem; see [Engrave an emblem](#engrave-an-emblem).
|
|
88
|
+
- **Custom balls**: a baseball, a softball and the classic soccer balls take `paint` (a solid colour, or two: along the seam or in halves, with stitches that still show), `decal` (your own SVG or image as a logo, wrapped onto the sphere so that it turns with the ball), `stamp` (condensed bold text between small stars, with an optional made-up signature), `script` (an original cursive word) and `mark` (a letter in a circle, or an SVG of your own); see [docs/custom-balls.md](./docs/custom-balls.md). The package carries no logo of anyone's: a logo or a mark is the one you pass.
|
|
88
89
|
- **Labels in two languages**: the `<title>` is English or Japanese (`locale`), your own words (`title: "…"`), or left out for an emblem that sits beside text that says the same (`title: false`).
|
|
89
90
|
- **As an image, a sprite, a podium or a case**: `emblemDataUri` for an `<img>`, a CSS background or a canvas, `emblemSprite` to draw one emblem fifty times cheaply, `sportEquipment` for what a sport is played with, and `podium` and `awardCase` for results and trophy shelves; see [docs/compose.md](./docs/compose.md).
|
|
90
91
|
- **One module per item**, so a bundler takes only what is imported; see [Use it in your project](#use-it-in-your-project).
|
|
91
92
|
- **Short names and helpers**: `"cup"` is `"trophy:cup"`, `"trophy:cup/line"` is the line style, and `crest`, `medal`, `sportIcon` and `pennant` draw a team's crest, a medal, a sport's icon and a championship pennant.
|
|
92
93
|
- **Typed ids**: `EmblemId` is a union of `award:*`, `trophy:*`, `medal:*`, `crest:*`, `ball:*`, `gear:*`, `sport:*` and `pennant:*` ids.
|
|
93
94
|
- **Japanese sports and budō** (道具 is the name): a sumo cup, a championship banner, and the war fan, belt, bamboo sword, kendo helmet, judo and karate suits, the white and blue judo suit flat, folded and seen from behind with its back number ([docs/judogi-back.md](./docs/judogi-back.md)), the belts of every grade and six pictures of how the belt is tied ([docs/obi-steps.md](./docs/obi-steps.md)), long bow and arrow, with Japanese names that are the governing bodies' words; see [docs/japanese-sports.md](./docs/japanese-sports.md).
|
|
94
|
-
- **
|
|
95
|
+
- **Made-up logos, experimental** (`@johnmorrisdotca/dougu-sports/brands`; a draft, the designs will change and it is not a supported feature yet): twelve fictional makers of balls and gear and ten fictional teams, each a bold geometric mark that stands alone (the name is optional), in colour or one colour, light and dark, with a note on the real brand it is nearest to and how it differs; a maker's mark prints on a baseball, a softball or a classic soccer ball, and a group places any logo inside your own drawing; see [docs/brands.md](./docs/brands.md).
|
|
96
|
+
- **Generic by design**: no emblem carries a league's, a team's or a federation's name or mark, and the made-up logos are nobody's.
|
|
95
97
|
- **Accessible**: every drawing is `role="img"` with a `<title>`; see [Accessibility](#accessibility).
|
|
96
98
|
- **Deterministic**: the same id and options give the same string; a gradient's id comes from its colour.
|
|
97
99
|
- **No dependencies**, ESM with types.
|
|
@@ -137,6 +139,7 @@ The alias is a name in your `package.json` only: the same package, the same code
|
|
|
137
139
|
| --- | --- |
|
|
138
140
|
| `@johnmorrisdotca/dougu-sports` | The full registry: every emblem by id, the functions, and each emblem as a constant |
|
|
139
141
|
| `@johnmorrisdotca/dougu-sports/emblems` | `renderEmblem`, the ids and the types, with no single drawing imported by name |
|
|
142
|
+
| `@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) |
|
|
140
143
|
| `@johnmorrisdotca/dougu-sports/turn` | `emblemFrame`, `ballFrame` and `bindTurn`; `bindTurn` with an emblem object takes nothing else with it |
|
|
141
144
|
| `@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>` |
|
|
142
145
|
|
|
@@ -149,7 +152,7 @@ console.log(TROPHY_HOCKEY_CUP.id); // trophy:hockey-cup
|
|
|
149
152
|
console.log(TROPHY_HOCKEY_CUP.svg({ size: 24 }).includes('width="24"')); // true
|
|
150
153
|
```
|
|
151
154
|
|
|
152
|
-
A bundler that imports this module takes the cup and the renderer for a body of revolution, and no other emblem: the package says `"sideEffects": false` 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 6
|
|
155
|
+
A bundler that imports this module takes the cup and the renderer for a body of revolution, and no other emblem: the package says `"sideEffects": false` 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.
|
|
153
156
|
|
|
154
157
|
### In a page
|
|
155
158
|
|
|
@@ -508,6 +511,7 @@ The metals are `METALS` (gold `#d9a620`, silver `#aeb6c0`, bronze `#b8733a`); ea
|
|
|
508
511
|
- 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.
|
|
509
512
|
- The size is a number of pixels up to 4096; the drawing is a vector at any size.
|
|
510
513
|
- No emblem carries a real league's, team's or federation's mark.
|
|
514
|
+
- No jerseys: a jersey, a cap or a kit is drawn by [Senshu Jerseys](https://github.com/johnmorrisdotca/senshu-jerseys), its own package (a `jersey()` made here in 0.2.0's draft was taken out and moved there). The pennant, the ring, the banner and the made-up maker and team logos stay here.
|
|
511
515
|
|
|
512
516
|
## Accessibility
|
|
513
517
|
|
|
@@ -551,39 +555,67 @@ Every emblem is drawn for this package, and nothing is copied from another proje
|
|
|
551
555
|
### The family
|
|
552
556
|
|
|
553
557
|
<!-- family:start (made by scripts/family-readme.mjs from scripts/family-template.mjs; change those, not this) -->
|
|
554
|
-
Dougu Sports is one of
|
|
555
|
-
[github.com/johnmorrisdotca](https://github.com/johnmorrisdotca). The code of every one is MIT.
|
|
558
|
+
Dougu Sports is one of thirty-two packages, each made for the same site, each at
|
|
559
|
+
[github.com/johnmorrisdotca](https://github.com/johnmorrisdotca) or [github.com/spxis](https://github.com/spxis). The code of every one is MIT.
|
|
556
560
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
- [
|
|
560
|
-
- [
|
|
561
|
-
- [Tane](https://github.com/johnmorrisdotca/tane) (種): seeded random numbers and daily seeds, the same in every browser and on every server. [Demo](https://johnmorrisdotca.github.io/tane/).
|
|
561
|
+
**Games — board**
|
|
562
|
+
|
|
563
|
+
- [Domino](https://github.com/johnmorrisdotca/domino) (ドミノ): dominoes and Mexican Train. [Demo](https://johnmorrisdotca.github.io/domino/).
|
|
564
|
+
- [Gunjin](https://github.com/johnmorrisdotca/gunjin) (軍人): five hidden-rank strategy games with pass-the-device play. [Demo](https://johnmorrisdotca.github.io/gunjin/).
|
|
562
565
|
- [Narabe](https://github.com/johnmorrisdotca/narabe) (並べ): one rules engine for abstract board games, from gomoku and Reversi to Go and checkers. [Demo](https://johnmorrisdotca.github.io/narabe/).
|
|
566
|
+
- [Sugoroku](https://github.com/johnmorrisdotca/sugoroku) (双六): backgammon and its variants, with the doubling cube and match play. [Demo](https://johnmorrisdotca.github.io/sugoroku/).
|
|
563
567
|
- [Tenka](https://github.com/johnmorrisdotca/tenka) (天下): world conquest for two to six, on a map of the real world. [Demo](https://johnmorrisdotca.github.io/tenka/).
|
|
564
|
-
|
|
565
|
-
|
|
568
|
+
|
|
569
|
+
**Games — cards & tiles**
|
|
570
|
+
|
|
571
|
+
- [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/).
|
|
566
572
|
- [Jarajara](https://github.com/johnmorrisdotca/jarajara) (ジャラジャラ): mahjong tiles drawn as SVG, stacked layouts, and the matching solitaire Awase. [Demo](https://johnmorrisdotca.github.io/jarajara/).
|
|
567
|
-
- [
|
|
568
|
-
- [
|
|
569
|
-
|
|
570
|
-
|
|
573
|
+
- [Kumimoji](https://github.com/johnmorrisdotca/kumimoji) (組み文字): a crossword tile race, in English and Japanese kana. [Demo](https://johnmorrisdotca.github.io/kumimoji/).
|
|
574
|
+
- [Toranpu](https://github.com/johnmorrisdotca/toranpu) (トランプ): a deck of playing cards, card games with computer players, and solitaires. [Demo](https://johnmorrisdotca.github.io/toranpu/).
|
|
575
|
+
|
|
576
|
+
**Games — puzzles**
|
|
577
|
+
|
|
578
|
+
- [Houseki](https://github.com/johnmorrisdotca/houseki) (宝石): gem and stone matching puzzles: falling triplets, stone collapse, colour chains and gem swap. [Demo](https://johnmorrisdotca.github.io/houseki/).
|
|
579
|
+
- [Jirai](https://github.com/johnmorrisdotca/jirai) (地雷): minesweeper on shaped grids with verified no-guess boards. [Demo](https://johnmorrisdotca.github.io/jirai/).
|
|
580
|
+
- [Karakuri](https://github.com/johnmorrisdotca/karakuri) (からくり): eight hyper-casual puzzle games, some of them physics: draw a shield, pull pins, cut ropes, slide blocks, pour tubes. [Demo](https://johnmorrisdotca.github.io/karakuri/).
|
|
571
581
|
- [Kazu](https://github.com/johnmorrisdotca/kazu) (数): grid number puzzles: Sudoku and its variants, Futoshiki and Skyscrapers. [Demo](https://johnmorrisdotca.github.io/kazu/).
|
|
582
|
+
- [Kyuubu](https://github.com/johnmorrisdotca/kyuubu) (キューブ): a turning cube for the browser, 2×2 to 7×7, with record solves to replay. [Demo](https://johnmorrisdotca.github.io/kyuubu/).
|
|
572
583
|
- [Meikyuu](https://github.com/johnmorrisdotca/meikyuu) (迷宮): mazes on squares, hexagons, triangles and circles, made from a seed and drawn through with a finger or the mouse. [Demo](https://johnmorrisdotca.github.io/meikyuu/).
|
|
584
|
+
- [Suido](https://github.com/johnmorrisdotca/suido) (水道): a pipe puzzle: turn the pieces until the water reaches every drain. [Demo](https://johnmorrisdotca.github.io/suido/).
|
|
585
|
+
- [Tobiishi](https://github.com/johnmorrisdotca/tobiishi) (飛び石): peg solitaire with nine boards and seeded solvable challenges. [Demo](https://johnmorrisdotca.github.io/tobiishi/).
|
|
586
|
+
- [Tsunagi](https://github.com/johnmorrisdotca/tsunagi) (繋ぎ): a line-joining logic puzzle whose every level has exactly one answer. [Demo](https://johnmorrisdotca.github.io/tsunagi/).
|
|
587
|
+
|
|
588
|
+
**Games — dice & random**
|
|
589
|
+
|
|
590
|
+
- [Korokoro](https://github.com/johnmorrisdotca/korokoro) (コロコロ): dice, with notation, exact odds, real sounds and the dice of many games. [Demo](https://johnmorrisdotca.github.io/korokoro/).
|
|
591
|
+
- [Tane](https://github.com/johnmorrisdotca/tane) (種): seeded random numbers and daily seeds, the same in every browser and on every server. [Demo](https://johnmorrisdotca.github.io/tane/).
|
|
592
|
+
|
|
593
|
+
**Language**
|
|
594
|
+
|
|
595
|
+
- [Bushu](https://github.com/johnmorrisdotca/bushu) (部首): find a kanji by the parts it is made of. [Demo](https://johnmorrisdotca.github.io/bushu/).
|
|
573
596
|
- [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/).
|
|
597
|
+
- [Kotoba](https://github.com/johnmorrisdotca/kotoba) (言葉): word lists and word-game rules in English, French, German and Japanese. [Demo](https://johnmorrisdotca.github.io/kotoba/).
|
|
598
|
+
|
|
599
|
+
**Geography & data**
|
|
600
|
+
|
|
601
|
+
- [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/).
|
|
574
602
|
- [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/).
|
|
575
|
-
- [
|
|
576
|
-
- [
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
- [Houseki](https://github.com/johnmorrisdotca/houseki) (宝石): gem and stone matching puzzles: falling triplets, stone collapse, colour chains and gem swap. [Demo](https://johnmorrisdotca.github.io/houseki/).
|
|
581
|
-
- [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/).
|
|
582
|
-
- [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/).
|
|
603
|
+
- [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/).
|
|
604
|
+
- [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/).
|
|
605
|
+
|
|
606
|
+
**Sports**
|
|
607
|
+
|
|
583
608
|
- [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/).
|
|
609
|
+
- [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/).
|
|
584
610
|
- [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/).
|
|
611
|
+
- [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/).
|
|
612
|
+
|
|
613
|
+
**Developer tools**
|
|
614
|
+
|
|
615
|
+
- [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/).
|
|
616
|
+
|
|
585
617
|
|
|
586
|
-
**This package is Dougu Sports.** The demos of all
|
|
618
|
+
**This package is Dougu Sports.** The demos of all thirty-two share one header and footer, so each links the rest.
|
|
587
619
|
<!-- family:end -->
|
|
588
620
|
|
|
589
621
|
## Development
|
|
@@ -605,7 +637,7 @@ Bug reports and ideas go in the [issues](https://github.com/johnmorrisdotca/doug
|
|
|
605
637
|
|
|
606
638
|
## Changes
|
|
607
639
|
|
|
608
|
-
See [CHANGELOG.md](./CHANGELOG.md). 0.8.0 makes `bindTurn` light: it takes an emblem object and then needs no registry, so a turnable cup is about 9.4 kB gzipped instead of about 81 kB, and an id loads the registry on demand; 0.7.3 turns the build, docs and picture scripts, the browser tests and the demo's source from JavaScript into TypeScript, with no change to the package; 0.7.2 makes every docs page single-language (a page in Japanese beside each page that had Japanese words in it, and a test that holds them apart), with no change to the pictures; 0.7.1 puts real countries (Canada, Japan) in the crest and puck examples in place of made-up teams, with no change to the code; 0.7.0 gives the national volleyballs layouts that tell them apart (Japan a crimson band, Poland white above and red below, the USA a navy field), strengthens the 2010-style grooved soccer ball, and adds six pictures of how the judo belt is tied, `gear:obi-step-1` to `gear:obi-step-6` (269 emblems: [docs/obi-steps.md](./docs/obi-steps.md)); 0.6.0 gives the judo suit and the karate suit their sleeves (a judogi has no short ones: they reach the wrist) and adds the judogi seen from behind with the IJF-style back number, a family name and a country code on a patch, with a `backnumber` option (269 emblems: [docs/judogi-back.md](./docs/judogi-back.md)); 0.5.1 redraws the judo suit, the belt and the football pictograms and adds the blue and folded suits and the belts of every grade (261 emblems: [docs/japanese-sports.md](./docs/japanese-sports.md)); 0.5.0 adds fifty balls: vintage leather soccer balls, era-style and shop-wall soccer balls, baseballs of other threads and volleyballs in national colours, with a `colors` option (244 emblems: [docs/vintage-balls.md](./docs/vintage-balls.md)); 0.4.0 adds eight printed pucks and a `face` option (194 emblems: [docs/pucks.md](./docs/pucks.md)); 0.3.0 adds nineteen soccer balls (26, 18, 14, 12 and 6 panels, winter orange and high-visibility yellow, futsal and beach soccer: 186 emblems); 0.2.1 draws every ball and implement to the rulebook's proportions; 0.2.0 is 167 emblems, every one drawn here, with the Japanese sports, engraving, a turn for every emblem and the compose helpers; 0.1.0 brought the first full set of 148; 0.0.1 was the first preview.
|
|
640
|
+
See [CHANGELOG.md](./CHANGELOG.md). 0.10.0 adds a standalone ribbon and the nets and posts of sepak takraw, netball and teqball from their rulebooks' sizes (273 emblems); 0.9.0 lets the baseball, the softball and the classic soccer balls be painted and printed: solid and two-tone colours, a logo of your own wrapped onto the ball, stamped text, an original cursive word and a small mark, all turning with the ball ([docs/custom-balls.md](./docs/custom-balls.md)); 0.8.0 makes `bindTurn` light: it takes an emblem object and then needs no registry, so a turnable cup is about 9.4 kB gzipped instead of about 81 kB, and an id loads the registry on demand; 0.7.3 turns the build, docs and picture scripts, the browser tests and the demo's source from JavaScript into TypeScript, with no change to the package; 0.7.2 makes every docs page single-language (a page in Japanese beside each page that had Japanese words in it, and a test that holds them apart), with no change to the pictures; 0.7.1 puts real countries (Canada, Japan) in the crest and puck examples in place of made-up teams, with no change to the code; 0.7.0 gives the national volleyballs layouts that tell them apart (Japan a crimson band, Poland white above and red below, the USA a navy field), strengthens the 2010-style grooved soccer ball, and adds six pictures of how the judo belt is tied, `gear:obi-step-1` to `gear:obi-step-6` (269 emblems: [docs/obi-steps.md](./docs/obi-steps.md)); 0.6.0 gives the judo suit and the karate suit their sleeves (a judogi has no short ones: they reach the wrist) and adds the judogi seen from behind with the IJF-style back number, a family name and a country code on a patch, with a `backnumber` option (269 emblems: [docs/judogi-back.md](./docs/judogi-back.md)); 0.5.1 redraws the judo suit, the belt and the football pictograms and adds the blue and folded suits and the belts of every grade (261 emblems: [docs/japanese-sports.md](./docs/japanese-sports.md)); 0.5.0 adds fifty balls: vintage leather soccer balls, era-style and shop-wall soccer balls, baseballs of other threads and volleyballs in national colours, with a `colors` option (244 emblems: [docs/vintage-balls.md](./docs/vintage-balls.md)); 0.4.0 adds eight printed pucks and a `face` option (194 emblems: [docs/pucks.md](./docs/pucks.md)); 0.3.0 adds nineteen soccer balls (26, 18, 14, 12 and 6 panels, winter orange and high-visibility yellow, futsal and beach soccer: 186 emblems); 0.2.1 draws every ball and implement to the rulebook's proportions; 0.2.0 is 167 emblems, every one drawn here, with the Japanese sports, engraving, a turn for every emblem and the compose helpers; 0.1.0 brought the first full set of 148; 0.0.1 was the first preview.
|
|
609
641
|
|
|
610
642
|
## Credits
|
|
611
643
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type EmblemRef } from "../emblems/emblem.api.ts";
|
|
2
|
+
import type { EmblemOptions } from "../emblems/emblem.core.ts";
|
|
3
|
+
import type { MakerId } from "./brand.data.ts";
|
|
4
|
+
import { type MakerLogoOptions } from "./brand.render.ts";
|
|
5
|
+
/** How a maker's logo sits on a ball. */
|
|
6
|
+
export interface MakerBallOptions extends Omit<MakerLogoOptions, "size" | "title"> {
|
|
7
|
+
/** How wide the logo is, in degrees of the ball (the mark alone 50 by default, a layout with a wordmark 74). */
|
|
8
|
+
width?: number;
|
|
9
|
+
/** A turn of the logo on the ball, in degrees. */
|
|
10
|
+
turn?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The ball options that print a maker's logo on it: `{ decal: { svg, size, turn } }`, to spread into the options of `renderEmblem`, `emblemFrame` or `bindTurn`. The logo is wrapped onto the sphere, so it curves with the ball and turns with it.
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { makerBall } from "@johnmorrisdotca/dougu-sports/brands";
|
|
17
|
+
* console.log(makerBall("arvane").decal.svg.includes("<path"));
|
|
18
|
+
* // true
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function makerBall(id: MakerId, o?: MakerBallOptions): {
|
|
22
|
+
decal: {
|
|
23
|
+
svg: string;
|
|
24
|
+
size: number;
|
|
25
|
+
turn: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/** A ball with a maker's logo printed on it: `renderMakerBall("ball:baseball", "arvane", { size: 320 })`. Any other options of the ball (`paint`, `stamp`, `spots`...) go in `ball`. */
|
|
29
|
+
export declare function renderMakerBall(ball: EmblemRef, id: MakerId, o?: MakerBallOptions, ballOptions?: EmblemOptions): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Puts a maker's mark on a ball: the options that print it (`decal`), and the ball drawn with them. The balls that take a printed logo are the baseball, the softball and the classic soccer balls (see docs/custom-balls.md);
|
|
2
|
+
// any other ball ignores the print and is drawn plain.
|
|
3
|
+
import { renderEmblem } from "../emblems/emblem.api.js";
|
|
4
|
+
import { makerLogo } from "./brand.render.js";
|
|
5
|
+
/**
|
|
6
|
+
* The ball options that print a maker's logo on it: `{ decal: { svg, size, turn } }`, to spread into the options of `renderEmblem`, `emblemFrame` or `bindTurn`. The logo is wrapped onto the sphere, so it curves with the ball and turns with it.
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { makerBall } from "@johnmorrisdotca/dougu-sports/brands";
|
|
10
|
+
* console.log(makerBall("arvane").decal.svg.includes("<path"));
|
|
11
|
+
* // true
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export function makerBall(id, o) {
|
|
15
|
+
const layout = o?.layout ?? "mark";
|
|
16
|
+
const size = typeof o?.width === "number" && Number.isFinite(o.width) ? Math.min(Math.max(o.width, 8), 120) : layout === "mark" ? 50 : 74;
|
|
17
|
+
const turn = typeof o?.turn === "number" && Number.isFinite(o.turn) ? o.turn : 0;
|
|
18
|
+
return { decal: { svg: makerLogo(id, { ...o, title: false, size: 200 }), size, turn } };
|
|
19
|
+
}
|
|
20
|
+
/** A ball with a maker's logo printed on it: `renderMakerBall("ball:baseball", "arvane", { size: 320 })`. Any other options of the ball (`paint`, `stamp`, `spots`...) go in `ball`. */
|
|
21
|
+
export function renderMakerBall(ball, id, o, ballOptions) {
|
|
22
|
+
return renderEmblem(ball, { ...ballOptions, ...makerBall(id, o) });
|
|
23
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { LetterStyle } from "./brand.letters.ts";
|
|
2
|
+
export type PartRole = "a" | "b" | "c";
|
|
3
|
+
/** One flat shape of a mark: an SVG path (drawn with the even-odd rule, so a hole is a hole) and the colour it takes. */
|
|
4
|
+
export interface LogoPart {
|
|
5
|
+
d: string;
|
|
6
|
+
role: PartRole;
|
|
7
|
+
}
|
|
8
|
+
/** The colours of a maker on a light page or a dark one: the two of its mark and the ink of its wordmark. */
|
|
9
|
+
export interface MakerPalette {
|
|
10
|
+
a: string;
|
|
11
|
+
b: string;
|
|
12
|
+
ink: string;
|
|
13
|
+
}
|
|
14
|
+
/** The three colours of a team logo on a light page or a dark one. */
|
|
15
|
+
export interface TeamPalette {
|
|
16
|
+
a: string;
|
|
17
|
+
b: string;
|
|
18
|
+
c: string;
|
|
19
|
+
}
|
|
20
|
+
/** A fictional maker of balls and sports gear: a mark, a name to set as a wordmark, two palettes and the note of how it differs from the nearest real brand. */
|
|
21
|
+
export interface MakerData {
|
|
22
|
+
id: MakerId;
|
|
23
|
+
name: string;
|
|
24
|
+
genre: string;
|
|
25
|
+
note: string;
|
|
26
|
+
parts: readonly LogoPart[];
|
|
27
|
+
light: MakerPalette;
|
|
28
|
+
dark: MakerPalette;
|
|
29
|
+
lettering: LetterStyle;
|
|
30
|
+
}
|
|
31
|
+
/** A fictional team: a city and a nickname, a logo, two palettes and a note. */
|
|
32
|
+
export interface TeamData {
|
|
33
|
+
id: TeamId;
|
|
34
|
+
city: string;
|
|
35
|
+
nickname: string;
|
|
36
|
+
genre: string;
|
|
37
|
+
note: string;
|
|
38
|
+
parts: readonly LogoPart[];
|
|
39
|
+
light: TeamPalette;
|
|
40
|
+
dark: TeamPalette;
|
|
41
|
+
}
|
|
42
|
+
export declare const MAKER_IDS: readonly ["arvane", "tarsin", "ravelle", "kovreth", "dunmar", "ostrel", "vexlin", "quillan", "tenzar", "marenko", "halvane", "solvik"];
|
|
43
|
+
export type MakerId = (typeof MAKER_IDS)[number];
|
|
44
|
+
export declare const TEAM_IDS: readonly ["saltmere", "greywick", "brightwater", "cinderfell", "valmere", "larkmoor", "ironport", "pinecrest", "redfern", "tarn"];
|
|
45
|
+
export type TeamId = (typeof TEAM_IDS)[number];
|
|
46
|
+
export declare const MAKERS: Readonly<Record<MakerId, MakerData>>;
|
|
47
|
+
export declare const TEAMS: Readonly<Record<TeamId, TeamData>>;
|