@johnmorrisdotca/dougu-sports 0.0.1 → 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 (338) hide show
  1. package/CHANGELOG.md +61 -1
  2. package/LICENSES/README.md +4 -3
  3. package/NOTICE.md +54 -14
  4. package/README.md +251 -80
  5. package/dist/emblems/award/badge.d.ts +2 -0
  6. package/dist/emblems/award/badge.js +14 -0
  7. package/dist/emblems/award/crown.d.ts +2 -0
  8. package/dist/emblems/award/crown.js +15 -0
  9. package/dist/emblems/award/medal.d.ts +1 -1
  10. package/dist/emblems/award/medal.js +10 -15
  11. package/dist/emblems/award/shield.d.ts +2 -0
  12. package/dist/emblems/award/shield.js +11 -0
  13. package/dist/emblems/award/star.d.ts +2 -0
  14. package/dist/emblems/award/star.js +11 -0
  15. package/dist/emblems/ball/ball.afl.d.ts +1 -0
  16. package/dist/emblems/ball/ball.afl.js +24 -0
  17. package/dist/emblems/ball/ball.baseball.d.ts +1 -0
  18. package/dist/emblems/ball/ball.baseball.js +14 -0
  19. package/dist/emblems/ball/ball.basketball.d.ts +7 -0
  20. package/dist/emblems/ball/ball.basketball.js +32 -0
  21. package/dist/emblems/ball/ball.basketball3x3.d.ts +1 -0
  22. package/dist/emblems/ball/ball.basketball3x3.js +10 -0
  23. package/dist/emblems/ball/ball.basketball6.d.ts +1 -0
  24. package/dist/emblems/ball/ball.basketball6.js +10 -0
  25. package/dist/emblems/ball/ball.core.d.ts +111 -0
  26. package/dist/emblems/ball/ball.core.js +79 -0
  27. package/dist/emblems/ball/ball.cricket.d.ts +5 -0
  28. package/dist/emblems/ball/ball.cricket.js +31 -0
  29. package/dist/emblems/ball/ball.curlingstone.d.ts +3 -0
  30. package/dist/emblems/ball/ball.curlingstone.js +46 -0
  31. package/dist/emblems/ball/ball.discus.d.ts +1 -0
  32. package/dist/emblems/ball/ball.discus.js +24 -0
  33. package/dist/emblems/ball/ball.engine.d.ts +114 -0
  34. package/dist/emblems/ball/ball.engine.js +342 -0
  35. package/dist/emblems/ball/ball.family.dotted.d.ts +27 -0
  36. package/dist/emblems/ball/ball.family.dotted.js +20 -0
  37. package/dist/emblems/ball/ball.family.panelled.d.ts +7 -0
  38. package/dist/emblems/ball/ball.family.panelled.js +60 -0
  39. package/dist/emblems/ball/ball.family.prolate.d.ts +16 -0
  40. package/dist/emblems/ball/ball.family.prolate.js +29 -0
  41. package/dist/emblems/ball/ball.family.seamed.d.ts +31 -0
  42. package/dist/emblems/ball/ball.family.seamed.js +26 -0
  43. package/dist/emblems/ball/ball.fieldhockey.d.ts +1 -0
  44. package/dist/emblems/ball/ball.fieldhockey.js +15 -0
  45. package/dist/emblems/ball/ball.football.d.ts +3 -0
  46. package/dist/emblems/ball/ball.football.js +51 -0
  47. package/dist/emblems/ball/ball.gaelic.d.ts +2 -0
  48. package/dist/emblems/ball/ball.gaelic.js +30 -0
  49. package/dist/emblems/ball/ball.golf.d.ts +1 -0
  50. package/dist/emblems/ball/ball.golf.js +15 -0
  51. package/dist/emblems/ball/ball.hammer.d.ts +1 -0
  52. package/dist/emblems/ball/ball.hammer.js +31 -0
  53. package/dist/emblems/ball/ball.handball.d.ts +1 -0
  54. package/dist/emblems/ball/ball.handball.js +25 -0
  55. package/dist/emblems/ball/ball.index.d.ts +48 -0
  56. package/dist/emblems/ball/ball.index.js +103 -0
  57. package/dist/emblems/ball/ball.math.d.ts +38 -0
  58. package/dist/emblems/ball/ball.math.js +105 -0
  59. package/dist/emblems/ball/ball.object.d.ts +38 -0
  60. package/dist/emblems/ball/ball.object.js +20 -0
  61. package/dist/emblems/ball/ball.padel.d.ts +1 -0
  62. package/dist/emblems/ball/ball.padel.js +13 -0
  63. package/dist/emblems/ball/ball.pickleball.d.ts +2 -0
  64. package/dist/emblems/ball/ball.pickleball.js +26 -0
  65. package/dist/emblems/ball/ball.polyhedra.d.ts +15 -0
  66. package/dist/emblems/ball/ball.polyhedra.js +63 -0
  67. package/dist/emblems/ball/ball.puck.d.ts +3 -0
  68. package/dist/emblems/ball/ball.puck.js +22 -0
  69. package/dist/emblems/ball/ball.roundnet.d.ts +1 -0
  70. package/dist/emblems/ball/ball.roundnet.js +15 -0
  71. package/dist/emblems/ball/ball.rugby.d.ts +1 -0
  72. package/dist/emblems/ball/ball.rugby.js +35 -0
  73. package/dist/emblems/ball/ball.sepaktakraw.d.ts +1 -0
  74. package/dist/emblems/ball/ball.sepaktakraw.js +48 -0
  75. package/dist/emblems/ball/ball.shuttlecock.d.ts +6 -0
  76. package/dist/emblems/ball/ball.shuttlecock.js +93 -0
  77. package/dist/emblems/ball/ball.sliotar.d.ts +1 -0
  78. package/dist/emblems/ball/ball.sliotar.js +14 -0
  79. package/dist/emblems/ball/ball.smooth.d.ts +4 -0
  80. package/dist/emblems/ball/ball.smooth.js +51 -0
  81. package/dist/emblems/ball/ball.soccer.d.ts +2 -0
  82. package/dist/emblems/ball/ball.soccer.js +54 -0
  83. package/dist/emblems/ball/ball.softball.d.ts +1 -0
  84. package/dist/emblems/ball/ball.softball.js +14 -0
  85. package/dist/emblems/ball/ball.squash.d.ts +7 -0
  86. package/dist/emblems/ball/ball.squash.js +27 -0
  87. package/dist/emblems/ball/ball.stack.d.ts +48 -0
  88. package/dist/emblems/ball/ball.stack.js +127 -0
  89. package/dist/emblems/ball/ball.stitch.d.ts +10 -0
  90. package/dist/emblems/ball/ball.stitch.js +59 -0
  91. package/dist/emblems/ball/ball.tennis.d.ts +1 -0
  92. package/dist/emblems/ball/ball.tennis.js +13 -0
  93. package/dist/emblems/ball/ball.teqball.d.ts +1 -0
  94. package/dist/emblems/ball/ball.teqball.js +27 -0
  95. package/dist/emblems/ball/ball.volleyball.d.ts +3 -0
  96. package/dist/emblems/ball/ball.volleyball.js +56 -0
  97. package/dist/emblems/ball/ball.waterpolo.d.ts +1 -0
  98. package/dist/emblems/ball/ball.waterpolo.js +31 -0
  99. package/dist/emblems/crest/diamond.d.ts +2 -0
  100. package/dist/emblems/crest/diamond.js +18 -0
  101. package/dist/emblems/crest/pennant.d.ts +2 -0
  102. package/dist/emblems/crest/pennant.js +18 -0
  103. package/dist/emblems/crest/roundel.d.ts +2 -0
  104. package/dist/emblems/crest/roundel.js +18 -0
  105. package/dist/emblems/crest/shield.d.ts +2 -0
  106. package/dist/emblems/crest/shield.js +17 -0
  107. package/dist/emblems/emblem.api.d.ts +77 -9
  108. package/dist/emblems/emblem.api.js +56 -10
  109. package/dist/emblems/emblem.compose.d.ts +31 -0
  110. package/dist/emblems/emblem.compose.js +91 -0
  111. package/dist/emblems/emblem.core.d.ts +89 -7
  112. package/dist/emblems/emblem.core.js +85 -11
  113. package/dist/emblems/emblem.descriptions.d.ts +7 -0
  114. package/dist/emblems/emblem.descriptions.js +60 -0
  115. package/dist/emblems/emblem.display.d.ts +75 -0
  116. package/dist/emblems/emblem.display.js +214 -0
  117. package/dist/emblems/emblem.engrave.d.ts +50 -0
  118. package/dist/emblems/emblem.engrave.js +145 -0
  119. package/dist/emblems/emblem.equipment.d.ts +24 -0
  120. package/dist/emblems/emblem.equipment.js +57 -0
  121. package/dist/emblems/emblem.flip.d.ts +10 -0
  122. package/dist/emblems/emblem.flip.js +45 -0
  123. package/dist/emblems/emblem.ids.d.ts +44 -30
  124. package/dist/emblems/emblem.ids.js +51 -17
  125. package/dist/emblems/emblem.lathe.d.ts +62 -0
  126. package/dist/emblems/emblem.lathe.js +426 -0
  127. package/dist/emblems/emblem.medal.d.ts +6 -0
  128. package/dist/emblems/emblem.medal.js +38 -0
  129. package/dist/emblems/emblem.pennant.d.ts +3 -0
  130. package/dist/emblems/emblem.pennant.js +79 -0
  131. package/dist/emblems/emblem.registry.js +162 -4
  132. package/dist/emblems/emblem.shapes.d.ts +48 -12
  133. package/dist/emblems/emblem.shapes.js +138 -31
  134. package/dist/emblems/emblem.sprite.d.ts +38 -0
  135. package/dist/emblems/emblem.sprite.js +65 -0
  136. package/dist/emblems/emblem.uri.d.ts +22 -0
  137. package/dist/emblems/emblem.uri.js +29 -0
  138. package/dist/emblems/gear/gear.badmintonracket.d.ts +1 -0
  139. package/dist/emblems/gear/gear.badmintonracket.js +19 -0
  140. package/dist/emblems/gear/gear.baseballglove.d.ts +1 -0
  141. package/dist/emblems/gear/gear.baseballglove.js +21 -0
  142. package/dist/emblems/gear/gear.budo.d.ts +17 -0
  143. package/dist/emblems/gear/gear.budo.js +60 -0
  144. package/dist/emblems/gear/gear.core.d.ts +64 -0
  145. package/dist/emblems/gear/gear.core.js +127 -0
  146. package/dist/emblems/gear/gear.cricketbat.d.ts +1 -0
  147. package/dist/emblems/gear/gear.cricketbat.js +17 -0
  148. package/dist/emblems/gear/gear.field.d.ts +6 -0
  149. package/dist/emblems/gear/gear.field.js +81 -0
  150. package/dist/emblems/gear/gear.fieldhockeystick.d.ts +1 -0
  151. package/dist/emblems/gear/gear.fieldhockeystick.js +16 -0
  152. package/dist/emblems/gear/gear.footballhelmet.d.ts +1 -0
  153. package/dist/emblems/gear/gear.footballhelmet.js +16 -0
  154. package/dist/emblems/gear/gear.goaliemask.d.ts +1 -0
  155. package/dist/emblems/gear/gear.goaliemask.js +23 -0
  156. package/dist/emblems/gear/gear.goalnet.d.ts +1 -0
  157. package/dist/emblems/gear/gear.goalnet.js +25 -0
  158. package/dist/emblems/gear/gear.hockeystick.d.ts +1 -0
  159. package/dist/emblems/gear/gear.hockeystick.js +15 -0
  160. package/dist/emblems/gear/gear.index.d.ts +22 -0
  161. package/dist/emblems/gear/gear.index.js +49 -0
  162. package/dist/emblems/gear/gear.kendo.d.ts +2 -0
  163. package/dist/emblems/gear/gear.kendo.js +41 -0
  164. package/dist/emblems/gear/gear.kyudo.d.ts +2 -0
  165. package/dist/emblems/gear/gear.kyudo.js +31 -0
  166. package/dist/emblems/gear/gear.lacrossestick.d.ts +1 -0
  167. package/dist/emblems/gear/gear.lacrossestick.js +26 -0
  168. package/dist/emblems/gear/gear.rackets.d.ts +4 -0
  169. package/dist/emblems/gear/gear.rackets.js +60 -0
  170. package/dist/emblems/gear/gear.skates.d.ts +3 -0
  171. package/dist/emblems/gear/gear.skates.js +39 -0
  172. package/dist/emblems/gear/gear.sticks.d.ts +3 -0
  173. package/dist/emblems/gear/gear.sticks.js +34 -0
  174. package/dist/emblems/gear/gear.sumo.d.ts +2 -0
  175. package/dist/emblems/gear/gear.sumo.js +43 -0
  176. package/dist/emblems/gear/gear.tabletennispaddle.d.ts +1 -0
  177. package/dist/emblems/gear/gear.tabletennispaddle.js +16 -0
  178. package/dist/emblems/gear/gear.tennisracket.d.ts +1 -0
  179. package/dist/emblems/gear/gear.tennisracket.js +17 -0
  180. package/dist/emblems/gear/gear.track.d.ts +4 -0
  181. package/dist/emblems/gear/gear.track.js +45 -0
  182. package/dist/emblems/gear/gear.water.d.ts +2 -0
  183. package/dist/emblems/gear/gear.water.js +25 -0
  184. package/dist/emblems/medal/bronze.d.ts +2 -0
  185. package/dist/emblems/medal/bronze.js +4 -0
  186. package/dist/emblems/medal/gold.d.ts +2 -0
  187. package/dist/emblems/medal/gold.js +4 -0
  188. package/dist/emblems/medal/place-1.d.ts +2 -0
  189. package/dist/emblems/medal/place-1.js +4 -0
  190. package/dist/emblems/medal/place-2.d.ts +2 -0
  191. package/dist/emblems/medal/place-2.js +4 -0
  192. package/dist/emblems/medal/place-3.d.ts +2 -0
  193. package/dist/emblems/medal/place-3.js +4 -0
  194. package/dist/emblems/medal/silver.d.ts +2 -0
  195. package/dist/emblems/medal/silver.js +4 -0
  196. package/dist/emblems/pennant/championship.d.ts +2 -0
  197. package/dist/emblems/pennant/championship.js +4 -0
  198. package/dist/emblems/sport/afl.d.ts +2 -0
  199. package/dist/emblems/sport/afl.js +12 -0
  200. package/dist/emblems/sport/artisticswimming.d.ts +2 -0
  201. package/dist/emblems/sport/artisticswimming.js +16 -0
  202. package/dist/emblems/sport/athletics.d.ts +2 -0
  203. package/dist/emblems/sport/athletics.js +12 -0
  204. package/dist/emblems/sport/badminton.d.ts +2 -0
  205. package/dist/emblems/sport/badminton.js +13 -0
  206. package/dist/emblems/sport/cfl.d.ts +2 -0
  207. package/dist/emblems/sport/cfl.js +5 -0
  208. package/dist/emblems/sport/cricket.d.ts +2 -0
  209. package/dist/emblems/sport/cricket.js +14 -0
  210. package/dist/emblems/sport/curling.d.ts +2 -0
  211. package/dist/emblems/sport/curling.js +14 -0
  212. package/dist/emblems/sport/diving.d.ts +2 -0
  213. package/dist/emblems/sport/diving.js +18 -0
  214. package/dist/emblems/sport/fieldhockey.d.ts +2 -0
  215. package/dist/emblems/sport/fieldhockey.js +11 -0
  216. package/dist/emblems/sport/gaelic.d.ts +2 -0
  217. package/dist/emblems/sport/gaelic.js +11 -0
  218. package/dist/emblems/sport/handball.d.ts +2 -0
  219. package/dist/emblems/sport/handball.js +15 -0
  220. package/dist/emblems/sport/ifaf.d.ts +2 -0
  221. package/dist/emblems/sport/ifaf.js +5 -0
  222. package/dist/emblems/sport/judo.d.ts +2 -0
  223. package/dist/emblems/sport/judo.js +13 -0
  224. package/dist/emblems/sport/karate.d.ts +2 -0
  225. package/dist/emblems/sport/karate.js +13 -0
  226. package/dist/emblems/sport/kendo.d.ts +2 -0
  227. package/dist/emblems/sport/kendo.js +14 -0
  228. package/dist/emblems/sport/kyudo.d.ts +2 -0
  229. package/dist/emblems/sport/kyudo.js +15 -0
  230. package/dist/emblems/sport/lacrosse.d.ts +2 -0
  231. package/dist/emblems/sport/lacrosse.js +13 -0
  232. package/dist/emblems/sport/mlb.d.ts +2 -0
  233. package/dist/emblems/sport/mlb.js +28 -0
  234. package/dist/emblems/sport/nba.d.ts +2 -0
  235. package/dist/emblems/sport/nba.js +12 -0
  236. package/dist/emblems/sport/netball.d.ts +2 -0
  237. package/dist/emblems/sport/netball.js +14 -0
  238. package/dist/emblems/sport/nfl.d.ts +3 -0
  239. package/dist/emblems/sport/nfl.js +15 -0
  240. package/dist/emblems/sport/nhl.d.ts +2 -0
  241. package/dist/emblems/sport/nhl.js +13 -0
  242. package/dist/emblems/sport/padel.d.ts +2 -0
  243. package/dist/emblems/sport/padel.js +14 -0
  244. package/dist/emblems/sport/pickleball.d.ts +2 -0
  245. package/dist/emblems/sport/pickleball.js +13 -0
  246. package/dist/emblems/sport/racquetball.d.ts +2 -0
  247. package/dist/emblems/sport/racquetball.js +13 -0
  248. package/dist/emblems/sport/roundnet.d.ts +2 -0
  249. package/dist/emblems/sport/roundnet.js +15 -0
  250. package/dist/emblems/sport/rugby.d.ts +2 -0
  251. package/dist/emblems/sport/rugby.js +12 -0
  252. package/dist/emblems/sport/sepaktakraw.d.ts +2 -0
  253. package/dist/emblems/sport/sepaktakraw.js +11 -0
  254. package/dist/emblems/sport/skating.d.ts +2 -0
  255. package/dist/emblems/sport/skating.js +14 -0
  256. package/dist/emblems/sport/soccer.d.ts +2 -0
  257. package/dist/emblems/sport/soccer.js +31 -0
  258. package/dist/emblems/sport/squash.d.ts +2 -0
  259. package/dist/emblems/sport/squash.js +15 -0
  260. package/dist/emblems/sport/sumo.d.ts +2 -0
  261. package/dist/emblems/sport/sumo.js +15 -0
  262. package/dist/emblems/sport/swimming.d.ts +2 -0
  263. package/dist/emblems/sport/swimming.js +15 -0
  264. package/dist/emblems/sport/tabletennis.d.ts +2 -0
  265. package/dist/emblems/sport/tabletennis.js +12 -0
  266. package/dist/emblems/sport/tennis.d.ts +2 -0
  267. package/dist/emblems/sport/tennis.js +15 -0
  268. package/dist/emblems/sport/teqball.d.ts +2 -0
  269. package/dist/emblems/sport/teqball.js +15 -0
  270. package/dist/emblems/sport/volleyball.d.ts +2 -0
  271. package/dist/emblems/sport/volleyball.js +25 -0
  272. package/dist/emblems/sport/waterpolo.d.ts +2 -0
  273. package/dist/emblems/sport/waterpolo.js +15 -0
  274. package/dist/emblems/trophy/banner.d.ts +2 -0
  275. package/dist/emblems/trophy/banner.js +20 -0
  276. package/dist/emblems/trophy/baseball.d.ts +2 -0
  277. package/dist/emblems/trophy/baseball.js +15 -0
  278. package/dist/emblems/trophy/basketball.d.ts +2 -0
  279. package/dist/emblems/trophy/basketball.js +17 -0
  280. package/dist/emblems/trophy/belt.d.ts +2 -0
  281. package/dist/emblems/trophy/belt.js +17 -0
  282. package/dist/emblems/trophy/bowl.d.ts +2 -0
  283. package/dist/emblems/trophy/bowl.js +8 -0
  284. package/dist/emblems/trophy/canadian-bowl.d.ts +2 -0
  285. package/dist/emblems/trophy/canadian-bowl.js +23 -0
  286. package/dist/emblems/trophy/championship-banner.d.ts +2 -0
  287. package/dist/emblems/trophy/championship-banner.js +67 -0
  288. package/dist/emblems/trophy/cricket-urn.d.ts +2 -0
  289. package/dist/emblems/trophy/cricket-urn.js +23 -0
  290. package/dist/emblems/trophy/cup.d.ts +2 -0
  291. package/dist/emblems/trophy/cup.js +16 -0
  292. package/dist/emblems/trophy/football.d.ts +2 -0
  293. package/dist/emblems/trophy/football.js +11 -0
  294. package/dist/emblems/trophy/globe.d.ts +2 -0
  295. package/dist/emblems/trophy/globe.js +9 -0
  296. package/dist/emblems/trophy/hockey-cup.d.ts +2 -0
  297. package/dist/emblems/trophy/hockey-cup.js +22 -0
  298. package/dist/emblems/trophy/laurel.d.ts +2 -0
  299. package/dist/emblems/trophy/laurel.js +40 -0
  300. package/dist/emblems/trophy/lidded-cup.d.ts +2 -0
  301. package/dist/emblems/trophy/lidded-cup.js +21 -0
  302. package/dist/emblems/trophy/plaque.d.ts +2 -0
  303. package/dist/emblems/trophy/plaque.js +17 -0
  304. package/dist/emblems/trophy/ring.d.ts +2 -0
  305. package/dist/emblems/trophy/ring.js +30 -0
  306. package/dist/emblems/trophy/rosette.d.ts +2 -0
  307. package/dist/emblems/trophy/rosette.js +27 -0
  308. package/dist/emblems/trophy/rugby-cup.d.ts +2 -0
  309. package/dist/emblems/trophy/rugby-cup.js +23 -0
  310. package/dist/emblems/trophy/salver.d.ts +2 -0
  311. package/dist/emblems/trophy/salver.js +9 -0
  312. package/dist/emblems/trophy/soccer-ball.d.ts +2 -0
  313. package/dist/emblems/trophy/soccer-ball.js +9 -0
  314. package/dist/emblems/trophy/soccer-globe.d.ts +2 -0
  315. package/dist/emblems/trophy/soccer-globe.js +18 -0
  316. package/dist/emblems/trophy/sumo-cup.d.ts +2 -0
  317. package/dist/emblems/trophy/sumo-cup.js +28 -0
  318. package/dist/emblems/trophy/tennis-cup.d.ts +2 -0
  319. package/dist/emblems/trophy/tennis-cup.js +24 -0
  320. package/dist/emblems/trophy/tennis-plate.d.ts +2 -0
  321. package/dist/emblems/trophy/tennis-plate.js +16 -0
  322. package/dist/emblems-entry.d.ts +20 -7
  323. package/dist/emblems-entry.js +8 -2
  324. package/dist/index.d.ts +131 -1
  325. package/dist/index.js +131 -3
  326. package/dist/turn-control.d.ts +101 -0
  327. package/dist/turn-control.js +363 -0
  328. package/dist/turn-entry.d.ts +2 -0
  329. package/dist/turn-entry.js +1 -0
  330. package/dist/version.d.ts +1 -1
  331. package/dist/version.js +1 -1
  332. package/package.json +33 -7
  333. package/LICENSES/Apache-2.0.txt +0 -55
  334. package/LICENSES/CC-BY-3.0.md +0 -15
  335. package/dist/emblems/ball/soccer.d.ts +0 -2
  336. package/dist/emblems/ball/soccer.js +0 -9
  337. package/dist/emblems/emblem.ball.d.ts +0 -28
  338. package/dist/emblems/emblem.ball.js +0 -70
@@ -0,0 +1,14 @@
1
+ // Badge: a seal with a star and two tails of ribbon, drawn for this package, in metal, line and flat colour.
2
+ import { circlePath, defineIcon, starPath } from "../emblem.shapes.js";
3
+ /** Badge with a star. */
4
+ export const AWARD_BADGE = /* @__PURE__ */ defineIcon("award:badge", "Badge", "バッジ", "ours", {
5
+ metal: "gold",
6
+ ribbon: "#c0392b",
7
+ front: [
8
+ ["r", "M21 41L12 61l10-4.4 5.4 6.4 4.4-17zM43 41l9 20-10-4.4-5.4 6.4-4.4-17z"],
9
+ ["o", starPath(32, 26, 24, 21, 18)],
10
+ ["e", circlePath(32, 26, 16.6), "2"],
11
+ ["m", starPath(32, 26, 10.6, 4.6)],
12
+ ["l", "M17 18a17 17 0 0 1 11-9 20 20 0 0 0-11 19z"],
13
+ ],
14
+ });
@@ -0,0 +1,2 @@
1
+ /** Crown. */
2
+ export declare const AWARD_CROWN: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
@@ -0,0 +1,15 @@
1
+ // Crown: three points tipped with balls over a jewelled band, drawn for this package, in metal, line and flat colour.
2
+ import { circlePath, defineIcon } from "../emblem.shapes.js";
3
+ /** Crown. */
4
+ export const AWARD_CROWN = /* @__PURE__ */ defineIcon("award:crown", "Crown", "王冠", "ours", {
5
+ metal: "gold",
6
+ ribbon: "#c0392b",
7
+ front: [
8
+ ["m", "M8 48L5 19L20 31L32 11L44 31L59 19L56 48z"],
9
+ ["e", "M12.4 43.4L10.6 28.6L21 37L32 19.6L43 37L53.4 28.6L51.6 43.4", "1.6"],
10
+ ["o", `${circlePath(5, 17, 3.6)}${circlePath(32, 9, 3.8)}${circlePath(59, 17, 3.6)}`],
11
+ ["m", "M8 50h48v8H8z"],
12
+ ["r", `${circlePath(18, 54, 2.2)}${circlePath(32, 54, 2.2)}${circlePath(46, 54, 2.2)}`],
13
+ ["l", "M12 24l6.4 5.2-1.6 12L13.6 41z"],
14
+ ],
15
+ });
@@ -1,2 +1,2 @@
1
- /** A medal on a ribbon. Turned, it flips like a coin and shows its plain back. */
1
+ /** Medal on a ribbon. */
2
2
  export declare const AWARD_MEDAL: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
@@ -1,19 +1,14 @@
1
- // The medal on a ribbon: a gold disc with a star on its face and a plain back, on two crossed straps. Drawn for this package. A sample of the award area (see docs/layout.md).
2
- import { circlePath, defineFlat, starPath } from "../emblem.shapes.js";
3
- /** A medal on a ribbon. Turned, it flips like a coin and shows its plain back. */
4
- export const AWARD_MEDAL = /* @__PURE__ */ defineFlat("award:medal", "Medal", "メダル", "ours", {
1
+ // Medal: a ribbon with a notched end and a star hanging from it, drawn for this package, in metal, line and flat colour.
2
+ import { defineIcon, starPath } from "../emblem.shapes.js";
3
+ /** Medal on a ribbon. */
4
+ export const AWARD_MEDAL = /* @__PURE__ */ defineIcon("award:medal", "Medal", "メダル", "ours", {
5
5
  metal: "gold",
6
+ ribbon: "#c0392b",
6
7
  front: [
7
- { part: "ribbon", d: "M17 3H29L39 31H28Z" },
8
- { part: "ribbon", d: "M47 3H35L25 31H36Z" },
9
- { part: "main", d: circlePath(32, 42, 17) },
10
- { part: "detail", d: circlePath(32, 42, 12.5) },
11
- { part: "main", d: starPath(32, 42, 8.6, 3.6) },
12
- ],
13
- back: [
14
- { part: "ribbon", d: "M17 3H29L39 31H28Z" },
15
- { part: "ribbon", d: "M47 3H35L25 31H36Z" },
16
- { part: "main", d: circlePath(32, 42, 17) },
17
- { part: "detail", d: circlePath(32, 42, 12.5) },
8
+ ["r", "M21 3h22v26L32 23.4 21 29z"],
9
+ ["e", "M26 3v22M38 3v22", "1.4"],
10
+ ["m", "M32 27.4a2.6 2.6 0 1 1 0 5.2a2.6 2.6 0 1 1 0-5.2z"],
11
+ ["m", starPath(32, 46, 16.4, 7)],
12
+ ["l", "M32 34.6l3.4 8-9.4 1.4z"],
18
13
  ],
19
14
  });
@@ -0,0 +1,2 @@
1
+ /** Shield. */
2
+ export declare const AWARD_SHIELD: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
@@ -0,0 +1,11 @@
1
+ // Shield: a shield with a bevelled face, drawn for this package, in metal, line and flat colour.
2
+ import { defineIcon } from "../emblem.shapes.js";
3
+ /** Shield. */
4
+ export const AWARD_SHIELD = /* @__PURE__ */ defineIcon("award:shield", "Shield", "盾", "ours", {
5
+ metal: "silver",
6
+ front: [
7
+ ["m", "M32 4L10 12v18c0 14 9 25 22 30 13-5 22-16 22-30V12z"],
8
+ ["e", "M32 10.4L15.6 16.4V30c0 10.6 6.4 18.8 16.4 22.8 10-4 16.4-12.2 16.4-22.8V16.4z", "2"],
9
+ ["l", "M17 18l13-5v38C21 46 17 38 17 30z"],
10
+ ],
11
+ });
@@ -0,0 +1,2 @@
1
+ /** Star. */
2
+ export declare const AWARD_STAR: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
@@ -0,0 +1,11 @@
1
+ // Star: a five-pointed star with a bevelled face, drawn for this package, in metal, line and flat colour.
2
+ import { defineIcon, starPath } from "../emblem.shapes.js";
3
+ /** Star. */
4
+ export const AWARD_STAR = /* @__PURE__ */ defineIcon("award:star", "Star", "星", "ours", {
5
+ metal: "gold",
6
+ front: [
7
+ ["m", starPath(32, 34, 29, 12.4)],
8
+ ["e", starPath(32, 35, 18.6, 7.8), "1.8"],
9
+ ["l", "M32 8.4l5 14.6-5 3.6-5-3.6z"],
10
+ ],
11
+ });
@@ -0,0 +1 @@
1
+ export declare const BALL_AFL: import("./ball.core.ts").Piece<import("./ball.engine.ts").BallSpec>;
@@ -0,0 +1,24 @@
1
+ // Australian football: a red leather ball, rounder than an American one, with four panels whose seams are sewn with white stitches.
2
+ import { defineBall } from "./ball.engine.js";
3
+ import { footballSeams } from "./ball.family.prolate.js";
4
+ import { stitches } from "./ball.stitch.js";
5
+ import { mix } from "./ball.core.js";
6
+ export const BALL_AFL = /* @__PURE__ */ defineBall({
7
+ id: "ball:afl",
8
+ en: "Australian football",
9
+ ja: "オージーボール",
10
+ size: { extentMm: 280, lengthMm: 280, circumferenceMm: 550.0, longCircumferenceMm: 725.0, rule: "Laws of Australian Football 2026, Law 4 The Football, 4.1 Specifications", note: "The Laws give the two circumferences (720-730 mm and 545-555 mm) and no length: 280 mm is the length of an ellipse of those two girths." },
11
+ spec: {
12
+ axes: [1, 0.7, 0.7],
13
+ view: { yaw: -30, pitch: 20, roll: -25 },
14
+ base: "#b4202b",
15
+ mat: { gloss: 0.55, shade: "#2a0408", grain: { f: 1.0, a: 0.34 } },
16
+ draw: (s, base) => {
17
+ const seams = footballSeams(Math.PI / 4);
18
+ let out = s.strokes(seams, mix(base, -0.5), 1.1, { closed: true });
19
+ for (const seam of seams)
20
+ out += s.strokes(stitches(seam, true, 46, 0.045, { lean: 0.0 }), "#f4efe4", 0.8, { ink: false });
21
+ return out;
22
+ },
23
+ },
24
+ });
@@ -0,0 +1 @@
1
+ export declare const BALL_BASEBALL: import("./ball.core.ts").Piece<import("./ball.engine.ts").BallSpec>;
@@ -0,0 +1,14 @@
1
+ // Baseball: a white leather ball with 108 red double stitches in V's along the figure-eight seam.
2
+ import { seamedBall } from "./ball.family.seamed.js";
3
+ export const BALL_BASEBALL = /* @__PURE__ */ seamedBall({
4
+ id: "ball:baseball",
5
+ en: "Baseball",
6
+ ja: "野球のボール",
7
+ size: { extentMm: 73.8, diameterMm: 73.8, circumferenceMm: 231.77, massG: [141.75, 148.83], rule: "Official Baseball Rules, Rule 3.01 The Ball", note: "Diameter worked out from the middle of the circumference range." },
8
+ base: "#f4f0e6",
9
+ b: 0.4,
10
+ view: { yaw: 18, pitch: 28, roll: -10 },
11
+ mat: { gloss: 0.3, shade: "#4a3a2a", grain: { f: 1.4, a: 0.12 } },
12
+ groove: "#8a7a62",
13
+ stitch: { colour: "#c4262e", count: 108, half: 0.075, width: 0.85, lean: 0.032 },
14
+ });
@@ -0,0 +1,7 @@
1
+ import { type BallSpec } from "./ball.engine.ts";
2
+ import type { V3 } from "./ball.math.ts";
3
+ /** One side channel: the wave above the equator for `sign` 1 and below it for -1. */
4
+ export declare const basketballChannel: (sign: 1 | -1, n?: number) => V3[];
5
+ /** The spec of a basketball: its colour, and the colour of its lower half for a two-tone ball. */
6
+ export declare function basketballSpec(base: string, lower?: string): BallSpec;
7
+ export declare const BALL_BASKETBALL: import("./ball.core.ts").Piece<BallSpec>;
@@ -0,0 +1,32 @@
1
+ // The basketball: an orange sphere with the equator, the meridian and the two curved side channels. The channels are the curves latitude = +-(0.304 + 0.585 sin^2 longitude) round the ball,
2
+ // each crossing the meridian square on and swinging away from the equator toward both sides; the constants were fitted to a photograph and a drawing of a generic ball (a least-squares
3
+ // match of 1,766 seam pixels), not copied from either. FIBA allows at most 12 seams of at most 6.35 mm; this ball has the four channels of the usual pattern.
4
+ import { defineBall } from "./ball.engine.js";
5
+ import { greatCircle, lonLat, smallCircle } from "./ball.math.js";
6
+ import { mix } from "./ball.core.js";
7
+ const L0 = 0.304;
8
+ const AMP = 0.585;
9
+ /** One side channel: the wave above the equator for `sign` 1 and below it for -1. */
10
+ export const basketballChannel = (sign, n = 72) => Array.from({ length: n }, (_, i) => {
11
+ const lon = (i / n) * 2 * Math.PI;
12
+ return lonLat(lon, sign * (L0 + AMP * Math.sin(lon) ** 2));
13
+ });
14
+ /** The spec of a basketball: its colour, and the colour of its lower half for a two-tone ball. */
15
+ export function basketballSpec(base, lower) {
16
+ return {
17
+ view: { yaw: 46.8, pitch: -13.5, roll: 183.6 },
18
+ base,
19
+ mat: { gloss: 0.5, shade: "#4a1c06", grain: { f: 1.1, a: 0.32 } },
20
+ draw(s, colour) {
21
+ const ink = mix(colour, -0.88);
22
+ let out = "";
23
+ if (lower !== undefined)
24
+ out += s.panel(smallCircle([0, -1, 0], 1.545, 72), lower, { n: 1, ink: false });
25
+ const curves = [greatCircle([0, 1, 0], 72), greatCircle([1, 0, 0], 72), basketballChannel(1), basketballChannel(-1)];
26
+ out += s.strokes(curves, ink, 2.0, { closed: true });
27
+ return out;
28
+ },
29
+ };
30
+ }
31
+ const SIZE7 = { extentMm: 241.9, diameterMm: 241.9, circumferenceMm: 760.0, massG: [580, 620], rule: "FIBA Basketball Equipment 2026, Rule 2 Basketballs, 2.4 and Table 1 (size 7 = men's competitions)", note: "Diameter worked out from the middle of the circumference range." };
32
+ export const BALL_BASKETBALL = /* @__PURE__ */ defineBall({ id: "ball:basketball", en: "Basketball", ja: "バスケットボール", size: SIZE7, spec: basketballSpec("#e0701f") });
@@ -0,0 +1 @@
1
+ export declare const BALL_BASKETBALL_3X3: import("./ball.core.ts").Piece<import("./ball.engine.ts").BallSpec>;
@@ -0,0 +1,10 @@
1
+ // The 3x3 basketball: two-tone, orange above and charcoal below, the size of a 6 and the weight of a 7. Our own two-tone scheme; the rules fix the size and the weight.
2
+ import { defineBall } from "./ball.engine.js";
3
+ import { basketballSpec } from "./ball.basketball.js";
4
+ export const BALL_BASKETBALL_3X3 = /* @__PURE__ */ defineBall({
5
+ id: "ball:basketball-3x3",
6
+ en: "Basketball, 3x3",
7
+ ja: "3x3バスケットボール",
8
+ size: { extentMm: 232.4, diameterMm: 232.4, circumferenceMm: 730.0, massG: [580, 620], rule: "FIBA 3x3 Official Equipment & Software Appendix to the 3x3 Official Rules (Dec 2024 update), Table 1 and section 5.7 (as quoted by balls.com)", note: "Not read in the FIBA 3x3 equipment appendix itself (fiba3x3.com refused the request); the figures are those a ball retailer prints from it: the circumference of a size 6 with the weight of a size 7. Diameter worked out from the middle of the circumference range." },
9
+ spec: basketballSpec("#e0701f", "#2b2d33"),
10
+ });
@@ -0,0 +1 @@
1
+ export declare const BALL_BASKETBALL_6: import("./ball.core.ts").Piece<import("./ball.engine.ts").BallSpec>;
@@ -0,0 +1,10 @@
1
+ // Basketball, size 6 (women's competitions): the same pattern a little smaller, here a shade lighter.
2
+ import { defineBall } from "./ball.engine.js";
3
+ import { basketballSpec } from "./ball.basketball.js";
4
+ export const BALL_BASKETBALL_6 = /* @__PURE__ */ defineBall({
5
+ id: "ball:basketball-6",
6
+ en: "Basketball, size 6",
7
+ ja: "バスケットボール6号球",
8
+ size: { extentMm: 230.0, diameterMm: 230.0, circumferenceMm: 722.5, massG: [510, 550], rule: "FIBA Basketball Equipment 2026, Rule 2 Basketballs, 2.4 and Table 1 (size 6 = women's competitions)", note: "Diameter worked out from the middle of the circumference range." },
9
+ spec: basketballSpec("#e57a26"),
10
+ });
@@ -0,0 +1,111 @@
1
+ /** `metal` (also written `colour`): full colour, with shading. `line`: one outline in `currentColor`. */
2
+ export type PieceStyle = "metal" | "colour" | "color" | "line";
3
+ /** `inherit` (the default): the page's text colour. `auto`: dark ink on a light device and pale ink on a dark one. `light` and `dark` force one. */
4
+ export type PieceTheme = "inherit" | "auto" | "light" | "dark";
5
+ export interface PieceOptions {
6
+ /** `metal` or `colour` (the default) or `line`. */
7
+ style?: PieceStyle;
8
+ /** The width and height in pixels (64 by default); the drawing is a vector at any size. */
9
+ size?: number;
10
+ /** A colour that replaces the main colour of the piece, where it has one. A hex colour or `rgb()`; anything else is ignored. */
11
+ tint?: string;
12
+ theme?: PieceTheme;
13
+ /** A second colour, where a piece has one (laces, a stripe). */
14
+ accent?: string;
15
+ /** Force the grain on or off. By default it is on for a colour ball of 48 pixels or more that is not turning. */
16
+ grain?: boolean;
17
+ /** The language of the `<title>`: `"en"` (the default) or `"ja"`. */
18
+ locale?: "en" | "ja";
19
+ /** A string is the `<title>` (escaped); `false` drops it and marks the drawing `aria-hidden="true"`. */
20
+ title?: string | false;
21
+ }
22
+ /** A turn: `yaw` degrees about the vertical axis (0 is the default view), `pitch` the tilt toward you, `roll` the turn about the line of sight. */
23
+ export interface BallFrameOptions extends PieceOptions {
24
+ yaw?: number;
25
+ pitch?: number;
26
+ roll?: number;
27
+ }
28
+ /** Where a drawing comes from. */
29
+ export type PieceSource = "generated" | "drawn";
30
+ /** `ball` is turned in 3D; `gear` is a flat drawing in a metal, a colour and a line style, which flips like a coin when turned. */
31
+ export type PieceKind = "ball" | "gear";
32
+ /** The official size of a ball or an implement, from the rulebook that governs it. Lengths in millimetres, mass in grams. */
33
+ export interface PieceSize {
34
+ /** The largest extent of the drawing (a ball's diameter, a football's length), in millimetres: the scale `lineup` draws at. */
35
+ extentMm: number;
36
+ /** Across a sphere or a disc. */
37
+ diameterMm?: number;
38
+ /** End to end, for a prolate ball or an implement. */
39
+ lengthMm?: number;
40
+ /** The width across the middle of a prolate ball, or a stone's height, a puck's thickness. */
41
+ thicknessMm?: number;
42
+ /** Round the middle, for a ball the rulebook measures that way. */
43
+ circumferenceMm?: number;
44
+ /** Round the long way, for a prolate ball. */
45
+ longCircumferenceMm?: number;
46
+ massG?: readonly [number, number];
47
+ /** The rule the figures are from: document, edition and rule number. */
48
+ rule: string;
49
+ /** Anything the figures leave out, such as a figure that is the middle of a range or a part drawn shorter than it is. */
50
+ note?: string;
51
+ }
52
+ /** One ball or piece of gear. */
53
+ export interface Piece<Model = unknown> {
54
+ readonly id: string;
55
+ readonly en: string;
56
+ readonly ja: string;
57
+ readonly source: PieceSource;
58
+ readonly kind: PieceKind;
59
+ readonly model: Model;
60
+ /** The official size, where the rulebook gives one. */
61
+ readonly size?: PieceSize;
62
+ /** The still drawing: a document of SVG. */
63
+ svg: (options?: PieceOptions) => string;
64
+ /** The piece turned: a ball in 3D, gear flipped like a coin. */
65
+ frame: (options?: BallFrameOptions) => string;
66
+ }
67
+ type Rgb = readonly [number, number, number];
68
+ export declare function readColour(value: string | undefined): Rgb | undefined;
69
+ export declare const hexOf: (rgb: Rgb) => string;
70
+ /** A colour mixed toward black (`amount` below 0) or white (above 0). */
71
+ export declare function mix(colour: string, amount: number): string;
72
+ /** Two colours mixed: `t` 0 is `a`, 1 is `b`. */
73
+ export declare function blend(a: string, b: string, t: number): string;
74
+ /** Text made safe to write between tags and inside a double-quoted attribute. */
75
+ export declare const escape: (text: string) => string;
76
+ /** A number written short: at most `digits` decimals, no trailing zeros, no `-0`. */
77
+ export declare const num: (value: number, digits?: number) => string;
78
+ /** A short stable hash of some text, for ids that two drawings of one piece agree on. */
79
+ export declare function hashOf(text: string): string;
80
+ /** The options as the renderers use them. */
81
+ export interface ResolvedOptions {
82
+ style: "colour" | "line";
83
+ size: number;
84
+ theme: PieceTheme;
85
+ tint: string | undefined;
86
+ accent: string | undefined;
87
+ grain: boolean | undefined;
88
+ }
89
+ export declare function resolveOptions(o: PieceOptions | undefined): ResolvedOptions;
90
+ /** The ink of a drawing when a theme sets it, and the page it is made to read on. */
91
+ export declare const PIECE_INK: {
92
+ readonly light: "#20262d";
93
+ readonly dark: "#eef1f3";
94
+ };
95
+ /** A drawing wrapped into a document, in a 100 by 100 box: the title, the outline's colour for the theme, the definitions and the body. */
96
+ export declare function wrapPiece(o: {
97
+ title: string;
98
+ size: number;
99
+ theme: PieceTheme;
100
+ defs?: string;
101
+ body: string;
102
+ box?: string;
103
+ desc?: string;
104
+ }): string;
105
+ /** A piece's drawing function, with the `<title>` its options ask for: the Japanese name, a title of the caller's own, or none (the same rule as the emblems', in emblem.core.ts). */
106
+ export declare const labelled: <O extends PieceOptions>(en: string, ja: string, draw: (options?: O) => string) => (options?: O) => string;
107
+ /** Degrees to radians, for a value that may be missing or not a number. */
108
+ export declare const radians: (degrees: number | undefined, fallback: number) => number;
109
+ /** The definition of the grain filter: noise lit from the upper left and multiplied into what it is applied to. It works in the box's own units, so the grain stays where it is while a ball turns. */
110
+ export declare function grainDef(id: string, f: number, a: number, seed?: number): string;
111
+ export {};
@@ -0,0 +1,79 @@
1
+ // What every ball and every piece of gear is made of: the options, the colour helpers, the way a drawing is wrapped into a document, and the `Piece` object each one is.
2
+ // It imports nothing, so a ball stands alone: a bundler can take one ball module without the others. The shape of a piece (`id`, `en`, `ja`, `source`, `kind`, `model`, `svg`, `frame`)
3
+ // is the shape of an emblem in the emblem registry, so a registry can take a ball or a piece of gear as it is.
4
+ export function readColour(value) {
5
+ if (value === undefined)
6
+ return undefined;
7
+ const text = value.trim();
8
+ const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(text)?.[1];
9
+ if (hex !== undefined) {
10
+ const full = hex.length === 3 ? [...hex].map((c) => c + c).join("") : hex;
11
+ return [parseInt(full.slice(0, 2), 16), parseInt(full.slice(2, 4), 16), parseInt(full.slice(4, 6), 16)];
12
+ }
13
+ const rgb = /^rgb\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})\s*\)$/i.exec(text);
14
+ return rgb === null ? undefined : [Math.min(255, Number(rgb[1])), Math.min(255, Number(rgb[2])), Math.min(255, Number(rgb[3]))];
15
+ }
16
+ const hex2 = (n) => Math.max(0, Math.min(255, Math.round(n))).toString(16).padStart(2, "0");
17
+ export const hexOf = (rgb) => `#${hex2(rgb[0])}${hex2(rgb[1])}${hex2(rgb[2])}`;
18
+ /** A colour mixed toward black (`amount` below 0) or white (above 0). */
19
+ export function mix(colour, amount) {
20
+ const rgb = readColour(colour) ?? [128, 128, 128];
21
+ const target = amount < 0 ? 0 : 255;
22
+ const t = Math.abs(amount);
23
+ return hexOf([rgb[0] + (target - rgb[0]) * t, rgb[1] + (target - rgb[1]) * t, rgb[2] + (target - rgb[2]) * t]);
24
+ }
25
+ /** Two colours mixed: `t` 0 is `a`, 1 is `b`. */
26
+ export function blend(a, b, t) {
27
+ const x = readColour(a) ?? [128, 128, 128];
28
+ const y = readColour(b) ?? [128, 128, 128];
29
+ return hexOf([x[0] + (y[0] - x[0]) * t, x[1] + (y[1] - x[1]) * t, x[2] + (y[2] - x[2]) * t]);
30
+ }
31
+ /** Text made safe to write between tags and inside a double-quoted attribute. */
32
+ export const escape = (text) => text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
33
+ /** A number written short: at most `digits` decimals, no trailing zeros, no `-0`. */
34
+ export const num = (value, digits = 1) => {
35
+ const text = (Math.round(value * 10 ** digits) / 10 ** digits).toString();
36
+ return text === "-0" ? "0" : text;
37
+ };
38
+ /** A short stable hash of some text, for ids that two drawings of one piece agree on. */
39
+ export function hashOf(text) {
40
+ let h = 2166136261;
41
+ for (let i = 0; i < text.length; i++)
42
+ h = Math.imul(h ^ text.charCodeAt(i), 16777619);
43
+ return (h >>> 0).toString(36);
44
+ }
45
+ export function resolveOptions(o) {
46
+ const size = typeof o?.size === "number" && Number.isFinite(o.size) && o.size > 0 ? Math.min(Math.round(o.size * 100) / 100, 4096) : 64;
47
+ const theme = o?.theme === "auto" || o?.theme === "light" || o?.theme === "dark" ? o.theme : "inherit";
48
+ const tint = readColour(o?.tint);
49
+ const accent = readColour(o?.accent);
50
+ return { style: o?.style === "line" ? "line" : "colour", size, theme, tint: tint === undefined ? undefined : hexOf(tint), accent: accent === undefined ? undefined : hexOf(accent), grain: typeof o?.grain === "boolean" ? o.grain : undefined };
51
+ }
52
+ /** The ink of a drawing when a theme sets it, and the page it is made to read on. */
53
+ export const PIECE_INK = { light: "#20262d", dark: "#eef1f3" };
54
+ /** A drawing wrapped into a document, in a 100 by 100 box: the title, the outline's colour for the theme, the definitions and the body. */
55
+ export function wrapPiece(o) {
56
+ const colour = o.theme === "dark" ? PIECE_INK.dark : o.theme === "inherit" ? "" : PIECE_INK.light;
57
+ const auto = o.theme === "auto" ? `<style>@media(prefers-color-scheme:dark){svg{color:${PIECE_INK.dark}}}</style>` : "";
58
+ return (`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${o.box ?? "0 0 100 100"}" width="${o.size}" height="${o.size}" role="img"${colour === "" ? "" : ` color="${colour}"`}>` +
59
+ `<title>${escape(o.title)}</title>${o.desc === undefined ? "" : `<desc>${escape(o.desc)}</desc>`}${auto}${o.defs === undefined || o.defs === "" ? "" : `<defs>${o.defs}</defs>`}${o.body}</svg>`);
60
+ }
61
+ /** A piece's drawing function, with the `<title>` its options ask for: the Japanese name, a title of the caller's own, or none (the same rule as the emblems', in emblem.core.ts). */
62
+ export const labelled = (en, ja, draw) => (options) => {
63
+ const svg = draw(options);
64
+ const title = options?.title;
65
+ const custom = typeof title === "string" && title.trim() !== "";
66
+ if (title === false)
67
+ return svg.replace(/<title>[^<]*<\/title>/, "").replace(' role="img"', ' aria-hidden="true"');
68
+ if (!custom && options?.locale !== "ja")
69
+ return svg;
70
+ const text = custom ? title.trim().slice(0, 300) : ja;
71
+ const titled = svg.replace(/<title>[^<]*<\/title>/, () => `<title>${escape(text)}</title>`);
72
+ return custom ? titled : titled.replace(' role="img"', ' role="img" lang="ja"');
73
+ };
74
+ /** Degrees to radians, for a value that may be missing or not a number. */
75
+ export const radians = (degrees, fallback) => ((typeof degrees === "number" && Number.isFinite(degrees) ? degrees : fallback) * Math.PI) / 180;
76
+ /** The definition of the grain filter: noise lit from the upper left and multiplied into what it is applied to. It works in the box's own units, so the grain stays where it is while a ball turns. */
77
+ export function grainDef(id, f, a, seed = 3) {
78
+ return `<filter id="${id}n" x="0" y="0" width="100" height="100" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feTurbulence type="fractalNoise" baseFrequency="${f}" numOctaves="2" seed="${seed}" result="n"/><feDiffuseLighting in="n" lighting-color="#fff" surfaceScale="${a}" diffuseConstant="1.15" result="l"><feDistantLight azimuth="225" elevation="58"/></feDiffuseLighting><feBlend in="SourceGraphic" in2="l" mode="multiply"/><feComposite in2="SourceGraphic" operator="in"/></filter>`;
79
+ }
@@ -0,0 +1,5 @@
1
+ import type { Piece } from "./ball.core.ts";
2
+ import type { BallSpec } from "./ball.engine.ts";
3
+ export declare const BALL_CRICKET_RED: Piece<BallSpec>;
4
+ export declare const BALL_CRICKET_WHITE: Piece<BallSpec>;
5
+ export declare const BALL_CRICKET_PINK: Piece<BallSpec>;
@@ -0,0 +1,31 @@
1
+ // Cricket balls: a leather ball with one raised seam round its middle and three rows of stitches either side of it. Red for Tests, white for limited overs, pink for day-night matches.
2
+ // The stitching is drawn the way it is sewn: 78 stitches to a row, each square across the row.
3
+ import { defineBall } from "./ball.engine.js";
4
+ import { greatCircle, smallCircle } from "./ball.math.js";
5
+ import { stitches } from "./ball.stitch.js";
6
+ import { mix } from "./ball.core.js";
7
+ const ROWS = [0.1, 0.19, 0.28];
8
+ const AXIS = [0.2, 1, 0.1];
9
+ function cricket(id, en, ja, base, thread, size, shade) {
10
+ return defineBall({
11
+ id,
12
+ en,
13
+ ja,
14
+ size,
15
+ spec: {
16
+ view: { yaw: 20, pitch: 24, roll: -12 },
17
+ base,
18
+ mat: { gloss: 0.62, shade, grain: { f: 1.1, a: 0.16 } },
19
+ draw: (s, colour) => {
20
+ let out = s.seam(greatCircle(AXIS, 96), mix(colour, -0.12), 2.6, { closed: true });
21
+ const rows = ROWS.flatMap((r) => [r, -r]).map((lat) => smallCircle(AXIS, Math.PI / 2 - lat, 96));
22
+ out += s.strokes(rows.flatMap((row) => stitches(row, true, 78, 0.026)), thread, 0.75, { ink: false });
23
+ return out;
24
+ },
25
+ },
26
+ });
27
+ }
28
+ const SIZE = { extentMm: 72.1, diameterMm: 72.1, circumferenceMm: 226.5, massG: [156, 163], rule: "Laws of Cricket, Law 4 The Ball, 4.1 Weight and size (Size 1, Size 2, Size 3)", note: "Size 1 (men's). Diameter worked out from the middle of the circumference range. The Laws do not set a colour." };
29
+ export const BALL_CRICKET_RED = /* @__PURE__ */ cricket("ball:cricket-red", "Cricket ball, red", "クリケットボール(赤)", "#a9161e", "#f2e8d2", SIZE, "#2a0408");
30
+ export const BALL_CRICKET_WHITE = /* @__PURE__ */ cricket("ball:cricket-white", "Cricket ball, white", "クリケットボール(白)", "#f3f0e8", "#2a2a2a", SIZE, "#4a4a58");
31
+ export const BALL_CRICKET_PINK = /* @__PURE__ */ cricket("ball:cricket-pink", "Cricket ball, pink", "ピンクのクリケット球", "#e45a8c", "#2a2a2a", SIZE, "#4a0a22");
@@ -0,0 +1,3 @@
1
+ export declare const BALL_CURLING_STONE: import("./ball.core.ts").Piece<{
2
+ slices: number;
3
+ }>;
@@ -0,0 +1,46 @@
1
+ // Curling stone: a granite drum with a polished striking band round its belly, a narrow running ring under it with the concave recess inside (it shows when the stone is turned over), and a
2
+ // handle on top. The slices follow the stone's profile.
3
+ import { drawStack } from "./ball.stack.js";
4
+ import { defineObject } from "./ball.object.js";
5
+ import {} from "./ball.math.js";
6
+ import { num } from "./ball.core.js";
7
+ const GRANITE = "#8d929a";
8
+ const POLISHED = "#4d525b";
9
+ const HANDLE = "#d4202c";
10
+ export const BALL_CURLING_STONE = /* @__PURE__ */ defineObject({
11
+ id: "ball:curling-stone",
12
+ en: "Curling stone",
13
+ ja: "カーリングストーン",
14
+ size: { extentMm: 290.9, diameterMm: 290.9, thicknessMm: 114, circumferenceMm: 914, massG: [17240, 19960], rule: "World Curling The Rules of Curling, R2 Stones (a)-(j); R3(b) handle colour", note: "The largest stone the rule allows: a circumference of at most 914 mm and a height of at least 114 mm; the mass includes the handle." },
15
+ view: { yaw: 0, pitch: 30, roll: -6 },
16
+ model: { slices: 6 },
17
+ draw: (c) => drawStack(c, {
18
+ slices: [
19
+ { y0: -0.2, y1: -0.15, r: [0.74, 0.8], colour: POLISHED, outline: true },
20
+ { y0: -0.15, y1: -0.04, r: [0.8, 0.94], colour: GRANITE },
21
+ { y0: -0.04, y1: 0.08, r: 1, colour: POLISHED, outline: true },
22
+ { y0: 0.08, y1: 0.15, r: [1, 0.9], colour: GRANITE },
23
+ { y0: 0.15, y1: 0.2, r: [0.9, 0.78], colour: GRANITE, outline: true },
24
+ ],
25
+ top: "#9a9fa7",
26
+ bottom: "#6a6f78",
27
+ gloss: 0.5,
28
+ shade: "#000",
29
+ grain: { f: 1.9, a: 0.55 },
30
+ dish: { r: 0.74, colour: "#555a63" },
31
+ extra: (ctx) => {
32
+ // The handle: a post and a bar, a capsule in 3D (a thick line with round ends).
33
+ const post0 = ctx.at([0, 0.2, 0]), post1 = ctx.at([0, 0.34, 0]);
34
+ const a = [-0.42, 0.4, 0], b = [0.42, 0.4, 0];
35
+ const p = ctx.at(a), q = ctx.at(b);
36
+ const colour = ctx.opts.style === "line" ? "currentColor" : (ctx.opts.tint ?? HANDLE);
37
+ const line = ctx.opts.style === "line";
38
+ const w = (r) => (line ? Math.max(2.4, ctx.minWidth) : Math.max(92 * r, ctx.minWidth));
39
+ const stroke = (width) => `stroke="${colour}" stroke-width="${num(width, 2)}"`;
40
+ const post = `<path d="M${num(post0[0])} ${num(post0[1])}L${num(post1[0])} ${num(post1[1])}" ${stroke(w(0.075))} stroke-linecap="round" fill="none"/>`;
41
+ const bar = `<path d="M${num(p[0])} ${num(p[1])}L${num(q[0])} ${num(q[1])}" ${stroke(w(0.11))} stroke-linecap="round" fill="none"/>`;
42
+ const sheen = line ? "" : `<path d="M${num(p[0])} ${num(p[1] - 1.2)}L${num(q[0])} ${num(q[1] - 1.2)}" stroke="#fff" stroke-opacity=".35" stroke-width="${num(Math.max(0.8, 46 * 0.03), 2)}" stroke-linecap="round" fill="none"/>`;
43
+ return post + bar + sheen;
44
+ },
45
+ }),
46
+ });
@@ -0,0 +1 @@
1
+ export declare const BALL_DISCUS: import("./ball.core.ts").Piece<import("./ball.engine.ts").BallSpec>;
@@ -0,0 +1,24 @@
1
+ // Discus: a lens, thin at the rim, with a metal plate let into each face and a metal rim. Drawn as a flattened ellipsoid.
2
+ import { defineBall } from "./ball.engine.js";
3
+ import { greatCircle, smallCircle } from "./ball.math.js";
4
+ export const BALL_DISCUS = /* @__PURE__ */ defineBall({
5
+ id: "ball:discus",
6
+ en: "Discus",
7
+ ja: "円盤",
8
+ size: { extentMm: 220, diameterMm: 220, thicknessMm: 45, massG: [2000, 2000], rule: "World Athletics Technical Rules (C2.1), Rule 34 Discus Throw - 'The discus shall conform to the following specifications'", note: "Men's discus, 219 to 221 mm across the rim and 44 to 46 mm thick at the middle; 2 kg is a minimum." },
9
+ spec: {
10
+ axes: [1, 0.2, 1],
11
+ view: { yaw: 25, pitch: 52, roll: -12 },
12
+ base: "#3b3f48",
13
+ mat: { gloss: 0.7, shade: "#050608", grain: { f: 1.4, a: 0.12 } },
14
+ draw: (s) => {
15
+ let out = "";
16
+ for (const sign of [1, -1])
17
+ out += s.panel(smallCircle([0, sign, 0], 0.82, 72), "#b4bac3", { n: 1, ink: false });
18
+ for (const sign of [1, -1])
19
+ out += s.stroke(smallCircle([0, sign, 0], 0.82, 72), "#555b66", 0.7, { closed: true });
20
+ out += s.stroke(greatCircle([0, 1, 0], 96), "#cfd4dc", 1.6, { closed: true });
21
+ return out;
22
+ },
23
+ },
24
+ });