@johnmorrisdotca/dougu-sports 0.29.0 → 0.31.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 +29 -0
- package/NOTICE.md +1 -1
- package/README.md +12 -3
- package/dist/emblems/ball/ball.plastic.js +15 -15
- package/dist/emblems/emblem.descriptions.js +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,35 @@ All notable changes to this project are written here. The format follows
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.31.0] - 2026-11-03
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **The playground takes kazoku-ui 0.12 and its zoom slider.** On a desk the bar under the stage is now `layout="horizontal"` (a phone keeps the classic bar, which fits its width): the turn on one row and, under it, the zoom as a slider marked at 1x, 2x, 3x and 5x with the readout, zoom out, zoom in and Fit, and the Centre button of 0.11 beside More. The angle, tilt, zoom and pan are kept in the address as before.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- The playground no longer drops the header's `theme=dark` from the address when the view moves: its own Look choice shares the `theme` parameter, and it wrote the default over the header's value on the next change of the view. It leaves `theme` alone until the Look is chosen on the page.
|
|
18
|
+
|
|
19
|
+
### Also in this release
|
|
20
|
+
|
|
21
|
+
- Docs only (MODULES-247): two more guides, with Japanese twins: architecture (the pipeline from an id to an SVG document, the five rules, the entries and the checks) and podiums, sprites and data addresses; `demo/builder.html`, a page where the group, the emblem, the look, the theme, the size and the tint are chosen and the code that puts the emblem in a page is copied (`emblemEmbedCode`), with `e2e/builder.demo.ts`; the README is under npm's 64,000 characters, its list of releases now the CHANGELOG's.
|
|
22
|
+
- The README opens with the package's thumbnail, and the demo carries it as its link preview (og:image) and publishes the card, a dark card and an icon on Pages at `thumbnail.png`, `thumbnail-dark.png` and `icon.png`.
|
|
23
|
+
|
|
24
|
+
## [0.30.0] - 2026-11-03
|
|
25
|
+
|
|
26
|
+
The practice baseball like the real one, and the playground's view controls with kazoku-ui 0.11.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- **The three practice baseballs have fewer, larger, rounder slots** (`ball:plastic-baseball-practice`, `-white`, `-orange`; MODULES-244). Each half had two rings of six thin slits (twenty-four in all); it now has one ring of six large oval slots running toward its pole, the two rings turned half a step apart, so about four or five show on a face, as on the ball in John's photographs. A slot is about 22 by 14 mm, an oval and not a slit. The descriptions say "large oval slots". The ids, the colours and the registry count are unchanged.
|
|
31
|
+
- **The playground takes kazoku-ui 0.11** (MODULES-236). A **Centre** button comes into the bar once the emblem is zoomed or moved and puts it back in the middle at Fit and the resting angle (the Home key does too); `object-size` is set from the emblem's drawn size so a pan always keeps a quarter of it in view; and a round ball sets `grab-radius`, so a drag keeps the touched point under the pointer (a drag of 30 pixels moves a soccer ball's ground by about 30). Pucks, discs, shuttlecocks, the oval footballs and everything that is not a ball keep the fixed turn. The playground follows the drag rule: a drag right moves the surface right, a drag up moves it up, and the arrow keys agree.
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
|
|
35
|
+
- **`e2e/centre.demo.ts`**: Centre hidden at Fit, then shown after a zoom and a drag, and putting the emblem back in the middle; a drag far off (thousands of pixels, every direction) never loses the emblem; the Home key; the shared drag-rule check (`e2e/ground.mjs`, kazoku-ui's `templates/e2e-ground.mjs`, copied unchanged) on a soccer ball; and exact grab on two balls.
|
|
36
|
+
- **`practice-light.webp` and `practice-dark.webp`**, the three practice balls from four sides, in the README and `docs/slotted-ball.md`.
|
|
37
|
+
|
|
9
38
|
## [0.29.0] - 2026-11-03
|
|
10
39
|
|
|
11
40
|
Put it anywhere: a tag, an embed page and the code for both. A practice baseball with slots all over. The playground's turning is the family's view controls. And the family's must-have list: a documentation site in English and Japanese, usage that is tested, and a check that holds it.
|
package/NOTICE.md
CHANGED
|
@@ -53,7 +53,7 @@ Each ball's `size.rule` names the rule; the table gives the document and where i
|
|
|
53
53
|
| `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
54
|
| `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
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
|
|
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
57
|
| `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
58
|
| `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
59
|
| `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
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<p align="center"><a href="https://johnmorrisdotca.github.io/dougu-sports/"><picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/thumbnail-dark.png"><img src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/thumbnail.png" alt="Dougu Sports: a soccer ball, a baseball glove, a gold cup with two handles, a basketball and a tennis racket, drawn as SVG." width="1200"></picture></a></p>
|
|
2
|
+
|
|
1
3
|
<h1 align="center">Dougu Sports <sub>道具</sub></h1>
|
|
2
4
|
|
|
3
5
|
<p align="center"><strong>Sports emblems as SVG strings, with optional 3D turning.</strong><br>
|
|
@@ -88,7 +90,7 @@ The ball and the gear of every sport, trophies, medals, crests and the icon of e
|
|
|
88
90
|
</picture>
|
|
89
91
|
</p>
|
|
90
92
|
|
|
91
|
-
- **Two plastic practice baseballs**: a hollow white one with eight oblong slots on one half, and the common one with slots
|
|
93
|
+
- **Two plastic practice baseballs**: a hollow white one with eight oblong slots on one half, and the common one with a ring of six large oval slots on each half, in two-tone yellow and black, white and orange (`ball:plastic-baseball-practice`, `-white`, `-orange`), drawn with the same see-through holes ([slotted ball](./docs/slotted-ball.md)).
|
|
92
94
|
|
|
93
95
|
<p align="center">
|
|
94
96
|
<picture>
|
|
@@ -97,6 +99,13 @@ The ball and the gear of every sport, trophies, medals, crests and the icon of e
|
|
|
97
99
|
</picture>
|
|
98
100
|
</p>
|
|
99
101
|
|
|
102
|
+
<p align="center">
|
|
103
|
+
<picture>
|
|
104
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/practice-dark.webp">
|
|
105
|
+
<img alt="The three practice baseballs with slots on both halves, in rows: yellow and black two-tone, white and orange, each at rest and from three other sides, with six large oval slots to a half." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/practice-light.webp" width="760">
|
|
106
|
+
</picture>
|
|
107
|
+
</p>
|
|
108
|
+
|
|
100
109
|
- **Trophies, medals, crests and the icon of every sport**, in metal, one line or flat colour, light and dark.
|
|
101
110
|
|
|
102
111
|
<p align="center">
|
|
@@ -636,7 +645,7 @@ The package's own words are the emblems' names, in English (`en`) and Japanese (
|
|
|
636
645
|
|
|
637
646
|
## Architecture
|
|
638
647
|
|
|
639
|
-
The code is `src/emblems/`: the core (options, colours, gradients, the wrapper), the id lists, the registry, the renderers (the body of revolution, the flat object and icon, and the ball and gear engines) and one module per emblem, or per family of balls and gear, in a folder for its group; [docs/layout.md](./docs/layout.md) has the folders and how to add one. The package has no state and no clock: every function is a pure function of its arguments.
|
|
648
|
+
The code is `src/emblems/`: the core (options, colours, gradients, the wrapper), the id lists, the registry, the renderers (the body of revolution, the flat object and icon, and the ball and gear engines) and one module per emblem, or per family of balls and gear, in a folder for its group; [docs/layout.md](./docs/layout.md) has the folders and how to add one, and the [architecture guide](./docs/guides/architecture.md) follows one call through them. [Podiums, sprites and data addresses](./docs/guides/compose.md) is the guide to the composing functions. The package has no state and no clock: every function is a pure function of its arguments.
|
|
640
649
|
|
|
641
650
|
## The name
|
|
642
651
|
|
|
@@ -735,7 +744,7 @@ Bug reports and ideas go in the [issues](https://github.com/johnmorrisdotca/doug
|
|
|
735
744
|
|
|
736
745
|
## Changes
|
|
737
746
|
|
|
738
|
-
See [CHANGELOG.md](./CHANGELOG.md)
|
|
747
|
+
See [CHANGELOG.md](./CHANGELOG.md), which has every release from 0.0.1 with its date and what it added. 0.31.0 puts the playground's zoom on kazoku-ui 0.12's slider. 0.30.0 makes the three practice baseballs' slots fewer, larger and rounder, like the real ball, and takes kazoku-ui 0.11 in the playground. 0.29.0 adds `<dougu-emblem>` and the embed page, three practice baseballs with slots on both halves, and the documentation site. 0.28.0 adds the Jackie Robinson Rookie of the Year plaque (`trophy:jackie-robinson-award`) and the Halas, Messier, O'Ree and NBA postseason trophies (346 emblems).
|
|
739
748
|
|
|
740
749
|
## Credits
|
|
741
750
|
|
|
@@ -41,21 +41,21 @@ export const BALL_PLASTIC_BASEBALL_SLOTTED = /* @__PURE__ */ defineBall({
|
|
|
41
41
|
},
|
|
42
42
|
});
|
|
43
43
|
/**
|
|
44
|
-
* The common hollow plastic practice baseball with slots all over it (the other, the one-sided ball above, is the first):
|
|
45
|
-
*
|
|
46
|
-
* the number and the layout of the slots are drawn from photographs looked at and never copied. No maker's name is in this package.
|
|
44
|
+
* The common hollow plastic practice baseball with slots all over it (the other, the one-sided ball above, is the first): one ring of five large oval slots on each half, running toward the pole, the two rings
|
|
45
|
+
* turned half a step apart so that no slot faces another across the seam, and often two-tone, the halves split along the seam. A slot is about 22 mm long and 14 mm wide on a ball of the size of a baseball, an oval
|
|
46
|
+
* and not a slit (larger than the 19 mm of the one-sided ball, as the photographs show); the other figures are the same facts as above, and the number and the layout of the slots are drawn from photographs looked at and never copied. No maker's name is in this package.
|
|
47
47
|
*/
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const ALL = [1, -1].flatMap((sign) =>
|
|
53
|
-
const a = ((
|
|
54
|
-
const t = (
|
|
48
|
+
const PRACTICE_HALF_LONG = 0.3;
|
|
49
|
+
const PRACTICE_HALF_WIDTH = 0.19;
|
|
50
|
+
const PRACTICE_PER_HALF = 6;
|
|
51
|
+
const PRACTICE_COLATITUDE = 56;
|
|
52
|
+
const ALL = [1, -1].flatMap((sign) => Array.from({ length: PRACTICE_PER_HALF }, (_, i) => {
|
|
53
|
+
const a = (((sign === 1 ? 0 : 180 / PRACTICE_PER_HALF) + (i / PRACTICE_PER_HALF) * 360) * Math.PI) / 180;
|
|
54
|
+
const t = (PRACTICE_COLATITUDE * Math.PI) / 180;
|
|
55
55
|
const m = [Math.sin(t) * Math.cos(a), Math.sin(t) * Math.sin(a), sign * Math.cos(t)];
|
|
56
|
-
const along =
|
|
56
|
+
const along = [-m[0] * m[2] * sign, -m[1] * m[2] * sign, sign - m[2] * m[2] * sign];
|
|
57
57
|
return { m, dir: along };
|
|
58
|
-
}))
|
|
58
|
+
}));
|
|
59
59
|
const PRACTICE_CENTRES = ALL.map((one) => one.m);
|
|
60
60
|
const PRACTICE_DIRS = ALL.map((one) => one.dir);
|
|
61
61
|
function practice(id, en, ja, colours) {
|
|
@@ -64,15 +64,15 @@ function practice(id, en, ja, colours) {
|
|
|
64
64
|
id,
|
|
65
65
|
en,
|
|
66
66
|
ja,
|
|
67
|
-
size: { extentMm: 73.8, diameterMm: 73.8, rule: "English Wikipedia, the article on the perforated plastic practice ball (accessed 2026-10-21): hollow plastic, wall at most 3.2 mm
|
|
67
|
+
size: { extentMm: 73.8, diameterMm: 73.8, rule: "English Wikipedia, the article on the perforated plastic practice ball (accessed 2026-10-21): hollow plastic, wall at most 3.2 mm; size taken from Official Baseball Rules, Rule 3.01 (the middle of the circumference range). The count and layout of the slots are drawn from photographs looked at, not copied.", note: "The size of a slot on this ball is not given by the article (19 mm is the one-sided ball's): it is drawn about 22 by 14 mm, an oval, to match the photographs. The mass is not stated. " },
|
|
68
68
|
spec: {
|
|
69
69
|
view: { yaw: -22, pitch: 26, roll: 0 },
|
|
70
70
|
base: colours.second ?? colours.first,
|
|
71
71
|
...(colours.second === undefined ? {} : { ground: colours.first }),
|
|
72
72
|
mat: { gloss: 0.5, shade: "#2b2e36", grain: { f: 1.4, a: 0.08 } },
|
|
73
73
|
draw: (s, base) => (colours.second === undefined ? "" : region(s, seam, base)) +
|
|
74
|
-
(s.line ? s.strokes(PRACTICE_CENTRES.map((m, i) => slotRing(m, PRACTICE_DIRS[i],
|
|
75
|
-
holes: (s, hid, base, shape, minWidth) => holeLayers(s, hid, { centres: PRACTICE_CENTRES, radius:
|
|
74
|
+
(s.line ? s.strokes(PRACTICE_CENTRES.map((m, i) => slotRing(m, PRACTICE_DIRS[i], PRACTICE_HALF_WIDTH, PRACTICE_HALF_LONG)), "#000", 1, { closed: true }) : ""),
|
|
75
|
+
holes: (s, hid, base, shape, minWidth) => holeLayers(s, hid, { centres: PRACTICE_CENTRES, radius: PRACTICE_HALF_WIDTH, long: PRACTICE_HALF_LONG, dirs: PRACTICE_DIRS }, base, shape, minWidth),
|
|
76
76
|
},
|
|
77
77
|
});
|
|
78
78
|
}
|
|
@@ -54,9 +54,9 @@ export const EMBLEM_DESCRIPTIONS = {
|
|
|
54
54
|
"ball:afl": { en: "Australian football", ja: "オーストラリアンフットボールのボール" },
|
|
55
55
|
"ball:gaelic-football": { en: "Gaelic football", ja: "ゲーリックフットボールのボール" },
|
|
56
56
|
"ball:plastic-baseball-slotted": { en: "A hollow white plastic practice baseball with eight oblong slots on one half and the other half solid", ja: "中空の白いプラスチック製の野球練習球。半球の一方に細長い穴が8つ並び、もう一方には穴がない" },
|
|
57
|
-
"ball:plastic-baseball-practice": { en: "A hollow plastic practice baseball in two tones, high-visibility yellow and black, with
|
|
58
|
-
"ball:plastic-baseball-practice-white": { en: "A hollow white plastic practice baseball with
|
|
59
|
-
"ball:plastic-baseball-practice-orange": { en: "A hollow orange plastic practice baseball with
|
|
57
|
+
"ball:plastic-baseball-practice": { en: "A hollow plastic practice baseball in two tones, high-visibility yellow and black, with large oval slots on both halves", ja: "中空のプラスチック製の野球練習球。蛍光の黄色と黒の二色で、両方の半球に大きな楕円の穴が並ぶ" },
|
|
58
|
+
"ball:plastic-baseball-practice-white": { en: "A hollow white plastic practice baseball with large oval slots on both halves", ja: "中空の白いプラスチック製の野球練習球。両方の半球に大きな楕円の穴が並ぶ" },
|
|
59
|
+
"ball:plastic-baseball-practice-orange": { en: "A hollow orange plastic practice baseball with large oval slots on both halves", ja: "中空の橙色のプラスチック製の野球練習球。両方の半球に大きな楕円の穴が並ぶ" },
|
|
60
60
|
"ball:squash": { en: "Squash ball, double yellow dot", ja: "スカッシュボール(ダブルイエロードット)" },
|
|
61
61
|
"ball:squash-yellow": { en: "Squash ball, yellow dot", ja: "スカッシュボール(イエロードット)" },
|
|
62
62
|
"ball:squash-green": { en: "Squash ball, green dot", ja: "スカッシュボール(グリーンドット)" },
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/dougu-sports",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "Dougu Sports 道具 — Sports emblems as SVG for JavaScript: trophies, medals, crests, sport icons, and the ball and gear of every sport, in metal, line or flat colour, with optional 3D turning and a tag for any page. Light and dark, accessible, tree-shakeable. Zero dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sports",
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"@angular/platform-browser": "^22.2.4",
|
|
153
153
|
"@eslint/js": "^9.0.0",
|
|
154
154
|
"@johnmorrisdotca/hata": "1.5.0",
|
|
155
|
-
"@johnmorrisdotca/kazoku-ui": "^0.
|
|
155
|
+
"@johnmorrisdotca/kazoku-ui": "^0.12.0",
|
|
156
156
|
"@playwright/test": "^1.63.0",
|
|
157
157
|
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
158
158
|
"@types/node": "^24.0.0",
|