@johnmorrisdotca/dougu-sports 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/CHANGELOG.md +38 -1
  2. package/NOTICE.md +9 -58
  3. package/README.md +168 -32
  4. package/dist/emblems/award/badge.d.ts +2 -2
  5. package/dist/emblems/award/badge.js +14 -5
  6. package/dist/emblems/award/crown.d.ts +1 -1
  7. package/dist/emblems/award/crown.js +14 -4
  8. package/dist/emblems/award/medal.d.ts +2 -2
  9. package/dist/emblems/award/medal.js +14 -5
  10. package/dist/emblems/award/shield.d.ts +1 -1
  11. package/dist/emblems/award/shield.js +10 -4
  12. package/dist/emblems/award/star.d.ts +1 -1
  13. package/dist/emblems/award/star.js +10 -4
  14. package/dist/emblems/ball/ball.afl.js +1 -1
  15. package/dist/emblems/ball/ball.basketball6.js +1 -1
  16. package/dist/emblems/ball/ball.core.d.ts +9 -3
  17. package/dist/emblems/ball/ball.core.js +13 -0
  18. package/dist/emblems/ball/ball.cricket.js +1 -1
  19. package/dist/emblems/ball/ball.engine.js +3 -3
  20. package/dist/emblems/ball/ball.football.js +3 -3
  21. package/dist/emblems/ball/ball.gaelic.js +1 -1
  22. package/dist/emblems/ball/ball.object.js +2 -2
  23. package/dist/emblems/ball/ball.shuttlecock.js +2 -2
  24. package/dist/emblems/ball/ball.squash.js +5 -5
  25. package/dist/emblems/emblem.api.d.ts +39 -1
  26. package/dist/emblems/emblem.api.js +20 -2
  27. package/dist/emblems/emblem.compose.d.ts +31 -0
  28. package/dist/emblems/emblem.compose.js +91 -0
  29. package/dist/emblems/emblem.core.d.ts +48 -2
  30. package/dist/emblems/emblem.core.js +30 -0
  31. package/dist/emblems/emblem.descriptions.d.ts +7 -0
  32. package/dist/emblems/emblem.descriptions.js +60 -0
  33. package/dist/emblems/emblem.display.d.ts +75 -0
  34. package/dist/emblems/emblem.display.js +214 -0
  35. package/dist/emblems/emblem.engrave.d.ts +50 -0
  36. package/dist/emblems/emblem.engrave.js +145 -0
  37. package/dist/emblems/emblem.equipment.d.ts +24 -0
  38. package/dist/emblems/emblem.equipment.js +57 -0
  39. package/dist/emblems/emblem.flip.d.ts +10 -0
  40. package/dist/emblems/emblem.flip.js +45 -0
  41. package/dist/emblems/emblem.ids.d.ts +19 -11
  42. package/dist/emblems/emblem.ids.js +21 -6
  43. package/dist/emblems/emblem.lathe.d.ts +3 -0
  44. package/dist/emblems/emblem.lathe.js +26 -4
  45. package/dist/emblems/emblem.medal.js +4 -4
  46. package/dist/emblems/emblem.pennant.d.ts +3 -0
  47. package/dist/emblems/emblem.pennant.js +79 -0
  48. package/dist/emblems/emblem.registry.js +20 -0
  49. package/dist/emblems/emblem.shapes.d.ts +19 -2
  50. package/dist/emblems/emblem.shapes.js +53 -12
  51. package/dist/emblems/emblem.sprite.d.ts +38 -0
  52. package/dist/emblems/emblem.sprite.js +65 -0
  53. package/dist/emblems/emblem.uri.d.ts +22 -0
  54. package/dist/emblems/emblem.uri.js +29 -0
  55. package/dist/emblems/gear/gear.badmintonracket.d.ts +1 -1
  56. package/dist/emblems/gear/gear.badmintonracket.js +18 -14
  57. package/dist/emblems/gear/gear.baseballglove.d.ts +1 -1
  58. package/dist/emblems/gear/gear.baseballglove.js +20 -14
  59. package/dist/emblems/gear/gear.budo.d.ts +17 -0
  60. package/dist/emblems/gear/gear.budo.js +60 -0
  61. package/dist/emblems/gear/gear.core.d.ts +12 -31
  62. package/dist/emblems/gear/gear.core.js +61 -54
  63. package/dist/emblems/gear/gear.cricketbat.d.ts +1 -1
  64. package/dist/emblems/gear/gear.cricketbat.js +16 -14
  65. package/dist/emblems/gear/gear.fieldhockeystick.d.ts +1 -1
  66. package/dist/emblems/gear/gear.fieldhockeystick.js +15 -14
  67. package/dist/emblems/gear/gear.footballhelmet.d.ts +1 -1
  68. package/dist/emblems/gear/gear.footballhelmet.js +15 -14
  69. package/dist/emblems/gear/gear.goaliemask.d.ts +1 -1
  70. package/dist/emblems/gear/gear.goaliemask.js +22 -16
  71. package/dist/emblems/gear/gear.goalnet.d.ts +1 -1
  72. package/dist/emblems/gear/gear.goalnet.js +24 -14
  73. package/dist/emblems/gear/gear.hockeystick.d.ts +1 -1
  74. package/dist/emblems/gear/gear.hockeystick.js +14 -14
  75. package/dist/emblems/gear/gear.index.js +5 -1
  76. package/dist/emblems/gear/gear.kendo.d.ts +2 -0
  77. package/dist/emblems/gear/gear.kendo.js +41 -0
  78. package/dist/emblems/gear/gear.kyudo.d.ts +2 -0
  79. package/dist/emblems/gear/gear.kyudo.js +31 -0
  80. package/dist/emblems/gear/gear.lacrossestick.d.ts +1 -1
  81. package/dist/emblems/gear/gear.lacrossestick.js +25 -14
  82. package/dist/emblems/gear/gear.skates.js +1 -1
  83. package/dist/emblems/gear/gear.sticks.js +2 -2
  84. package/dist/emblems/gear/gear.sumo.d.ts +2 -0
  85. package/dist/emblems/gear/gear.sumo.js +43 -0
  86. package/dist/emblems/gear/gear.tabletennispaddle.d.ts +1 -1
  87. package/dist/emblems/gear/gear.tabletennispaddle.js +15 -14
  88. package/dist/emblems/gear/gear.tennisracket.d.ts +1 -1
  89. package/dist/emblems/gear/gear.tennisracket.js +16 -14
  90. package/dist/emblems/pennant/championship.d.ts +2 -0
  91. package/dist/emblems/pennant/championship.js +4 -0
  92. package/dist/emblems/sport/afl.js +1 -1
  93. package/dist/emblems/sport/artisticswimming.js +1 -1
  94. package/dist/emblems/sport/cfl.d.ts +1 -1
  95. package/dist/emblems/sport/cfl.js +4 -4
  96. package/dist/emblems/sport/cricket.d.ts +1 -1
  97. package/dist/emblems/sport/cricket.js +13 -4
  98. package/dist/emblems/sport/fieldhockey.js +1 -1
  99. package/dist/emblems/sport/gaelic.js +1 -1
  100. package/dist/emblems/sport/handball.d.ts +1 -1
  101. package/dist/emblems/sport/handball.js +14 -4
  102. package/dist/emblems/sport/ifaf.d.ts +1 -1
  103. package/dist/emblems/sport/ifaf.js +4 -4
  104. package/dist/emblems/sport/judo.d.ts +2 -0
  105. package/dist/emblems/sport/judo.js +13 -0
  106. package/dist/emblems/sport/karate.d.ts +2 -0
  107. package/dist/emblems/sport/karate.js +13 -0
  108. package/dist/emblems/sport/kendo.d.ts +2 -0
  109. package/dist/emblems/sport/kendo.js +14 -0
  110. package/dist/emblems/sport/kyudo.d.ts +2 -0
  111. package/dist/emblems/sport/kyudo.js +15 -0
  112. package/dist/emblems/sport/mlb.d.ts +1 -1
  113. package/dist/emblems/sport/mlb.js +27 -4
  114. package/dist/emblems/sport/nba.d.ts +1 -1
  115. package/dist/emblems/sport/nba.js +11 -4
  116. package/dist/emblems/sport/netball.js +1 -1
  117. package/dist/emblems/sport/nfl.d.ts +2 -1
  118. package/dist/emblems/sport/nfl.js +14 -4
  119. package/dist/emblems/sport/nhl.d.ts +1 -1
  120. package/dist/emblems/sport/nhl.js +12 -4
  121. package/dist/emblems/sport/pickleball.js +1 -1
  122. package/dist/emblems/sport/racquetball.js +1 -1
  123. package/dist/emblems/sport/roundnet.js +1 -1
  124. package/dist/emblems/sport/rugby.d.ts +1 -1
  125. package/dist/emblems/sport/rugby.js +11 -4
  126. package/dist/emblems/sport/sepaktakraw.js +1 -1
  127. package/dist/emblems/sport/soccer.d.ts +1 -1
  128. package/dist/emblems/sport/soccer.js +30 -4
  129. package/dist/emblems/sport/squash.js +1 -1
  130. package/dist/emblems/sport/sumo.d.ts +2 -0
  131. package/dist/emblems/sport/sumo.js +15 -0
  132. package/dist/emblems/sport/tabletennis.js +1 -1
  133. package/dist/emblems/sport/tennis.d.ts +1 -1
  134. package/dist/emblems/sport/tennis.js +14 -4
  135. package/dist/emblems/sport/teqball.js +1 -1
  136. package/dist/emblems/sport/volleyball.d.ts +1 -1
  137. package/dist/emblems/sport/volleyball.js +24 -4
  138. package/dist/emblems/trophy/banner.d.ts +2 -0
  139. package/dist/emblems/trophy/banner.js +20 -0
  140. package/dist/emblems/trophy/baseball.js +1 -0
  141. package/dist/emblems/trophy/basketball.js +1 -0
  142. package/dist/emblems/trophy/belt.js +2 -1
  143. package/dist/emblems/trophy/bowl.js +1 -0
  144. package/dist/emblems/trophy/canadian-bowl.js +1 -0
  145. package/dist/emblems/trophy/championship-banner.d.ts +2 -0
  146. package/dist/emblems/trophy/championship-banner.js +67 -0
  147. package/dist/emblems/trophy/cricket-urn.js +1 -0
  148. package/dist/emblems/trophy/cup.d.ts +1 -1
  149. package/dist/emblems/trophy/cup.js +15 -4
  150. package/dist/emblems/trophy/football.js +2 -1
  151. package/dist/emblems/trophy/globe.js +1 -0
  152. package/dist/emblems/trophy/hockey-cup.js +2 -1
  153. package/dist/emblems/trophy/lidded-cup.js +1 -0
  154. package/dist/emblems/trophy/plaque.js +2 -1
  155. package/dist/emblems/trophy/ring.d.ts +2 -0
  156. package/dist/emblems/trophy/ring.js +30 -0
  157. package/dist/emblems/trophy/rugby-cup.js +1 -0
  158. package/dist/emblems/trophy/salver.js +1 -0
  159. package/dist/emblems/trophy/soccer-ball.js +2 -1
  160. package/dist/emblems/trophy/soccer-globe.js +1 -0
  161. package/dist/emblems/trophy/sumo-cup.d.ts +2 -0
  162. package/dist/emblems/trophy/sumo-cup.js +28 -0
  163. package/dist/emblems/trophy/tennis-cup.js +2 -1
  164. package/dist/emblems/trophy/tennis-plate.js +1 -0
  165. package/dist/emblems-entry.d.ts +15 -6
  166. package/dist/emblems-entry.js +7 -2
  167. package/dist/index.d.ts +17 -0
  168. package/dist/index.js +15 -0
  169. package/dist/turn-control.d.ts +101 -0
  170. package/dist/turn-control.js +363 -0
  171. package/dist/turn-entry.d.ts +2 -0
  172. package/dist/turn-entry.js +1 -0
  173. package/dist/version.d.ts +1 -1
  174. package/dist/version.js +1 -1
  175. package/package.json +7 -1
  176. package/LICENSES/Apache-2.0.txt +0 -202
  177. package/LICENSES/CC-BY-3.0.txt +0 -319
  178. package/LICENSES/upstream/game-icons.license.txt +0 -45
  179. package/LICENSES/upstream/noto-emoji-2D-svg.LICENSE +0 -13
  180. package/LICENSES/upstream/pictogrammers-mdi.LICENSE +0 -20
  181. package/dist/emblems/emblem.material.d.ts +0 -9
  182. package/dist/emblems/emblem.material.data.d.ts +0 -34
  183. package/dist/emblems/emblem.material.data.js +0 -85
  184. package/dist/emblems/emblem.material.js +0 -23
@@ -0,0 +1,30 @@
1
+ // A championship ring seen face on: a thick band, a wide faceted head with a gem in a bezel, and a flat on each shoulder of the head for the team and the year. It turns like a coin, with its rim, and shows
2
+ // the plain back of the head. Drawn for this package: generic, no team's or league's ring.
3
+ import { circlePath, defineFlat } from "../emblem.shapes.js";
4
+ const poly = (...p) => `M${p.map((q) => q.join(" ")).join("L")}Z`;
5
+ /** A band: a disc with a round hole, wound the other way so that it is cut out. */
6
+ const annulus = (cx, cy, R, r) => `M${cx - R} ${cy}a${R} ${R} 0 1 0 ${2 * R} 0a${R} ${R} 0 1 0 ${-2 * R} 0ZM${cx - r} ${cy}a${r} ${r} 0 1 1 ${2 * r} 0a${r} ${r} 0 1 1 ${-2 * r} 0Z`;
7
+ const HEAD = poly([16, 5], [48, 5], [58, 14], [58, 26], [48, 35], [16, 35], [6, 26], [6, 14]);
8
+ const BEZEL = poly([17.5, 8], [46.5, 8], [54.5, 15], [54.5, 25], [46.5, 32], [17.5, 32], [9.5, 25], [9.5, 15]);
9
+ const GEM = poly([24, 11], [40, 11], [47, 17], [47, 23], [40, 29], [24, 29], [17, 23], [17, 17]);
10
+ /** The facets: the table, and a line from each corner of the gem to the nearest corner of the table. */
11
+ const FACETS = `${poly([27.5, 15.5], [36.5, 15.5], [40.5, 18.5], [40.5, 21.5], [36.5, 24.5], [27.5, 24.5], [23.5, 21.5], [23.5, 18.5])}M24 11L27.5 15.5M40 11L36.5 15.5M47 17L40.5 18.5M47 23L40.5 21.5M40 29L36.5 24.5M24 29L27.5 24.5M17 23L23.5 21.5M17 17L23.5 18.5`;
12
+ const front = [
13
+ ["o", annulus(32, 44, 19, 11)],
14
+ ["t", circlePath(32, 44, 15)],
15
+ ["o", HEAD],
16
+ ["e", BEZEL, "1.6"],
17
+ ["r", GEM],
18
+ ["t", FACETS],
19
+ ["l", "M24 11L40 11L36.5 15.5L27.5 15.5ZM17 17L24 11L27.5 15.5L23.5 18.5Z"],
20
+ ];
21
+ const back = [["o", annulus(32, 44, 19, 11)], ["o", HEAD], ["e", BEZEL, "1.6"]];
22
+ /** A championship ring. */
23
+ export const TROPHY_RING = /* @__PURE__ */ defineFlat("trophy:ring", "Championship ring", "優勝リング", "ours", {
24
+ metal: "gold",
25
+ ribbon: "#b3262e",
26
+ front,
27
+ back,
28
+ rim: 5,
29
+ engrave: { front: { x: 12.4, y: 20, w: 19, h: 7, rot: -90 }, year: { x: 51.6, y: 20, w: 19, h: 7, rot: 90 }, back: { x: 32, y: 20, w: 30, h: 12 } },
30
+ });
@@ -19,4 +19,5 @@ export const TROPHY_RUGBY_CUP = /* @__PURE__ */ defineLathe("trophy:rugby-cup",
19
19
  { a: 90, w: 1.5, pts: [[9.4, 28], [14.2, 26], [17.6, 20], [17.6, 12.6], [15.6, 10.4], [16.6, 8.6]] },
20
20
  { a: -90, w: 1.5, pts: [[9.4, 28], [14.2, 26], [17.6, 20], [17.6, 12.6], [15.6, 10.4], [16.6, 8.6]] },
21
21
  ],
22
+ plate: { y0: 43.4, y1: 51.2 },
22
23
  });
@@ -5,4 +5,5 @@ export const TROPHY_SALVER = /* @__PURE__ */ defineLathe("trophy:salver", "Salve
5
5
  metal: "gold",
6
6
  tilt: 24,
7
7
  solids: [{ open: true, p: [[22, 30, 1], [24.4, 30, 1], [29, 22, 1], [34, 8, 1], [34, 4.8, 1], [42, 3.8, 1], [42, 9.4, 1], [46, 10.4, 1], [48, 12.6, 1], [51, 12.6, 1]], decor: [["disc", 26.4, "main"]] }],
8
+ plate: { y0: 48.2, y1: 50.8 },
8
9
  });
@@ -1,8 +1,9 @@
1
1
  // A gold soccer ball held up on a tapering stand with a stepped base. Drawn for this package.
2
2
  import { defineLathe } from "../emblem.lathe.js";
3
3
  /** A soccer ball held up on a tapering stand. */
4
- export const TROPHY_SOCCER_BALL = /* @__PURE__ */ defineLathe("trophy:soccer-ball", "Soccer ball trophy", "サッカーボールのトロフィー", "ours", {
4
+ export const TROPHY_SOCCER_BALL = /* @__PURE__ */ defineLathe("trophy:soccer-ball", "Soccer ball trophy", "サッカーのトロフィー", "ours", {
5
5
  metal: "gold",
6
6
  solids: [{ p: [[27, 4.4, 1], [38, 3.4], [47, 5.4, 1], [47, 8, 1], [51, 8, 1], [51, 12.4, 1], [55, 12.4, 1], [55, 15, 1], [59, 15, 1]] }],
7
7
  balls: [{ kind: "soccer", cy: 16, r: 11.4 }],
8
+ plate: { y0: 55.2, y1: 58.8 },
8
9
  });
@@ -14,4 +14,5 @@ export const TROPHY_SOCCER_GLOBE = /* @__PURE__ */ defineLathe("trophy:soccer-gl
14
14
  },
15
15
  ],
16
16
  balls: [{ kind: "globe", cy: 11, r: 10 }],
17
+ plate: { y0: 52.4, y1: 56.8, tone: "green" },
17
18
  });
@@ -0,0 +1,2 @@
1
+ /** A tall silver cup with phoenix-crested handles on a tall stand. */
2
+ export declare const TROPHY_SUMO_CUP: import("../emblem.core.ts").Emblem<import("../emblem.lathe.ts").LatheModel>;
@@ -0,0 +1,28 @@
1
+ // A tall silver cup on a tall stepped stand: a wide bell of a bowl with a gilt rim, a knopped stem, and on each side an ornate handle that sweeps up past the rim and ends in a crested curl like a bird's
2
+ // head, with a trailing plume below it. Drawn for this package from what such a cup is known to look like; a generic trophy that carries no name, mark or engraving.
3
+ import { defineLathe } from "../emblem.lathe.js";
4
+ /** The handle of one side: it swings out from the bowl, rises past the rim, and ends in a crest that curls over like a bird's head. */
5
+ const side = (a) => ({ a, w: 2.4, tone: "gilt", pts: [[8.4, 27], [14, 25], [18.4, 18], [17.6, 10], [15.2, 3.8], [18, 1.6], [20.2, 3.6]] });
6
+ /** A tall silver cup with phoenix-crested handles on a tall stand. */
7
+ export const TROPHY_SUMO_CUP = /* @__PURE__ */ defineLathe("trophy:sumo-cup", "Phoenix-handle cup", "鳳凰飾りの銀杯", "ours", {
8
+ metal: "silver",
9
+ tones: { dark: "#2b2f36", gilt: "#d9a620" },
10
+ solids: [
11
+ {
12
+ open: true,
13
+ p: [
14
+ [8, 11.6, 1, "gilt"], [10.2, 11.2, 1, "gilt"],
15
+ [10.2, 10.6, 1], [14, 9.8], [20, 8.4], [25.4, 6.6], [28.6, 5, 1],
16
+ [28.6, 5.4, 1, "gilt"], [30.4, 5.4, 1, "gilt"],
17
+ [30.4, 3.2, 1], [33, 3.2], [35.4, 4.8], [37.2, 3.6], [39.4, 3.2, 1],
18
+ [39.4, 6, 1, "gilt"], [41.2, 6, 1, "gilt"],
19
+ [41.2, 8, 1], [43.4, 8.4, 1],
20
+ [43.4, 9.6, 1, "dark"], [47, 9.6, 1, "dark"],
21
+ [47, 11.6, 1, "gilt"], [48.6, 11.6, 1, "gilt"],
22
+ [48.6, 13.2, 1, "dark"], [58, 13.2, 1, "dark"],
23
+ ],
24
+ },
25
+ ],
26
+ handles: [side(90), side(-90)],
27
+ plate: { y0: 50.4, y1: 56.6, tone: "dark" },
28
+ });
@@ -1,7 +1,7 @@
1
1
  // A gilded two-handled cup with a domed lid and a small pineapple on top, on a stem and a round plinth. Drawn for this package; a generic trophy.
2
2
  import { defineLathe } from "../emblem.lathe.js";
3
3
  /** A two-handled cup with a lid and a small pineapple finial. */
4
- export const TROPHY_TENNIS_CUP = /* @__PURE__ */ defineLathe("trophy:tennis-cup", "Two-handled cup with a pineapple", "取っ手が二つあり、ふたにパイナップルの飾りが付いたカップ", "ours", {
4
+ export const TROPHY_TENNIS_CUP = /* @__PURE__ */ defineLathe("trophy:tennis-cup", "Pineapple cup", "パイナップル飾りのカップ", "ours", {
5
5
  metal: "gold",
6
6
  tones: { dark: "#2b2f36" },
7
7
  solids: [
@@ -20,4 +20,5 @@ export const TROPHY_TENNIS_CUP = /* @__PURE__ */ defineLathe("trophy:tennis-cup"
20
20
  { a: 90, w: 1.8, pts: [[10.8, 26], [14.8, 24.6], [17.6, 19], [17, 14], [15.2, 12.4]] },
21
21
  { a: -90, w: 1.8, pts: [[10.8, 26], [14.8, 24.6], [17.6, 19], [17, 14], [15.2, 12.4]] },
22
22
  ],
23
+ plate: { y0: 45.8, y1: 52.6 },
23
24
  });
@@ -12,4 +12,5 @@ export const TROPHY_TENNIS_PLATE = /* @__PURE__ */ defineLathe("trophy:tennis-pl
12
12
  decor: [["disc", 28, "gilt"], ["disc", 25.6, "main"], ["pills", 22.6, 10, 22, 3.6, "plain"], ["disc", 18.6, "gilt"], ["disc", 15.6, "main"], ["pills", 11, 4, 36, 3.6, "plain"], ["disc", 6.4, "gilt"], ["disc", 3.8, "main"]],
13
13
  },
14
14
  ],
15
+ plate: { y0: 50.2, y1: 53.8 },
15
16
  });
@@ -1,12 +1,21 @@
1
- export { EMBLEMS, crest, emblemInfo, emblemModel, emblemName, emblemOf, emblemSvg, isBallId, isEmblemId, medal, parseEmblem, renderEmblem, sportIcon } from "./emblems/emblem.api.ts";
2
- export type { CrestOptions, EmblemInfo, EmblemRef } from "./emblems/emblem.api.ts";
3
- export { AWARD_IDS, BALL_IDS, CREST_IDS, CREST_SHAPES, EMBLEM_ALIASES, EMBLEM_FOLDERS, EMBLEM_GROUPS, EMBLEM_IDS, GEAR_IDS, MEDAL_IDS, MEDAL_KINDS, SPORT_IDS, SPORT_NAMES, TROPHY_IDS } from "./emblems/emblem.ids.ts";
4
- export type { AwardId, BallId, CrestId, CrestShape, EmblemGroup, EmblemId, GearId, MedalId, MedalKind, SportEmblemId, SportName, TrophyId } from "./emblems/emblem.ids.ts";
1
+ export { EMBLEM_DESCRIPTIONS } from "./emblems/emblem.descriptions.ts";
2
+ export type { EmblemDescription } from "./emblems/emblem.descriptions.ts";
3
+ export { EMBLEMS, crest, emblemInfo, emblemModel, emblemName, emblemOf, emblemSvg, isBallId, isEmblemId, medal, parseEmblem, pennant, renderEmblem, sportIcon } from "./emblems/emblem.api.ts";
4
+ export type { CrestOptions, EmblemInfo, EmblemRef, PennantOptions } from "./emblems/emblem.api.ts";
5
+ export { AWARD_IDS, BALL_IDS, CREST_IDS, CREST_SHAPES, EMBLEM_ALIASES, EMBLEM_FOLDERS, EMBLEM_GROUPS, EMBLEM_IDS, GEAR_IDS, JAPANESE_IDS, MEDAL_IDS, MEDAL_KINDS, PENNANT_IDS, SPORT_IDS, SPORT_NAMES, TROPHY_IDS } from "./emblems/emblem.ids.ts";
6
+ export type { AwardId, BallId, CrestId, CrestShape, EmblemGroup, EmblemId, GearId, JapaneseId, MedalId, MedalKind, PennantId, SportEmblemId, SportName, TrophyId } from "./emblems/emblem.ids.ts";
5
7
  export { EMBLEM_INK, EMBLEM_PAGE, EMBLEM_STYLES, METALS } from "./emblems/emblem.core.ts";
6
- export type { Emblem, EmblemKind, EmblemOptions, EmblemSource, EmblemStyle, EmblemTheme, FrameOptions } from "./emblems/emblem.core.ts";
8
+ export type { Emblem, EmblemKind, EmblemLocale, EmblemOptions, EmblemSource, EmblemStyle, EmblemTheme, FrameOptions } from "./emblems/emblem.core.ts";
7
9
  export { lineup } from "./emblems/ball/ball.index.ts";
8
10
  export type { LineupOptions } from "./emblems/ball/ball.index.ts";
9
11
  export type { PieceSize } from "./emblems/ball/ball.core.ts";
10
12
  export type { Ball, BallKind, Decor, Handle, LatheModel, Poles, Pt, Solid } from "./emblems/emblem.lathe.ts";
11
- export type { MaterialModel } from "./emblems/emblem.material.ts";
12
13
  export type { FlatModel, Role, Shape } from "./emblems/emblem.shapes.ts";
14
+ export { emblemSprite } from "./emblems/emblem.sprite.ts";
15
+ export type { Sprite, SpriteOptions, UseOptions } from "./emblems/emblem.sprite.ts";
16
+ export { emblemDataUri } from "./emblems/emblem.uri.ts";
17
+ export type { DataUriOptions } from "./emblems/emblem.uri.ts";
18
+ export { sportEquipment } from "./emblems/emblem.equipment.ts";
19
+ export type { SportEquipment } from "./emblems/emblem.equipment.ts";
20
+ export { awardCase, podium } from "./emblems/emblem.display.ts";
21
+ export type { AwardCaseOptions, AwardItem, DisplayOptions, PodiumOptions, PodiumPlace } from "./emblems/emblem.display.ts";
@@ -1,6 +1,11 @@
1
1
  // The emblems entry point: `renderEmblem(id, options)` draws any emblem from its id, and the ids and types say which there are. Nothing here imports a single drawing's module directly, so for one
2
2
  // emblem and nothing else import its own module (`@johnmorrisdotca/dougu-sports/ball/soccer`).
3
- export { EMBLEMS, crest, emblemInfo, emblemModel, emblemName, emblemOf, emblemSvg, isBallId, isEmblemId, medal, parseEmblem, renderEmblem, sportIcon } from "./emblems/emblem.api.js";
4
- export { AWARD_IDS, BALL_IDS, CREST_IDS, CREST_SHAPES, EMBLEM_ALIASES, EMBLEM_FOLDERS, EMBLEM_GROUPS, EMBLEM_IDS, GEAR_IDS, MEDAL_IDS, MEDAL_KINDS, SPORT_IDS, SPORT_NAMES, TROPHY_IDS } from "./emblems/emblem.ids.js";
3
+ export { EMBLEM_DESCRIPTIONS } from "./emblems/emblem.descriptions.js";
4
+ export { EMBLEMS, crest, emblemInfo, emblemModel, emblemName, emblemOf, emblemSvg, isBallId, isEmblemId, medal, parseEmblem, pennant, renderEmblem, sportIcon } from "./emblems/emblem.api.js";
5
+ export { AWARD_IDS, BALL_IDS, CREST_IDS, CREST_SHAPES, EMBLEM_ALIASES, EMBLEM_FOLDERS, EMBLEM_GROUPS, EMBLEM_IDS, GEAR_IDS, JAPANESE_IDS, MEDAL_IDS, MEDAL_KINDS, PENNANT_IDS, SPORT_IDS, SPORT_NAMES, TROPHY_IDS } from "./emblems/emblem.ids.js";
5
6
  export { EMBLEM_INK, EMBLEM_PAGE, EMBLEM_STYLES, METALS } from "./emblems/emblem.core.js";
6
7
  export { lineup } from "./emblems/ball/ball.index.js";
8
+ export { emblemSprite } from "./emblems/emblem.sprite.js";
9
+ export { emblemDataUri } from "./emblems/emblem.uri.js";
10
+ export { sportEquipment } from "./emblems/emblem.equipment.js";
11
+ export { awardCase, podium } from "./emblems/emblem.display.js";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export * from "./emblems-entry.ts";
2
2
  export { ballFrame, emblemFrame } from "./emblems/emblem.api.ts";
3
+ export { bindTurn } from "./turn-control.ts";
4
+ export type { TurnAngles, TurnContainer, TurnControlOptions, TurnController, TurnEvent } from "./turn-control.ts";
3
5
  export { EMBLEM_TABLE } from "./emblems/emblem.registry.ts";
4
6
  export { AWARD_MEDAL } from "./emblems/award/medal.ts";
5
7
  export { AWARD_BADGE } from "./emblems/award/badge.ts";
@@ -26,6 +28,10 @@ export { TROPHY_PLAQUE } from "./emblems/trophy/plaque.ts";
26
28
  export { TROPHY_BELT } from "./emblems/trophy/belt.ts";
27
29
  export { TROPHY_LAUREL } from "./emblems/trophy/laurel.ts";
28
30
  export { TROPHY_ROSETTE } from "./emblems/trophy/rosette.ts";
31
+ export { TROPHY_SUMO_CUP } from "./emblems/trophy/sumo-cup.ts";
32
+ export { TROPHY_CHAMPIONSHIP_BANNER } from "./emblems/trophy/championship-banner.ts";
33
+ export { TROPHY_RING } from "./emblems/trophy/ring.ts";
34
+ export { TROPHY_BANNER } from "./emblems/trophy/banner.ts";
29
35
  export { MEDAL_GOLD } from "./emblems/medal/gold.ts";
30
36
  export { MEDAL_SILVER } from "./emblems/medal/silver.ts";
31
37
  export { MEDAL_BRONZE } from "./emblems/medal/bronze.ts";
@@ -36,6 +42,7 @@ export { CREST_SHIELD } from "./emblems/crest/shield.ts";
36
42
  export { CREST_ROUNDEL } from "./emblems/crest/roundel.ts";
37
43
  export { CREST_DIAMOND } from "./emblems/crest/diamond.ts";
38
44
  export { CREST_PENNANT } from "./emblems/crest/pennant.ts";
45
+ export { PENNANT_CHAMPIONSHIP } from "./emblems/pennant/championship.ts";
39
46
  export { SPORT_NFL } from "./emblems/sport/nfl.ts";
40
47
  export { SPORT_CFL } from "./emblems/sport/cfl.ts";
41
48
  export { SPORT_IFAF } from "./emblems/sport/ifaf.ts";
@@ -69,6 +76,11 @@ export { SPORT_FIELDHOCKEY } from "./emblems/sport/fieldhockey.ts";
69
76
  export { SPORT_HANDBALL } from "./emblems/sport/handball.ts";
70
77
  export { SPORT_ATHLETICS } from "./emblems/sport/athletics.ts";
71
78
  export { SPORT_SKATING } from "./emblems/sport/skating.ts";
79
+ export { SPORT_SUMO } from "./emblems/sport/sumo.ts";
80
+ export { SPORT_KENDO } from "./emblems/sport/kendo.ts";
81
+ export { SPORT_JUDO } from "./emblems/sport/judo.ts";
82
+ export { SPORT_KYUDO } from "./emblems/sport/kyudo.ts";
83
+ export { SPORT_KARATE } from "./emblems/sport/karate.ts";
72
84
  export { BALL_AFL } from "./emblems/ball/ball.afl.ts";
73
85
  export { BALL_BASEBALL } from "./emblems/ball/ball.baseball.ts";
74
86
  export { BALL_BASKETBALL } from "./emblems/ball/ball.basketball.ts";
@@ -116,4 +128,9 @@ export { GEAR_TABLE_TENNIS_PADDLE } from "./emblems/gear/gear.tabletennispaddle.
116
128
  export { GEAR_TENNIS_RACKET } from "./emblems/gear/gear.tennisracket.ts";
117
129
  export { GEAR_STARTING_BLOCKS, GEAR_RELAY_BATON, GEAR_JAVELIN, GEAR_HURDLES } from "./emblems/gear/gear.track.ts";
118
130
  export { GEAR_DIVING_BOARD, GEAR_SWIM_GOGGLES } from "./emblems/gear/gear.water.ts";
131
+ export { GEAR_GUNBAI, GEAR_MAWASHI } from "./emblems/gear/gear.sumo.ts";
132
+ export { GEAR_SHINAI, GEAR_KENDO_MEN } from "./emblems/gear/gear.kendo.ts";
133
+ export { GEAR_JUDOGI, GEAR_KARATE_GI, GEAR_OBI, OBI_RANKS, obi } from "./emblems/gear/gear.budo.ts";
134
+ export type { ObiRank } from "./emblems/gear/gear.budo.ts";
135
+ export { GEAR_YUMI, GEAR_YA } from "./emblems/gear/gear.kyudo.ts";
119
136
  export { VERSION } from "./version.ts";
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  // its own module (`@johnmorrisdotca/dougu-sports/trophy/hockey-cup`), and for the functions alone `@johnmorrisdotca/dougu-sports/emblems`.
3
3
  export * from "./emblems-entry.js";
4
4
  export { ballFrame, emblemFrame } from "./emblems/emblem.api.js";
5
+ export { bindTurn } from "./turn-control.js";
5
6
  export { EMBLEM_TABLE } from "./emblems/emblem.registry.js";
6
7
  export { AWARD_MEDAL } from "./emblems/award/medal.js";
7
8
  export { AWARD_BADGE } from "./emblems/award/badge.js";
@@ -28,6 +29,10 @@ export { TROPHY_PLAQUE } from "./emblems/trophy/plaque.js";
28
29
  export { TROPHY_BELT } from "./emblems/trophy/belt.js";
29
30
  export { TROPHY_LAUREL } from "./emblems/trophy/laurel.js";
30
31
  export { TROPHY_ROSETTE } from "./emblems/trophy/rosette.js";
32
+ export { TROPHY_SUMO_CUP } from "./emblems/trophy/sumo-cup.js";
33
+ export { TROPHY_CHAMPIONSHIP_BANNER } from "./emblems/trophy/championship-banner.js";
34
+ export { TROPHY_RING } from "./emblems/trophy/ring.js";
35
+ export { TROPHY_BANNER } from "./emblems/trophy/banner.js";
31
36
  export { MEDAL_GOLD } from "./emblems/medal/gold.js";
32
37
  export { MEDAL_SILVER } from "./emblems/medal/silver.js";
33
38
  export { MEDAL_BRONZE } from "./emblems/medal/bronze.js";
@@ -38,6 +43,7 @@ export { CREST_SHIELD } from "./emblems/crest/shield.js";
38
43
  export { CREST_ROUNDEL } from "./emblems/crest/roundel.js";
39
44
  export { CREST_DIAMOND } from "./emblems/crest/diamond.js";
40
45
  export { CREST_PENNANT } from "./emblems/crest/pennant.js";
46
+ export { PENNANT_CHAMPIONSHIP } from "./emblems/pennant/championship.js";
41
47
  export { SPORT_NFL } from "./emblems/sport/nfl.js";
42
48
  export { SPORT_CFL } from "./emblems/sport/cfl.js";
43
49
  export { SPORT_IFAF } from "./emblems/sport/ifaf.js";
@@ -71,6 +77,11 @@ export { SPORT_FIELDHOCKEY } from "./emblems/sport/fieldhockey.js";
71
77
  export { SPORT_HANDBALL } from "./emblems/sport/handball.js";
72
78
  export { SPORT_ATHLETICS } from "./emblems/sport/athletics.js";
73
79
  export { SPORT_SKATING } from "./emblems/sport/skating.js";
80
+ export { SPORT_SUMO } from "./emblems/sport/sumo.js";
81
+ export { SPORT_KENDO } from "./emblems/sport/kendo.js";
82
+ export { SPORT_JUDO } from "./emblems/sport/judo.js";
83
+ export { SPORT_KYUDO } from "./emblems/sport/kyudo.js";
84
+ export { SPORT_KARATE } from "./emblems/sport/karate.js";
74
85
  export { BALL_AFL } from "./emblems/ball/ball.afl.js";
75
86
  export { BALL_BASEBALL } from "./emblems/ball/ball.baseball.js";
76
87
  export { BALL_BASKETBALL } from "./emblems/ball/ball.basketball.js";
@@ -118,4 +129,8 @@ export { GEAR_TABLE_TENNIS_PADDLE } from "./emblems/gear/gear.tabletennispaddle.
118
129
  export { GEAR_TENNIS_RACKET } from "./emblems/gear/gear.tennisracket.js";
119
130
  export { GEAR_STARTING_BLOCKS, GEAR_RELAY_BATON, GEAR_JAVELIN, GEAR_HURDLES } from "./emblems/gear/gear.track.js";
120
131
  export { GEAR_DIVING_BOARD, GEAR_SWIM_GOGGLES } from "./emblems/gear/gear.water.js";
132
+ export { GEAR_GUNBAI, GEAR_MAWASHI } from "./emblems/gear/gear.sumo.js";
133
+ export { GEAR_SHINAI, GEAR_KENDO_MEN } from "./emblems/gear/gear.kendo.js";
134
+ export { GEAR_JUDOGI, GEAR_KARATE_GI, GEAR_OBI, OBI_RANKS, obi } from "./emblems/gear/gear.budo.js";
135
+ export { GEAR_YUMI, GEAR_YA } from "./emblems/gear/gear.kyudo.js";
121
136
  export { VERSION } from "./version.js";
@@ -0,0 +1,101 @@
1
+ import { type EmblemRef } from "./emblems/emblem.api.ts";
2
+ import type { FrameOptions } from "./emblems/emblem.core.ts";
3
+ /** The three angles of a turn, in degrees. */
4
+ export interface TurnAngles {
5
+ /** About the vertical axis, from -180 (excluded) to 180. */
6
+ yaw: number;
7
+ /** The tilt toward the eye, within `pitchRange`. */
8
+ pitch: number;
9
+ /** A ball: the turn about the line of sight, from -180 (excluded) to 180. */
10
+ roll: number;
11
+ }
12
+ /** What `bindTurn` takes: the frame options (`style`, `size`, `tint`, `theme`, and the first `yaw`, `pitch` and `roll`) and how the turning behaves. */
13
+ export interface TurnControlOptions extends FrameOptions {
14
+ /** Degrees of turn for each pixel the pointer moves (1.5 by default). */
15
+ sensitivity?: number;
16
+ /** The least and most tilt, in degrees (`[-60, 60]` by default). */
17
+ pitchRange?: readonly [number, number];
18
+ /** Degrees an arrow key turns (5 by default); with Shift it is three times as much (15). */
19
+ keyStep?: number;
20
+ /** Called after each turn the pointer, a key or the auto-turn makes, with the new angles. It is not called for `setAngles` or `update`, which the caller makes itself. */
21
+ onTurn?: (angles: TurnAngles) => void;
22
+ /**
23
+ * `true` starts the auto-turn when the emblem is bound, unless the reader prefers reduced motion, when it starts paused; `"force"` starts it anyway. By default (`false`) nothing turns until `play()` is called.
24
+ * Only read by `bindTurn`.
25
+ */
26
+ autoPlay?: boolean | "force";
27
+ /** Degrees of yaw each second the auto-turn advances (36 by default; negative turns the other way). */
28
+ speed?: number;
29
+ /** 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. */
30
+ pauseOnInteract?: boolean;
31
+ /** Called with `true` when the auto-turn starts and `false` when it stops, whatever stopped it. */
32
+ onPlayChange?: (playing: boolean) => void;
33
+ }
34
+ /** What `bindTurn` returns. */
35
+ export interface TurnController {
36
+ /** The angles now (a copy). */
37
+ readonly angles: TurnAngles;
38
+ /** Whether the auto-turn is running. */
39
+ readonly playing: boolean;
40
+ /** Whether the emblem now drawn can be turned at all (read from the registry, so an emblem that gains a turn is turnable here without a change). */
41
+ readonly turnable: boolean;
42
+ /** Sets some of the angles (wrapped or clamped as a drag would) and draws. Pauses the auto-turn when `pauseOnInteract` is on. */
43
+ setAngles(angles: Partial<TurnAngles>): void;
44
+ /** Draws another emblem, or the same one with other options, and keeps the angles (unless the options carry some). */
45
+ update(ref: EmblemRef, options?: TurnControlOptions): void;
46
+ /** Starts the auto-turn. An emblem that cannot turn does nothing and gives `false`. */
47
+ play(): boolean;
48
+ /** Stops the auto-turn. */
49
+ pause(): void;
50
+ /** Starts or stops the auto-turn and gives the new state; `false` for an emblem that cannot turn. */
51
+ togglePlay(): boolean;
52
+ /** Removes the listeners and the attributes and styles `bindTurn` added; the last drawing stays. */
53
+ destroy(): void;
54
+ }
55
+ /** An event, as much of it as `bindTurn` reads: a pointer's or a key's. */
56
+ export interface TurnEvent {
57
+ button?: number;
58
+ isPrimary?: boolean;
59
+ pointerId?: number;
60
+ clientX?: number;
61
+ clientY?: number;
62
+ shiftKey?: boolean;
63
+ ctrlKey?: boolean;
64
+ metaKey?: boolean;
65
+ altKey?: boolean;
66
+ key?: string;
67
+ preventDefault(): void;
68
+ }
69
+ /** What `bindTurn` needs of an element: any `HTMLElement` is one, and so is a small fake in a test. */
70
+ export interface TurnContainer {
71
+ innerHTML: string;
72
+ style: {
73
+ touchAction: string;
74
+ userSelect: string;
75
+ cursor: string;
76
+ webkitUserSelect?: string;
77
+ };
78
+ addEventListener(type: string, listener: (event: TurnEvent) => void): void;
79
+ removeEventListener(type: string, listener: (event: TurnEvent) => void): void;
80
+ getAttribute(name: string): string | null;
81
+ setAttribute(name: string, value: string): void;
82
+ removeAttribute(name: string): void;
83
+ setPointerCapture?(pointerId: number): void;
84
+ releasePointerCapture?(pointerId: number): void;
85
+ }
86
+ /** An angle wrapped into -180 (excluded) to 180, as the demo's slider is. */
87
+ export declare function wrapAngle(value: number): number;
88
+ /**
89
+ * Binds an emblem to an element so that it can be turned: it draws `emblemFrame` into `container`, and a drag turns it (left and right are yaw, up and down are pitch, and Shift on a ball is roll), the arrow keys turn
90
+ * it, Home or 0 puts it back, and Space starts and stops an auto-turn. An emblem that cannot turn is drawn as it is, and nothing is listened to. Nothing moves by itself: `autoPlay` is off by default and, under
91
+ * `prefers-reduced-motion`, only starts when it is `"force"`. The element gets `touch-action: none`, `user-select: none`, a grab cursor, a tab stop, a role description and a hint; `destroy()` takes them away.
92
+ * @example
93
+ * ```ts
94
+ * import { bindTurn } from "@johnmorrisdotca/dougu-sports/turn";
95
+ * const turner = bindTurn(document.getElementById("cup")!, "trophy:tennis-cup", { size: 160 });
96
+ * turner.setAngles({ yaw: 40 });
97
+ * console.log(turner.angles.yaw);
98
+ * // 40
99
+ * ```
100
+ */
101
+ export declare function bindTurn(container: TurnContainer, ref: EmblemRef, options?: TurnControlOptions): TurnController;