@johnmorrisdotca/dougu-sports 0.12.1 → 0.14.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 CHANGED
@@ -6,6 +6,29 @@ All notable changes to this project are written here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.14.0] - 2026-10-21
10
+
11
+ The auto-turn can go either way, and the pictures and the demo are slower and wait for the pointer.
12
+
13
+ ### Added
14
+
15
+ - **`direction` for the auto-turn**: `bindTurn(container, emblem, { direction: "clockwise" })` (seen from above; the default, `"counterclockwise"`, is how it has always turned, the front swinging to the viewer's right). `controller.setDirection(direction)` changes it while it turns without stopping it, `controller.direction()` reads it, and `turnDirection(value)` is the check the option goes through (exported from `./turn` and the main entry, with the `TurnDirection` type). `update` keeps the direction unless it names one. A drag, the keys and `setAngles` are not reversed. Tests: `test/turn-control.test.ts` and the demo's.
16
+
17
+ ### Changed
18
+
19
+ - **README: it opens on the still pictures again** (the balls, the vintage balls, the trophies, the famous trophies and the gear, with the turned and phone pictures), as before 0.12.1. The turning pictures sit lower, each beside its own point of "The best of it" (the famous trophies, the balls, the medals and crests), never stacked.
20
+ - **The turning pictures run at half the speed** (`pnpm animations` shows each frame 140 ms, it was 70; `DELAY=70` for the old pace).
21
+ - **Demo: the emblem waits still and turns while the mouse is over it.** Leaving stops it where it is; a tap on a phone turns it and a second tap holds it (a drag turns it by hand as before). Auto-turn keeps it going wherever the pointer is, and `?turn=1` starts it with the page. The speed buttons are Slow 9, Medium 18 (the default, half of the old 36) and Fast 45 degrees a second; addresses with `speed=18`, `36` or `90` still mean those speeds. A **Reverse** button (`逆回転`, "reverse rotation", with the label `逆向きに回す`, "Turn the other way") turns it the other way, kept in the address as `dir=cw`. The trophy case waits still too and turns an emblem while the pointer is over it or after a tap, at 22 degrees a second (it was 45). A reader who prefers reduced motion is never turned for by the pointer. The package's own default speed (36) is unchanged.
22
+
23
+ ## [0.13.0] - 2026-10-20
24
+
25
+ Four combat sports get their pictograms, so a page that lists MMA, boxing, wrestling or professional wrestling no longer borrows the judo or karate suit.
26
+
27
+ ### Added
28
+
29
+ - **`sport:mma`, `sport:boxing`, `sport:wrestling` and `sport:prowrestling`** (`SPORT_MMA`, `SPORT_BOXING`, `SPORT_WRESTLING`, `SPORT_PROWRESTLING`), in the metal, colour and line styles like the other pictograms, all drawn for this package with no mark of any promotion, federation or maker and no lettering: MMA is a generic eight-sided cage seen from above inside a fence of diamond mesh, boxing a padded glove with the thumb against its side and a banded cuff, wrestling two wrestlers in the tie-up on the round of the mat, and professional wrestling a ring seen from a corner with a post at each corner, three ropes between them and the apron. Names: "MMA", "Boxing", "Wrestling", "Pro wrestling" (each also has a Japanese name). 325 emblems.
30
+ - **`mma`, `boxing`, `wrestling` and `prowrestling` in `SPORT_NAMES`** (42 sports). `sportEquipment` gives each a trophy (the belt for MMA, boxing and professional wrestling, a cup for wrestling), a gold medal for boxing and wrestling, no ball and no gear yet.
31
+
9
32
  ## [0.12.1] - 2026-10-20
10
33
 
11
34
  The npm page and the demo open on a trophy that turns. No change to the package's code beyond its version.
package/README.md CHANGED
@@ -15,29 +15,25 @@ The ball and the gear of every sport, trophies, medals, crests and the icon of e
15
15
 
16
16
  <p align="center">
17
17
  <picture>
18
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/trophies-turn-dark.webp">
19
- <img alt="Five famous trophies turning in 3D on royal purple, each a little behind the one before: the Stanley Cup first, then the FIFA World Cup, the Lombardi Trophy, the Larry O'Brien trophy and the Webb Ellis Cup. Each keeps its outline while its light and its handles move." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/trophies-turn-light.webp" width="760">
18
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/balls-desk-dark.webp">
19
+ <img alt="Thirty-six balls and pucks drawn in 3D under floodlights, in four rows of nine: soccer balls of several constructions and colours, then basketball, the 3x3 ball, baseball, softball, a football, a rugby ball, an Australian football and two volleyballs, then tennis, padel, pickleball with its holes, squash with its two dots, racquetball, golf, red and pink cricket and water polo, and last sepak takraw, a shuttlecock, a puck, a curling stone, lacrosse, handball, table tennis, a sliotar and a roundnet ball." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/balls-desk-light.webp" width="760">
20
20
  </picture>
21
21
  </p>
22
22
 
23
23
  <p align="center">
24
24
  <picture>
25
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/balls-turn-dark.webp">
26
- <img alt="Seven balls rolling under floodlights: a soccer ball, a basketball, a baseball, a rugby ball, a volleyball, a tennis ball and a golf ball, each turned a little differently so that the seams and panels travel across them." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/balls-turn-light.webp" width="760">
25
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/vintage-desk-dark.webp">
26
+ <img alt="Eighteen more balls on a warm sunburst, in two rows of nine: five vintage leather soccer balls (hand-stitched, laced, 18 strips, 12 panels, 32 panels), a lemon-peel baseball, two baseballs stitched in two colours and an aged baseball, then nine soccer balls in the style of an era, with patterns of pentagons, leaves, a rosette, a star, a pinwheel and kites, a double border and plain white panels." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/vintage-desk-light.webp" width="760">
27
27
  </picture>
28
28
  </p>
29
29
 
30
30
  <p align="center">
31
31
  <picture>
32
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/flips-turn-dark.webp">
33
- <img alt="A gold and a silver medal, a championship banner, a crest, a hockey skate and a baseball glove flipping like coins on royal purple: each shows its face, then its edge, then its plain back." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/flips-turn-light.webp" width="760">
32
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/hero-desk-dark.webp">
33
+ <img alt="Trophies, medals and crests, in four rows of nine: nine famous cups, then a gilded cup, a phoenix-handle cup, a soccer ball trophy, a wreath, a rosette, a belt, a banner, a ring and a plaque, then three medals, three place badges and three crests, and last three cups each in metal, line and colour." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/hero-desk-light.webp" width="760">
34
34
  </picture>
35
35
  </p>
36
36
 
37
- ## The best of it
38
-
39
- - **47 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)).
40
-
41
37
  <p align="center">
42
38
  <picture>
43
39
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/famous-desk-dark.webp">
@@ -45,42 +41,58 @@ The ball and the gear of every sport, trophies, medals, crests and the icon of e
45
41
  </picture>
46
42
  </p>
47
43
 
48
- - **117 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)).
49
-
50
44
  <p align="center">
51
45
  <picture>
52
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/balls-desk-dark.webp">
53
- <img alt="Thirty-six balls and pucks drawn in 3D under floodlights, in four rows of nine: soccer balls of several constructions and colours, then basketball, the 3x3 ball, baseball, softball, a football, a rugby ball, an Australian football and two volleyballs, then tennis, padel, pickleball with its holes, squash with its two dots, racquetball, golf, red and pink cricket and water polo, and last sepak takraw, a shuttlecock, a puck, a curling stone, lacrosse, handball, table tennis, a sliotar and a roundnet ball." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/balls-desk-light.webp" width="760">
46
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/gear-desk-dark.webp">
47
+ <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">
54
48
  </picture>
55
49
  </p>
56
50
 
57
- - **Trophies, medals, crests and the icon of every sport**, in metal, one line or flat colour, light and dark.
51
+ <table align="center">
52
+ <tr>
53
+ <td align="center" valign="top">
54
+ <img alt="A two-handled cup, a medal, a soccer ball and a championship banner each turned through seven angles: the cup keeps its outline and moves its light and handles, the medal and the banner flip like a coin to show their plain backs, and the ball rolls." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/turn-desk.webp" width="470"><br><em>Turned: a ball rolls, a medal flips</em>
55
+ </td>
56
+ <td align="center" valign="top">
57
+ <img alt="Cups, a medal, balls and gear on a phone, three to a row." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/phone-light.webp" width="200"><br><em>On a phone</em>
58
+ </td>
59
+ </tr>
60
+ </table>
61
+
62
+ ## The best of it
63
+
64
+ - **47 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)).
58
65
 
59
66
  <p align="center">
60
67
  <picture>
61
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/hero-desk-dark.webp">
62
- <img alt="Trophies, medals and crests, in four rows of nine: nine famous cups, then a gilded cup, a phoenix-handle cup, a soccer ball trophy, a wreath, a rosette, a belt, a banner, a ring and a plaque, then three medals, three place badges and three crests, and last three cups each in metal, line and colour." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/hero-desk-light.webp" width="760">
68
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/trophies-turn-dark.webp">
69
+ <img alt="Five famous trophies turning in 3D on royal purple, each a little behind the one before: the Stanley Cup first, then the FIFA World Cup, the Lombardi Trophy, the Larry O'Brien trophy and the Webb Ellis Cup. Each keeps its outline while its light and its handles move." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/trophies-turn-light.webp" width="760">
63
70
  </picture>
64
71
  </p>
65
72
 
66
- - **70 pieces of gear**, among them the Japanese sports and budo ([Japanese sports](./docs/japanese-sports.md)).
73
+ - **117 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)).
67
74
 
68
75
  <p align="center">
69
76
  <picture>
70
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/gear-desk-dark.webp">
71
- <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">
77
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/balls-turn-dark.webp">
78
+ <img alt="Seven balls rolling under floodlights: a soccer ball, a basketball, a baseball, a rugby ball, a volleyball, a tennis ball and a golf ball, each turned a little differently so that the seams and panels travel across them." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/balls-turn-light.webp" width="760">
72
79
  </picture>
73
80
  </p>
74
81
 
75
- - **On a phone**, and **turned by hand**: drag, arrow keys or the automatic turn ([turning](./docs/turning.md)).
82
+ - **Trophies, medals, crests and the icon of every sport**, in metal, one line or flat colour, light and dark.
76
83
 
77
84
  <p align="center">
78
85
  <picture>
79
- <img alt="Cups, a medal, balls and gear on a phone, three to a row." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/phone-light.webp" width="200">
86
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/flips-turn-dark.webp">
87
+ <img alt="A gold and a silver medal, a championship banner, a crest, a hockey skate and a baseball glove flipping like coins on royal purple: each shows its face, then its edge, then its plain back." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/flips-turn-light.webp" width="760">
80
88
  </picture>
81
89
  </p>
82
90
 
83
- > **Status: preview.** 321 emblems: 71 trophies, 6 awards, 6 medals, 4 crests, a pictogram for each of the 38 sports, 117 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.
91
+ - **70 pieces of gear**, among them the Japanese sports and budo ([Japanese sports](./docs/japanese-sports.md)).
92
+
93
+ - **On a phone**, and **turned by hand**: drag, arrow keys or the automatic turn ([turning](./docs/turning.md)).
94
+
95
+ > **Status: preview.** 325 emblems: 71 trophies, 6 awards, 6 medals, 4 crests, a pictogram for each of the 42 sports, 117 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.
84
96
 
85
97
  ## In 30 seconds
86
98
 
@@ -311,7 +323,7 @@ import { EMBLEM_GROUPS, EMBLEM_IDS, SPORT_NAMES } from "@johnmorrisdotca/dougu-s
311
323
 
312
324
  console.log(Object.keys(EMBLEM_GROUPS).join(" ")); // award trophy medal crest ball puck gear sport pennant
313
325
  console.log(EMBLEM_IDS.includes("ball:soccer")); // true
314
- console.log(SPORT_NAMES.length); // 38
326
+ console.log(SPORT_NAMES.length); // 42
315
327
  ```
316
328
 
317
329
  ### Check a string from outside
@@ -394,9 +406,10 @@ import { TROPHY_TENNIS_CUP } from "@johnmorrisdotca/dougu-sports/trophy/tennis-c
394
406
 
395
407
  const turner = bindTurn(document.getElementById("cup"), TROPHY_TENNIS_CUP, { size: 160, speed: 36 });
396
408
  document.getElementById("spin").onclick = () => turner.togglePlay();
409
+ turner.setDirection("clockwise"); // seen from above: the other way (the default, `"counterclockwise"`, swings the front to the viewer's right)
397
410
  ```
398
411
 
399
- A drag turns it, the arrow keys turn it, Space starts and stops an auto-turn, and nothing moves until you ask. Pass the emblem itself and the page carries the turning and that one emblem and nothing else (a cup and the turning are about 9 kB gzipped); pass an id, `"trophy:tennis-cup"`, and the registry is loaded when it is needed. See [docs/turning.md](./docs/turning.md).
412
+ `direction` is `"counterclockwise"` (how it has always turned) or `"clockwise"`, and `turnDirection(value)` is the check it goes through (anything but `"clockwise"` is counterclockwise). A drag turns it, the arrow keys turn it, Space starts and stops an auto-turn, and nothing moves until you ask. Pass the emblem itself and the page carries the turning and that one emblem and nothing else (a cup and the turning are about 9 kB gzipped); pass an id, `"trophy:tennis-cup"`, and the registry is loaded when it is needed. See [docs/turning.md](./docs/turning.md).
400
413
 
401
414
  ### In React, Vue and the rest
402
415
 
@@ -429,10 +442,10 @@ An emblem is a small object: `id`, `en` and `ja` names, a `source` (who drew it)
429
442
  | `ball` | 117 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/` |
430
443
  | `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` |
431
444
  | `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/` |
432
- | `sport` | One pictogram for each of the thirty-eight sports | `src/emblems/sport/` |
445
+ | `sport` | One pictogram for each of the forty-two sports | `src/emblems/sport/` |
433
446
  | `pennant` | A felt championship pennant on a dowel, with a stitched edge, lettered with its words and its year | `src/emblems/pennant/` |
434
447
 
435
- The thirty-eight 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): 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).
448
+ 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).
436
449
 
437
450
  ## API
438
451
 
@@ -463,7 +476,7 @@ The thirty-eight sports the ball, gear and sport emblems are made for are `SPORT
463
476
  | `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`) |
464
477
  | `AWARD_IDS`, `TROPHY_IDS`, `MEDAL_IDS`, `CREST_IDS`, `BALL_IDS`, `PUCK_IDS`, `GEAR_IDS`, `SPORT_IDS`, `PENNANT_IDS` | The ids of each group |
465
478
  | `MEDAL_KINDS`, `CREST_SHAPES` | The kinds of medal, and the shapes of crest |
466
- | `SPORT_NAMES` | The thirty-eight sports |
479
+ | `SPORT_NAMES` | The forty-two sports |
467
480
  | `JAPANESE_IDS` | The ids of the Japanese sports and budo, together: sumo, kendo, judo, kyudo and karate, with their trophies and gear ([docs/japanese-sports.md](./docs/japanese-sports.md)) |
468
481
  | `OBI_RANKS`, `obi(rank, options?)` | The colours of a belt from `white` to `red` (the kyu, black, the red-and-white belt, red), and the belt of a rank, or of a pair of ranks (a two-colour belt), drawn; `women: true` is the white stripe of the women's black belt |
469
482
  | `obiStep(step, options?)`, `GEAR_OBI_STEP_1` to `GEAR_OBI_STEP_6`, `ObiStep` | One of the six steps of tying the judo belt, 1 to 6: the jacket in close-up with the belt at that stage and a red step number ([docs/obi-steps.md](./docs/obi-steps.md), [日本語](./docs/obi-steps.ja.md)); `tint` is the jacket and `accent` the belt |
@@ -645,7 +658,7 @@ Bug reports and ideas go in the [issues](https://github.com/johnmorrisdotca/doug
645
658
 
646
659
  ## Changes
647
660
 
648
- See [CHANGELOG.md](./CHANGELOG.md). 0.12.0 adds forty-seven named trophies, each a close likeness measured on a photograph (321 emblems); 0.11.0 gives the era soccer balls neutral ids (the old ones stay as aliases), new looks and a second 1980s ball (274 emblems); 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.
661
+ See [CHANGELOG.md](./CHANGELOG.md). 0.14.0 lets the auto-turn go either way (`direction: "clockwise"` or `"counterclockwise"`, `setDirection()`); 0.13.0 adds a pictogram for each of four combat sports, MMA (a cage), boxing (a glove), wrestling (two wrestlers on the mat) and professional wrestling (a ring with ropes), in the three styles (325 emblems); 0.12.0 adds forty-seven named trophies, each a close likeness measured on a photograph (321 emblems); 0.11.0 gives the era soccer balls neutral ids (the old ones stay as aliases), new looks and a second 1980s ball (274 emblems); 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.
649
662
 
650
663
  ## Credits
651
664
 
@@ -124,6 +124,10 @@ export const EMBLEM_DESCRIPTIONS = {
124
124
  "sport:judo": { en: "A judo suit: a jacket with sleeves down to the wrist and crossed lapels, a belt in a flat knot with two ends hanging, and trousers", ja: "柔道衣。手首まで届く袖と、右前に合わせた襟の上衣、本結びで二本の端を垂らした帯、ズボン" },
125
125
  "sport:kyudo": { en: "A long bow, its string and an arrow", ja: "弦を張った長弓と矢" },
126
126
  "sport:karate": { en: "A karate suit: a short jacket with three-quarter sleeves and a wide V of lapels, a belt in a flat knot, and straight trousers", ja: "空手衣。七分袖で襟を広いV字に合わせた短めの上衣、本結びの帯、まっすぐなズボン" },
127
+ "sport:mma": { en: "A mixed martial arts cage seen from above: an eight-sided floor inside a fence of diamond mesh", ja: "上から見た総合格闘技のケージ。ひし形の金網に囲まれた八角形の床" },
128
+ "sport:boxing": { en: "A boxing glove: the padded fist with the thumb against its side, the fold of the fingers and the cuff with its band", ja: "ボクシンググローブ。親指を添えた丸いこぶしと、指の折り目、バンドの付いた袖口" },
129
+ "sport:wrestling": { en: "Two wrestlers in the tie-up, heads up and hands on each other's shoulders, knees bent, on the round of the mat", ja: "マットの円の上で組み合う二人のレスラー。互いの肩に手をかけ、膝を曲げて構える" },
130
+ "sport:prowrestling": { en: "A professional wrestling ring seen from a corner: the canvas, a post at each corner with three ropes between them, and the apron", ja: "角から見たプロレスのリング。キャンバス、四隅のコーナーポストとその間に張った三本のロープ、エプロン" },
127
131
  "gear:gunbai": { en: "The sumo referee's war fan, with its tassel", ja: "行司が持つ軍配と、その房" },
128
132
  "gear:mawashi": { en: "The wrestler's belt, with the stiff cords that hang from its front", ja: "力士の廻しと、前に垂らした下がり" },
129
133
  "gear:shinai": { en: "The kendo practice sword: four bamboo staves with a leather tip, a tie and a hilt", ja: "剣道の竹刀。四つ割りの竹に先革、中結、柄が付く" },
@@ -2,9 +2,9 @@ import type { BallId, GearId, MedalId, SportName, TrophyId } from "./emblem.ids.
2
2
  /** The equipment of one sport. */
3
3
  export interface SportEquipment {
4
4
  sport: SportName;
5
- /** The ball, or the implement that stands for one (the puck, the shuttlecock, the shot). Swimming, diving, artistic swimming, skating and the Japanese sports (sumo, kendo, judo, kyudo, karate) have none. */
5
+ /** The ball, or the implement that stands for one (the puck, the shuttlecock, the shot). Swimming, diving, artistic swimming, skating, the Japanese sports (sumo, kendo, judo, kyudo, karate) and the combat sports (MMA, boxing, wrestling, professional wrestling) have none. */
6
6
  ball?: BallId;
7
- /** The gear the sport has an emblem for, most telling first. Empty where the package has none yet. */
7
+ /** The gear the sport has an emblem for, most telling first. Empty where the package has none yet (the combat sports). */
8
8
  gear: GearId[];
9
9
  /** The trophy that stands for the sport's cup: its own where the package draws one, otherwise a plain cup, bowl or globe. */
10
10
  trophy: TrophyId;
@@ -38,6 +38,10 @@ const TABLE = {
38
38
  judo: [undefined, ["gear:judogi", "gear:obi"], "trophy:cup", GOLD],
39
39
  kyudo: [undefined, ["gear:yumi", "gear:ya"], "trophy:cup"],
40
40
  karate: [undefined, ["gear:karate-gi"], "trophy:cup", GOLD],
41
+ mma: [undefined, [], "trophy:belt"],
42
+ boxing: [undefined, [], "trophy:belt", GOLD],
43
+ wrestling: [undefined, [], "trophy:cup", GOLD],
44
+ prowrestling: [undefined, [], "trophy:belt"],
41
45
  };
42
46
  /**
43
47
  * What a sport is played and won with, as ids of the registry: `sportEquipment("nhl")` is the puck, a stick, a skate, a goalie's mask and a net, and the hockey cup. The arrays are new each call. An unknown sport is an error.
@@ -1,5 +1,5 @@
1
- /** The thirty-eight sports the emblems are made for (the five Japanese ones, sumo, kendo, judo, kyudo and karate, have a pictogram and their gear, and no ball): the names that `ball:<sport>`, `gear:<sport>` and `sport:<sport>` use. */
2
- export declare const SPORT_NAMES: readonly ["nfl", "cfl", "ifaf", "nhl", "nba", "mlb", "soccer", "curling", "tennis", "volleyball", "badminton", "pickleball", "tabletennis", "padel", "squash", "racquetball", "sepaktakraw", "teqball", "roundnet", "netball", "swimming", "waterpolo", "diving", "artisticswimming", "lacrosse", "rugby", "afl", "gaelic", "cricket", "fieldhockey", "handball", "athletics", "skating", "sumo", "kendo", "judo", "kyudo", "karate"];
1
+ /** The forty-two sports the emblems are made for (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): the names that `ball:<sport>`, `gear:<sport>` and `sport:<sport>` use. */
2
+ export declare const SPORT_NAMES: readonly ["nfl", "cfl", "ifaf", "nhl", "nba", "mlb", "soccer", "curling", "tennis", "volleyball", "badminton", "pickleball", "tabletennis", "padel", "squash", "racquetball", "sepaktakraw", "teqball", "roundnet", "netball", "swimming", "waterpolo", "diving", "artisticswimming", "lacrosse", "rugby", "afl", "gaelic", "cricket", "fieldhockey", "handball", "athletics", "skating", "sumo", "kendo", "judo", "kyudo", "karate", "mma", "boxing", "wrestling", "prowrestling"];
3
3
  export type SportName = (typeof SPORT_NAMES)[number];
4
4
  /** The awards: a medal on a ribbon, a badge, a crown, a star and a shield. */
5
5
  export declare const AWARD_IDS: readonly ["award:medal", "award:badge", "award:crown", "award:star", "award:shield", "award:ribbon"];
@@ -32,7 +32,7 @@ export type JapaneseId = (typeof JAPANESE_IDS)[number];
32
32
  /** The pennants: a felt championship pennant with a stitched edge. */
33
33
  export declare const PENNANT_IDS: readonly ["pennant:championship"];
34
34
  export type PennantId = (typeof PENNANT_IDS)[number];
35
- /** The sports' own emblems: one pictogram for each of the thirty-eight. */
35
+ /** The sports' own emblems: one pictogram for each of the forty-two. */
36
36
  export type SportEmblemId = `sport:${SportName}`;
37
37
  export declare const SPORT_IDS: readonly SportEmblemId[];
38
38
  /** Every emblem id. */
@@ -46,7 +46,7 @@ export declare const EMBLEM_GROUPS: {
46
46
  readonly ball: readonly ["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:futsal", "ball:beach-soccer", "ball:soccer-1870-hand-stitched", "ball:soccer-1900-laced", "ball:soccer-1930-18-panel", "ball:soccer-1950-12-panel", "ball:soccer-1960-32-panel-leather", "ball:soccer-retro-pentagons", "ball:soccer-retro-leaves", "ball:soccer-retro-rosette", "ball:soccer-retro-star", "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", "ball:teqball", "ball:basketball", "ball:basketball-6", "ball:basketball-3x3", "ball:baseball", "ball:softball", "ball:baseball-lemon-peel", "ball:baseball-red-blue", "ball:baseball-black-red", "ball:baseball-vintage-leather", "ball:softball-11-optic", "ball:tennis", "ball:padel", "ball:sliotar", "ball:volleyball", "ball:volleyball-8", "ball:beach-volleyball", "ball:volleyball-colours", "ball:volleyball-brazil", "ball:volleyball-japan", "ball:volleyball-canada", "ball:volleyball-usa", "ball:volleyball-italy", "ball:volleyball-poland", "ball:volleyball-france", "ball:volleyball-serbia", "ball:volleyball-netherlands", "ball:volleyball-germany", "ball:cricket-red", "ball:cricket-white", "ball:cricket-pink", "ball:football", "ball:football-cfl", "ball:football-ifaf", "ball:rugby", "ball:afl", "ball:gaelic-football", "ball:netball", "ball:pickleball-outdoor", "ball:pickleball-indoor", "ball:squash", "ball:squash-yellow", "ball:squash-green", "ball:squash-red", "ball:squash-blue", "ball:racquetball", "ball:lacrosse", "ball:field-hockey", "ball:table-tennis", "ball:handball", "ball:water-polo", "ball:golf", "ball:puck", "ball:curling-stone", "ball:shot", "ball:discus", "ball:hammer", "ball:sepak-takraw", "ball:roundnet", "ball:shuttlecock-feather", "ball:shuttlecock-nylon"];
47
47
  readonly puck: readonly ["puck:canada", "puck:canada-red", "puck:canada-white", "puck:usa", "puck:usa-navy", "puck:player", "puck:signed", "puck:souvenir"];
48
48
  readonly gear: readonly ["gear:hockey-stick", "gear:goalie-stick", "gear:hockey-skate", "gear:goalie-mask", "gear:goal-net", "gear:field-hockey-stick", "gear:lacrosse-stick", "gear:cricket-bat", "gear:wicket", "gear:table-tennis-paddle", "gear:badminton-racket", "gear:tennis-racket", "gear:squash-racket", "gear:racquetball-racket", "gear:padel-racket", "gear:pickleball-paddle", "gear:roundnet-set", "gear:takraw-net", "gear:netball-post", "gear:teqball-table", "gear:volleyball-net", "gear:basketball-hoop", "gear:baseball-bat", "gear:baseball-glove", "gear:football-helmet", "gear:goalposts", "gear:hurley", "gear:curling-broom", "gear:figure-skate", "gear:speed-skate", "gear:diving-board", "gear:swim-goggles", "gear:starting-blocks", "gear:relay-baton", "gear:javelin", "gear:hurdles", "gear:gunbai", "gear:mawashi", "gear:shinai", "gear:kendo-men", "gear:judogi", "gear:judogi-blue", "gear:judogi-folded", "gear:judogi-blue-folded", "gear:judogi-back", "gear:judogi-blue-back", "gear:obi", "gear:obi-white", "gear:obi-yellow", "gear:obi-orange", "gear:obi-green", "gear:obi-blue", "gear:obi-brown", "gear:obi-kohaku", "gear:obi-red", "gear:obi-women", "gear:obi-white-yellow", "gear:obi-yellow-orange", "gear:obi-orange-green", "gear:obi-green-blue", "gear:obi-blue-brown", "gear:obi-step-1", "gear:obi-step-2", "gear:obi-step-3", "gear:obi-step-4", "gear:obi-step-5", "gear:obi-step-6", "gear:yumi", "gear:ya", "gear:karate-gi"];
49
- readonly sport: readonly ("sport:sumo" | "sport:kendo" | "sport:judo" | "sport:kyudo" | "sport:karate" | "sport:nfl" | "sport:cfl" | "sport:ifaf" | "sport:nhl" | "sport:nba" | "sport:mlb" | "sport:soccer" | "sport:curling" | "sport:tennis" | "sport:volleyball" | "sport:badminton" | "sport:pickleball" | "sport:tabletennis" | "sport:padel" | "sport:squash" | "sport:racquetball" | "sport:sepaktakraw" | "sport:teqball" | "sport:roundnet" | "sport:netball" | "sport:swimming" | "sport:waterpolo" | "sport:diving" | "sport:artisticswimming" | "sport:lacrosse" | "sport:rugby" | "sport:afl" | "sport:gaelic" | "sport:cricket" | "sport:fieldhockey" | "sport:handball" | "sport:athletics" | "sport:skating")[];
49
+ readonly sport: readonly ("sport:sumo" | "sport:kendo" | "sport:judo" | "sport:kyudo" | "sport:karate" | "sport:nfl" | "sport:cfl" | "sport:ifaf" | "sport:nhl" | "sport:nba" | "sport:mlb" | "sport:soccer" | "sport:curling" | "sport:tennis" | "sport:volleyball" | "sport:badminton" | "sport:pickleball" | "sport:tabletennis" | "sport:padel" | "sport:squash" | "sport:racquetball" | "sport:sepaktakraw" | "sport:teqball" | "sport:roundnet" | "sport:netball" | "sport:swimming" | "sport:waterpolo" | "sport:diving" | "sport:artisticswimming" | "sport:lacrosse" | "sport:rugby" | "sport:afl" | "sport:gaelic" | "sport:cricket" | "sport:fieldhockey" | "sport:handball" | "sport:athletics" | "sport:skating" | "sport:mma" | "sport:boxing" | "sport:wrestling" | "sport:prowrestling")[];
50
50
  readonly pennant: readonly ["pennant:championship"];
51
51
  };
52
52
  export type EmblemGroup = keyof typeof EMBLEM_GROUPS;
@@ -1,10 +1,11 @@
1
1
  // The ids of the emblems, in their groups, and the types they make. Nothing is imported: this file is only names, so it costs nothing to read. An id is `<group>:<name>`.
2
2
  // Each list below holds the emblems that exist. The art for the rest arrives group by group (docs/layout.md), and each arrival adds its names here and its entry to emblem.registry.ts.
3
- /** The thirty-eight sports the emblems are made for (the five Japanese ones, sumo, kendo, judo, kyudo and karate, have a pictogram and their gear, and no ball): the names that `ball:<sport>`, `gear:<sport>` and `sport:<sport>` use. */
3
+ /** The forty-two sports the emblems are made for (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): the names that `ball:<sport>`, `gear:<sport>` and `sport:<sport>` use. */
4
4
  export const SPORT_NAMES = [
5
5
  "nfl", "cfl", "ifaf", "nhl", "nba", "mlb", "soccer", "curling", "tennis", "volleyball", "badminton", "pickleball", "tabletennis", "padel", "squash", "racquetball", "sepaktakraw", "teqball", "roundnet", "netball",
6
6
  "swimming", "waterpolo", "diving", "artisticswimming", "lacrosse", "rugby", "afl", "gaelic", "cricket", "fieldhockey", "handball", "athletics", "skating",
7
7
  "sumo", "kendo", "judo", "kyudo", "karate",
8
+ "mma", "boxing", "wrestling", "prowrestling",
8
9
  ];
9
10
  /** The awards: a medal on a ribbon, a badge, a crown, a star and a shield. */
10
11
  export const AWARD_IDS = ["award:medal", "award:badge", "award:crown", "award:star", "award:shield", "award:ribbon"];
@@ -126,6 +126,10 @@ import { SPORT_KENDO } from "./sport/kendo.js";
126
126
  import { SPORT_JUDO } from "./sport/judo.js";
127
127
  import { SPORT_KYUDO } from "./sport/kyudo.js";
128
128
  import { SPORT_KARATE } from "./sport/karate.js";
129
+ import { SPORT_MMA } from "./sport/mma.js";
130
+ import { SPORT_BOXING } from "./sport/boxing.js";
131
+ import { SPORT_WRESTLING } from "./sport/wrestling.js";
132
+ import { SPORT_PROWRESTLING } from "./sport/prowrestling.js";
129
133
  /** The balls and the gear are drawn by families, each family in a module of its own, and listed in order by their own indexes. */
130
134
  const PIECES = Object.fromEntries([...BALLS, ...PUCKS, ...GEARS].map((piece) => [piece.id, piece]));
131
135
  /** The emblems drawn one to a module: every id but the balls and the gear. A missing or extra entry is a type error. */
@@ -256,6 +260,10 @@ const OWN = {
256
260
  "sport:judo": SPORT_JUDO,
257
261
  "sport:kyudo": SPORT_KYUDO,
258
262
  "sport:karate": SPORT_KARATE,
263
+ "sport:mma": SPORT_MMA,
264
+ "sport:boxing": SPORT_BOXING,
265
+ "sport:wrestling": SPORT_WRESTLING,
266
+ "sport:prowrestling": SPORT_PROWRESTLING,
259
267
  };
260
268
  /** Every emblem, by id. */
261
269
  export const EMBLEM_TABLE = { ...OWN, ...PIECES };
@@ -0,0 +1,2 @@
1
+ /** Boxing. */
2
+ export declare const SPORT_BOXING: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
@@ -0,0 +1,16 @@
1
+ // Boxing: a pictogram of a boxing glove, drawn for this package in a 64 by 64 box: the padded fist with the thumb lying against its side, the curve where the fingers fold over, and the cuff with its band. It
2
+ // carries no maker's mark. The metal style paints its main shapes with a grey sheet, the line style draws one outline.
3
+ import { defineIcon } from "../emblem.shapes.js";
4
+ /** Boxing. */
5
+ export const SPORT_BOXING = /* @__PURE__ */ defineIcon("sport:boxing", "Boxing", "ボクシング", "ours", {
6
+ metal: "flat",
7
+ ink: true,
8
+ front: [
9
+ ["m", "M22 25C22 12.5 29.5 5 40 5C51 5 57 12.5 57 24L57 36C57 41.5 54 45.5 49 46.6L49 50L24 50L24 46C22.4 43.4 22 40 22 36Z"],
10
+ ["m", "M13.5 28C9.8 28.4 8.4 33.6 11 38.4C13 42 17.6 45 24 45L24 33Z"],
11
+ ["n", "M24 33C24 37 24 41 24 45"],
12
+ ["t", "M30 33C37 26.4 47 26.4 56 31"],
13
+ ["k", "M23 50H50V59H23Z"],
14
+ ["t", "M23 54.5H50"],
15
+ ],
16
+ });
@@ -0,0 +1,2 @@
1
+ /** Mixed martial arts. */
2
+ export declare const SPORT_MMA: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
@@ -0,0 +1,13 @@
1
+ // MMA: a pictogram of a cage seen from above, drawn for this package in a 64 by 64 box: an eight-sided floor inside a fence of diamond mesh. It is a generic cage: no promotion's mark and
2
+ // no name on it. The metal style paints its main shapes with a grey sheet, the line style draws one outline.
3
+ import { defineIcon, polygon } from "../emblem.shapes.js";
4
+ /** Mixed martial arts. */
5
+ export const SPORT_MMA = /* @__PURE__ */ defineIcon("sport:mma", "MMA", "総合格闘技", "ours", {
6
+ metal: "flat",
7
+ ink: true,
8
+ front: [
9
+ ["m", polygon(32, 32, 29, 8, 22.5)],
10
+ ["t", "M5.2 22.8L22.8 5.2M5.2 41.2L22.8 58.8M5.2 31.8L31.8 5.2M5.2 32.2L31.8 58.8M5.2 40.8L40.8 5.2M5.2 23.2L40.8 58.8M8.6 46.4L46.4 8.6M8.6 17.6L46.4 55.4M13.1 50.9L50.9 13.1M13.1 13.1L50.9 50.9M17.6 55.4L55.4 17.6M17.6 8.6L55.4 46.4M23.2 58.8L58.8 23.2M23.2 5.2L58.8 40.8M32.2 58.8L58.8 32.2M32.2 5.2L58.8 31.8M41.2 58.8L58.8 41.2M41.2 5.2L58.8 22.8"],
11
+ ["n", polygon(32, 32, 29, 8, 22.5)],
12
+ ],
13
+ });
@@ -0,0 +1,2 @@
1
+ /** Professional wrestling. */
2
+ export declare const SPORT_PROWRESTLING: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
@@ -0,0 +1,16 @@
1
+ // Professional wrestling: a pictogram of the ring, drawn for this package in a 64 by 64 box: the square canvas seen from a corner, a post at each corner with three ropes strung between them and the apron
2
+ // along the front edge. The metal style paints the canvas with a grey sheet, the line style draws one outline.
3
+ import { defineIcon } from "../emblem.shapes.js";
4
+ /** Professional wrestling. */
5
+ export const SPORT_PROWRESTLING = /* @__PURE__ */ defineIcon("sport:prowrestling", "Pro wrestling", "プロレス", "ours", {
6
+ metal: "flat",
7
+ ink: true,
8
+ front: [
9
+ ["m", "M6 50L58 50L47 38L17 38Z"],
10
+ ["t", "M17 38L17 17M47 38L47 17M17 22.5L47 22.5M17 28L47 28M17 33.5L47 33.5"],
11
+ ["k", "M6 50H58V58H6Z"],
12
+ ["b", "M6 50L6 20M58 50L58 20"],
13
+ ["t", "M6 26L17 22.5M6 33L17 28M6 40L17 33.5M58 26L47 22.5M58 33L47 28M58 40L47 33.5M6 26L58 26M6 33L58 33M6 40L58 40"],
14
+ ["k", "M3.2 36H8.8V41H3.2ZM55.2 36H60.8V41H55.2Z"],
15
+ ],
16
+ });
@@ -0,0 +1,2 @@
1
+ /** Wrestling. */
2
+ export declare const SPORT_WRESTLING: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
@@ -0,0 +1,16 @@
1
+ // Wrestling: a pictogram of two wrestlers in the tie-up, drawn for this package in a 64 by 64 box: heads up, a hand on each other's shoulder, backs leaning in, knees bent and feet planted, on the round of the mat.
2
+ // The metal style paints the heads and the mat with a grey sheet, the line style draws one outline.
3
+ import { circlePath as circ, defineIcon, ellipsePath } from "../emblem.shapes.js";
4
+ /** Wrestling. */
5
+ export const SPORT_WRESTLING = /* @__PURE__ */ defineIcon("sport:wrestling", "Wrestling", "レスリング", "ours", {
6
+ metal: "flat",
7
+ ink: true,
8
+ front: [
9
+ ["m", ellipsePath(32, 57, 30, 5.5)],
10
+ ["m", circ(19, 11.5, 6)],
11
+ ["m", circ(45, 11.5, 6)],
12
+ ["b", "M21 21L15 37L8 46L7 56M15 37L23 47L21 56"],
13
+ ["b", "M43 21L49 37L56 46L57 56M49 37L41 47L43 56"],
14
+ ["b", "M21 25L34 24M43 29L30 28"],
15
+ ],
16
+ });
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  export * from "./emblems-entry.ts";
2
2
  export { ballFrame, emblemFrame } from "./emblems/emblem.api.ts";
3
3
  export { bindTurn } from "./turn-full.ts";
4
- export type { TurnAngles, TurnContainer, TurnControlOptions, TurnController, TurnEvent } from "./turn-control.ts";
4
+ export { turnDirection } from "./turn-control.ts";
5
+ export type { TurnAngles, TurnContainer, TurnControlOptions, TurnController, TurnDirection, TurnEvent } from "./turn-control.ts";
5
6
  export { EMBLEM_TABLE } from "./emblems/emblem.registry.ts";
6
7
  export { AWARD_MEDAL } from "./emblems/award/medal.ts";
7
8
  export { AWARD_BADGE } from "./emblems/award/badge.ts";
@@ -129,6 +130,10 @@ export { SPORT_KENDO } from "./emblems/sport/kendo.ts";
129
130
  export { SPORT_JUDO } from "./emblems/sport/judo.ts";
130
131
  export { SPORT_KYUDO } from "./emblems/sport/kyudo.ts";
131
132
  export { SPORT_KARATE } from "./emblems/sport/karate.ts";
133
+ export { SPORT_MMA } from "./emblems/sport/mma.ts";
134
+ export { SPORT_BOXING } from "./emblems/sport/boxing.ts";
135
+ export { SPORT_WRESTLING } from "./emblems/sport/wrestling.ts";
136
+ export { SPORT_PROWRESTLING } from "./emblems/sport/prowrestling.ts";
132
137
  export { BALL_AFL } from "./emblems/ball/ball.afl.ts";
133
138
  export { BALL_BASEBALL, BALL_SOFTBALL, BALL_SOCCER, BALL_SOCCER_COLOUR, BALL_SOCCER_ORANGE, BALL_SOCCER_YELLOW } from "./emblems/ball/ball.printable.ts";
134
139
  export { printed } from "./emblems/ball/ball.print.ts";
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  export * from "./emblems-entry.js";
4
4
  export { ballFrame, emblemFrame } from "./emblems/emblem.api.js";
5
5
  export { bindTurn } from "./turn-full.js";
6
+ export { turnDirection } from "./turn-control.js";
6
7
  export { EMBLEM_TABLE } from "./emblems/emblem.registry.js";
7
8
  export { AWARD_MEDAL } from "./emblems/award/medal.js";
8
9
  export { AWARD_BADGE } from "./emblems/award/badge.js";
@@ -130,6 +131,10 @@ export { SPORT_KENDO } from "./emblems/sport/kendo.js";
130
131
  export { SPORT_JUDO } from "./emblems/sport/judo.js";
131
132
  export { SPORT_KYUDO } from "./emblems/sport/kyudo.js";
132
133
  export { SPORT_KARATE } from "./emblems/sport/karate.js";
134
+ export { SPORT_MMA } from "./emblems/sport/mma.js";
135
+ export { SPORT_BOXING } from "./emblems/sport/boxing.js";
136
+ export { SPORT_WRESTLING } from "./emblems/sport/wrestling.js";
137
+ export { SPORT_PROWRESTLING } from "./emblems/sport/prowrestling.js";
133
138
  export { BALL_AFL } from "./emblems/ball/ball.afl.js";
134
139
  export { BALL_BASEBALL, BALL_SOFTBALL, BALL_SOCCER, BALL_SOCCER_COLOUR, BALL_SOCCER_ORANGE, BALL_SOCCER_YELLOW } from "./emblems/ball/ball.printable.js";
135
140
  export { printed } from "./emblems/ball/ball.print.js";
@@ -8,6 +8,13 @@ export interface TurnRegistry {
8
8
  renderEmblem(ref: EmblemRef, options?: FrameOptions): string;
9
9
  emblemFrame(ref: EmblemRef, options?: FrameOptions): string;
10
10
  }
11
+ /**
12
+ * Which way the auto-turn goes, seen from above. `"counterclockwise"` is how it has always turned: the front swings to the viewer's right. `"clockwise"` is the other way: the front swings to the viewer's left.
13
+ * A drag, the arrow keys and `setAngles` are not reversed.
14
+ */
15
+ export type TurnDirection = "clockwise" | "counterclockwise";
16
+ /** A direction from anything: `"clockwise"` is clockwise, and everything else is the default, `"counterclockwise"`. */
17
+ export declare function turnDirection(value: unknown): TurnDirection;
11
18
  /** The three angles of a turn, in degrees. */
12
19
  export interface TurnAngles {
13
20
  /** About the vertical axis, from -180 (excluded) to 180. */
@@ -34,6 +41,8 @@ export interface TurnControlOptions extends FrameOptions {
34
41
  autoPlay?: boolean | "force";
35
42
  /** Degrees of yaw each second the auto-turn advances (36 by default; negative turns the other way). */
36
43
  speed?: number;
44
+ /** Which way the auto-turn goes (`"counterclockwise"`, the way it has always turned, by default). `update` keeps the direction unless it names one; a negative `speed` reverses it. */
45
+ direction?: TurnDirection;
37
46
  /** When true (the default), a drag holds the auto-turn while the pointer is down, and an arrow key, Home or `setAngles` pauses it. When false nothing but `pause()` stops it. */
38
47
  pauseOnInteract?: boolean;
39
48
  /** Called with `true` when the auto-turn starts and `false` when it stops, whatever stopped it. */
@@ -60,6 +69,10 @@ export interface TurnController {
60
69
  play(): boolean;
61
70
  /** Stops the auto-turn. */
62
71
  pause(): void;
72
+ /** Which way the auto-turn goes. */
73
+ direction(): TurnDirection;
74
+ /** Changes which way the auto-turn goes, at once and without stopping it. */
75
+ setDirection(direction: TurnDirection): void;
63
76
  /** Starts or stops the auto-turn and gives the new state; `false` for an emblem that cannot turn. */
64
77
  togglePlay(): boolean;
65
78
  /** Removes the listeners and the attributes and styles `bindTurn` added; the last drawing stays. */
@@ -1,3 +1,7 @@
1
+ /** A direction from anything: `"clockwise"` is clockwise, and everything else is the default, `"counterclockwise"`. */
2
+ export function turnDirection(value) {
3
+ return value === "clockwise" ? "clockwise" : "counterclockwise";
4
+ }
1
5
  const WORDS = {
2
6
  en: { role: "turnable emblem", hint: "Drag, or use the arrow keys, to turn it. Space starts and stops the turning." },
3
7
  ja: { role: "回せるエンブレム", hint: "ドラッグするか矢印キーで回せます。スペースキーで自動回転を始めたり止めたりできます。" },
@@ -63,6 +67,7 @@ export function bindTurnWith(registry, container, ref, options = {}) {
63
67
  let range = [-60, 60];
64
68
  let keyStep = 5;
65
69
  let speed = 36;
70
+ let way = turnDirection(options.direction);
66
71
  let pauseOnInteract = true;
67
72
  let locale = "en";
68
73
  let onTurn;
@@ -86,12 +91,14 @@ export function bindTurnWith(registry, container, ref, options = {}) {
86
91
  range = low <= high ? [low, high] : [high, low];
87
92
  keyStep = clamp(finite(o.keyStep, 5), 0.5, 90);
88
93
  speed = clamp(finite(o.speed, 36), -720, 720);
94
+ if (o.direction !== undefined)
95
+ way = turnDirection(o.direction);
89
96
  pauseOnInteract = o.pauseOnInteract !== false;
90
97
  locale = o.locale === "ja" ? "ja" : "en";
91
98
  onTurn = typeof o.onTurn === "function" ? o.onTurn : undefined;
92
99
  onPlayChange = typeof o.onPlayChange === "function" ? o.onPlayChange : undefined;
93
100
  const rest = { ...o };
94
- for (const name of ["sensitivity", "pitchRange", "keyStep", "onTurn", "autoPlay", "speed", "pauseOnInteract", "onPlayChange", "yaw", "pitch", "roll"])
101
+ for (const name of ["sensitivity", "pitchRange", "keyStep", "onTurn", "autoPlay", "speed", "direction", "pauseOnInteract", "onPlayChange", "yaw", "pitch", "roll"])
95
102
  delete rest[name];
96
103
  frame = rest;
97
104
  };
@@ -156,7 +163,7 @@ export function bindTurnWith(registry, container, ref, options = {}) {
156
163
  const dt = last === undefined ? 0 : clamp((time - last) / 1000, 0, 0.1);
157
164
  last = time;
158
165
  if (!held && dt > 0) {
159
- place({ yaw: angles.yaw + speed * dt });
166
+ place({ yaw: angles.yaw + (way === "clockwise" ? -1 : 1) * speed * dt });
160
167
  draw();
161
168
  onTurn?.(copy());
162
169
  }
@@ -378,6 +385,12 @@ export function bindTurnWith(registry, container, ref, options = {}) {
378
385
  if (pending === undefined)
379
386
  draw();
380
387
  },
388
+ direction() {
389
+ return way;
390
+ },
391
+ setDirection(next) {
392
+ way = turnDirection(next);
393
+ },
381
394
  play() {
382
395
  if (!turnable || destroyed)
383
396
  return false;
@@ -1,4 +1,4 @@
1
1
  export { ballFrame, emblemFrame } from "./emblems/emblem.api.ts";
2
2
  export type { FrameOptions } from "./emblems/emblem.core.ts";
3
- export { bindTurn } from "./turn-control.ts";
4
- export type { TurnAngles, TurnContainer, TurnControlOptions, TurnController, TurnEvent } from "./turn-control.ts";
3
+ export { bindTurn, turnDirection } from "./turn-control.ts";
4
+ export type { TurnAngles, TurnContainer, TurnControlOptions, TurnController, TurnDirection, TurnEvent } from "./turn-control.ts";
@@ -1,4 +1,4 @@
1
1
  // The turning entry point: an emblem at an angle. `emblemFrame` turns any emblem about its vertical axis and tilts it; `ballFrame` rolls a ball. Each frame is plain SVG, so a turn is a loop over
2
2
  // the angle, drawn by the caller (a slider, a requestAnimationFrame, a CSS-free animation).
3
3
  export { ballFrame, emblemFrame } from "./emblems/emblem.api.js";
4
- export { bindTurn } from "./turn-control.js";
4
+ export { bindTurn, turnDirection } from "./turn-control.js";
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.12.1";
1
+ export declare const VERSION = "0.14.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.12.1";
1
+ export const VERSION = "0.14.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmorrisdotca/dougu-sports",
3
- "version": "0.12.1",
3
+ "version": "0.14.0",
4
4
  "description": "Dougu Sports 道具, sports emblems as SVG strings: trophies, medals, crests, sport icons, and the ball and gear of every sport, in metal, line or flat colour, with optional 3D turning. Light and dark, accessible, tree-shakeable. Zero dependencies.",
5
5
  "keywords": [
6
6
  "sports",