@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,7 +1,24 @@
|
|
|
1
1
|
import { type MakerId, type TeamId } from "./brand.data.ts";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* What a maker's logo is made of: its mark alone (the default), its wordmark alone, the two side by side or the wordmark under the mark.
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import type { LogoLayout } from "@johnmorrisdotca/dougu-sports/brands";
|
|
7
|
+
* const layout: LogoLayout = "stacked";
|
|
8
|
+
* console.log(layout);
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
3
11
|
export type LogoLayout = "mark" | "wordmark" | "horizontal" | "stacked";
|
|
4
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* The options every logo takes.
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { teamLogo } from "@johnmorrisdotca/dougu-sports/brands";
|
|
17
|
+
* import type { LogoOptions } from "@johnmorrisdotca/dougu-sports/brands";
|
|
18
|
+
* const options: LogoOptions = { color: "mono", ink: "#222222", size: 48 };
|
|
19
|
+
* console.log(teamLogo("saltmere", options).startsWith("<svg"));
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
5
22
|
export interface LogoOptions {
|
|
6
23
|
/** `"full"` (the default) draws the logo in its own colours; `"mono"` draws it in one colour, `ink`. */
|
|
7
24
|
color?: "full" | "mono";
|
|
@@ -14,12 +31,29 @@ export interface LogoOptions {
|
|
|
14
31
|
/** The `<title>`: a string writes that title (escaped), `false` drops it and marks the drawing `aria-hidden="true"`. By default the maker's name or the team's name. */
|
|
15
32
|
title?: string | false;
|
|
16
33
|
}
|
|
17
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* The options of a maker's logo.
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { makerLogo } from "@johnmorrisdotca/dougu-sports/brands";
|
|
39
|
+
* import type { MakerLogoOptions } from "@johnmorrisdotca/dougu-sports/brands";
|
|
40
|
+
* const options: MakerLogoOptions = { layout: "horizontal", theme: "dark", size: 48 };
|
|
41
|
+
* console.log(makerLogo("arvane", options).startsWith("<svg"));
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
18
44
|
export interface MakerLogoOptions extends LogoOptions {
|
|
19
45
|
/** Which parts to draw. By default only the mark: the name is optional. */
|
|
20
46
|
layout?: LogoLayout;
|
|
21
47
|
}
|
|
22
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Where a logo goes inside another drawing: its top left corner and its height, in that drawing's units.
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* import type { LogoPlace } from "@johnmorrisdotca/dougu-sports/brands";
|
|
53
|
+
* const place: LogoPlace = { x: 12, y: 8, size: 30 };
|
|
54
|
+
* console.log(place.size);
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
23
57
|
export interface LogoPlace {
|
|
24
58
|
x?: number;
|
|
25
59
|
y?: number;
|
|
@@ -28,6 +62,9 @@ export interface LogoPlace {
|
|
|
28
62
|
}
|
|
29
63
|
/**
|
|
30
64
|
* A fictional maker's logo as an SVG document: its mark by default, or its wordmark, or both (`layout`). In its own colours for a light or a dark page, or in one colour (`color: "mono"`, `ink`).
|
|
65
|
+
* @param id - A maker id from `MAKER_IDS`.
|
|
66
|
+
* @param o - The layout, colours, size and title.
|
|
67
|
+
* @returns The logo as a document of SVG.
|
|
31
68
|
* @example
|
|
32
69
|
* ```ts
|
|
33
70
|
* import { makerLogo } from "@johnmorrisdotca/dougu-sports/brands";
|
|
@@ -37,11 +74,41 @@ export interface LogoPlace {
|
|
|
37
74
|
* ```
|
|
38
75
|
*/
|
|
39
76
|
export declare function makerLogo(id: MakerId, o?: MakerLogoOptions): string;
|
|
40
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* A fictional team's logo as an SVG document, in its own colours for a light or a dark page, or in one colour.
|
|
79
|
+
* @param id - A team id from `TEAM_IDS`.
|
|
80
|
+
* @param o - The colours, size and title.
|
|
81
|
+
* @returns The logo as a document of SVG.
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* import { teamLogo } from "@johnmorrisdotca/dougu-sports/brands";
|
|
85
|
+
* console.log(teamLogo("saltmere", { size: 64 }).startsWith("<svg"));
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
41
88
|
export declare function teamLogo(id: TeamId, o?: LogoOptions): string;
|
|
42
89
|
/**
|
|
43
90
|
* A maker's logo as a `<g>` to put inside another SVG: a jersey, a cap, a T-shirt, a card. It has no id, no gradient and no `<title>`, so any number of them can sit in one document. `x`, `y` and `size` place it in that drawing's units.
|
|
91
|
+
* @param id - A maker id from `MAKER_IDS`.
|
|
92
|
+
* @param place - Where the logo goes: its top left corner and height.
|
|
93
|
+
* @param o - The layout and colours.
|
|
94
|
+
* @returns A `<g>` element to place inside another SVG.
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* import { makerLogoGroup } from "@johnmorrisdotca/dougu-sports/brands";
|
|
98
|
+
* console.log(makerLogoGroup("arvane", { x: 10, y: 10, size: 40 }).startsWith("<g"));
|
|
99
|
+
* ```
|
|
44
100
|
*/
|
|
45
101
|
export declare function makerLogoGroup(id: MakerId, place?: LogoPlace, o?: Omit<MakerLogoOptions, "size" | "title">): string;
|
|
46
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* A team's logo as a `<g>` to put inside another SVG (see `makerLogoGroup`).
|
|
104
|
+
* @param id - A team id from `TEAM_IDS`.
|
|
105
|
+
* @param place - Where the logo goes: its top left corner and height.
|
|
106
|
+
* @param o - The colours.
|
|
107
|
+
* @returns A `<g>` element to place inside another SVG.
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* import { teamLogoGroup } from "@johnmorrisdotca/dougu-sports/brands";
|
|
111
|
+
* console.log(teamLogoGroup("saltmere", { x: 0, y: 0, size: 40 }).startsWith("<g"));
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
47
114
|
export declare function teamLogoGroup(id: TeamId, place?: LogoPlace, o?: Omit<LogoOptions, "size" | "title">): string;
|
|
@@ -77,6 +77,9 @@ function team(id) {
|
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* A fictional maker's logo as an SVG document: its mark by default, or its wordmark, or both (`layout`). In its own colours for a light or a dark page, or in one colour (`color: "mono"`, `ink`).
|
|
80
|
+
* @param id - A maker id from `MAKER_IDS`.
|
|
81
|
+
* @param o - The layout, colours, size and title.
|
|
82
|
+
* @returns The logo as a document of SVG.
|
|
80
83
|
* @example
|
|
81
84
|
* ```ts
|
|
82
85
|
* import { makerLogo } from "@johnmorrisdotca/dougu-sports/brands";
|
|
@@ -89,18 +92,48 @@ export function makerLogo(id, o) {
|
|
|
89
92
|
const data = maker(id);
|
|
90
93
|
return document(makerBody(data, layoutOf(o?.layout), o), data.name, o);
|
|
91
94
|
}
|
|
92
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* A fictional team's logo as an SVG document, in its own colours for a light or a dark page, or in one colour.
|
|
97
|
+
* @param id - A team id from `TEAM_IDS`.
|
|
98
|
+
* @param o - The colours, size and title.
|
|
99
|
+
* @returns The logo as a document of SVG.
|
|
100
|
+
* @example
|
|
101
|
+
* ```ts
|
|
102
|
+
* import { teamLogo } from "@johnmorrisdotca/dougu-sports/brands";
|
|
103
|
+
* console.log(teamLogo("saltmere", { size: 64 }).startsWith("<svg"));
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
93
106
|
export function teamLogo(id, o) {
|
|
94
107
|
const data = team(id);
|
|
95
108
|
return document(teamBody(data, o), `${data.city} ${data.nickname}`, o);
|
|
96
109
|
}
|
|
97
110
|
/**
|
|
98
111
|
* A maker's logo as a `<g>` to put inside another SVG: a jersey, a cap, a T-shirt, a card. It has no id, no gradient and no `<title>`, so any number of them can sit in one document. `x`, `y` and `size` place it in that drawing's units.
|
|
112
|
+
* @param id - A maker id from `MAKER_IDS`.
|
|
113
|
+
* @param place - Where the logo goes: its top left corner and height.
|
|
114
|
+
* @param o - The layout and colours.
|
|
115
|
+
* @returns A `<g>` element to place inside another SVG.
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* import { makerLogoGroup } from "@johnmorrisdotca/dougu-sports/brands";
|
|
119
|
+
* console.log(makerLogoGroup("arvane", { x: 10, y: 10, size: 40 }).startsWith("<g"));
|
|
120
|
+
* ```
|
|
99
121
|
*/
|
|
100
122
|
export function makerLogoGroup(id, place, o) {
|
|
101
123
|
return group(makerBody(maker(id), layoutOf(o?.layout), o), place);
|
|
102
124
|
}
|
|
103
|
-
/**
|
|
125
|
+
/**
|
|
126
|
+
* A team's logo as a `<g>` to put inside another SVG (see `makerLogoGroup`).
|
|
127
|
+
* @param id - A team id from `TEAM_IDS`.
|
|
128
|
+
* @param place - Where the logo goes: its top left corner and height.
|
|
129
|
+
* @param o - The colours.
|
|
130
|
+
* @returns A `<g>` element to place inside another SVG.
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* import { teamLogoGroup } from "@johnmorrisdotca/dougu-sports/brands";
|
|
134
|
+
* console.log(teamLogoGroup("saltmere", { x: 0, y: 0, size: 40 }).startsWith("<g"));
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
104
137
|
export function teamLogoGroup(id, place, o) {
|
|
105
138
|
return group(teamBody(team(id), o), place);
|
|
106
139
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TurnController } from "./turn-control.ts";
|
|
2
|
+
/** `HTMLElement` where there is one; a bare class on a server, so that importing this module there does not throw. */
|
|
3
|
+
declare const Base: typeof HTMLElement;
|
|
4
|
+
/**
|
|
5
|
+
* The `<dougu-emblem>` custom element: one emblem drawn as SVG in its shadow root. Importing this entry point registers the tag once. It takes the attributes `emblem` (an id such as `trophy:cup`, or a short name), `variant` (`metal`, `line` or `color`), `size` (pixels, 64 by default), `tint`, `accent`, `initials`, `theme` (`inherit`, `auto`, `light` or `dark`), `locale` (`en` or `ja`), `title`, `yaw`, `pitch` and `roll` (the angle it is drawn at), `turnable` (a drag, the arrow keys and Space turn it), `autoplay` (it turns by itself, unless the reader prefers reduced motion; it waits while it is off screen) and `speed` (degrees a second). Change any attribute and it is drawn again. An emblem that cannot turn is drawn still whatever `turnable` says.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts no-run
|
|
9
|
+
* import type { DouguEmblem } from "@johnmorrisdotca/dougu-sports/element";
|
|
10
|
+
*
|
|
11
|
+
* const cup = document.createElement("dougu-emblem") as DouguEmblem;
|
|
12
|
+
* cup.setAttribute("emblem", "trophy:stanley-cup");
|
|
13
|
+
* cup.setAttribute("size", "160");
|
|
14
|
+
* cup.setAttribute("turnable", "");
|
|
15
|
+
* document.body.append(cup);
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class DouguEmblem extends Base {
|
|
19
|
+
#private;
|
|
20
|
+
static observedAttributes: string[];
|
|
21
|
+
/** The controller of the turning while the emblem is turnable and drawn, or `undefined`: its angles, `play()`, `pause()` and `setAngles()`. */
|
|
22
|
+
get turner(): TurnController | undefined;
|
|
23
|
+
connectedCallback(): void;
|
|
24
|
+
disconnectedCallback(): void;
|
|
25
|
+
attributeChangedCallback(): void;
|
|
26
|
+
}
|
|
27
|
+
declare global {
|
|
28
|
+
interface HTMLElementTagNameMap {
|
|
29
|
+
"dougu-emblem": DouguEmblem;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export {};
|
package/dist/element.js
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/// <reference lib="dom" />
|
|
2
|
+
// <dougu-emblem>: any emblem as a web component, still or turning by hand or by itself. Importing this entry point registers the tag once.
|
|
3
|
+
import { emblemFrame, renderEmblem } from "./emblems/emblem.api.js";
|
|
4
|
+
import { bindTurn } from "./turn-full.js";
|
|
5
|
+
const STYLE = ":host{display:inline-block;line-height:0;max-width:100%}.stage{display:block;line-height:0}.stage svg{display:block;max-width:100%;height:auto}";
|
|
6
|
+
const number = (value) => {
|
|
7
|
+
if (value === null || value.trim() === "")
|
|
8
|
+
return undefined;
|
|
9
|
+
const n = Number(value);
|
|
10
|
+
return Number.isFinite(n) ? n : undefined;
|
|
11
|
+
};
|
|
12
|
+
const flag = (value) => value !== null && value !== "false" && value !== "0";
|
|
13
|
+
/** `HTMLElement` where there is one; a bare class on a server, so that importing this module there does not throw. */
|
|
14
|
+
const Base = typeof HTMLElement === "undefined" ? class {
|
|
15
|
+
} : HTMLElement;
|
|
16
|
+
/**
|
|
17
|
+
* The `<dougu-emblem>` custom element: one emblem drawn as SVG in its shadow root. Importing this entry point registers the tag once. It takes the attributes `emblem` (an id such as `trophy:cup`, or a short name), `variant` (`metal`, `line` or `color`), `size` (pixels, 64 by default), `tint`, `accent`, `initials`, `theme` (`inherit`, `auto`, `light` or `dark`), `locale` (`en` or `ja`), `title`, `yaw`, `pitch` and `roll` (the angle it is drawn at), `turnable` (a drag, the arrow keys and Space turn it), `autoplay` (it turns by itself, unless the reader prefers reduced motion; it waits while it is off screen) and `speed` (degrees a second). Change any attribute and it is drawn again. An emblem that cannot turn is drawn still whatever `turnable` says.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts no-run
|
|
21
|
+
* import type { DouguEmblem } from "@johnmorrisdotca/dougu-sports/element";
|
|
22
|
+
*
|
|
23
|
+
* const cup = document.createElement("dougu-emblem") as DouguEmblem;
|
|
24
|
+
* cup.setAttribute("emblem", "trophy:stanley-cup");
|
|
25
|
+
* cup.setAttribute("size", "160");
|
|
26
|
+
* cup.setAttribute("turnable", "");
|
|
27
|
+
* document.body.append(cup);
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export class DouguEmblem extends Base {
|
|
31
|
+
static observedAttributes = ["emblem", "variant", "size", "tint", "accent", "initials", "theme", "locale", "title", "yaw", "pitch", "roll", "turnable", "autoplay", "speed"];
|
|
32
|
+
#stage;
|
|
33
|
+
#turner;
|
|
34
|
+
#watch;
|
|
35
|
+
#resume = false;
|
|
36
|
+
#queued = false;
|
|
37
|
+
/** The controller of the turning while the emblem is turnable and drawn, or `undefined`: its angles, `play()`, `pause()` and `setAngles()`. */
|
|
38
|
+
get turner() {
|
|
39
|
+
return this.#turner;
|
|
40
|
+
}
|
|
41
|
+
connectedCallback() {
|
|
42
|
+
this.#shell();
|
|
43
|
+
this.#draw();
|
|
44
|
+
if (typeof IntersectionObserver === "function") {
|
|
45
|
+
this.#watch = new IntersectionObserver((seen) => {
|
|
46
|
+
const visible = seen[seen.length - 1]?.isIntersecting !== false;
|
|
47
|
+
if (!visible && this.#turner?.playing) {
|
|
48
|
+
this.#turner.pause();
|
|
49
|
+
this.#resume = true;
|
|
50
|
+
}
|
|
51
|
+
else if (visible && this.#resume) {
|
|
52
|
+
this.#resume = false;
|
|
53
|
+
this.#turner?.play();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
this.#watch.observe(this);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
disconnectedCallback() {
|
|
60
|
+
this.#watch?.disconnect();
|
|
61
|
+
this.#watch = undefined;
|
|
62
|
+
this.#resume = false;
|
|
63
|
+
this.#turner?.destroy();
|
|
64
|
+
this.#turner = undefined;
|
|
65
|
+
}
|
|
66
|
+
attributeChangedCallback() {
|
|
67
|
+
if (!this.isConnected || this.#queued)
|
|
68
|
+
return;
|
|
69
|
+
this.#queued = true;
|
|
70
|
+
queueMicrotask(() => {
|
|
71
|
+
this.#queued = false;
|
|
72
|
+
if (this.isConnected)
|
|
73
|
+
this.#draw();
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
#shell() {
|
|
77
|
+
if (this.#stage)
|
|
78
|
+
return;
|
|
79
|
+
const root = this.shadowRoot ?? this.attachShadow({ mode: "open" });
|
|
80
|
+
if (typeof CSSStyleSheet === "function" && "adoptedStyleSheets" in root) {
|
|
81
|
+
const sheet = new CSSStyleSheet();
|
|
82
|
+
sheet.replaceSync(STYLE);
|
|
83
|
+
root.adoptedStyleSheets = [sheet];
|
|
84
|
+
}
|
|
85
|
+
else
|
|
86
|
+
root.innerHTML = `<style>${STYLE}</style>`;
|
|
87
|
+
const stage = document.createElement("div");
|
|
88
|
+
stage.className = "stage";
|
|
89
|
+
stage.setAttribute("part", "stage");
|
|
90
|
+
root.append(stage);
|
|
91
|
+
this.#stage = stage;
|
|
92
|
+
}
|
|
93
|
+
#options() {
|
|
94
|
+
const get = (name) => this.getAttribute(name);
|
|
95
|
+
const options = {};
|
|
96
|
+
const variant = get("variant");
|
|
97
|
+
if (variant === "metal" || variant === "line" || variant === "color")
|
|
98
|
+
options.style = variant;
|
|
99
|
+
const theme = get("theme");
|
|
100
|
+
if (theme === "inherit" || theme === "auto" || theme === "light" || theme === "dark")
|
|
101
|
+
options.theme = theme;
|
|
102
|
+
const size = number(get("size"));
|
|
103
|
+
if (size !== undefined && size > 0)
|
|
104
|
+
options.size = size;
|
|
105
|
+
const tint = get("tint");
|
|
106
|
+
if (tint)
|
|
107
|
+
options.tint = tint;
|
|
108
|
+
const accent = get("accent");
|
|
109
|
+
if (accent)
|
|
110
|
+
options.accent = accent;
|
|
111
|
+
const initials = get("initials");
|
|
112
|
+
if (initials)
|
|
113
|
+
options.initials = initials;
|
|
114
|
+
if (get("locale") === "ja")
|
|
115
|
+
options.locale = "ja";
|
|
116
|
+
const title = get("title");
|
|
117
|
+
if (title !== null)
|
|
118
|
+
options.title = title === "" ? false : title;
|
|
119
|
+
const speed = number(get("speed"));
|
|
120
|
+
if (speed !== undefined)
|
|
121
|
+
options.speed = speed;
|
|
122
|
+
const yaw = number(get("yaw"));
|
|
123
|
+
const pitch = number(get("pitch"));
|
|
124
|
+
const roll = number(get("roll"));
|
|
125
|
+
if (yaw !== undefined)
|
|
126
|
+
options.yaw = yaw;
|
|
127
|
+
if (pitch !== undefined)
|
|
128
|
+
options.pitch = pitch;
|
|
129
|
+
if (roll !== undefined)
|
|
130
|
+
options.roll = roll;
|
|
131
|
+
return options;
|
|
132
|
+
}
|
|
133
|
+
#draw() {
|
|
134
|
+
const stage = this.#stage;
|
|
135
|
+
if (!stage)
|
|
136
|
+
return;
|
|
137
|
+
const ref = this.getAttribute("emblem");
|
|
138
|
+
this.dataset["state"] = "empty";
|
|
139
|
+
if (!ref) {
|
|
140
|
+
this.#turner?.destroy();
|
|
141
|
+
this.#turner = undefined;
|
|
142
|
+
stage.innerHTML = "";
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const options = this.#options();
|
|
146
|
+
try {
|
|
147
|
+
if (flag(this.getAttribute("turnable")) || flag(this.getAttribute("autoplay"))) {
|
|
148
|
+
const { yaw, pitch, roll, ...rest } = options;
|
|
149
|
+
const angles = { ...(yaw === undefined ? {} : { yaw }), ...(pitch === undefined ? {} : { pitch }), ...(roll === undefined ? {} : { roll }) };
|
|
150
|
+
if (this.#turner) {
|
|
151
|
+
this.#turner.update(ref, rest);
|
|
152
|
+
if (Object.keys(angles).length > 0)
|
|
153
|
+
this.#turner.setAngles(angles);
|
|
154
|
+
if (flag(this.getAttribute("autoplay")) && !this.#turner.playing)
|
|
155
|
+
this.#turner.play();
|
|
156
|
+
else if (!flag(this.getAttribute("autoplay")) && this.#turner.playing)
|
|
157
|
+
this.#turner.pause();
|
|
158
|
+
}
|
|
159
|
+
else
|
|
160
|
+
this.#turner = bindTurn(stage, ref, { ...rest, ...angles, autoPlay: flag(this.getAttribute("autoplay")) });
|
|
161
|
+
this.dataset["state"] = "live";
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
this.#turner?.destroy();
|
|
165
|
+
this.#turner = undefined;
|
|
166
|
+
const turned = options.yaw !== undefined || options.pitch !== undefined || options.roll !== undefined;
|
|
167
|
+
stage.innerHTML = turned ? emblemFrame(ref, options) : renderEmblem(ref, options);
|
|
168
|
+
this.dataset["state"] = "still";
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
stage.innerHTML = "";
|
|
172
|
+
this.dataset["state"] = "error";
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (typeof customElements !== "undefined" && !customElements.get("dougu-emblem"))
|
|
177
|
+
customElements.define("dougu-emblem", DouguEmblem);
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Badge with a star.
|
|
3
|
+
* @example
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { AWARD_BADGE } from "@johnmorrisdotca/dougu-sports";
|
|
6
|
+
* console.log(AWARD_BADGE.id, AWARD_BADGE.svg({ size: 48 }).startsWith("<svg"));
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
2
9
|
export declare const AWARD_BADGE: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
// Badge: a seal with a star and two tails of ribbon, drawn for this package, in metal, line and flat colour.
|
|
2
2
|
import { circlePath, defineIcon, starPath } from "../emblem.shapes.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Badge with a star.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { AWARD_BADGE } from "@johnmorrisdotca/dougu-sports";
|
|
8
|
+
* console.log(AWARD_BADGE.id, AWARD_BADGE.svg({ size: 48 }).startsWith("<svg"));
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
4
11
|
export const AWARD_BADGE = /* @__PURE__ */ defineIcon("award:badge", "Badge", "バッジ", "ours", {
|
|
5
12
|
metal: "gold",
|
|
6
13
|
ribbon: "#c0392b",
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Crown.
|
|
3
|
+
* @example
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { AWARD_CROWN } from "@johnmorrisdotca/dougu-sports";
|
|
6
|
+
* console.log(AWARD_CROWN.id, AWARD_CROWN.svg({ size: 48 }).startsWith("<svg"));
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
2
9
|
export declare const AWARD_CROWN: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
// Crown: three points tipped with balls over a jewelled band, drawn for this package, in metal, line and flat colour.
|
|
2
2
|
import { circlePath, defineIcon } from "../emblem.shapes.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Crown.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { AWARD_CROWN } from "@johnmorrisdotca/dougu-sports";
|
|
8
|
+
* console.log(AWARD_CROWN.id, AWARD_CROWN.svg({ size: 48 }).startsWith("<svg"));
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
4
11
|
export const AWARD_CROWN = /* @__PURE__ */ defineIcon("award:crown", "Crown", "王冠", "ours", {
|
|
5
12
|
metal: "gold",
|
|
6
13
|
ribbon: "#c0392b",
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Medal on a ribbon.
|
|
3
|
+
* @example
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { AWARD_MEDAL } from "@johnmorrisdotca/dougu-sports";
|
|
6
|
+
* console.log(AWARD_MEDAL.id, AWARD_MEDAL.svg({ size: 48 }).startsWith("<svg"));
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
2
9
|
export declare const AWARD_MEDAL: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
// Medal: a ribbon with a notched end and a star hanging from it, drawn for this package, in metal, line and flat colour.
|
|
2
2
|
import { defineIcon, starPath } from "../emblem.shapes.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Medal on a ribbon.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { AWARD_MEDAL } from "@johnmorrisdotca/dougu-sports";
|
|
8
|
+
* console.log(AWARD_MEDAL.id, AWARD_MEDAL.svg({ size: 48 }).startsWith("<svg"));
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
4
11
|
export const AWARD_MEDAL = /* @__PURE__ */ defineIcon("award:medal", "Medal", "メダル", "ours", {
|
|
5
12
|
metal: "gold",
|
|
6
13
|
ribbon: "#c0392b",
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Ribbon.
|
|
3
|
+
* @example
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { AWARD_RIBBON } from "@johnmorrisdotca/dougu-sports";
|
|
6
|
+
* console.log(AWARD_RIBBON.id, AWARD_RIBBON.svg({ size: 48 }).startsWith("<svg"));
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
2
9
|
export declare const AWARD_RIBBON: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
// Ribbon: a banner ribbon, a gold band with two red notched tails hanging behind it, drawn for this package, in metal, line and flat colour. It stands alone (a prize ribbon without a rosette); `trophy:rosette` is the one with ribbons.
|
|
2
2
|
import { defineFlat } from "../emblem.shapes.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Ribbon.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { AWARD_RIBBON } from "@johnmorrisdotca/dougu-sports";
|
|
8
|
+
* console.log(AWARD_RIBBON.id, AWARD_RIBBON.svg({ size: 48 }).startsWith("<svg"));
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
4
11
|
export const AWARD_RIBBON = /* @__PURE__ */ defineFlat("award:ribbon", "Ribbon", "リボン", "ours", {
|
|
5
12
|
metal: "gold",
|
|
6
13
|
ribbon: "#c0392b",
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Shield.
|
|
3
|
+
* @example
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { AWARD_SHIELD } from "@johnmorrisdotca/dougu-sports";
|
|
6
|
+
* console.log(AWARD_SHIELD.id, AWARD_SHIELD.svg({ size: 48 }).startsWith("<svg"));
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
2
9
|
export declare const AWARD_SHIELD: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
// Shield: a shield with a bevelled face, drawn for this package, in metal, line and flat colour.
|
|
2
2
|
import { defineIcon } from "../emblem.shapes.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Shield.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { AWARD_SHIELD } from "@johnmorrisdotca/dougu-sports";
|
|
8
|
+
* console.log(AWARD_SHIELD.id, AWARD_SHIELD.svg({ size: 48 }).startsWith("<svg"));
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
4
11
|
export const AWARD_SHIELD = /* @__PURE__ */ defineIcon("award:shield", "Shield", "盾", "ours", {
|
|
5
12
|
metal: "silver",
|
|
6
13
|
front: [
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Star.
|
|
3
|
+
* @example
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { AWARD_STAR } from "@johnmorrisdotca/dougu-sports";
|
|
6
|
+
* console.log(AWARD_STAR.id, AWARD_STAR.svg({ size: 48 }).startsWith("<svg"));
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
2
9
|
export declare const AWARD_STAR: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
// Star: a five-pointed star with a bevelled face, drawn for this package, in metal, line and flat colour.
|
|
2
2
|
import { defineIcon, starPath } from "../emblem.shapes.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Star.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { AWARD_STAR } from "@johnmorrisdotca/dougu-sports";
|
|
8
|
+
* console.log(AWARD_STAR.id, AWARD_STAR.svg({ size: 48 }).startsWith("<svg"));
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
4
11
|
export const AWARD_STAR = /* @__PURE__ */ defineIcon("award:star", "Star", "星", "ours", {
|
|
5
12
|
metal: "gold",
|
|
6
13
|
front: [
|
|
@@ -1 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Australian football emblem (オージーボール in Japanese): id `ball:afl`, a ball turned in 3D.
|
|
3
|
+
* @example
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { BALL_AFL } from "@johnmorrisdotca/dougu-sports";
|
|
6
|
+
* console.log(BALL_AFL.id, BALL_AFL.svg({ size: 48 }).startsWith("<svg"));
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
1
9
|
export declare const BALL_AFL: import("./ball.core.ts").Piece<import("./ball.engine.ts").BallSpec>;
|
|
@@ -3,6 +3,14 @@ import { defineBall } from "./ball.engine.js";
|
|
|
3
3
|
import { footballSeams } from "./ball.family.prolate.js";
|
|
4
4
|
import { stitches } from "./ball.stitch.js";
|
|
5
5
|
import { mix } from "./ball.core.js";
|
|
6
|
+
/**
|
|
7
|
+
* The Australian football emblem (オージーボール in Japanese): id `ball:afl`, a ball turned in 3D.
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { BALL_AFL } from "@johnmorrisdotca/dougu-sports";
|
|
11
|
+
* console.log(BALL_AFL.id, BALL_AFL.svg({ size: 48 }).startsWith("<svg"));
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
6
14
|
export const BALL_AFL = /* @__PURE__ */ defineBall({
|
|
7
15
|
id: "ball:afl",
|
|
8
16
|
en: "Australian football",
|
|
@@ -1,10 +1,45 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* The 1850s and 1860s: a cover of four pieces sewn along four seams that run from one point to the opposite one, like the peel of a lemon, in aged leather with a dark thread. No rule fixed the ball then, so it is drawn at the size of today's.
|
|
3
|
+
* @example
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { BALL_BASEBALL_LEMON_PEEL } from "@johnmorrisdotca/dougu-sports";
|
|
6
|
+
* console.log(BALL_BASEBALL_LEMON_PEEL.id, BALL_BASEBALL_LEMON_PEEL.svg({ size: 48 }).startsWith("<svg"));
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
2
9
|
export declare const BALL_BASEBALL_LEMON_PEEL: import("./ball.core.ts").Piece<import("./ball.engine.ts").BallSpec>;
|
|
3
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* The figure-8 seam stitched with alternate red and blue stitches (the American League's laces, in the recollection of a 1930s player).
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { BALL_BASEBALL_RED_BLUE } from "@johnmorrisdotca/dougu-sports";
|
|
15
|
+
* console.log(BALL_BASEBALL_RED_BLUE.id, BALL_BASEBALL_RED_BLUE.svg({ size: 48 }).startsWith("<svg"));
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
4
18
|
export declare const BALL_BASEBALL_RED_BLUE: import("./ball.core.ts").Piece<import("./ball.engine.ts").BallSpec>;
|
|
5
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* The figure-8 seam stitched with alternate black and red stitches (the National League's laces, in the same recollection).
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { BALL_BASEBALL_BLACK_RED } from "@johnmorrisdotca/dougu-sports";
|
|
24
|
+
* console.log(BALL_BASEBALL_BLACK_RED.id, BALL_BASEBALL_BLACK_RED.svg({ size: 48 }).startsWith("<svg"));
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
6
27
|
export declare const BALL_BASEBALL_BLACK_RED: import("./ball.core.ts").Piece<import("./ball.engine.ts").BallSpec>;
|
|
7
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* An old ball: the leather gone the colour of tea and scuffed, the red thread faded.
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { BALL_BASEBALL_VINTAGE_LEATHER } from "@johnmorrisdotca/dougu-sports";
|
|
33
|
+
* console.log(BALL_BASEBALL_VINTAGE_LEATHER.id, BALL_BASEBALL_VINTAGE_LEATHER.svg({ size: 48 }).startsWith("<svg"));
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
8
36
|
export declare const BALL_BASEBALL_VINTAGE_LEATHER: import("./ball.core.ts").Piece<import("./ball.engine.ts").BallSpec>;
|
|
9
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* The optic yellow 11 inch softball: 27.9 cm (circumference 27.6 to 28.3 cm, 166.5 to 173.6 g), red stitch, as the WBSC's Slow Pitch rules set it for women and girls.
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* import { BALL_SOFTBALL_11_OPTIC } from "@johnmorrisdotca/dougu-sports";
|
|
42
|
+
* console.log(BALL_SOFTBALL_11_OPTIC.id, BALL_SOFTBALL_11_OPTIC.svg({ size: 48 }).startsWith("<svg"));
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
10
45
|
export declare const BALL_SOFTBALL_11_OPTIC: import("./ball.core.ts").Piece<import("./ball.engine.ts").BallSpec>;
|