@johnmorrisdotca/dougu-sports 0.28.1 → 0.30.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 +36 -0
- package/NOTICE.md +1 -0
- package/README.md +71 -5
- package/dist/brands/brand.ball.d.ts +25 -2
- package/dist/brands/brand.ball.js +16 -1
- package/dist/brands/brand.data.d.ts +108 -5
- package/dist/brands/brand.data.js +32 -0
- package/dist/brands/brand.letters.d.ts +39 -4
- package/dist/brands/brand.letters.js +20 -2
- package/dist/brands/brand.render.d.ts +73 -6
- package/dist/brands/brand.render.js +35 -2
- package/dist/element.d.ts +32 -0
- package/dist/element.js +177 -0
- package/dist/emblems/award/badge.d.ts +8 -1
- package/dist/emblems/award/badge.js +8 -1
- package/dist/emblems/award/crown.d.ts +8 -1
- package/dist/emblems/award/crown.js +8 -1
- package/dist/emblems/award/medal.d.ts +8 -1
- package/dist/emblems/award/medal.js +8 -1
- package/dist/emblems/award/ribbon.d.ts +8 -1
- package/dist/emblems/award/ribbon.js +8 -1
- package/dist/emblems/award/shield.d.ts +8 -1
- package/dist/emblems/award/shield.js +8 -1
- package/dist/emblems/award/star.d.ts +8 -1
- package/dist/emblems/award/star.js +8 -1
- package/dist/emblems/ball/ball.afl.d.ts +8 -0
- package/dist/emblems/ball/ball.afl.js +8 -0
- package/dist/emblems/ball/ball.baseball.vintage.d.ts +40 -5
- package/dist/emblems/ball/ball.baseball.vintage.js +40 -5
- package/dist/emblems/ball/ball.basketball.d.ts +8 -0
- package/dist/emblems/ball/ball.basketball.js +8 -0
- package/dist/emblems/ball/ball.basketball3x3.d.ts +8 -0
- package/dist/emblems/ball/ball.basketball3x3.js +8 -0
- package/dist/emblems/ball/ball.basketball6.d.ts +8 -0
- package/dist/emblems/ball/ball.basketball6.js +8 -0
- package/dist/emblems/ball/ball.core.d.ts +16 -1
- package/dist/emblems/ball/ball.cricket.d.ts +24 -0
- package/dist/emblems/ball/ball.cricket.js +24 -0
- package/dist/emblems/ball/ball.curlingstone.d.ts +8 -0
- package/dist/emblems/ball/ball.curlingstone.js +8 -0
- package/dist/emblems/ball/ball.discus.d.ts +8 -0
- package/dist/emblems/ball/ball.discus.js +8 -0
- package/dist/emblems/ball/ball.face.d.ts +48 -4
- package/dist/emblems/ball/ball.fieldhockey.d.ts +8 -0
- package/dist/emblems/ball/ball.fieldhockey.js +8 -0
- package/dist/emblems/ball/ball.football.d.ts +24 -0
- package/dist/emblems/ball/ball.football.js +24 -0
- package/dist/emblems/ball/ball.gaelic.d.ts +16 -0
- package/dist/emblems/ball/ball.gaelic.js +16 -0
- package/dist/emblems/ball/ball.golf.d.ts +8 -0
- package/dist/emblems/ball/ball.golf.js +8 -0
- package/dist/emblems/ball/ball.hammer.d.ts +8 -0
- package/dist/emblems/ball/ball.hammer.js +8 -0
- package/dist/emblems/ball/ball.handball.d.ts +8 -0
- package/dist/emblems/ball/ball.handball.js +8 -0
- package/dist/emblems/ball/ball.index.d.ts +15 -4
- package/dist/emblems/ball/ball.index.js +8 -6
- package/dist/emblems/ball/ball.padel.d.ts +8 -0
- package/dist/emblems/ball/ball.padel.js +8 -0
- package/dist/emblems/ball/ball.pickleball.d.ts +16 -0
- package/dist/emblems/ball/ball.pickleball.js +16 -0
- package/dist/emblems/ball/ball.plastic.d.ts +38 -1
- package/dist/emblems/ball/ball.plastic.js +73 -0
- package/dist/emblems/ball/ball.print.d.ts +71 -7
- package/dist/emblems/ball/ball.print.js +8 -0
- package/dist/emblems/ball/ball.printable.d.ts +48 -0
- package/dist/emblems/ball/ball.printable.js +48 -0
- package/dist/emblems/ball/ball.puck.d.ts +8 -0
- package/dist/emblems/ball/ball.puck.js +8 -0
- package/dist/emblems/ball/ball.puck.print.d.ts +64 -0
- package/dist/emblems/ball/ball.puck.print.js +64 -0
- package/dist/emblems/ball/ball.roundnet.d.ts +8 -0
- package/dist/emblems/ball/ball.roundnet.js +8 -0
- package/dist/emblems/ball/ball.rugby.d.ts +8 -0
- package/dist/emblems/ball/ball.rugby.js +8 -0
- package/dist/emblems/ball/ball.sepaktakraw.d.ts +8 -0
- package/dist/emblems/ball/ball.sepaktakraw.js +8 -0
- package/dist/emblems/ball/ball.shuttlecock.d.ts +16 -0
- package/dist/emblems/ball/ball.shuttlecock.js +16 -0
- package/dist/emblems/ball/ball.sliotar.d.ts +8 -0
- package/dist/emblems/ball/ball.sliotar.js +8 -0
- package/dist/emblems/ball/ball.smooth.d.ts +32 -0
- package/dist/emblems/ball/ball.smooth.js +32 -0
- package/dist/emblems/ball/ball.soccer.era.d.ts +96 -12
- package/dist/emblems/ball/ball.soccer.era.js +96 -12
- package/dist/emblems/ball/ball.soccer.indoor.d.ts +16 -0
- package/dist/emblems/ball/ball.soccer.indoor.js +16 -0
- package/dist/emblems/ball/ball.soccer.panels.d.ts +120 -0
- package/dist/emblems/ball/ball.soccer.panels.js +120 -0
- package/dist/emblems/ball/ball.soccer.store.d.ts +144 -0
- package/dist/emblems/ball/ball.soccer.store.js +144 -0
- package/dist/emblems/ball/ball.soccer.vintage.d.ts +40 -5
- package/dist/emblems/ball/ball.soccer.vintage.js +40 -5
- package/dist/emblems/ball/ball.squash.d.ts +40 -0
- package/dist/emblems/ball/ball.squash.js +40 -0
- package/dist/emblems/ball/ball.tennis.d.ts +8 -0
- package/dist/emblems/ball/ball.tennis.js +8 -0
- package/dist/emblems/ball/ball.teqball.d.ts +8 -0
- package/dist/emblems/ball/ball.teqball.js +8 -0
- package/dist/emblems/ball/ball.volleyball.d.ts +24 -0
- package/dist/emblems/ball/ball.volleyball.flag.d.ts +88 -0
- package/dist/emblems/ball/ball.volleyball.flag.js +88 -0
- package/dist/emblems/ball/ball.volleyball.js +24 -0
- package/dist/emblems/ball/ball.waterpolo.d.ts +8 -0
- package/dist/emblems/ball/ball.waterpolo.js +8 -0
- package/dist/emblems/crest/diamond.d.ts +8 -1
- package/dist/emblems/crest/diamond.js +8 -1
- package/dist/emblems/crest/pennant.d.ts +8 -1
- package/dist/emblems/crest/pennant.js +8 -1
- package/dist/emblems/crest/roundel.d.ts +8 -1
- package/dist/emblems/crest/roundel.js +8 -1
- package/dist/emblems/crest/shield.d.ts +8 -1
- package/dist/emblems/crest/shield.js +8 -1
- package/dist/emblems/emblem.api.d.ts +178 -17
- package/dist/emblems/emblem.api.js +138 -13
- package/dist/emblems/emblem.core.d.ts +104 -8
- package/dist/emblems/emblem.core.js +32 -2
- package/dist/emblems/emblem.descriptions.d.ts +17 -1
- package/dist/emblems/emblem.descriptions.js +11 -0
- package/dist/emblems/emblem.display.d.ts +53 -5
- package/dist/emblems/emblem.display.js +6 -0
- package/dist/emblems/emblem.embed.d.ts +68 -0
- package/dist/emblems/emblem.embed.js +65 -0
- package/dist/emblems/emblem.equipment.d.ts +12 -1
- package/dist/emblems/emblem.equipment.js +2 -0
- package/dist/emblems/emblem.ids.d.ts +273 -18
- package/dist/emblems/emblem.ids.js +137 -15
- package/dist/emblems/emblem.lathe.d.ts +70 -6
- package/dist/emblems/emblem.named.d.ts +37 -4
- package/dist/emblems/emblem.named.js +18 -2
- package/dist/emblems/emblem.registry.d.ts +8 -1
- package/dist/emblems/emblem.registry.js +8 -1
- package/dist/emblems/emblem.shapes.d.ts +25 -2
- package/dist/emblems/emblem.sprite.d.ts +33 -3
- package/dist/emblems/emblem.sprite.js +3 -0
- package/dist/emblems/emblem.uri.d.ts +13 -1
- package/dist/emblems/emblem.uri.js +3 -0
- package/dist/emblems/gear/gear.badmintonracket.d.ts +8 -0
- package/dist/emblems/gear/gear.badmintonracket.js +8 -0
- package/dist/emblems/gear/gear.baseballcap.d.ts +8 -0
- package/dist/emblems/gear/gear.baseballcap.js +8 -0
- package/dist/emblems/gear/gear.baseballglove.d.ts +8 -0
- package/dist/emblems/gear/gear.baseballglove.js +8 -0
- package/dist/emblems/gear/gear.budo.d.ts +224 -4
- package/dist/emblems/gear/gear.budo.js +205 -3
- package/dist/emblems/gear/gear.budo.steps.d.ts +68 -1
- package/dist/emblems/gear/gear.budo.steps.js +59 -1
- package/dist/emblems/gear/gear.cricketbat.d.ts +8 -0
- package/dist/emblems/gear/gear.cricketbat.js +8 -0
- package/dist/emblems/gear/gear.field.d.ts +48 -0
- package/dist/emblems/gear/gear.field.js +48 -0
- package/dist/emblems/gear/gear.fieldhockeystick.d.ts +8 -0
- package/dist/emblems/gear/gear.fieldhockeystick.js +8 -0
- package/dist/emblems/gear/gear.footballhelmet.d.ts +8 -0
- package/dist/emblems/gear/gear.footballhelmet.js +8 -0
- package/dist/emblems/gear/gear.goaliemask.d.ts +8 -0
- package/dist/emblems/gear/gear.goaliemask.js +8 -0
- package/dist/emblems/gear/gear.goalnet.d.ts +8 -0
- package/dist/emblems/gear/gear.goalnet.js +8 -0
- package/dist/emblems/gear/gear.hockeystick.d.ts +8 -0
- package/dist/emblems/gear/gear.hockeystick.js +8 -0
- package/dist/emblems/gear/gear.kendo.d.ts +16 -0
- package/dist/emblems/gear/gear.kendo.js +16 -0
- package/dist/emblems/gear/gear.kyudo.d.ts +16 -0
- package/dist/emblems/gear/gear.kyudo.js +16 -0
- package/dist/emblems/gear/gear.lacrossestick.d.ts +8 -0
- package/dist/emblems/gear/gear.lacrossestick.js +8 -0
- package/dist/emblems/gear/gear.nets.d.ts +24 -0
- package/dist/emblems/gear/gear.nets.js +24 -0
- package/dist/emblems/gear/gear.rackets.d.ts +32 -0
- package/dist/emblems/gear/gear.rackets.js +32 -0
- package/dist/emblems/gear/gear.skates.d.ts +24 -0
- package/dist/emblems/gear/gear.skates.js +24 -0
- package/dist/emblems/gear/gear.sticks.d.ts +24 -0
- package/dist/emblems/gear/gear.sticks.js +24 -0
- package/dist/emblems/gear/gear.sumo.d.ts +16 -0
- package/dist/emblems/gear/gear.sumo.js +16 -0
- package/dist/emblems/gear/gear.tabletennispaddle.d.ts +8 -0
- package/dist/emblems/gear/gear.tabletennispaddle.js +8 -0
- package/dist/emblems/gear/gear.tennisracket.d.ts +8 -0
- package/dist/emblems/gear/gear.tennisracket.js +8 -0
- package/dist/emblems/gear/gear.track.d.ts +32 -0
- package/dist/emblems/gear/gear.track.js +32 -0
- package/dist/emblems/gear/gear.water.d.ts +16 -0
- package/dist/emblems/gear/gear.water.js +16 -0
- package/dist/emblems/medal/bronze.d.ts +8 -1
- package/dist/emblems/medal/bronze.js +8 -1
- package/dist/emblems/medal/gold.d.ts +8 -1
- package/dist/emblems/medal/gold.js +8 -1
- package/dist/emblems/medal/place-1.d.ts +8 -1
- package/dist/emblems/medal/place-1.js +8 -1
- package/dist/emblems/medal/place-2.d.ts +8 -1
- package/dist/emblems/medal/place-2.js +8 -1
- package/dist/emblems/medal/place-3.d.ts +8 -1
- package/dist/emblems/medal/place-3.js +8 -1
- package/dist/emblems/medal/silver.d.ts +8 -1
- package/dist/emblems/medal/silver.js +8 -1
- package/dist/emblems/pennant/championship.d.ts +8 -1
- package/dist/emblems/pennant/championship.js +8 -1
- package/dist/emblems/sport/afl.d.ts +8 -1
- package/dist/emblems/sport/afl.js +8 -1
- package/dist/emblems/sport/artisticswimming.d.ts +8 -1
- package/dist/emblems/sport/artisticswimming.js +8 -1
- package/dist/emblems/sport/athletics.d.ts +8 -1
- package/dist/emblems/sport/athletics.js +8 -1
- package/dist/emblems/sport/badminton.d.ts +8 -1
- package/dist/emblems/sport/badminton.js +8 -1
- package/dist/emblems/sport/boxing.d.ts +8 -1
- package/dist/emblems/sport/boxing.js +8 -1
- package/dist/emblems/sport/cfl.d.ts +8 -1
- package/dist/emblems/sport/cfl.js +8 -1
- package/dist/emblems/sport/cricket.d.ts +8 -1
- package/dist/emblems/sport/cricket.js +8 -1
- package/dist/emblems/sport/curling.d.ts +8 -1
- package/dist/emblems/sport/curling.js +8 -1
- package/dist/emblems/sport/diving.d.ts +8 -1
- package/dist/emblems/sport/diving.js +8 -1
- package/dist/emblems/sport/fieldhockey.d.ts +8 -1
- package/dist/emblems/sport/fieldhockey.js +8 -1
- package/dist/emblems/sport/gaelic.d.ts +8 -1
- package/dist/emblems/sport/gaelic.js +8 -1
- package/dist/emblems/sport/handball.d.ts +8 -1
- package/dist/emblems/sport/handball.js +8 -1
- package/dist/emblems/sport/ifaf.d.ts +8 -1
- package/dist/emblems/sport/ifaf.js +8 -1
- package/dist/emblems/sport/judo.d.ts +8 -1
- package/dist/emblems/sport/judo.js +8 -1
- package/dist/emblems/sport/karate.d.ts +8 -1
- package/dist/emblems/sport/karate.js +8 -1
- package/dist/emblems/sport/kendo.d.ts +8 -1
- package/dist/emblems/sport/kendo.js +8 -1
- package/dist/emblems/sport/kyudo.d.ts +8 -1
- package/dist/emblems/sport/kyudo.js +8 -1
- package/dist/emblems/sport/lacrosse.d.ts +8 -1
- package/dist/emblems/sport/lacrosse.js +8 -1
- package/dist/emblems/sport/mlb.d.ts +8 -1
- package/dist/emblems/sport/mlb.js +8 -1
- package/dist/emblems/sport/mma.d.ts +8 -1
- package/dist/emblems/sport/mma.js +8 -1
- package/dist/emblems/sport/nba.d.ts +8 -1
- package/dist/emblems/sport/nba.js +8 -1
- package/dist/emblems/sport/netball.d.ts +8 -1
- package/dist/emblems/sport/netball.js +8 -1
- package/dist/emblems/sport/nfl.d.ts +8 -1
- package/dist/emblems/sport/nfl.js +8 -1
- package/dist/emblems/sport/nhl.d.ts +8 -1
- package/dist/emblems/sport/nhl.js +8 -1
- package/dist/emblems/sport/padel.d.ts +8 -1
- package/dist/emblems/sport/padel.js +8 -1
- package/dist/emblems/sport/pickleball.d.ts +8 -1
- package/dist/emblems/sport/pickleball.js +8 -1
- package/dist/emblems/sport/prowrestling.d.ts +8 -1
- package/dist/emblems/sport/prowrestling.js +8 -1
- package/dist/emblems/sport/racquetball.d.ts +8 -1
- package/dist/emblems/sport/racquetball.js +8 -1
- package/dist/emblems/sport/roundnet.d.ts +8 -1
- package/dist/emblems/sport/roundnet.js +8 -1
- package/dist/emblems/sport/rugby.d.ts +8 -1
- package/dist/emblems/sport/rugby.js +8 -1
- package/dist/emblems/sport/sepaktakraw.d.ts +8 -1
- package/dist/emblems/sport/sepaktakraw.js +8 -1
- package/dist/emblems/sport/skating.d.ts +8 -1
- package/dist/emblems/sport/skating.js +8 -1
- package/dist/emblems/sport/soccer.d.ts +8 -1
- package/dist/emblems/sport/soccer.js +8 -1
- package/dist/emblems/sport/squash.d.ts +8 -1
- package/dist/emblems/sport/squash.js +8 -1
- package/dist/emblems/sport/sumo.d.ts +8 -1
- package/dist/emblems/sport/sumo.js +8 -1
- package/dist/emblems/sport/swimming.d.ts +8 -1
- package/dist/emblems/sport/swimming.js +8 -1
- package/dist/emblems/sport/tabletennis.d.ts +8 -1
- package/dist/emblems/sport/tabletennis.js +8 -1
- package/dist/emblems/sport/tennis.d.ts +8 -1
- package/dist/emblems/sport/tennis.js +8 -1
- package/dist/emblems/sport/teqball.d.ts +8 -1
- package/dist/emblems/sport/teqball.js +8 -1
- package/dist/emblems/sport/volleyball.d.ts +8 -1
- package/dist/emblems/sport/volleyball.js +8 -1
- package/dist/emblems/sport/waterpolo.d.ts +8 -1
- package/dist/emblems/sport/waterpolo.js +8 -1
- package/dist/emblems/sport/wrestling.d.ts +8 -1
- package/dist/emblems/sport/wrestling.js +8 -1
- package/dist/emblems/trophy/americas-cup.d.ts +8 -1
- package/dist/emblems/trophy/americas-cup.js +8 -1
- package/dist/emblems/trophy/art-ross-trophy.d.ts +8 -1
- package/dist/emblems/trophy/art-ross-trophy.js +8 -1
- package/dist/emblems/trophy/ashes-urn.d.ts +8 -1
- package/dist/emblems/trophy/ashes-urn.js +8 -1
- package/dist/emblems/trophy/avco-world-trophy.d.ts +8 -1
- package/dist/emblems/trophy/avco-world-trophy.js +8 -1
- package/dist/emblems/trophy/ballon-dor.d.ts +8 -1
- package/dist/emblems/trophy/ballon-dor.js +8 -1
- package/dist/emblems/trophy/banner.d.ts +8 -1
- package/dist/emblems/trophy/banner.js +8 -1
- package/dist/emblems/trophy/baseball.d.ts +8 -1
- package/dist/emblems/trophy/baseball.js +8 -1
- package/dist/emblems/trophy/basketball.d.ts +8 -1
- package/dist/emblems/trophy/basketball.js +8 -1
- package/dist/emblems/trophy/belt.d.ts +8 -1
- package/dist/emblems/trophy/belt.js +8 -1
- package/dist/emblems/trophy/bill-russell-trophy.d.ts +8 -1
- package/dist/emblems/trophy/bill-russell-trophy.js +8 -1
- package/dist/emblems/trophy/bob-cousy-trophy.d.ts +8 -1
- package/dist/emblems/trophy/bob-cousy-trophy.js +8 -1
- package/dist/emblems/trophy/borg-warner-trophy.d.ts +8 -1
- package/dist/emblems/trophy/borg-warner-trophy.js +8 -1
- package/dist/emblems/trophy/bowl.d.ts +8 -1
- package/dist/emblems/trophy/bowl.js +8 -1
- package/dist/emblems/trophy/calder-cup.d.ts +8 -1
- package/dist/emblems/trophy/calder-cup.js +8 -1
- package/dist/emblems/trophy/calder-trophy.d.ts +8 -1
- package/dist/emblems/trophy/calder-trophy.js +8 -1
- package/dist/emblems/trophy/campbell-bowl.d.ts +8 -1
- package/dist/emblems/trophy/campbell-bowl.js +8 -1
- package/dist/emblems/trophy/canadian-bowl.d.ts +8 -1
- package/dist/emblems/trophy/canadian-bowl.js +8 -1
- package/dist/emblems/trophy/cfp-trophy.d.ts +8 -1
- package/dist/emblems/trophy/cfp-trophy.js +8 -1
- package/dist/emblems/trophy/champions-league-trophy.d.ts +8 -1
- package/dist/emblems/trophy/champions-league-trophy.js +8 -1
- package/dist/emblems/trophy/championship-banner.d.ts +8 -1
- package/dist/emblems/trophy/championship-banner.js +8 -1
- package/dist/emblems/trophy/commissioners-trophy.d.ts +8 -1
- package/dist/emblems/trophy/commissioners-trophy.js +8 -1
- package/dist/emblems/trophy/conn-smythe-trophy.d.ts +8 -1
- package/dist/emblems/trophy/conn-smythe-trophy.js +8 -1
- package/dist/emblems/trophy/cricket-urn.d.ts +8 -1
- package/dist/emblems/trophy/cricket-urn.js +8 -1
- package/dist/emblems/trophy/cricket-world-cup.d.ts +8 -1
- package/dist/emblems/trophy/cricket-world-cup.js +8 -1
- package/dist/emblems/trophy/cup.d.ts +8 -1
- package/dist/emblems/trophy/cup.js +8 -1
- package/dist/emblems/trophy/cy-young-award.d.ts +8 -1
- package/dist/emblems/trophy/cy-young-award.js +8 -1
- package/dist/emblems/trophy/dfb-pokal.d.ts +8 -1
- package/dist/emblems/trophy/dfb-pokal.js +8 -1
- package/dist/emblems/trophy/fa-cup.d.ts +8 -1
- package/dist/emblems/trophy/fa-cup.js +8 -1
- package/dist/emblems/trophy/fifa-world-cup.d.ts +8 -1
- package/dist/emblems/trophy/fifa-world-cup.js +8 -1
- package/dist/emblems/trophy/football.d.ts +8 -1
- package/dist/emblems/trophy/football.js +8 -1
- package/dist/emblems/trophy/foundation-player-award.d.ts +8 -1
- package/dist/emblems/trophy/foundation-player-award.js +8 -1
- package/dist/emblems/trophy/george-halas-trophy.d.ts +8 -1
- package/dist/emblems/trophy/george-halas-trophy.js +8 -1
- package/dist/emblems/trophy/globe.d.ts +8 -1
- package/dist/emblems/trophy/globe.js +8 -1
- package/dist/emblems/trophy/gold-glove-award.d.ts +8 -1
- package/dist/emblems/trophy/gold-glove-award.js +8 -1
- package/dist/emblems/trophy/grey-cup.d.ts +8 -1
- package/dist/emblems/trophy/grey-cup.js +8 -1
- package/dist/emblems/trophy/hank-aaron-award.d.ts +8 -1
- package/dist/emblems/trophy/hank-aaron-award.js +8 -1
- package/dist/emblems/trophy/hart-trophy.d.ts +8 -1
- package/dist/emblems/trophy/hart-trophy.js +8 -1
- package/dist/emblems/trophy/hockey-cup.d.ts +8 -1
- package/dist/emblems/trophy/hockey-cup.js +8 -1
- package/dist/emblems/trophy/jack-adams-trophy.d.ts +8 -1
- package/dist/emblems/trophy/jack-adams-trophy.js +8 -1
- package/dist/emblems/trophy/jackie-robinson-award.d.ts +8 -1
- package/dist/emblems/trophy/jackie-robinson-award.js +8 -1
- package/dist/emblems/trophy/jennings-trophy.d.ts +8 -1
- package/dist/emblems/trophy/jennings-trophy.js +8 -1
- package/dist/emblems/trophy/kelly-cup.d.ts +8 -1
- package/dist/emblems/trophy/kelly-cup.js +8 -1
- package/dist/emblems/trophy/king-clancy-trophy.d.ts +8 -1
- package/dist/emblems/trophy/king-clancy-trophy.js +8 -1
- package/dist/emblems/trophy/lady-byng-trophy.d.ts +8 -1
- package/dist/emblems/trophy/lady-byng-trophy.js +8 -1
- package/dist/emblems/trophy/lamar-hunt-trophy.d.ts +8 -1
- package/dist/emblems/trophy/lamar-hunt-trophy.js +8 -1
- package/dist/emblems/trophy/larry-bird-trophy.d.ts +8 -1
- package/dist/emblems/trophy/larry-bird-trophy.js +8 -1
- package/dist/emblems/trophy/larry-obrien-trophy-1977.d.ts +8 -1
- package/dist/emblems/trophy/larry-obrien-trophy-1977.js +8 -1
- package/dist/emblems/trophy/larry-obrien-trophy.d.ts +8 -1
- package/dist/emblems/trophy/larry-obrien-trophy.js +8 -1
- package/dist/emblems/trophy/laurel.d.ts +8 -1
- package/dist/emblems/trophy/laurel.js +8 -1
- package/dist/emblems/trophy/lester-patrick-trophy.d.ts +8 -1
- package/dist/emblems/trophy/lester-patrick-trophy.js +8 -1
- package/dist/emblems/trophy/lidded-cup.d.ts +8 -1
- package/dist/emblems/trophy/lidded-cup.js +8 -1
- package/dist/emblems/trophy/lombardi-trophy.d.ts +8 -1
- package/dist/emblems/trophy/lombardi-trophy.js +8 -1
- package/dist/emblems/trophy/magic-johnson-trophy.d.ts +8 -1
- package/dist/emblems/trophy/magic-johnson-trophy.js +8 -1
- package/dist/emblems/trophy/masterton-trophy.d.ts +8 -1
- package/dist/emblems/trophy/masterton-trophy.js +8 -1
- package/dist/emblems/trophy/messier-leadership-award.d.ts +8 -1
- package/dist/emblems/trophy/messier-leadership-award.js +8 -1
- package/dist/emblems/trophy/mlb-mvp-award.d.ts +8 -1
- package/dist/emblems/trophy/mlb-mvp-award.js +8 -1
- package/dist/emblems/trophy/mls-cup.d.ts +8 -1
- package/dist/emblems/trophy/mls-cup.js +8 -1
- package/dist/emblems/trophy/nba-eastern-conference-2001.d.ts +8 -1
- package/dist/emblems/trophy/nba-eastern-conference-2001.js +8 -1
- package/dist/emblems/trophy/nba-western-conference-2001.d.ts +8 -1
- package/dist/emblems/trophy/nba-western-conference-2001.js +8 -1
- package/dist/emblems/trophy/norris-trophy.d.ts +8 -1
- package/dist/emblems/trophy/norris-trophy.js +8 -1
- package/dist/emblems/trophy/obrien-cup.d.ts +8 -1
- package/dist/emblems/trophy/obrien-cup.js +8 -1
- package/dist/emblems/trophy/oscar-robertson-trophy.d.ts +8 -1
- package/dist/emblems/trophy/oscar-robertson-trophy.js +8 -1
- package/dist/emblems/trophy/paterson-cup.d.ts +8 -1
- package/dist/emblems/trophy/paterson-cup.js +8 -1
- package/dist/emblems/trophy/plaque.d.ts +8 -1
- package/dist/emblems/trophy/plaque.js +8 -1
- package/dist/emblems/trophy/presidents-trophy.d.ts +8 -1
- package/dist/emblems/trophy/presidents-trophy.js +8 -1
- package/dist/emblems/trophy/prince-of-wales-trophy.d.ts +8 -1
- package/dist/emblems/trophy/prince-of-wales-trophy.js +8 -1
- package/dist/emblems/trophy/relief-man-award.d.ts +8 -1
- package/dist/emblems/trophy/relief-man-award.js +8 -1
- package/dist/emblems/trophy/ring.d.ts +8 -1
- package/dist/emblems/trophy/ring.js +8 -1
- package/dist/emblems/trophy/rocket-richard-trophy.d.ts +8 -1
- package/dist/emblems/trophy/rocket-richard-trophy.js +8 -1
- package/dist/emblems/trophy/rosette.d.ts +8 -1
- package/dist/emblems/trophy/rosette.js +8 -1
- package/dist/emblems/trophy/rugby-cup.d.ts +8 -1
- package/dist/emblems/trophy/rugby-cup.js +8 -1
- package/dist/emblems/trophy/salver.d.ts +8 -1
- package/dist/emblems/trophy/salver.js +8 -1
- package/dist/emblems/trophy/selke-trophy.d.ts +8 -1
- package/dist/emblems/trophy/selke-trophy.js +8 -1
- package/dist/emblems/trophy/silver-slugger-award.d.ts +8 -1
- package/dist/emblems/trophy/silver-slugger-award.js +8 -1
- package/dist/emblems/trophy/soccer-ball.d.ts +8 -1
- package/dist/emblems/trophy/soccer-ball.js +8 -1
- package/dist/emblems/trophy/soccer-globe.d.ts +8 -1
- package/dist/emblems/trophy/soccer-globe.js +8 -1
- package/dist/emblems/trophy/stanley-cup.d.ts +8 -1
- package/dist/emblems/trophy/stanley-cup.js +8 -1
- package/dist/emblems/trophy/sumo-cup.d.ts +8 -1
- package/dist/emblems/trophy/sumo-cup.js +8 -1
- package/dist/emblems/trophy/ted-lindsay-award.d.ts +8 -1
- package/dist/emblems/trophy/ted-lindsay-award.js +8 -1
- package/dist/emblems/trophy/tennis-cup.d.ts +8 -1
- package/dist/emblems/trophy/tennis-cup.js +8 -1
- package/dist/emblems/trophy/tennis-plate.d.ts +8 -1
- package/dist/emblems/trophy/tennis-plate.js +8 -1
- package/dist/emblems/trophy/venus-rosewater-dish.d.ts +8 -1
- package/dist/emblems/trophy/venus-rosewater-dish.js +8 -1
- package/dist/emblems/trophy/vezina-trophy.d.ts +8 -1
- package/dist/emblems/trophy/vezina-trophy.js +8 -1
- package/dist/emblems/trophy/walter-cup.d.ts +8 -1
- package/dist/emblems/trophy/walter-cup.js +8 -1
- package/dist/emblems/trophy/webb-ellis-cup.d.ts +8 -1
- package/dist/emblems/trophy/webb-ellis-cup.js +8 -1
- package/dist/emblems/trophy/willie-oree-award.d.ts +8 -1
- package/dist/emblems/trophy/willie-oree-award.js +8 -1
- package/dist/emblems/trophy/wimbledon-gentlemens-trophy.d.ts +8 -1
- package/dist/emblems/trophy/wimbledon-gentlemens-trophy.js +8 -1
- package/dist/emblems/trophy/wnba-championship-trophy.d.ts +8 -1
- package/dist/emblems/trophy/wnba-championship-trophy.js +8 -1
- package/dist/emblems/trophy/woodlawn-vase.d.ts +8 -1
- package/dist/emblems/trophy/woodlawn-vase.js +8 -1
- package/dist/emblems/trophy/world-series-mvp-trophy.d.ts +8 -1
- package/dist/emblems/trophy/world-series-mvp-trophy.js +8 -1
- package/dist/emblems-entry.d.ts +2 -0
- package/dist/emblems-entry.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/turn-control.d.ts +72 -7
- package/dist/turn-control.js +22 -3
- package/dist/turn-full.d.ts +5 -1
- package/dist/turn-full.js +5 -1
- package/dist/version.d.ts +9 -1
- package/dist/version.js +9 -1
- package/package.json +37 -7
|
@@ -1,16 +1,56 @@
|
|
|
1
1
|
import type { FlagRenderer, PuckFace } from "./ball/ball.face.ts";
|
|
2
2
|
import type { Backnumber } from "./ball/ball.core.ts";
|
|
3
3
|
import type { BallDecal, BallMark, BallPaint, BallScript, BallSpots, BallStamp } from "./ball/ball.print.ts";
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* `metal`: full colour with a gradient. `line`: one outline in `currentColor`. `color`: flat fills of the main colour, with no gradient.
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import type { EmblemStyle } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
9
|
+
* const style: EmblemStyle = "color";
|
|
10
|
+
* console.log(style);
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
5
13
|
export type EmblemStyle = "metal" | "line" | "color";
|
|
14
|
+
/**
|
|
15
|
+
* The three styles an emblem is drawn in: `metal`, `line` and `color`.
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { EMBLEM_STYLES } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
19
|
+
* console.log(EMBLEM_STYLES.length, EMBLEM_STYLES[0]);
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
6
22
|
export declare const EMBLEM_STYLES: readonly ["metal", "line", "color"];
|
|
7
23
|
/**
|
|
8
24
|
* Where the outline's colour comes from. `inherit` (the default for markup you put in a page): the page's text colour, `currentColor`. `auto`: dark ink on a light device and pale ink on a dark
|
|
9
25
|
* one, for an image (an `<img>`, a data address) that cannot inherit. `light` and `dark` force one.
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* import type { EmblemTheme } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
29
|
+
* const theme: EmblemTheme = "auto";
|
|
30
|
+
* console.log(theme);
|
|
31
|
+
* ```
|
|
10
32
|
*/
|
|
11
33
|
export type EmblemTheme = "inherit" | "auto" | "light" | "dark";
|
|
12
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* The languages an emblem's `<title>` can be written in.
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* import type { EmblemLocale } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
39
|
+
* const locale: EmblemLocale = "ja";
|
|
40
|
+
* console.log(locale);
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
13
43
|
export type EmblemLocale = "en" | "ja";
|
|
44
|
+
/**
|
|
45
|
+
* What every emblem takes: its style, size, colours, theme, title and engraving.
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
49
|
+
* import type { EmblemOptions } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
50
|
+
* const options: EmblemOptions = { style: "line", size: 48, locale: "ja" };
|
|
51
|
+
* console.log(renderEmblem("medal:gold", options).includes("<title>"));
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
14
54
|
export interface EmblemOptions {
|
|
15
55
|
/** `metal` (the default), `line` or `color`. */
|
|
16
56
|
style?: EmblemStyle;
|
|
@@ -77,23 +117,54 @@ export interface EmblemOptions {
|
|
|
77
117
|
/** The same balls: where the logo and the lettering go, in degrees from the middle of the label area (see `BallSpots`). */
|
|
78
118
|
spots?: BallSpots;
|
|
79
119
|
}
|
|
80
|
-
/**
|
|
120
|
+
/**
|
|
121
|
+
* A turn, in degrees from the resting view (0 and 0 is the still drawing): `yaw` about the vertical axis, `pitch` the tilt toward the eye.
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* import { emblemFrame } from "@johnmorrisdotca/dougu-sports/turn";
|
|
125
|
+
* import type { FrameOptions } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
126
|
+
* const options: FrameOptions = { yaw: 40, pitch: 10, size: 96 };
|
|
127
|
+
* console.log(emblemFrame("trophy:cup", options).startsWith("<svg"));
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
81
130
|
export interface FrameOptions extends EmblemOptions {
|
|
82
131
|
yaw?: number;
|
|
83
132
|
pitch?: number;
|
|
84
133
|
/** A ball: the turn about the line of sight. */
|
|
85
134
|
roll?: number;
|
|
86
135
|
}
|
|
87
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* The ink of a drawing when a theme sets it, and the page it is made to read on.
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* import { EMBLEM_INK } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
141
|
+
* console.log(Object.keys(EMBLEM_INK).length);
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
88
144
|
export declare const EMBLEM_INK: {
|
|
89
145
|
readonly light: "#20262d";
|
|
90
146
|
readonly dark: "#eef1f3";
|
|
91
147
|
};
|
|
148
|
+
/**
|
|
149
|
+
* The page colour the line style is drawn against, for a light and for a dark page.
|
|
150
|
+
* @example
|
|
151
|
+
* ```ts
|
|
152
|
+
* import { EMBLEM_PAGE } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
153
|
+
* console.log(Object.keys(EMBLEM_PAGE).length);
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
92
156
|
export declare const EMBLEM_PAGE: {
|
|
93
157
|
readonly light: "#ffffff";
|
|
94
158
|
readonly dark: "#14181c";
|
|
95
159
|
};
|
|
96
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* The metals.
|
|
162
|
+
* @example
|
|
163
|
+
* ```ts
|
|
164
|
+
* import { METALS } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
165
|
+
* console.log(Object.keys(METALS).length);
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
97
168
|
export declare const METALS: {
|
|
98
169
|
readonly gold: "#d9a620";
|
|
99
170
|
readonly silver: "#aeb6c0";
|
|
@@ -101,9 +172,25 @@ export declare const METALS: {
|
|
|
101
172
|
};
|
|
102
173
|
/** A metal by name, or `flat` for a colour that is no metal (a crest's blue, a sport's plain ink). */
|
|
103
174
|
export type Metal = keyof typeof METALS | "flat";
|
|
104
|
-
/**
|
|
175
|
+
/**
|
|
176
|
+
* Where an emblem's art comes from: drawn for this package (`ours`, `drawn`) or made by this package's own code (`generated`). Nothing is copied from another project.
|
|
177
|
+
* @example
|
|
178
|
+
* ```ts
|
|
179
|
+
* import type { EmblemSource } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
180
|
+
* const source: EmblemSource = "drawn";
|
|
181
|
+
* console.log(source);
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
105
184
|
export type EmblemSource = "ours" | "generated" | "drawn";
|
|
106
|
-
/**
|
|
185
|
+
/**
|
|
186
|
+
* What an emblem is: a flat object (a front and a back, to flip), a ball (a sphere or a solid, turned in 3D), a body of revolution (`lathe`), an icon (one drawing, not turned) or a piece of gear (a flat drawing, not turned).
|
|
187
|
+
* @example
|
|
188
|
+
* ```ts
|
|
189
|
+
* import type { EmblemKind } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
190
|
+
* const kind: EmblemKind = "lathe";
|
|
191
|
+
* console.log(kind);
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
107
194
|
export type EmblemKind = "flat" | "ball" | "lathe" | "icon" | "gear";
|
|
108
195
|
export type Rgb = readonly [number, number, number];
|
|
109
196
|
/** A colour from `#rgb`, `#rrggbb` or `rgb(r, g, b)`, or `undefined` for anything else. */
|
|
@@ -200,7 +287,16 @@ export declare function wrap(o: {
|
|
|
200
287
|
edge?: string;
|
|
201
288
|
width?: number;
|
|
202
289
|
}): string;
|
|
203
|
-
/**
|
|
290
|
+
/**
|
|
291
|
+
* One emblem: its id and names, where its art comes from, and the functions that draw it. Importing one of these pulls in its own module and the small renderer it needs, not the other emblems.
|
|
292
|
+
* @example
|
|
293
|
+
* ```ts
|
|
294
|
+
* import { TROPHY_CUP } from "@johnmorrisdotca/dougu-sports";
|
|
295
|
+
* import type { Emblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
296
|
+
* const emblem: Emblem = TROPHY_CUP;
|
|
297
|
+
* console.log(emblem.id, emblem.kind);
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
204
300
|
export interface Emblem<Model = unknown> {
|
|
205
301
|
readonly id: string;
|
|
206
302
|
readonly en: string;
|
|
@@ -1,10 +1,40 @@
|
|
|
1
1
|
// What every emblem is made of: the options, the colours, the way a drawing is wrapped into a document, and the `Emblem` object each drawing is. It imports nothing from the rest of the
|
|
2
2
|
// package, so a bundler can take one emblem and leave the others.
|
|
3
|
+
/**
|
|
4
|
+
* The three styles an emblem is drawn in: `metal`, `line` and `color`.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { EMBLEM_STYLES } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
8
|
+
* console.log(EMBLEM_STYLES.length, EMBLEM_STYLES[0]);
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
3
11
|
export const EMBLEM_STYLES = ["metal", "line", "color"];
|
|
4
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* The ink of a drawing when a theme sets it, and the page it is made to read on.
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { EMBLEM_INK } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
17
|
+
* console.log(Object.keys(EMBLEM_INK).length);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
5
20
|
export const EMBLEM_INK = { light: "#20262d", dark: "#eef1f3" };
|
|
21
|
+
/**
|
|
22
|
+
* The page colour the line style is drawn against, for a light and for a dark page.
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { EMBLEM_PAGE } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
26
|
+
* console.log(Object.keys(EMBLEM_PAGE).length);
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
6
29
|
export const EMBLEM_PAGE = { light: "#ffffff", dark: "#14181c" };
|
|
7
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* The metals.
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { METALS } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
35
|
+
* console.log(Object.keys(METALS).length);
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
8
38
|
export const METALS = { gold: "#d9a620", silver: "#aeb6c0", bronze: "#b8733a" };
|
|
9
39
|
/** A colour from `#rgb`, `#rrggbb` or `rgb(r, g, b)`, or `undefined` for anything else. */
|
|
10
40
|
export function readColour(value) {
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import type { EmblemId } from "./emblem.ids.ts";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* An emblem's description in the two languages.
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import type { EmblemDescription } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
7
|
+
* const description: EmblemDescription = { en: "A cup on a plinth", ja: "台座の上のカップ" };
|
|
8
|
+
* console.log(description.en);
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
3
11
|
export interface EmblemDescription {
|
|
4
12
|
readonly en: string;
|
|
5
13
|
readonly ja: string;
|
|
6
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* What each emblem draws, in more words than its name, in English and Japanese. Not every emblem has one.
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { EMBLEM_DESCRIPTIONS } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
20
|
+
* console.log(Object.keys(EMBLEM_DESCRIPTIONS).length);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
7
23
|
export declare const EMBLEM_DESCRIPTIONS: Readonly<Partial<Record<EmblemId, EmblemDescription>>>;
|
|
@@ -19,6 +19,14 @@ function soccerColourways() {
|
|
|
19
19
|
}
|
|
20
20
|
return out;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* What each emblem draws, in more words than its name, in English and Japanese. Not every emblem has one.
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { EMBLEM_DESCRIPTIONS } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
27
|
+
* console.log(Object.keys(EMBLEM_DESCRIPTIONS).length);
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
22
30
|
export const EMBLEM_DESCRIPTIONS = {
|
|
23
31
|
"trophy:hockey-cup": { en: "Tall banded silver cup", ja: "帯を何段も重ねた背の高い銀のカップ" },
|
|
24
32
|
"trophy:basketball": { en: "Basketball trophy", ja: "バスケットボールのトロフィー" },
|
|
@@ -46,6 +54,9 @@ export const EMBLEM_DESCRIPTIONS = {
|
|
|
46
54
|
"ball:afl": { en: "Australian football", ja: "オーストラリアンフットボールのボール" },
|
|
47
55
|
"ball:gaelic-football": { en: "Gaelic football", ja: "ゲーリックフットボールのボール" },
|
|
48
56
|
"ball:plastic-baseball-slotted": { en: "A hollow white plastic practice baseball with eight oblong slots on one half and the other half solid", ja: "中空の白いプラスチック製の野球練習球。半球の一方に細長い穴が8つ並び、もう一方には穴がない" },
|
|
57
|
+
"ball:plastic-baseball-practice": { en: "A hollow plastic practice baseball in two tones, high-visibility yellow and black, with large oval slots on both halves", ja: "中空のプラスチック製の野球練習球。蛍光の黄色と黒の二色で、両方の半球に大きな楕円の穴が並ぶ" },
|
|
58
|
+
"ball:plastic-baseball-practice-white": { en: "A hollow white plastic practice baseball with large oval slots on both halves", ja: "中空の白いプラスチック製の野球練習球。両方の半球に大きな楕円の穴が並ぶ" },
|
|
59
|
+
"ball:plastic-baseball-practice-orange": { en: "A hollow orange plastic practice baseball with large oval slots on both halves", ja: "中空の橙色のプラスチック製の野球練習球。両方の半球に大きな楕円の穴が並ぶ" },
|
|
49
60
|
"ball:squash": { en: "Squash ball, double yellow dot", ja: "スカッシュボール(ダブルイエロードット)" },
|
|
50
61
|
"ball:squash-yellow": { en: "Squash ball, yellow dot", ja: "スカッシュボール(イエロードット)" },
|
|
51
62
|
"ball:squash-green": { en: "Squash ball, green dot", ja: "スカッシュボール(グリーンドット)" },
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { type EmblemLocale, type EmblemStyle, type EmblemTheme } from "./emblem.core.ts";
|
|
2
2
|
import { type EmblemRef } from "./emblem.api.ts";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* The options both displays share.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import type { DisplayOptions } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
8
|
+
* const options: DisplayOptions = { width: 400, style: "color", locale: "ja" };
|
|
9
|
+
* console.log(options.width);
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
4
12
|
export interface DisplayOptions {
|
|
5
13
|
/** The width in pixels; the height follows the drawing's proportions. A podium is 320 by default, an award case as wide as its cells. */
|
|
6
14
|
width?: number;
|
|
@@ -15,7 +23,15 @@ export interface DisplayOptions {
|
|
|
15
23
|
/** The `<desc>`: by default it lists what is drawn, in words. */
|
|
16
24
|
desc?: string;
|
|
17
25
|
}
|
|
18
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* One place of a podium.
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import type { PodiumPlace } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
31
|
+
* const place: PodiumPlace = { emblem: "medal:gold", name: "Aoki", label: "9.80" };
|
|
32
|
+
* console.log(place.name);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
19
35
|
export interface PodiumPlace {
|
|
20
36
|
/** The medal or trophy for the place: any emblem. By default the gold, silver and bronze medals. */
|
|
21
37
|
emblem?: EmblemRef;
|
|
@@ -26,9 +42,26 @@ export interface PodiumPlace {
|
|
|
26
42
|
/** A line on the step: a time, a score, a number of points. */
|
|
27
43
|
label?: string;
|
|
28
44
|
}
|
|
29
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* What `podium` takes.
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* import { podium } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
50
|
+
* import type { PodiumOptions } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
51
|
+
* const options: PodiumOptions = { width: 360 };
|
|
52
|
+
* console.log(podium([{ name: "Aoki" }], options).startsWith("<svg"));
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
30
55
|
export type PodiumOptions = DisplayOptions;
|
|
31
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* One kind of trophy in an award case.
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* import type { AwardItem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
61
|
+
* const item: AwardItem = { emblem: "trophy:hockey-cup", count: 4, label: "2012 to 2024" };
|
|
62
|
+
* console.log(item.count);
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
32
65
|
export interface AwardItem {
|
|
33
66
|
/** The trophy, medal or crest: any emblem. */
|
|
34
67
|
emblem: EmblemRef;
|
|
@@ -37,7 +70,16 @@ export interface AwardItem {
|
|
|
37
70
|
/** A line under the shelf: the years, or a name. */
|
|
38
71
|
label?: string;
|
|
39
72
|
}
|
|
40
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* What `awardCase` takes.
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* import { awardCase } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
78
|
+
* import type { AwardCaseOptions } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
79
|
+
* const options: AwardCaseOptions = { perRow: 3, layout: "row" };
|
|
80
|
+
* console.log(awardCase([{ emblem: "medal:gold" }], options).startsWith("<svg"));
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
41
83
|
export interface AwardCaseOptions extends DisplayOptions {
|
|
42
84
|
/** Items in a row before the case wraps into another (5 by default, 1 to 12). */
|
|
43
85
|
perRow?: number;
|
|
@@ -52,6 +94,9 @@ export declare function safeImage(source: unknown): string | undefined;
|
|
|
52
94
|
* A podium: first, second and third on tiered steps (second on the left, first in the middle, third on the right), each with a medal or a trophy, and optionally a name, a flag and a line of text. `places[0]` is first;
|
|
53
95
|
* a place left out is an empty step. The drawing is the page's text colour on tinted steps, so it reads on light and dark; it has a title and a description that says who stands where. A flag is SVG markup or a URL
|
|
54
96
|
* and is drawn as an `<image>`, so it cannot run script or reach anything it was not given; anything that is neither is left out.
|
|
97
|
+
* @param places - First, second and third; a place left out is an empty step.
|
|
98
|
+
* @param options - The width, style, theme and labels.
|
|
99
|
+
* @returns The podium as a document of SVG.
|
|
55
100
|
* @example
|
|
56
101
|
* ```ts
|
|
57
102
|
* import { podium } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
@@ -64,6 +109,9 @@ export declare function podium(places: readonly (PodiumPlace | null | undefined)
|
|
|
64
109
|
/**
|
|
65
110
|
* An award case: a team's trophies on a shelf (or in a row), each drawn once with a `×N` badge when the team has won it more than once, wrapping into more rows after `perRow` items. Each item can carry a line of
|
|
66
111
|
* text, such as its years. The drawing follows the page's text colour, has a title and a description that lists what is in the case, and holds at most 60 items.
|
|
112
|
+
* @param items - The trophies, each with how many and a line of text.
|
|
113
|
+
* @param options - The width, rows, layout, style and labels.
|
|
114
|
+
* @returns The case as a document of SVG.
|
|
67
115
|
* @example
|
|
68
116
|
* ```ts
|
|
69
117
|
* import { awardCase } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
@@ -87,6 +87,9 @@ function step(style, place, x, y, w, h, defs) {
|
|
|
87
87
|
* A podium: first, second and third on tiered steps (second on the left, first in the middle, third on the right), each with a medal or a trophy, and optionally a name, a flag and a line of text. `places[0]` is first;
|
|
88
88
|
* a place left out is an empty step. The drawing is the page's text colour on tinted steps, so it reads on light and dark; it has a title and a description that says who stands where. A flag is SVG markup or a URL
|
|
89
89
|
* and is drawn as an `<image>`, so it cannot run script or reach anything it was not given; anything that is neither is left out.
|
|
90
|
+
* @param places - First, second and third; a place left out is an empty step.
|
|
91
|
+
* @param options - The width, style, theme and labels.
|
|
92
|
+
* @returns The podium as a document of SVG.
|
|
90
93
|
* @example
|
|
91
94
|
* ```ts
|
|
92
95
|
* import { podium } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
@@ -148,6 +151,9 @@ export function podium(places, options = {}) {
|
|
|
148
151
|
/**
|
|
149
152
|
* An award case: a team's trophies on a shelf (or in a row), each drawn once with a `×N` badge when the team has won it more than once, wrapping into more rows after `perRow` items. Each item can carry a line of
|
|
150
153
|
* text, such as its years. The drawing follows the page's text colour, has a title and a description that lists what is in the case, and holds at most 60 items.
|
|
154
|
+
* @param items - The trophies, each with how many and a line of text.
|
|
155
|
+
* @param options - The width, rows, layout, style and labels.
|
|
156
|
+
* @returns The case as a document of SVG.
|
|
151
157
|
* @example
|
|
152
158
|
* ```ts
|
|
153
159
|
* import { awardCase } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type EmblemRef } from "./emblem.api.ts";
|
|
2
|
+
import type { EmblemOptions } from "./emblem.core.ts";
|
|
3
|
+
/**
|
|
4
|
+
* What `emblemEmbedCode` takes: the look of the emblem, how it turns, and where the package's pages are.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import type { EmbedOptions } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
8
|
+
* const options: EmbedOptions = { style: "line", size: 160, turnable: true, speed: 24 };
|
|
9
|
+
* console.log(options.size);
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export interface EmbedOptions extends Pick<EmblemOptions, "style" | "size" | "tint" | "accent" | "initials" | "theme" | "locale"> {
|
|
13
|
+
/** The angle it is drawn at, in degrees. */
|
|
14
|
+
yaw?: number;
|
|
15
|
+
pitch?: number;
|
|
16
|
+
roll?: number;
|
|
17
|
+
/** A drag, the arrow keys and Space turn it. */
|
|
18
|
+
turnable?: boolean;
|
|
19
|
+
/** It turns by itself (not for a reader who prefers reduced motion). */
|
|
20
|
+
autoplay?: boolean;
|
|
21
|
+
/** Degrees a second. */
|
|
22
|
+
speed?: number;
|
|
23
|
+
/** Where the embed page is: this package's demo site by default. */
|
|
24
|
+
site?: string;
|
|
25
|
+
/** Where the package's `element` script is: jsDelivr's copy of the latest version by default. */
|
|
26
|
+
cdn?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The ways to put one emblem in a page, each as the text to paste.
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { emblemEmbedCode } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
33
|
+
* import type { EmbedCode } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
34
|
+
* const code: EmbedCode = emblemEmbedCode("medal:gold");
|
|
35
|
+
* console.log(code.iframe.startsWith("<iframe"), code.img.startsWith("<img"));
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export interface EmbedCode {
|
|
39
|
+
/** The `<script>` that registers `<dougu-emblem>`. */
|
|
40
|
+
script: string;
|
|
41
|
+
/** The `<dougu-emblem>` tag with its attributes. */
|
|
42
|
+
element: string;
|
|
43
|
+
/** The script and the tag, to paste into a page. */
|
|
44
|
+
html: string;
|
|
45
|
+
/** An `<iframe>` of the embed page, which needs no script on your page. */
|
|
46
|
+
iframe: string;
|
|
47
|
+
/** The embed page's address. */
|
|
48
|
+
address: string;
|
|
49
|
+
/** An ES module that imports the element and draws the emblem. */
|
|
50
|
+
module: string;
|
|
51
|
+
/** An `<img>` with the drawing in its `src` as a data address. */
|
|
52
|
+
img: string;
|
|
53
|
+
/** The drawing as SVG markup. */
|
|
54
|
+
svg: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Every way to put one emblem in a page, as text to copy: the script and tag, an iframe, an ES module, an `<img>` with a data address, and the raw SVG. The tag and the iframe carry the same choices, so they draw the same emblem.
|
|
58
|
+
* @param ref - An emblem id (or short name, or an emblem).
|
|
59
|
+
* @param options - How it looks and turns, and where the package's pages are (`site`, `cdn`).
|
|
60
|
+
* @returns The snippets, as strings.
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* import { emblemEmbedCode } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
64
|
+
* const code = emblemEmbedCode("trophy:cup", { style: "line", size: 160, turnable: true });
|
|
65
|
+
* console.log(code.element);
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare function emblemEmbedCode(ref: EmblemRef, options?: EmbedOptions): EmbedCode;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { emblemDataUri } from "./emblem.uri.js";
|
|
2
|
+
import { emblemOf, renderEmblem } from "./emblem.api.js";
|
|
3
|
+
const escapeHtml = (text) => text.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
4
|
+
/**
|
|
5
|
+
* Every way to put one emblem in a page, as text to copy: the script and tag, an iframe, an ES module, an `<img>` with a data address, and the raw SVG. The tag and the iframe carry the same choices, so they draw the same emblem.
|
|
6
|
+
* @param ref - An emblem id (or short name, or an emblem).
|
|
7
|
+
* @param options - How it looks and turns, and where the package's pages are (`site`, `cdn`).
|
|
8
|
+
* @returns The snippets, as strings.
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { emblemEmbedCode } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
12
|
+
* const code = emblemEmbedCode("trophy:cup", { style: "line", size: 160, turnable: true });
|
|
13
|
+
* console.log(code.element);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export function emblemEmbedCode(ref, options = {}) {
|
|
17
|
+
const { emblem } = emblemOf(ref);
|
|
18
|
+
const id = typeof ref === "string" ? ref : emblem.id;
|
|
19
|
+
const size = options.size ?? 64;
|
|
20
|
+
const site = (options.site ?? "https://johnmorrisdotca.github.io/dougu-sports/").replace(/\/?$/, "/");
|
|
21
|
+
const cdn = options.cdn ?? "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/dougu-sports/element/+esm";
|
|
22
|
+
const pairs = [["emblem", id]];
|
|
23
|
+
if (options.style !== undefined && options.style !== "metal")
|
|
24
|
+
pairs.push(["variant", options.style]);
|
|
25
|
+
if (options.size !== undefined)
|
|
26
|
+
pairs.push(["size", String(options.size)]);
|
|
27
|
+
if (options.tint)
|
|
28
|
+
pairs.push(["tint", options.tint]);
|
|
29
|
+
if (options.accent)
|
|
30
|
+
pairs.push(["accent", options.accent]);
|
|
31
|
+
if (options.initials)
|
|
32
|
+
pairs.push(["initials", options.initials]);
|
|
33
|
+
if (options.theme !== undefined && options.theme !== "inherit")
|
|
34
|
+
pairs.push(["theme", options.theme]);
|
|
35
|
+
if (options.locale === "ja")
|
|
36
|
+
pairs.push(["locale", "ja"]);
|
|
37
|
+
for (const name of ["yaw", "pitch", "roll", "speed"])
|
|
38
|
+
if (options[name] !== undefined && Number.isFinite(options[name]))
|
|
39
|
+
pairs.push([name, String(options[name])]);
|
|
40
|
+
const attributes = pairs.map(([name, value]) => ` ${name}="${escapeHtml(value)}"`).join("");
|
|
41
|
+
const element = `<dougu-emblem${attributes}${options.turnable ? " turnable" : ""}${options.autoplay ? " autoplay" : ""}></dougu-emblem>`;
|
|
42
|
+
const script = `<script type="module" src="${escapeHtml(cdn)}"></script>`;
|
|
43
|
+
const query = new URLSearchParams(pairs);
|
|
44
|
+
if (options.turnable)
|
|
45
|
+
query.set("turnable", "1");
|
|
46
|
+
if (options.autoplay)
|
|
47
|
+
query.set("autoplay", "1");
|
|
48
|
+
const address = `${site}embed.html?${query.toString()}`;
|
|
49
|
+
const name = options.locale === "ja" ? emblem.ja : emblem.en;
|
|
50
|
+
const frame = Math.ceil(size) + 16;
|
|
51
|
+
const draw = { ...options };
|
|
52
|
+
for (const key of ["yaw", "pitch", "roll", "turnable", "autoplay", "speed", "site", "cdn"])
|
|
53
|
+
delete draw[key];
|
|
54
|
+
const svgOptions = { ...draw, ...(options.style === undefined ? {} : { style: options.style }) };
|
|
55
|
+
return {
|
|
56
|
+
script,
|
|
57
|
+
element,
|
|
58
|
+
html: `${script}\n${element}`,
|
|
59
|
+
iframe: `<iframe src="${escapeHtml(address)}" title="${escapeHtml(name)}" width="${frame}" height="${frame}" loading="lazy" style="border:0"></iframe>`,
|
|
60
|
+
address,
|
|
61
|
+
module: `import "@johnmorrisdotca/dougu-sports/element";\n\nconst emblem = document.createElement("dougu-emblem");\n${pairs.map(([n, v]) => `emblem.setAttribute("${n}", ${JSON.stringify(v)});`).join("\n")}${options.turnable ? '\nemblem.setAttribute("turnable", "");' : ""}${options.autoplay ? '\nemblem.setAttribute("autoplay", "");' : ""}\ndocument.body.append(emblem);`,
|
|
62
|
+
img: `<img src="${escapeHtml(emblemDataUri(ref, svgOptions))}" alt="${escapeHtml(name)}" width="${size}" height="${size}">`,
|
|
63
|
+
svg: renderEmblem(ref, svgOptions),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { BallId, GearId, MedalId, SportName, TrophyId } from "./emblem.ids.ts";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The equipment of one sport.
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { sportEquipment } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
7
|
+
* import type { SportEquipment } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
8
|
+
* const nhl: SportEquipment = sportEquipment("nhl");
|
|
9
|
+
* console.log(nhl.ball, nhl.trophy);
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
3
12
|
export interface SportEquipment {
|
|
4
13
|
sport: SportName;
|
|
5
14
|
/** The ball, or the implement that stands for one (the puck, the shuttlecock, the shot). Swimming, diving, artistic swimming, skating, the Japanese sports (sumo, kendo, judo, kyudo, karate) and the combat sports (MMA, boxing, wrestling, professional wrestling) have none. */
|
|
@@ -13,6 +22,8 @@ export interface SportEquipment {
|
|
|
13
22
|
}
|
|
14
23
|
/**
|
|
15
24
|
* What a sport is played and won with, as ids of the registry: `sportEquipment("nhl")` is the puck, a stick, a skate, a goalie's mask and a net, and the hockey cup. The arrays are new each call. An unknown sport is an error.
|
|
25
|
+
* @param sport - A name from `SPORT_NAMES`.
|
|
26
|
+
* @returns The sport's ball, gear, trophy and medal, as emblem ids.
|
|
16
27
|
* @example
|
|
17
28
|
* ```ts
|
|
18
29
|
* import { sportEquipment } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
@@ -45,6 +45,8 @@ const TABLE = {
|
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
47
47
|
* What a sport is played and won with, as ids of the registry: `sportEquipment("nhl")` is the puck, a stick, a skate, a goalie's mask and a net, and the hockey cup. The arrays are new each call. An unknown sport is an error.
|
|
48
|
+
* @param sport - A name from `SPORT_NAMES`.
|
|
49
|
+
* @returns The sport's ball, gear, trophy and medal, as emblem ids.
|
|
48
50
|
* @example
|
|
49
51
|
* ```ts
|
|
50
52
|
* import { sportEquipment } from "@johnmorrisdotca/dougu-sports/emblems";
|