@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.
- package/CHANGELOG.md +61 -1
- package/LICENSES/README.md +4 -3
- package/NOTICE.md +54 -14
- package/README.md +251 -80
- package/dist/emblems/award/badge.d.ts +2 -0
- package/dist/emblems/award/badge.js +14 -0
- package/dist/emblems/award/crown.d.ts +2 -0
- package/dist/emblems/award/crown.js +15 -0
- package/dist/emblems/award/medal.d.ts +1 -1
- package/dist/emblems/award/medal.js +10 -15
- package/dist/emblems/award/shield.d.ts +2 -0
- package/dist/emblems/award/shield.js +11 -0
- package/dist/emblems/award/star.d.ts +2 -0
- package/dist/emblems/award/star.js +11 -0
- package/dist/emblems/ball/ball.afl.d.ts +1 -0
- package/dist/emblems/ball/ball.afl.js +24 -0
- package/dist/emblems/ball/ball.baseball.d.ts +1 -0
- package/dist/emblems/ball/ball.baseball.js +14 -0
- package/dist/emblems/ball/ball.basketball.d.ts +7 -0
- package/dist/emblems/ball/ball.basketball.js +32 -0
- package/dist/emblems/ball/ball.basketball3x3.d.ts +1 -0
- package/dist/emblems/ball/ball.basketball3x3.js +10 -0
- package/dist/emblems/ball/ball.basketball6.d.ts +1 -0
- package/dist/emblems/ball/ball.basketball6.js +10 -0
- package/dist/emblems/ball/ball.core.d.ts +111 -0
- package/dist/emblems/ball/ball.core.js +79 -0
- package/dist/emblems/ball/ball.cricket.d.ts +5 -0
- package/dist/emblems/ball/ball.cricket.js +31 -0
- package/dist/emblems/ball/ball.curlingstone.d.ts +3 -0
- package/dist/emblems/ball/ball.curlingstone.js +46 -0
- package/dist/emblems/ball/ball.discus.d.ts +1 -0
- package/dist/emblems/ball/ball.discus.js +24 -0
- package/dist/emblems/ball/ball.engine.d.ts +114 -0
- package/dist/emblems/ball/ball.engine.js +342 -0
- package/dist/emblems/ball/ball.family.dotted.d.ts +27 -0
- package/dist/emblems/ball/ball.family.dotted.js +20 -0
- package/dist/emblems/ball/ball.family.panelled.d.ts +7 -0
- package/dist/emblems/ball/ball.family.panelled.js +60 -0
- package/dist/emblems/ball/ball.family.prolate.d.ts +16 -0
- package/dist/emblems/ball/ball.family.prolate.js +29 -0
- package/dist/emblems/ball/ball.family.seamed.d.ts +31 -0
- package/dist/emblems/ball/ball.family.seamed.js +26 -0
- package/dist/emblems/ball/ball.fieldhockey.d.ts +1 -0
- package/dist/emblems/ball/ball.fieldhockey.js +15 -0
- package/dist/emblems/ball/ball.football.d.ts +3 -0
- package/dist/emblems/ball/ball.football.js +51 -0
- package/dist/emblems/ball/ball.gaelic.d.ts +2 -0
- package/dist/emblems/ball/ball.gaelic.js +30 -0
- package/dist/emblems/ball/ball.golf.d.ts +1 -0
- package/dist/emblems/ball/ball.golf.js +15 -0
- package/dist/emblems/ball/ball.hammer.d.ts +1 -0
- package/dist/emblems/ball/ball.hammer.js +31 -0
- package/dist/emblems/ball/ball.handball.d.ts +1 -0
- package/dist/emblems/ball/ball.handball.js +25 -0
- package/dist/emblems/ball/ball.index.d.ts +48 -0
- package/dist/emblems/ball/ball.index.js +103 -0
- package/dist/emblems/ball/ball.math.d.ts +38 -0
- package/dist/emblems/ball/ball.math.js +105 -0
- package/dist/emblems/ball/ball.object.d.ts +38 -0
- package/dist/emblems/ball/ball.object.js +20 -0
- package/dist/emblems/ball/ball.padel.d.ts +1 -0
- package/dist/emblems/ball/ball.padel.js +13 -0
- package/dist/emblems/ball/ball.pickleball.d.ts +2 -0
- package/dist/emblems/ball/ball.pickleball.js +26 -0
- package/dist/emblems/ball/ball.polyhedra.d.ts +15 -0
- package/dist/emblems/ball/ball.polyhedra.js +63 -0
- package/dist/emblems/ball/ball.puck.d.ts +3 -0
- package/dist/emblems/ball/ball.puck.js +22 -0
- package/dist/emblems/ball/ball.roundnet.d.ts +1 -0
- package/dist/emblems/ball/ball.roundnet.js +15 -0
- package/dist/emblems/ball/ball.rugby.d.ts +1 -0
- package/dist/emblems/ball/ball.rugby.js +35 -0
- package/dist/emblems/ball/ball.sepaktakraw.d.ts +1 -0
- package/dist/emblems/ball/ball.sepaktakraw.js +48 -0
- package/dist/emblems/ball/ball.shuttlecock.d.ts +6 -0
- package/dist/emblems/ball/ball.shuttlecock.js +93 -0
- package/dist/emblems/ball/ball.sliotar.d.ts +1 -0
- package/dist/emblems/ball/ball.sliotar.js +14 -0
- package/dist/emblems/ball/ball.smooth.d.ts +4 -0
- package/dist/emblems/ball/ball.smooth.js +51 -0
- package/dist/emblems/ball/ball.soccer.d.ts +2 -0
- package/dist/emblems/ball/ball.soccer.js +54 -0
- package/dist/emblems/ball/ball.softball.d.ts +1 -0
- package/dist/emblems/ball/ball.softball.js +14 -0
- package/dist/emblems/ball/ball.squash.d.ts +7 -0
- package/dist/emblems/ball/ball.squash.js +27 -0
- package/dist/emblems/ball/ball.stack.d.ts +48 -0
- package/dist/emblems/ball/ball.stack.js +127 -0
- package/dist/emblems/ball/ball.stitch.d.ts +10 -0
- package/dist/emblems/ball/ball.stitch.js +59 -0
- package/dist/emblems/ball/ball.tennis.d.ts +1 -0
- package/dist/emblems/ball/ball.tennis.js +13 -0
- package/dist/emblems/ball/ball.teqball.d.ts +1 -0
- package/dist/emblems/ball/ball.teqball.js +27 -0
- package/dist/emblems/ball/ball.volleyball.d.ts +3 -0
- package/dist/emblems/ball/ball.volleyball.js +56 -0
- package/dist/emblems/ball/ball.waterpolo.d.ts +1 -0
- package/dist/emblems/ball/ball.waterpolo.js +31 -0
- package/dist/emblems/crest/diamond.d.ts +2 -0
- package/dist/emblems/crest/diamond.js +18 -0
- package/dist/emblems/crest/pennant.d.ts +2 -0
- package/dist/emblems/crest/pennant.js +18 -0
- package/dist/emblems/crest/roundel.d.ts +2 -0
- package/dist/emblems/crest/roundel.js +18 -0
- package/dist/emblems/crest/shield.d.ts +2 -0
- package/dist/emblems/crest/shield.js +17 -0
- package/dist/emblems/emblem.api.d.ts +77 -9
- package/dist/emblems/emblem.api.js +56 -10
- package/dist/emblems/emblem.compose.d.ts +31 -0
- package/dist/emblems/emblem.compose.js +91 -0
- package/dist/emblems/emblem.core.d.ts +89 -7
- package/dist/emblems/emblem.core.js +85 -11
- package/dist/emblems/emblem.descriptions.d.ts +7 -0
- package/dist/emblems/emblem.descriptions.js +60 -0
- package/dist/emblems/emblem.display.d.ts +75 -0
- package/dist/emblems/emblem.display.js +214 -0
- package/dist/emblems/emblem.engrave.d.ts +50 -0
- package/dist/emblems/emblem.engrave.js +145 -0
- package/dist/emblems/emblem.equipment.d.ts +24 -0
- package/dist/emblems/emblem.equipment.js +57 -0
- package/dist/emblems/emblem.flip.d.ts +10 -0
- package/dist/emblems/emblem.flip.js +45 -0
- package/dist/emblems/emblem.ids.d.ts +44 -30
- package/dist/emblems/emblem.ids.js +51 -17
- package/dist/emblems/emblem.lathe.d.ts +62 -0
- package/dist/emblems/emblem.lathe.js +426 -0
- package/dist/emblems/emblem.medal.d.ts +6 -0
- package/dist/emblems/emblem.medal.js +38 -0
- package/dist/emblems/emblem.pennant.d.ts +3 -0
- package/dist/emblems/emblem.pennant.js +79 -0
- package/dist/emblems/emblem.registry.js +162 -4
- package/dist/emblems/emblem.shapes.d.ts +48 -12
- package/dist/emblems/emblem.shapes.js +138 -31
- package/dist/emblems/emblem.sprite.d.ts +38 -0
- package/dist/emblems/emblem.sprite.js +65 -0
- package/dist/emblems/emblem.uri.d.ts +22 -0
- package/dist/emblems/emblem.uri.js +29 -0
- package/dist/emblems/gear/gear.badmintonracket.d.ts +1 -0
- package/dist/emblems/gear/gear.badmintonracket.js +19 -0
- package/dist/emblems/gear/gear.baseballglove.d.ts +1 -0
- package/dist/emblems/gear/gear.baseballglove.js +21 -0
- package/dist/emblems/gear/gear.budo.d.ts +17 -0
- package/dist/emblems/gear/gear.budo.js +60 -0
- package/dist/emblems/gear/gear.core.d.ts +64 -0
- package/dist/emblems/gear/gear.core.js +127 -0
- package/dist/emblems/gear/gear.cricketbat.d.ts +1 -0
- package/dist/emblems/gear/gear.cricketbat.js +17 -0
- package/dist/emblems/gear/gear.field.d.ts +6 -0
- package/dist/emblems/gear/gear.field.js +81 -0
- package/dist/emblems/gear/gear.fieldhockeystick.d.ts +1 -0
- package/dist/emblems/gear/gear.fieldhockeystick.js +16 -0
- package/dist/emblems/gear/gear.footballhelmet.d.ts +1 -0
- package/dist/emblems/gear/gear.footballhelmet.js +16 -0
- package/dist/emblems/gear/gear.goaliemask.d.ts +1 -0
- package/dist/emblems/gear/gear.goaliemask.js +23 -0
- package/dist/emblems/gear/gear.goalnet.d.ts +1 -0
- package/dist/emblems/gear/gear.goalnet.js +25 -0
- package/dist/emblems/gear/gear.hockeystick.d.ts +1 -0
- package/dist/emblems/gear/gear.hockeystick.js +15 -0
- package/dist/emblems/gear/gear.index.d.ts +22 -0
- package/dist/emblems/gear/gear.index.js +49 -0
- package/dist/emblems/gear/gear.kendo.d.ts +2 -0
- package/dist/emblems/gear/gear.kendo.js +41 -0
- package/dist/emblems/gear/gear.kyudo.d.ts +2 -0
- package/dist/emblems/gear/gear.kyudo.js +31 -0
- package/dist/emblems/gear/gear.lacrossestick.d.ts +1 -0
- package/dist/emblems/gear/gear.lacrossestick.js +26 -0
- package/dist/emblems/gear/gear.rackets.d.ts +4 -0
- package/dist/emblems/gear/gear.rackets.js +60 -0
- package/dist/emblems/gear/gear.skates.d.ts +3 -0
- package/dist/emblems/gear/gear.skates.js +39 -0
- package/dist/emblems/gear/gear.sticks.d.ts +3 -0
- package/dist/emblems/gear/gear.sticks.js +34 -0
- package/dist/emblems/gear/gear.sumo.d.ts +2 -0
- package/dist/emblems/gear/gear.sumo.js +43 -0
- package/dist/emblems/gear/gear.tabletennispaddle.d.ts +1 -0
- package/dist/emblems/gear/gear.tabletennispaddle.js +16 -0
- package/dist/emblems/gear/gear.tennisracket.d.ts +1 -0
- package/dist/emblems/gear/gear.tennisracket.js +17 -0
- package/dist/emblems/gear/gear.track.d.ts +4 -0
- package/dist/emblems/gear/gear.track.js +45 -0
- package/dist/emblems/gear/gear.water.d.ts +2 -0
- package/dist/emblems/gear/gear.water.js +25 -0
- package/dist/emblems/medal/bronze.d.ts +2 -0
- package/dist/emblems/medal/bronze.js +4 -0
- package/dist/emblems/medal/gold.d.ts +2 -0
- package/dist/emblems/medal/gold.js +4 -0
- package/dist/emblems/medal/place-1.d.ts +2 -0
- package/dist/emblems/medal/place-1.js +4 -0
- package/dist/emblems/medal/place-2.d.ts +2 -0
- package/dist/emblems/medal/place-2.js +4 -0
- package/dist/emblems/medal/place-3.d.ts +2 -0
- package/dist/emblems/medal/place-3.js +4 -0
- package/dist/emblems/medal/silver.d.ts +2 -0
- package/dist/emblems/medal/silver.js +4 -0
- package/dist/emblems/pennant/championship.d.ts +2 -0
- package/dist/emblems/pennant/championship.js +4 -0
- package/dist/emblems/sport/afl.d.ts +2 -0
- package/dist/emblems/sport/afl.js +12 -0
- package/dist/emblems/sport/artisticswimming.d.ts +2 -0
- package/dist/emblems/sport/artisticswimming.js +16 -0
- package/dist/emblems/sport/athletics.d.ts +2 -0
- package/dist/emblems/sport/athletics.js +12 -0
- package/dist/emblems/sport/badminton.d.ts +2 -0
- package/dist/emblems/sport/badminton.js +13 -0
- package/dist/emblems/sport/cfl.d.ts +2 -0
- package/dist/emblems/sport/cfl.js +5 -0
- package/dist/emblems/sport/cricket.d.ts +2 -0
- package/dist/emblems/sport/cricket.js +14 -0
- package/dist/emblems/sport/curling.d.ts +2 -0
- package/dist/emblems/sport/curling.js +14 -0
- package/dist/emblems/sport/diving.d.ts +2 -0
- package/dist/emblems/sport/diving.js +18 -0
- package/dist/emblems/sport/fieldhockey.d.ts +2 -0
- package/dist/emblems/sport/fieldhockey.js +11 -0
- package/dist/emblems/sport/gaelic.d.ts +2 -0
- package/dist/emblems/sport/gaelic.js +11 -0
- package/dist/emblems/sport/handball.d.ts +2 -0
- package/dist/emblems/sport/handball.js +15 -0
- package/dist/emblems/sport/ifaf.d.ts +2 -0
- package/dist/emblems/sport/ifaf.js +5 -0
- package/dist/emblems/sport/judo.d.ts +2 -0
- package/dist/emblems/sport/judo.js +13 -0
- package/dist/emblems/sport/karate.d.ts +2 -0
- package/dist/emblems/sport/karate.js +13 -0
- package/dist/emblems/sport/kendo.d.ts +2 -0
- package/dist/emblems/sport/kendo.js +14 -0
- package/dist/emblems/sport/kyudo.d.ts +2 -0
- package/dist/emblems/sport/kyudo.js +15 -0
- package/dist/emblems/sport/lacrosse.d.ts +2 -0
- package/dist/emblems/sport/lacrosse.js +13 -0
- package/dist/emblems/sport/mlb.d.ts +2 -0
- package/dist/emblems/sport/mlb.js +28 -0
- package/dist/emblems/sport/nba.d.ts +2 -0
- package/dist/emblems/sport/nba.js +12 -0
- package/dist/emblems/sport/netball.d.ts +2 -0
- package/dist/emblems/sport/netball.js +14 -0
- package/dist/emblems/sport/nfl.d.ts +3 -0
- package/dist/emblems/sport/nfl.js +15 -0
- package/dist/emblems/sport/nhl.d.ts +2 -0
- package/dist/emblems/sport/nhl.js +13 -0
- package/dist/emblems/sport/padel.d.ts +2 -0
- package/dist/emblems/sport/padel.js +14 -0
- package/dist/emblems/sport/pickleball.d.ts +2 -0
- package/dist/emblems/sport/pickleball.js +13 -0
- package/dist/emblems/sport/racquetball.d.ts +2 -0
- package/dist/emblems/sport/racquetball.js +13 -0
- package/dist/emblems/sport/roundnet.d.ts +2 -0
- package/dist/emblems/sport/roundnet.js +15 -0
- package/dist/emblems/sport/rugby.d.ts +2 -0
- package/dist/emblems/sport/rugby.js +12 -0
- package/dist/emblems/sport/sepaktakraw.d.ts +2 -0
- package/dist/emblems/sport/sepaktakraw.js +11 -0
- package/dist/emblems/sport/skating.d.ts +2 -0
- package/dist/emblems/sport/skating.js +14 -0
- package/dist/emblems/sport/soccer.d.ts +2 -0
- package/dist/emblems/sport/soccer.js +31 -0
- package/dist/emblems/sport/squash.d.ts +2 -0
- package/dist/emblems/sport/squash.js +15 -0
- package/dist/emblems/sport/sumo.d.ts +2 -0
- package/dist/emblems/sport/sumo.js +15 -0
- package/dist/emblems/sport/swimming.d.ts +2 -0
- package/dist/emblems/sport/swimming.js +15 -0
- package/dist/emblems/sport/tabletennis.d.ts +2 -0
- package/dist/emblems/sport/tabletennis.js +12 -0
- package/dist/emblems/sport/tennis.d.ts +2 -0
- package/dist/emblems/sport/tennis.js +15 -0
- package/dist/emblems/sport/teqball.d.ts +2 -0
- package/dist/emblems/sport/teqball.js +15 -0
- package/dist/emblems/sport/volleyball.d.ts +2 -0
- package/dist/emblems/sport/volleyball.js +25 -0
- package/dist/emblems/sport/waterpolo.d.ts +2 -0
- package/dist/emblems/sport/waterpolo.js +15 -0
- package/dist/emblems/trophy/banner.d.ts +2 -0
- package/dist/emblems/trophy/banner.js +20 -0
- package/dist/emblems/trophy/baseball.d.ts +2 -0
- package/dist/emblems/trophy/baseball.js +15 -0
- package/dist/emblems/trophy/basketball.d.ts +2 -0
- package/dist/emblems/trophy/basketball.js +17 -0
- package/dist/emblems/trophy/belt.d.ts +2 -0
- package/dist/emblems/trophy/belt.js +17 -0
- package/dist/emblems/trophy/bowl.d.ts +2 -0
- package/dist/emblems/trophy/bowl.js +8 -0
- package/dist/emblems/trophy/canadian-bowl.d.ts +2 -0
- package/dist/emblems/trophy/canadian-bowl.js +23 -0
- package/dist/emblems/trophy/championship-banner.d.ts +2 -0
- package/dist/emblems/trophy/championship-banner.js +67 -0
- package/dist/emblems/trophy/cricket-urn.d.ts +2 -0
- package/dist/emblems/trophy/cricket-urn.js +23 -0
- package/dist/emblems/trophy/cup.d.ts +2 -0
- package/dist/emblems/trophy/cup.js +16 -0
- package/dist/emblems/trophy/football.d.ts +2 -0
- package/dist/emblems/trophy/football.js +11 -0
- package/dist/emblems/trophy/globe.d.ts +2 -0
- package/dist/emblems/trophy/globe.js +9 -0
- package/dist/emblems/trophy/hockey-cup.d.ts +2 -0
- package/dist/emblems/trophy/hockey-cup.js +22 -0
- package/dist/emblems/trophy/laurel.d.ts +2 -0
- package/dist/emblems/trophy/laurel.js +40 -0
- package/dist/emblems/trophy/lidded-cup.d.ts +2 -0
- package/dist/emblems/trophy/lidded-cup.js +21 -0
- package/dist/emblems/trophy/plaque.d.ts +2 -0
- package/dist/emblems/trophy/plaque.js +17 -0
- package/dist/emblems/trophy/ring.d.ts +2 -0
- package/dist/emblems/trophy/ring.js +30 -0
- package/dist/emblems/trophy/rosette.d.ts +2 -0
- package/dist/emblems/trophy/rosette.js +27 -0
- package/dist/emblems/trophy/rugby-cup.d.ts +2 -0
- package/dist/emblems/trophy/rugby-cup.js +23 -0
- package/dist/emblems/trophy/salver.d.ts +2 -0
- package/dist/emblems/trophy/salver.js +9 -0
- package/dist/emblems/trophy/soccer-ball.d.ts +2 -0
- package/dist/emblems/trophy/soccer-ball.js +9 -0
- package/dist/emblems/trophy/soccer-globe.d.ts +2 -0
- package/dist/emblems/trophy/soccer-globe.js +18 -0
- package/dist/emblems/trophy/sumo-cup.d.ts +2 -0
- package/dist/emblems/trophy/sumo-cup.js +28 -0
- package/dist/emblems/trophy/tennis-cup.d.ts +2 -0
- package/dist/emblems/trophy/tennis-cup.js +24 -0
- package/dist/emblems/trophy/tennis-plate.d.ts +2 -0
- package/dist/emblems/trophy/tennis-plate.js +16 -0
- package/dist/emblems-entry.d.ts +20 -7
- package/dist/emblems-entry.js +8 -2
- package/dist/index.d.ts +131 -1
- package/dist/index.js +131 -3
- package/dist/turn-control.d.ts +101 -0
- package/dist/turn-control.js +363 -0
- package/dist/turn-entry.d.ts +2 -0
- package/dist/turn-entry.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +33 -7
- package/LICENSES/Apache-2.0.txt +0 -55
- package/LICENSES/CC-BY-3.0.md +0 -15
- package/dist/emblems/ball/soccer.d.ts +0 -2
- package/dist/emblems/ball/soccer.js +0 -9
- package/dist/emblems/emblem.ball.d.ts +0 -28
- package/dist/emblems/emblem.ball.js +0 -70
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// A baseball glove with a ball, drawn for this package: a leather mitt of four fingers and a thumb round a deep pocket, a laced web, a wrist strap and a ball in the pocket.
|
|
2
|
+
import { capsule, circle, drawn, ellipse } from "./gear.core.js";
|
|
3
|
+
export const GEAR_BASEBALL_GLOVE = /* @__PURE__ */ drawn("gear:baseball-glove", "Baseball glove", "野球のグラブ", {
|
|
4
|
+
main: "#b5702f",
|
|
5
|
+
accent: "#e6cfa0",
|
|
6
|
+
parts: [
|
|
7
|
+
{ d: capsule(17, 30, 12.6, 16, 9.6), fill: "$main", cyl: 0.8, shade: 0.3 },
|
|
8
|
+
{ d: capsule(28, 28, 26.6, 11.6, 10), fill: "$main", cyl: 0.8, shade: 0.3 },
|
|
9
|
+
{ d: capsule(39, 28.4, 40.6, 12.6, 9.8), fill: "$main", cyl: 0.8, shade: 0.3 },
|
|
10
|
+
{ d: capsule(48, 32, 52.6, 19.4, 9), fill: "$main", cyl: 0.8, shade: 0.3 },
|
|
11
|
+
{ d: capsule(12, 42, 5.8, 34.6, 10), fill: "$main", cyl: 0.8, shade: 0.3 },
|
|
12
|
+
{ d: "M9 34C7 47 16 59 32 59C48 59 58 49 56 34C53 25 45 23 36 23C27 23 13 23 9 34Z", fill: "$main", shade: 0.6 },
|
|
13
|
+
{ d: ellipse(32, 42, 15.4, 12.4), fill: "#8f5220", stroke: "#6a3a14", shade: 0, line: "stroke" },
|
|
14
|
+
{ d: "M13.4 24.2L17 29.4M23.4 20L24.6 26M34 20.6L34 26M45 22.6L42.4 27.4M8.6 36L13.4 36.6", fill: "none", stroke: "$accent", w: 1.4, line: "none" },
|
|
15
|
+
{ d: "M20 55.6Q32 61 45 55.4", fill: "none", stroke: "$accent", w: 1.6, line: "none" },
|
|
16
|
+
{ d: "M22 56.4L44 56.6L43.4 60.8Q32 63.4 23 60.8Z", fill: "#7a4318", stroke: "#4a280c", shade: 0.3, line: "none" },
|
|
17
|
+
{ d: circle(32, 41, 7.8), fill: "#f6f3ec", stroke: "#8f98a3", shade: 0.9 },
|
|
18
|
+
{ d: "M27.2 35.4Q31 41 27.2 46.6M36.8 35.4Q33 41 36.8 46.6", fill: "none", stroke: "#c4262e", w: 1, line: "none" },
|
|
19
|
+
{ d: "M8.6 35Q9.6 29 13 26.4", fill: "none", stroke: "#fff", w: 1.6, op: 0.4, line: "none", fx: true },
|
|
20
|
+
],
|
|
21
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PieceOptions } from "../ball/ball.core.ts";
|
|
2
|
+
/** The colours of a judo belt from the first rank to the black belt, in order, which `tint` takes. */
|
|
3
|
+
export declare const OBI_RANKS: {
|
|
4
|
+
readonly white: "#f2efe8";
|
|
5
|
+
readonly yellow: "#f2c21b";
|
|
6
|
+
readonly orange: "#ee8a1c";
|
|
7
|
+
readonly green: "#2f9a52";
|
|
8
|
+
readonly blue: "#2b64c8";
|
|
9
|
+
readonly brown: "#7a4a24";
|
|
10
|
+
readonly black: "#1f2228";
|
|
11
|
+
};
|
|
12
|
+
export type ObiRank = keyof typeof OBI_RANKS;
|
|
13
|
+
export declare const GEAR_JUDOGI: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
14
|
+
export declare const GEAR_KARATE_GI: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
15
|
+
export declare const GEAR_OBI: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
16
|
+
/** The belt of a rank, `"white"` to `"black"`: the same as `GEAR_OBI.svg({ ...options, tint: OBI_RANKS[rank] })`. An unknown rank is the black belt. */
|
|
17
|
+
export declare const obi: (rank: ObiRank, options?: PieceOptions) => string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { drawn, seg } from "./gear.core.js";
|
|
2
|
+
/** The colours of a judo belt from the first rank to the black belt, in order, which `tint` takes. */
|
|
3
|
+
export const OBI_RANKS = {
|
|
4
|
+
white: "#f2efe8",
|
|
5
|
+
yellow: "#f2c21b",
|
|
6
|
+
orange: "#ee8a1c",
|
|
7
|
+
green: "#2f9a52",
|
|
8
|
+
blue: "#2b64c8",
|
|
9
|
+
brown: "#7a4a24",
|
|
10
|
+
black: "#1f2228",
|
|
11
|
+
};
|
|
12
|
+
const CLOTH = "#f4f2ec";
|
|
13
|
+
const EDGE = "#7b8491";
|
|
14
|
+
/** A belt tied at the waist (a flat band, a knot, two ends hanging) from `x0` to `x1` at height `y`. */
|
|
15
|
+
const tied = (x0, x1, y) => {
|
|
16
|
+
const c = (x0 + x1) / 2;
|
|
17
|
+
return `M${x0} ${y}H${x1}V${y + 4}H${x0}zM${c - 3} ${y - 0.6}h6v5.2h-6zM${c - 1.4} ${y + 4.6}L${c - 4.6} ${y + 14}h3.4L${c + 0.4} ${y + 4.6}zM${c + 1.4} ${y + 4.6}L${c + 4.8} ${y + 13.4}h-3.4L${c - 0.4} ${y + 4.6}z`;
|
|
18
|
+
};
|
|
19
|
+
export const GEAR_JUDOGI = /* @__PURE__ */ drawn("gear:judogi", "Judo suit", "柔道衣", {
|
|
20
|
+
main: CLOTH,
|
|
21
|
+
accent: "#1f2228",
|
|
22
|
+
parts: [
|
|
23
|
+
{ d: "M22.4 44.4H31.6L30.8 61H21.2ZM32.4 44.4H41.6L42.8 61H33.2Z", fill: "$main", cyl: 0.6, shade: 0.3 },
|
|
24
|
+
{ d: "M23.6 9.4L8 36.4Q6.6 39.4 9.4 41.4L14.6 45Q17.4 46.4 19 43.4L29 27.4Z", fill: "$main", cyl: 0.5, shade: 0.4 },
|
|
25
|
+
{ d: "M40.4 9.4L56 36.4Q57.4 39.4 54.6 41.4L49.4 45Q46.6 46.4 45 43.4L35 27.4Z", fill: "$main", cyl: 0.5, shade: 0.4 },
|
|
26
|
+
{ d: "M23.6 9.4Q32 7 40.4 9.4L45 27.4V46H19V27.4Z", fill: "$main", cyl: 0.6, shade: 0.4 },
|
|
27
|
+
{ d: "M26 8.6L35.4 31M38 8.6L28.6 31", fill: "none", stroke: "#cfc8b8", w: 3.6, line: "none" },
|
|
28
|
+
{ d: "M26 8.6L35.4 31M38 8.6L28.6 31", fill: "none", stroke: "#8f98a3", w: 0.7, line: "stroke" },
|
|
29
|
+
{ d: "M29.2 9.4Q32 12 34.8 9.4L32 16Z", fill: "#3a414b", stroke: "none", op: 0.5, line: "none", fx: true },
|
|
30
|
+
{ d: "M13 31L19.4 39.4M11.4 34.4L17.6 42.4M47 31L40.6 39.4M48.6 34.4L42.4 42.4", fill: "none", stroke: "#a9b1bb", w: 0.7, line: "none" },
|
|
31
|
+
{ d: tied(19, 45, 40.4), fill: "$accent", stroke: EDGE, cyl: 0.8, shade: 0.2 },
|
|
32
|
+
],
|
|
33
|
+
});
|
|
34
|
+
export const GEAR_KARATE_GI = /* @__PURE__ */ drawn("gear:karate-gi", "Karate suit", "空手衣", {
|
|
35
|
+
main: CLOTH,
|
|
36
|
+
accent: "#1f2228",
|
|
37
|
+
parts: [
|
|
38
|
+
{ d: "M20.4 46H31.4L28.4 61H17.8ZM32.6 46H43.6L46.2 61H35.6Z", fill: "$main", cyl: 0.6, shade: 0.3 },
|
|
39
|
+
{ d: "M22.6 9.6L9 27.4Q7 30.4 9.6 32.4L13 34.6Q15.6 36.6 17.6 33.6L26 22Z", fill: "$main", cyl: 0.5, shade: 0.4 },
|
|
40
|
+
{ d: "M41.4 9.6L55 27.4Q57 30.4 54.4 32.4L51 34.6Q48.4 36.6 46.4 33.6L38 22Z", fill: "$main", cyl: 0.5, shade: 0.4 },
|
|
41
|
+
{ d: "M22.6 9.6Q32 7.4 41.4 9.6L44.8 28V48H19.2V28Z", fill: "$main", cyl: 0.6, shade: 0.4 },
|
|
42
|
+
{ d: "M25.4 8.8L37 37M38.6 8.8L27 37", fill: "none", stroke: "#8f98a3", w: 0.9, line: "stroke" },
|
|
43
|
+
{ d: "M28.8 9.6Q32 13 35.2 9.6L32 19Z", fill: "#3a414b", stroke: "none", op: 0.5, line: "none", fx: true },
|
|
44
|
+
{ d: tied(19.2, 44.8, 40), fill: "$accent", stroke: EDGE, cyl: 0.8, shade: 0.2 },
|
|
45
|
+
],
|
|
46
|
+
});
|
|
47
|
+
export const GEAR_OBI = /* @__PURE__ */ drawn("gear:obi", "Belt", "武道の帯", {
|
|
48
|
+
main: OBI_RANKS.black,
|
|
49
|
+
parts: [
|
|
50
|
+
{ d: "M35 34L24.4 57.6L30 61L40.6 36Z", fill: "$main", stroke: EDGE, cyl: 0.7, shade: 0.3 },
|
|
51
|
+
{ d: "M29 34L40.4 57.6L46 55.4L34.6 34Z", fill: "$main", stroke: EDGE, cyl: 0.7, shade: 0.3 },
|
|
52
|
+
{ d: seg(27.4, 55.6, 31.4, 58.4) + seg(38.4, 54.6, 42.4, 53), fill: "none", stroke: "$accent", w: 1.6, line: "none" },
|
|
53
|
+
{ d: "M2.6 23.4Q32 27.6 61.4 23.4V34.4Q32 38.6 2.6 34.4Z", fill: "$main", stroke: EDGE, cyl: 0.7, shade: 0.3 },
|
|
54
|
+
{ d: "M2.6 27.2Q32 31.4 61.4 27.2", fill: "none", stroke: "$accent", w: 1.4, line: "none" },
|
|
55
|
+
{ d: "M25.4 22.4h13.2v15.6H25.4z", fill: "$main", stroke: EDGE, cyl: 1, shade: 0.3 },
|
|
56
|
+
{ d: "M25.4 27.6h13.2M25.4 32.6h13.2", fill: "none", stroke: "$accent", w: 0.8, line: "none" },
|
|
57
|
+
],
|
|
58
|
+
});
|
|
59
|
+
/** The belt of a rank, `"white"` to `"black"`: the same as `GEAR_OBI.svg({ ...options, tint: OBI_RANKS[rank] })`. An unknown rank is the black belt. */
|
|
60
|
+
export const obi = (rank, options) => GEAR_OBI.svg({ ...options, tint: Object.hasOwn(OBI_RANKS, rank) ? OBI_RANKS[rank] : OBI_RANKS.black });
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type Piece, type PieceOptions, type PieceSize, type PieceSource } from "../ball/ball.core.ts";
|
|
2
|
+
/** One part of a drawn piece. */
|
|
3
|
+
export interface Part {
|
|
4
|
+
/** The path (in the piece's box). */
|
|
5
|
+
d: string;
|
|
6
|
+
/** The fill, a colour, `none`, or `$main` or `$accent` (the colours `tint` and `accent` replace). */
|
|
7
|
+
fill?: string;
|
|
8
|
+
/** The stroke colour; by default a darker fill. */
|
|
9
|
+
stroke?: string;
|
|
10
|
+
/** The stroke width (0.9 by default for an outline in colour, and a part with no fill is drawn as a line this wide in both styles). */
|
|
11
|
+
w?: number;
|
|
12
|
+
/** How the part reads in the line style: `stroke` (its outline, the default), `ink` (filled solid) or `none` (left out). */
|
|
13
|
+
line?: "stroke" | "ink" | "none";
|
|
14
|
+
/** A transform for the part. */
|
|
15
|
+
t?: string;
|
|
16
|
+
/** How much light and shade the part takes along a diagonal, 0 (flat) to 1 (the default). */
|
|
17
|
+
shade?: number;
|
|
18
|
+
/** How much a part is shaded across its own width, as a round shaft is (a bright band, a dark side), 0 to 1. Drawn in the part's own frame, so it follows the part's transform. */
|
|
19
|
+
cyl?: number;
|
|
20
|
+
/** A highlight or a shadow laid on a part: drawn in the metal style only, never flat and never as a line. */
|
|
21
|
+
fx?: boolean;
|
|
22
|
+
/** Opacity of the part in colour. */
|
|
23
|
+
op?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface GearSpec {
|
|
26
|
+
/** The box, `0 0 64 64` by default. */
|
|
27
|
+
box?: string;
|
|
28
|
+
/** What `tint` replaces. */
|
|
29
|
+
main: string;
|
|
30
|
+
/** What `accent` replaces. */
|
|
31
|
+
accent?: string;
|
|
32
|
+
parts: readonly Part[];
|
|
33
|
+
}
|
|
34
|
+
export interface GearDef<Model = unknown> {
|
|
35
|
+
id: string;
|
|
36
|
+
en: string;
|
|
37
|
+
ja: string;
|
|
38
|
+
source: PieceSource;
|
|
39
|
+
size?: PieceSize;
|
|
40
|
+
model: Model;
|
|
41
|
+
draw: (options: PieceOptions | undefined) => string;
|
|
42
|
+
}
|
|
43
|
+
/** A piece of gear from its drawing function. Turned, it flips like a coin (`flipSvg`): the front, then its mirrored back, with a thin rim. */
|
|
44
|
+
export declare function defineGear<Model>(def: GearDef<Model>): Piece<Model>;
|
|
45
|
+
/** A drawn piece: its parts become a document in the metal, color or line style, whole or turned (the turn is `flipSvg`'s). */
|
|
46
|
+
export declare function drawGear(id: string, title: string, spec: GearSpec, options: PieceOptions | undefined): string;
|
|
47
|
+
/** The pieces' drawing helpers: shapes written as path strings. */
|
|
48
|
+
export declare const rect: (x: number, y: number, w: number, h: number, r?: number) => string;
|
|
49
|
+
export declare const ellipse: (cx: number, cy: number, rx: number, ry: number) => string;
|
|
50
|
+
export declare const circle: (cx: number, cy: number, r: number) => string;
|
|
51
|
+
export declare const poly: (...pts: Array<[number, number]>) => string;
|
|
52
|
+
/** A line from one point to another, as a path (to be drawn with a stroke width). */
|
|
53
|
+
export declare const seg: (x1: number, y1: number, x2: number, y2: number) => string;
|
|
54
|
+
/** A capsule: a thick line with round ends, as a closed path (so it has an outline in the line style). */
|
|
55
|
+
export declare function capsule(x1: number, y1: number, x2: number, y2: number, w: number): string;
|
|
56
|
+
/** A piece we drew: the common case of `defineGear`. */
|
|
57
|
+
export declare function drawn(id: string, en: string, ja: string, spec: GearSpec, size?: PieceSize): Piece<GearSpec>;
|
|
58
|
+
/** The strings of a racket's head: a grid of lines clipped to an ellipse. */
|
|
59
|
+
export declare function strings(cx: number, cy: number, rx: number, ry: number, step: number): string;
|
|
60
|
+
/**
|
|
61
|
+
* A shape of varying width along a curve, as a closed path: a cubic Bezier from `a` to `b` through the controls `c1` and `c2`, drawn `width(t)` wide at the fraction `t` of the way along. A bow, a blade or a feather
|
|
62
|
+
* is one of these. `steps` is how many segments each side has.
|
|
63
|
+
*/
|
|
64
|
+
export declare function swell(a: readonly [number, number], c1: readonly [number, number], c2: readonly [number, number], b: readonly [number, number], width: (t: number) => number, steps?: number): string;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// Gear: pieces of equipment drawn flat from a list of parts (a path, a colour, how it reads as a line), in the same three styles as the trophies: `metal` (a fill shaded across and along, edged in a darker tone
|
|
2
|
+
// of itself), `color` (flat fills with the same edges) and `line` (`currentColor`). A piece turns like a coin through the one turn every flat drawing shares (emblem.flip.ts): squeezed by the cosine of the yaw,
|
|
3
|
+
// its back mirrored, with a thin rim. Self-contained: it imports only the shared option and colour helpers of the ball folder and the coin-flip turn.
|
|
4
|
+
import { flipSvg } from "../emblem.flip.js";
|
|
5
|
+
import { escape, hashOf, labelled, mix, num, readColour, resolveOptions, wrapPiece } from "../ball/ball.core.js";
|
|
6
|
+
/** A turn in degrees, as a finite number (0 for anything else). */
|
|
7
|
+
const turn = (value) => (typeof value === "number" && Number.isFinite(value) ? value % 360 : 0);
|
|
8
|
+
/** A piece of gear turned like a coin: a flat cut-out with a front, a mirrored back and a thin rim. */
|
|
9
|
+
const flip = (draw) => (o) => flipSvg(draw(o), { yaw: turn(o?.yaw), pitch: turn(o?.pitch), line: o?.style === "line", thick: 0.025 });
|
|
10
|
+
/** A piece of gear from its drawing function. Turned, it flips like a coin (`flipSvg`): the front, then its mirrored back, with a thin rim. */
|
|
11
|
+
export function defineGear(def) {
|
|
12
|
+
return { id: def.id, en: def.en, ja: def.ja, source: def.source, kind: "gear", model: def.model, size: def.size, svg: labelled(def.en, def.ja, (o) => def.draw(o)), frame: labelled(def.en, def.ja, flip(def.draw)) };
|
|
13
|
+
}
|
|
14
|
+
/** A drawn piece: its parts become a document in the metal, color or line style, whole or turned (the turn is `flipSvg`'s). */
|
|
15
|
+
export function drawGear(id, title, spec, options) {
|
|
16
|
+
const o = resolveOptions(options);
|
|
17
|
+
const line = o.style === "line";
|
|
18
|
+
const flat = options?.style === "color";
|
|
19
|
+
const main = o.tint ?? spec.main;
|
|
20
|
+
const accent = o.accent ?? spec.accent ?? mix(main, -0.3);
|
|
21
|
+
const gid = `g${hashOf(`${id}|${o.tint ?? ""}|${o.accent ?? ""}`)}`;
|
|
22
|
+
const resolve = (c) => (c === "$main" ? main : c === "$accent" ? accent : c);
|
|
23
|
+
let body = "";
|
|
24
|
+
let across = false;
|
|
25
|
+
let along = false;
|
|
26
|
+
for (const p of spec.parts) {
|
|
27
|
+
const t = p.t === undefined ? "" : ` transform="${escape(p.t)}"`;
|
|
28
|
+
const fill = resolve(p.fill);
|
|
29
|
+
const hasFill = fill !== undefined && fill !== "none";
|
|
30
|
+
if (line) {
|
|
31
|
+
const mode = p.line ?? "stroke";
|
|
32
|
+
if (mode === "none" || p.fx === true)
|
|
33
|
+
continue;
|
|
34
|
+
if (mode === "ink" && hasFill)
|
|
35
|
+
body += `<path d="${p.d}" fill="currentColor"${t}/>`;
|
|
36
|
+
else if (!hasFill && p.stroke !== undefined)
|
|
37
|
+
body += `<path d="${p.d}" fill="none" stroke="currentColor" stroke-width="${num(p.w ?? 2, 2)}"${t}/>`;
|
|
38
|
+
else
|
|
39
|
+
body += `<path d="${p.d}" fill="none" stroke="currentColor" stroke-width="${num(Math.max(p.w ?? 2, 1.6), 2)}"${t}/>`;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const op = p.op === undefined ? "" : ` opacity="${p.op}"`;
|
|
43
|
+
if (p.fx === true) {
|
|
44
|
+
if (!flat)
|
|
45
|
+
body += `<path d="${p.d}" fill="${fill}"${op}${t}/>`;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const stroke = resolve(p.stroke) ?? (hasFill ? mix(readColour(fill) === undefined ? "#888888" : fill, -0.45) : "none");
|
|
49
|
+
const w = p.w ?? 0.9;
|
|
50
|
+
body += `<path d="${p.d}" fill="${hasFill ? fill : "none"}" stroke="${stroke}" stroke-width="${num(w, 2)}"${hasFill || stroke === "none" ? ` stroke-linejoin="round"` : ` stroke-linecap="round"`}${op}${t}/>`;
|
|
51
|
+
if (hasFill && !flat) {
|
|
52
|
+
if (p.shade !== 0) {
|
|
53
|
+
along = true;
|
|
54
|
+
body += `<path d="${p.d}" fill="url(#${gid})"${p.shade === undefined ? "" : ` opacity="${p.shade}"`}${t}/>`;
|
|
55
|
+
}
|
|
56
|
+
if (p.cyl !== undefined && p.cyl > 0) {
|
|
57
|
+
across = true;
|
|
58
|
+
body += `<path d="${p.d}" fill="url(#${gid}c)"${p.cyl === 1 ? "" : ` opacity="${p.cyl}"`}${t}/>`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const defs = (along ? `<linearGradient id="${gid}" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#fff" stop-opacity=".42"/><stop offset=".5" stop-color="#fff" stop-opacity="0"/><stop offset="1" stop-color="#000" stop-opacity=".3"/></linearGradient>` : "") +
|
|
63
|
+
(across ? `<linearGradient id="${gid}c" x2="1"><stop offset="0" stop-color="#000" stop-opacity=".34"/><stop offset=".26" stop-color="#fff" stop-opacity=".5"/><stop offset=".55" stop-color="#fff" stop-opacity="0"/><stop offset=".88" stop-color="#000" stop-opacity=".22"/><stop offset="1" stop-color="#000" stop-opacity=".4"/></linearGradient>` : "");
|
|
64
|
+
const box = spec.box ?? "0 0 64 64";
|
|
65
|
+
const inner = line ? `<g stroke-linecap="round" stroke-linejoin="round">${body}</g>` : `<g stroke-linecap="round">${body}</g>`;
|
|
66
|
+
return wrapPiece({ title: escape(title), size: o.size, theme: o.theme, defs, body: inner, box });
|
|
67
|
+
}
|
|
68
|
+
/** The pieces' drawing helpers: shapes written as path strings. */
|
|
69
|
+
export const rect = (x, y, w, h, r = 0) => r === 0 ? `M${x} ${y}h${w}v${h}h${-w}z` : `M${x + r} ${y}h${w - 2 * r}a${r} ${r} 0 0 1 ${r} ${r}v${h - 2 * r}a${r} ${r} 0 0 1 ${-r} ${r}h${-(w - 2 * r)}a${r} ${r} 0 0 1 ${-r} ${-r}v${-(h - 2 * r)}a${r} ${r} 0 0 1 ${r} ${-r}z`;
|
|
70
|
+
export const ellipse = (cx, cy, rx, ry) => `M${cx - rx} ${cy}a${rx} ${ry} 0 1 0 ${2 * rx} 0a${rx} ${ry} 0 1 0 ${-2 * rx} 0z`;
|
|
71
|
+
export const circle = (cx, cy, r) => ellipse(cx, cy, r, r);
|
|
72
|
+
export const poly = (...pts) => `M${pts.map((p) => `${p[0]} ${p[1]}`).join("L")}z`;
|
|
73
|
+
/** A line from one point to another, as a path (to be drawn with a stroke width). */
|
|
74
|
+
export const seg = (x1, y1, x2, y2) => `M${x1} ${y1}L${x2} ${y2}`;
|
|
75
|
+
/** A capsule: a thick line with round ends, as a closed path (so it has an outline in the line style). */
|
|
76
|
+
export function capsule(x1, y1, x2, y2, w) {
|
|
77
|
+
const dx = x2 - x1, dy = y2 - y1;
|
|
78
|
+
const l = Math.hypot(dx, dy) || 1;
|
|
79
|
+
const nx = (-dy / l) * (w / 2), ny = (dx / l) * (w / 2);
|
|
80
|
+
const r = w / 2;
|
|
81
|
+
const f = (n) => String(Math.round(n * 100) / 100);
|
|
82
|
+
return `M${f(x1 + nx)} ${f(y1 + ny)}L${f(x2 + nx)} ${f(y2 + ny)}A${r} ${r} 0 0 0 ${f(x2 - nx)} ${f(y2 - ny)}L${f(x1 - nx)} ${f(y1 - ny)}A${r} ${r} 0 0 0 ${f(x1 + nx)} ${f(y1 + ny)}z`;
|
|
83
|
+
}
|
|
84
|
+
/** A piece we drew: the common case of `defineGear`. */
|
|
85
|
+
export function drawn(id, en, ja, spec, size) {
|
|
86
|
+
return defineGear({ id, en, ja, source: "drawn", size, model: spec, draw: (o) => drawGear(id, en, spec, o) });
|
|
87
|
+
}
|
|
88
|
+
/** The strings of a racket's head: a grid of lines clipped to an ellipse. */
|
|
89
|
+
export function strings(cx, cy, rx, ry, step) {
|
|
90
|
+
let d = "";
|
|
91
|
+
const f = (n) => String(Math.round(n * 10) / 10);
|
|
92
|
+
for (let x = cx - rx + step; x < cx + rx - step / 2; x += step) {
|
|
93
|
+
const h = ry * Math.sqrt(1 - ((x - cx) / rx) ** 2);
|
|
94
|
+
d += `M${f(x)} ${f(cy - h)}V${f(cy + h)}`;
|
|
95
|
+
}
|
|
96
|
+
for (let y = cy - ry + step; y < cy + ry - step / 2; y += step) {
|
|
97
|
+
const w = rx * Math.sqrt(1 - ((y - cy) / ry) ** 2);
|
|
98
|
+
d += `M${f(cx - w)} ${f(y)}H${f(cx + w)}`;
|
|
99
|
+
}
|
|
100
|
+
return d;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A shape of varying width along a curve, as a closed path: a cubic Bezier from `a` to `b` through the controls `c1` and `c2`, drawn `width(t)` wide at the fraction `t` of the way along. A bow, a blade or a feather
|
|
104
|
+
* is one of these. `steps` is how many segments each side has.
|
|
105
|
+
*/
|
|
106
|
+
export function swell(a, c1, c2, b, width, steps = 14) {
|
|
107
|
+
const at = (t) => {
|
|
108
|
+
const u = 1 - t;
|
|
109
|
+
return [u * u * u * a[0] + 3 * u * u * t * c1[0] + 3 * u * t * t * c2[0] + t * t * t * b[0], u * u * u * a[1] + 3 * u * u * t * c1[1] + 3 * u * t * t * c2[1] + t * t * t * b[1]];
|
|
110
|
+
};
|
|
111
|
+
const f = (n) => String(Math.round(n * 10) / 10);
|
|
112
|
+
const left = [];
|
|
113
|
+
const right = [];
|
|
114
|
+
for (let i = 0; i <= steps; i++) {
|
|
115
|
+
const t = i / steps;
|
|
116
|
+
const p = at(t);
|
|
117
|
+
const q = at(Math.min(1, t + 0.01));
|
|
118
|
+
const r = at(Math.max(0, t - 0.01));
|
|
119
|
+
const dx = q[0] - r[0];
|
|
120
|
+
const dy = q[1] - r[1];
|
|
121
|
+
const l = Math.hypot(dx, dy) || 1;
|
|
122
|
+
const h = width(t) / 2;
|
|
123
|
+
left.push(`${f(p[0] - (dy / l) * h)} ${f(p[1] + (dx / l) * h)}`);
|
|
124
|
+
right.push(`${f(p[0] + (dy / l) * h)} ${f(p[1] - (dx / l) * h)}`);
|
|
125
|
+
}
|
|
126
|
+
return `M${left.join("L")}L${right.reverse().join("L")}z`;
|
|
127
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GEAR_CRICKET_BAT: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// A cricket bat and a ball, drawn for this package: a broad willow blade with a ridge down the back, a cane handle with a grip, and a red ball with its seam.
|
|
2
|
+
import { capsule, circle, drawn } from "./gear.core.js";
|
|
3
|
+
const T = "rotate(34 32 32)";
|
|
4
|
+
export const GEAR_CRICKET_BAT = /* @__PURE__ */ drawn("gear:cricket-bat", "Cricket bat", "クリケットのバット", {
|
|
5
|
+
main: "#e6b96e",
|
|
6
|
+
accent: "#2a2f38",
|
|
7
|
+
parts: [
|
|
8
|
+
{ d: capsule(32, 2, 32, 26, 3.4), fill: "#c99a58", t: T, cyl: 1, shade: 0 },
|
|
9
|
+
{ d: capsule(32, 2, 32, 16, 4.4), fill: "$accent", t: T, cyl: 0.7, shade: 0 },
|
|
10
|
+
{ d: "M25.8 24.4h12.4L40.2 30V57a3 3 0 0 1-3 3H26.8a3 3 0 0 1-3-3V30z", fill: "$main", t: T, cyl: 0.9, shade: 0 },
|
|
11
|
+
{ d: "M32 31v27", fill: "none", stroke: "#b88540", w: 0.9, t: T, op: 0.9, line: "none", fx: true },
|
|
12
|
+
{ d: "M25 50.5h14", fill: "none", stroke: "#b88540", w: 0.8, t: T, line: "none", fx: true },
|
|
13
|
+
{ d: "M28.4 25.4L26.2 30.4", fill: "none", stroke: "#fff", w: 1.1, t: T, op: 0.5, line: "none", fx: true },
|
|
14
|
+
{ d: circle(53, 52.6, 6), fill: "#c4262e", stroke: "#6e1217", cyl: 0, shade: 0.7 },
|
|
15
|
+
{ d: "M48.6 48.6Q52 53 48.4 57M57.4 48.2Q54 52.6 57.6 57", fill: "none", stroke: "#f4ece0", w: 0.9, op: 0.9, line: "none" },
|
|
16
|
+
],
|
|
17
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const GEAR_BASEBALL_BAT: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
2
|
+
export declare const GEAR_BASKETBALL_HOOP: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
3
|
+
export declare const GEAR_VOLLEYBALL_NET: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
4
|
+
export declare const GEAR_GOALPOSTS: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
5
|
+
export declare const GEAR_WICKET: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
6
|
+
export declare const GEAR_ROUNDNET_SET: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Gear for the field and court, drawn by us: a baseball bat, a basketball hoop, a volleyball net, goal posts, a cricket wicket and a roundnet set.
|
|
2
|
+
import { capsule, drawn, ellipse, rect, seg } from "./gear.core.js";
|
|
3
|
+
const BAT = "rotate(-38 32 32)";
|
|
4
|
+
export const GEAR_BASEBALL_BAT = /* @__PURE__ */ drawn("gear:baseball-bat", "Baseball bat", "野球のバット", {
|
|
5
|
+
main: "#d9b57a",
|
|
6
|
+
accent: "#3a2a1a",
|
|
7
|
+
parts: [
|
|
8
|
+
{ d: "M6 29.200c-2.200 0-3.300 1.200-3.300 2.800s1.100 2.800 3.300 2.800L8 33.500H28C36 33.500 40 36.200 46 36.200H55a4.200 4.200 0 0 0 0-8.400H46C40 27.800 36 30.500 28 30.500H8z", fill: "$main", t: BAT },
|
|
9
|
+
{ d: rect(9, 30.500, 11, 3, 0), fill: "$accent", t: BAT, shade: 0.4 },
|
|
10
|
+
{ d: seg(47, 28.500, 47, 35.500), stroke: "#a98650", w: 0.9, t: BAT, line: "none" },
|
|
11
|
+
],
|
|
12
|
+
});
|
|
13
|
+
export const GEAR_BASKETBALL_HOOP = /* @__PURE__ */ drawn("gear:basketball-hoop", "Basketball hoop", "バスケットゴール", {
|
|
14
|
+
main: "#e8501a",
|
|
15
|
+
accent: "#f4f1ea",
|
|
16
|
+
parts: [
|
|
17
|
+
{ d: rect(8, 3, 48, 28, 2.500), fill: "$accent", stroke: "#8a949f", w: 1.600 },
|
|
18
|
+
{ d: rect(23, 13, 18, 14, 0), fill: "none", stroke: "$main", w: 1.800 },
|
|
19
|
+
{ d: rect(27, 28, 10, 5, 0), fill: "#8a949f", shade: 0.4, line: "none" },
|
|
20
|
+
{ d: "M19.500 35.500L26 57M25 38L29.500 57.500M32 39V58M39 38L34.500 57.500M44.500 35.500L38 57M20.500 43.500h23M23 50.500h18", stroke: "#b8c0c8", w: 1, line: "stroke" },
|
|
21
|
+
{ d: ellipse(32, 35, 13.500, 4), stroke: "$main", w: 2.800 },
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
const MESH = (() => {
|
|
25
|
+
let d = "";
|
|
26
|
+
for (let x = 13; x < 52; x += 4)
|
|
27
|
+
d += `M${x} 19V43`;
|
|
28
|
+
for (let y = 23; y < 43; y += 4)
|
|
29
|
+
d += `M9 ${y}H55`;
|
|
30
|
+
return d;
|
|
31
|
+
})();
|
|
32
|
+
export const GEAR_VOLLEYBALL_NET = /* @__PURE__ */ drawn("gear:volleyball-net", "Volleyball net", "バレーボールのネット", {
|
|
33
|
+
main: "#f4f1ea",
|
|
34
|
+
accent: "#c8202c",
|
|
35
|
+
parts: [
|
|
36
|
+
{ d: MESH, stroke: "#4a5260", w: 0.8, line: "stroke" },
|
|
37
|
+
{ d: rect(9, 13, 46, 6, 1), fill: "$main" },
|
|
38
|
+
{ d: rect(9, 42, 46, 3, 0), fill: "$main", shade: 0.3 },
|
|
39
|
+
{ d: rect(5, 5, 4, 56, 1.500), fill: "#9aa3ae", shade: 0.6 },
|
|
40
|
+
{ d: rect(55, 5, 4, 56, 1.500), fill: "#9aa3ae", shade: 0.6 },
|
|
41
|
+
{ d: rect(11, 3, 2, 26, 0), fill: "$accent", shade: 0.3, line: "none" },
|
|
42
|
+
{ d: rect(51, 3, 2, 26, 0), fill: "$accent", shade: 0.3, line: "none" },
|
|
43
|
+
],
|
|
44
|
+
});
|
|
45
|
+
export const GEAR_GOALPOSTS = /* @__PURE__ */ drawn("gear:goalposts", "Goal posts", "ゴールポスト", {
|
|
46
|
+
main: "#f2c21b",
|
|
47
|
+
accent: "#2b6cb5",
|
|
48
|
+
parts: [
|
|
49
|
+
{ d: rect(30.500, 36, 3, 24, 1), fill: "$main", shade: 0.5 },
|
|
50
|
+
{ d: rect(22, 58, 20, 4, 1.500), fill: "$accent", shade: 0.4 },
|
|
51
|
+
{ d: rect(16, 3, 3, 34, 1.500), fill: "$main", shade: 0.6 },
|
|
52
|
+
{ d: rect(45, 3, 3, 34, 1.500), fill: "$main", shade: 0.6 },
|
|
53
|
+
{ d: rect(16, 33, 32, 3.500, 1), fill: "$main", shade: 0.6 },
|
|
54
|
+
],
|
|
55
|
+
});
|
|
56
|
+
export const GEAR_WICKET = /* @__PURE__ */ drawn("gear:wicket", "Cricket wicket", "クリケットのウィケット", {
|
|
57
|
+
main: "#ecd9a8",
|
|
58
|
+
accent: "#c28a48",
|
|
59
|
+
parts: [
|
|
60
|
+
{ d: seg(8, 58.500, 56, 58.500), stroke: "#6aa84f", w: 2.400, line: "none" },
|
|
61
|
+
{ d: rect(19, 13, 5, 45, 1.500), fill: "$main" },
|
|
62
|
+
{ d: rect(29.500, 13, 5, 45, 1.500), fill: "$main" },
|
|
63
|
+
{ d: rect(40, 13, 5, 45, 1.500), fill: "$main" },
|
|
64
|
+
{ d: capsule(20, 10.500, 32.500, 10.500, 3.400), fill: "$accent", shade: 0.7 },
|
|
65
|
+
{ d: capsule(31.500, 10.500, 43.500, 10.500, 3.400), fill: "$accent", shade: 0.7 },
|
|
66
|
+
],
|
|
67
|
+
});
|
|
68
|
+
export const GEAR_ROUNDNET_SET = /* @__PURE__ */ drawn("gear:roundnet-set", "Roundnet set", "ラウンドネットのセット", {
|
|
69
|
+
main: "#1f2328",
|
|
70
|
+
accent: "#f0b429",
|
|
71
|
+
parts: [
|
|
72
|
+
{ d: capsule(9, 40, 8, 54, 2.600), fill: "#4a525d", shade: 0.5 },
|
|
73
|
+
{ d: capsule(55, 40, 56, 54, 2.600), fill: "#4a525d", shade: 0.5 },
|
|
74
|
+
{ d: capsule(21, 44, 21, 55, 2.600), fill: "#4a525d", shade: 0.5 },
|
|
75
|
+
{ d: capsule(43, 44, 43, 55, 2.600), fill: "#4a525d", shade: 0.5 },
|
|
76
|
+
{ d: ellipse(32, 33, 24, 9), fill: "$accent", stroke: "none", op: 0.6, shade: 0, line: "none" },
|
|
77
|
+
{ d: "M8 33H56M32 24V42M15 27.500L49 38.500M15 38.500L49 27.500", stroke: "#4a525d", w: 0.8, line: "stroke" },
|
|
78
|
+
{ d: ellipse(32, 33, 14, 5.200), fill: "none", stroke: "#4a525d", w: 0.8 },
|
|
79
|
+
{ d: ellipse(32, 33, 25.500, 10.500), stroke: "$main", w: 3 },
|
|
80
|
+
],
|
|
81
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GEAR_FIELD_HOCKEY_STICK: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// A field hockey stick and ball, drawn for this package: a long taped shaft and a head that hooks round at the foot, with a flat face, beside a white ball.
|
|
2
|
+
import { capsule, circle, drawn } from "./gear.core.js";
|
|
3
|
+
const T = "rotate(24 32 32)";
|
|
4
|
+
export const GEAR_FIELD_HOCKEY_STICK = /* @__PURE__ */ drawn("gear:field-hockey-stick", "Field hockey stick", "ホッケーのスティック", {
|
|
5
|
+
main: "#dcb06a",
|
|
6
|
+
accent: "#2a2f38",
|
|
7
|
+
parts: [
|
|
8
|
+
{ d: capsule(32, 1.5, 32, 44, 3.6), fill: "$main", t: T, cyl: 1, shade: 0 },
|
|
9
|
+
{ d: capsule(32, 1.5, 32, 16, 4.2), fill: "$accent", t: T, cyl: 0.7, shade: 0 },
|
|
10
|
+
{ d: "M24.2 41.2L29.8 43.6Q29.4 50.4 33.2 52.2H43.6Q46.6 52.4 46.6 55.6Q46.6 58.8 43.6 58.8H32.4Q22.8 58 23.4 48.4Q23.6 44.6 24.2 41.2Z", fill: "$main", cyl: 0.9, shade: 0 },
|
|
11
|
+
{ d: "M25.4 47.4Q25.6 55 33 56.6", fill: "none", stroke: "#fff", w: 1.1, op: 0.55, line: "none", fx: true },
|
|
12
|
+
{ d: capsule(31.5, 22.4, 31.5, 27.4, 4.2).replace(/^/, ""), fill: "$accent", t: T, line: "none", shade: 0.3 },
|
|
13
|
+
{ d: circle(54.5, 54.6, 4.8), fill: "#f4f2ee", stroke: "#8f98a3", shade: 0.9 },
|
|
14
|
+
{ d: "M51.4 51.8a4.6 4.6 0 0 1 3-1", fill: "none", stroke: "#fff", w: 1, line: "none", fx: true },
|
|
15
|
+
],
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GEAR_FOOTBALL_HELMET: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// A football helmet, drawn for this package: a glossy shell seen from the side with a stripe over the crown, an ear hole, and a cage of bars across the face opening.
|
|
2
|
+
import { drawn, ellipse } from "./gear.core.js";
|
|
3
|
+
export const GEAR_FOOTBALL_HELMET = /* @__PURE__ */ drawn("gear:football-helmet", "Football helmet", "アメフトのヘルメット", {
|
|
4
|
+
main: "#cfd6de",
|
|
5
|
+
accent: "#c8202c",
|
|
6
|
+
parts: [
|
|
7
|
+
{ d: "M6 38C3 21 15 7 32 7C45 7 53 15 53 27V33L48.6 36L45.6 46C41.6 55 29.6 57 19.6 54C11.6 51 7 46 6 38Z", fill: "$main", cyl: 0.6 },
|
|
8
|
+
{ d: "M45 11.6Q22 9.4 12 31", fill: "none", stroke: "$accent", w: 4.4, line: "none" },
|
|
9
|
+
{ d: ellipse(25.5, 39, 6, 7.2), fill: "#2a2f38", stroke: "#1b1f27", shade: 0.5 },
|
|
10
|
+
{ d: "M21 33Q25 30.4 30 33", fill: "none", stroke: "#fff", w: 1, op: 0.45, line: "none", fx: true },
|
|
11
|
+
{ d: "M13 18Q21 9.6 33 10", fill: "none", stroke: "#fff", w: 2, op: 0.55, line: "none", fx: true },
|
|
12
|
+
{ d: "M52.6 28Q62 29.6 61 38L57 47Q54 52 46 52.4", fill: "none", stroke: "#4a5362", w: 2.6 },
|
|
13
|
+
{ d: "M50.4 35H60.4M49.2 41.6H58.4M47 47.4H55.4", fill: "none", stroke: "#4a5362", w: 2 },
|
|
14
|
+
{ d: "M45.6 46L50 52.4M38.6 55.4Q43 54.4 46 52.4", fill: "none", stroke: "#2a2f38", w: 2, line: "none" },
|
|
15
|
+
],
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GEAR_GOALIE_MASK: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// A goalie mask, drawn for this package: a pale moulded shell with a caged face opening, painted brow, side pieces over the ears and a chin guard.
|
|
2
|
+
import { drawn, ellipse, seg } from "./gear.core.js";
|
|
3
|
+
/** The cage: bars across the face opening. */
|
|
4
|
+
const CAGE = (() => {
|
|
5
|
+
let d = "";
|
|
6
|
+
for (const x of [26.5, 32, 37.5])
|
|
7
|
+
d += seg(x, 15, x, 53);
|
|
8
|
+
for (const y of [24, 35, 46])
|
|
9
|
+
d += `M${32 - 12.4 * Math.sqrt(1 - ((y - 34) / 20) ** 2)} ${y}H${32 + 12.4 * Math.sqrt(1 - ((y - 34) / 20) ** 2)}`;
|
|
10
|
+
return d;
|
|
11
|
+
})();
|
|
12
|
+
export const GEAR_GOALIE_MASK = /* @__PURE__ */ drawn("gear:goalie-mask", "Goalie mask", "ゴールキーパーマスク", {
|
|
13
|
+
main: "#eef0f2",
|
|
14
|
+
accent: "#c8202c",
|
|
15
|
+
parts: [
|
|
16
|
+
{ d: "M32 3C46 3 53 14 53 29C53 41 48 51 41 58Q32 63 23 58C16 51 11 41 11 29C11 14 18 3 32 3Z", fill: "$main", cyl: 0.7 },
|
|
17
|
+
{ d: "M14 20Q32 6 50 20L48 25Q32 13 16 25Z", fill: "$accent", stroke: "none", shade: 0.6, line: "none" },
|
|
18
|
+
{ d: ellipse(32, 34, 13.6, 20.4), fill: "#2b3038", stroke: "#1b1f27", shade: 0, line: "stroke" },
|
|
19
|
+
{ d: CAGE, fill: "none", stroke: "#cfd6de", w: 1.5 },
|
|
20
|
+
{ d: "M11.6 30Q10.6 40 13.6 47L18 44Q15.4 38 16.4 30ZM52.4 30Q53.4 40 50.4 47L46 44Q48.6 38 47.6 30Z", fill: "$main", cyl: 0.6, line: "none" },
|
|
21
|
+
{ d: "M18 8Q24 4.8 29 4.4", fill: "none", stroke: "#fff", w: 1.8, op: 0.8, line: "none", fx: true },
|
|
22
|
+
],
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GEAR_GOAL_NET: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// A goal with a net, drawn for this package: a frame of round posts seen from the front and a little above, the back bar and the sloping top and sides, and a mesh of strings.
|
|
2
|
+
import { drawn, seg } from "./gear.core.js";
|
|
3
|
+
/** The mesh: the back panel, the top, and the two sides, as strings. */
|
|
4
|
+
const MESH = (() => {
|
|
5
|
+
let d = "";
|
|
6
|
+
for (let x = 16; x <= 48; x += 4)
|
|
7
|
+
d += seg(x, 20, x, 42);
|
|
8
|
+
for (let y = 24; y <= 40; y += 4)
|
|
9
|
+
d += seg(14, y, 50, y);
|
|
10
|
+
d += seg(7, 13, 14, 20) + seg(57, 13, 50, 20) + seg(7, 44, 14, 42) + seg(57, 44, 50, 42);
|
|
11
|
+
return d;
|
|
12
|
+
})();
|
|
13
|
+
export const GEAR_GOAL_NET = /* @__PURE__ */ drawn("gear:goal-net", "Goal net", "ゴールネット", {
|
|
14
|
+
main: "#d62b2b",
|
|
15
|
+
accent: "#dfe4ea",
|
|
16
|
+
parts: [
|
|
17
|
+
{ d: "M7 12H57L50 20H14z", fill: "$accent", stroke: "none", op: 0.45, shade: 0, line: "none" },
|
|
18
|
+
{ d: "M7 12L14 20V42L7 46zM57 12L50 20V42L57 46z", fill: "$accent", stroke: "none", op: 0.28, shade: 0, line: "none" },
|
|
19
|
+
{ d: MESH, fill: "none", stroke: "#8f98a3", w: 0.6 },
|
|
20
|
+
{ d: "M14 20H50M14 20V42H50V20", fill: "none", stroke: "#aeb6c0", w: 1.4, line: "stroke" },
|
|
21
|
+
{ d: "M7 46V12H57V46", fill: "none", stroke: "$main", w: 4.2 },
|
|
22
|
+
{ d: "M7 46V12H57V46", fill: "none", stroke: "#fff", w: 1, op: 0.35, fx: true, line: "none", t: "translate(-.7 .4)" },
|
|
23
|
+
{ d: "M4.6 49H59.4", fill: "none", stroke: "#8f98a3", w: 3.2 },
|
|
24
|
+
],
|
|
25
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GEAR_HOCKEY_STICK: import("./gear.index.ts").Piece<import("./gear.core.ts").GearSpec>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// An ice hockey stick and a puck, drawn for this package: a long shaft taped at the top, and a blade with a heel and a toe lying flat on the ice.
|
|
2
|
+
import { capsule, drawn } from "./gear.core.js";
|
|
3
|
+
const T = "rotate(28 32 32)";
|
|
4
|
+
export const GEAR_HOCKEY_STICK = /* @__PURE__ */ drawn("gear:hockey-stick", "Hockey stick and puck", "スティックとパック", {
|
|
5
|
+
main: "#c8202c",
|
|
6
|
+
accent: "#f2efe8",
|
|
7
|
+
parts: [
|
|
8
|
+
{ d: capsule(32, 1.5, 32, 47, 4.2), fill: "$main", t: T, cyl: 1, shade: 0 },
|
|
9
|
+
{ d: capsule(32, 1.5, 32, 11, 4.4), fill: "$accent", t: T, cyl: 0.8, shade: 0 },
|
|
10
|
+
{ d: "M23.2 41.6L29.4 44.4C29 49 31 51.6 35.6 51.6H43.4Q46.8 51.8 46.4 54.8Q46 58 42.4 58H19.8Q16.4 58 17 54.4C17.8 49.6 20 45 23.2 41.6Z", fill: "#dcb97b", cyl: 0.7, shade: 0 },
|
|
11
|
+
{ d: "M19 52.4L25 49.6L26.6 58H18ZM33.6 51.6H38.4L37.6 58H32.6Z", fill: "$accent", stroke: "none", op: 0.92, shade: 0, line: "none" },
|
|
12
|
+
{ d: "M48.6 52.4v3.2a5.4 2.3 0 0 0 10.8 0v-3.2a5.4 2.3 0 0 0-10.8 0z", fill: "#3a414b", cyl: 0.8, shade: 0 },
|
|
13
|
+
{ d: "M48.6 52.4a5.4 2.3 0 0 0 10.8 0a5.4 2.3 0 0 0-10.8 0z", fill: "#6b7480", shade: 0, line: "none" },
|
|
14
|
+
],
|
|
15
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Piece, PieceOptions } from "../ball/ball.core.ts";
|
|
2
|
+
/** Every piece of gear, in the order a gallery shows them. */
|
|
3
|
+
export declare const GEARS: readonly Piece[];
|
|
4
|
+
/** The id of every piece of gear: `"gear:hockey-stick"`. */
|
|
5
|
+
export declare const GEAR_IDS: readonly string[];
|
|
6
|
+
/** A piece of gear by its id, or by its name without the `gear:`. An unknown name is an error that lists the ids. */
|
|
7
|
+
export declare function gearOf(name: string): Piece;
|
|
8
|
+
/** True when the text is the id of a piece of gear (or a name without `gear:`). */
|
|
9
|
+
export declare const isGearId: (name: unknown) => name is string;
|
|
10
|
+
/**
|
|
11
|
+
* A piece of gear as a document of SVG, in the colour style (the default) or the line style (`currentColor`).
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { renderGear } from "@johnmorrisdotca/kyogijo-stadiums/gear";
|
|
15
|
+
* const colour = renderGear("hockey-stick", { size: 48 });
|
|
16
|
+
* const line = renderGear("hockey-stick", { size: 48, style: "line" });
|
|
17
|
+
* console.log(colour !== line, line.includes("currentColor"));
|
|
18
|
+
* // true true
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function renderGear(name: string, options?: PieceOptions): string;
|
|
22
|
+
export type { Piece, PieceOptions, PieceStyle, PieceTheme } from "../ball/ball.core.ts";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { GEAR_BADMINTON_RACKET } from "./gear.badmintonracket.js";
|
|
2
|
+
import { GEAR_BASEBALL_GLOVE } from "./gear.baseballglove.js";
|
|
3
|
+
import { GEAR_CRICKET_BAT } from "./gear.cricketbat.js";
|
|
4
|
+
import { GEAR_BASEBALL_BAT, GEAR_BASKETBALL_HOOP, GEAR_VOLLEYBALL_NET, GEAR_GOALPOSTS, GEAR_WICKET, GEAR_ROUNDNET_SET } from "./gear.field.js";
|
|
5
|
+
import { GEAR_FIELD_HOCKEY_STICK } from "./gear.fieldhockeystick.js";
|
|
6
|
+
import { GEAR_FOOTBALL_HELMET } from "./gear.footballhelmet.js";
|
|
7
|
+
import { GEAR_GOALIE_MASK } from "./gear.goaliemask.js";
|
|
8
|
+
import { GEAR_GOAL_NET } from "./gear.goalnet.js";
|
|
9
|
+
import { GEAR_HOCKEY_STICK } from "./gear.hockeystick.js";
|
|
10
|
+
import { GEAR_LACROSSE_STICK } from "./gear.lacrossestick.js";
|
|
11
|
+
import { GEAR_SQUASH_RACKET, GEAR_RACQUETBALL_RACKET, GEAR_PADEL_RACKET, GEAR_PICKLEBALL_PADDLE } from "./gear.rackets.js";
|
|
12
|
+
import { GEAR_HOCKEY_SKATE, GEAR_FIGURE_SKATE, GEAR_SPEED_SKATE } from "./gear.skates.js";
|
|
13
|
+
import { GEAR_GOALIE_STICK, GEAR_HURLEY, GEAR_CURLING_BROOM } from "./gear.sticks.js";
|
|
14
|
+
import { GEAR_TABLE_TENNIS_PADDLE } from "./gear.tabletennispaddle.js";
|
|
15
|
+
import { GEAR_TENNIS_RACKET } from "./gear.tennisracket.js";
|
|
16
|
+
import { GEAR_STARTING_BLOCKS, GEAR_RELAY_BATON, GEAR_JAVELIN, GEAR_HURDLES } from "./gear.track.js";
|
|
17
|
+
import { GEAR_DIVING_BOARD, GEAR_SWIM_GOGGLES } from "./gear.water.js";
|
|
18
|
+
import { GEAR_GUNBAI, GEAR_MAWASHI } from "./gear.sumo.js";
|
|
19
|
+
import { GEAR_SHINAI, GEAR_KENDO_MEN } from "./gear.kendo.js";
|
|
20
|
+
import { GEAR_JUDOGI, GEAR_KARATE_GI, GEAR_OBI } from "./gear.budo.js";
|
|
21
|
+
import { GEAR_YUMI, GEAR_YA } from "./gear.kyudo.js";
|
|
22
|
+
/** Every piece of gear, in the order a gallery shows them. */
|
|
23
|
+
export const GEARS = [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_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_OBI, GEAR_YUMI, GEAR_YA, GEAR_KARATE_GI];
|
|
24
|
+
/** The id of every piece of gear: `"gear:hockey-stick"`. */
|
|
25
|
+
export const GEAR_IDS = GEARS.map((g) => g.id);
|
|
26
|
+
const TABLE = new Map(GEARS.map((g) => [g.id, g]));
|
|
27
|
+
/** A piece of gear by its id, or by its name without the `gear:`. An unknown name is an error that lists the ids. */
|
|
28
|
+
export function gearOf(name) {
|
|
29
|
+
const found = TABLE.get(name.startsWith("gear:") ? name : `gear:${name}`);
|
|
30
|
+
if (found === undefined)
|
|
31
|
+
throw new Error(`Unknown gear "${name}". The ids are ${GEAR_IDS.join(", ")}.`);
|
|
32
|
+
return found;
|
|
33
|
+
}
|
|
34
|
+
/** True when the text is the id of a piece of gear (or a name without `gear:`). */
|
|
35
|
+
export const isGearId = (name) => typeof name === "string" && TABLE.has(name.startsWith("gear:") ? name : `gear:${name}`);
|
|
36
|
+
/**
|
|
37
|
+
* A piece of gear as a document of SVG, in the colour style (the default) or the line style (`currentColor`).
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { renderGear } from "@johnmorrisdotca/kyogijo-stadiums/gear";
|
|
41
|
+
* const colour = renderGear("hockey-stick", { size: 48 });
|
|
42
|
+
* const line = renderGear("hockey-stick", { size: 48, style: "line" });
|
|
43
|
+
* console.log(colour !== line, line.includes("currentColor"));
|
|
44
|
+
* // true true
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export function renderGear(name, options) {
|
|
48
|
+
return gearOf(name).svg(options);
|
|
49
|
+
}
|