@johnmorrisdotca/kyogijo-stadiums 0.19.0 → 0.20.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 +8 -0
- package/NOTICE.md +1 -0
- package/README.md +30 -10
- package/dist/budo/cage.d.ts +46 -0
- package/dist/budo/cage.js +91 -0
- package/dist/budo/describe.js +11 -0
- package/dist/budo/looks.js +8 -0
- package/dist/budo/plan.d.ts +10 -2
- package/dist/budo/plan.js +15 -1
- package/dist/budo/types.d.ts +11 -3
- package/dist/budo-entry.d.ts +1 -1
- package/dist/budo-entry.js +1 -1
- package/dist/budo.style.js +7 -2
- package/dist/crowd.js +2 -0
- package/dist/draw.js +8 -7
- package/dist/features.js +10 -0
- package/dist/fields.types.d.ts +1 -1
- package/dist/heat.zones.js +1 -1
- package/dist/homeside.js +2 -0
- package/dist/leagues/budo.d.ts +3 -2
- package/dist/leagues/budo.js +2 -1
- package/dist/leagues/combat.d.ts +54 -0
- package/dist/leagues/combat.js +27 -0
- package/dist/leagues/sources.js +6 -0
- package/dist/leagues/types.d.ts +1 -1
- package/dist/leagues.d.ts +1 -0
- package/dist/leagues.js +21 -1
- package/dist/outline.js +1 -0
- package/dist/ranges.names.js +1 -0
- package/dist/score.js +3 -0
- package/dist/strings.d.ts +7 -1
- package/dist/strings.js +22 -10
- package/dist/surfaces/budo.js +3 -2
- package/dist/turn.kit.d.ts +1 -1
- package/dist/turn.style.js +8 -3
- package/dist/types.d.ts +4 -2
- package/dist/units.js +2 -0
- package/dist/uprights.budo.js +4 -2
- package/dist/uprights.cage.d.ts +4 -0
- package/dist/uprights.cage.js +91 -0
- package/dist/uprights.js +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -3
package/dist/turn.style.js
CHANGED
|
@@ -4,9 +4,9 @@ import { JUDGING_DARK, JUDGING_LIGHT } from "./judging.style.js";
|
|
|
4
4
|
* defaults are in `:where()`, which has no weight, so a page's own rule always wins; the colours are custom properties (`--ky-up-*`) a page can set.
|
|
5
5
|
*/
|
|
6
6
|
export const KYOGIJO_TURN_STYLE = `
|
|
7
|
-
:where(.ky-turn){--ky-left:#2f6db0;--ky-right:#b5452c;--ky-cr-home:#b5452c;--ky-cr-away:#2f6db0;--ky-cr-bed:#4a525d;--ky-cr-empty:#7d8794;--ky-cr-gap:#14181d;--ky-cr-conc:#8c929b;--ky-cr-dim:1;--ky-up-roof:rgba(214,218,212,.6);--ky-up-roofline:rgba(40,46,42,.55);--ky-up-fascia:#9aa09a;--ky-up-door:#8a6a46;--ky-up-window:rgba(150,200,240,.55);--ky-up-sash:#f2f0e6;--ky-up-banner:#26211d;--ky-up-bannerline:#c8b88a;--ky-up-room:#efe8d6;--ky-up-roomback:#d6cdb9;--ky-up-ceiling:#dedcd5;--ky-up-railw:#fbfaf6;--ky-up-wainline:#6b4a2a;--ky-up-riser:#3f342c;--ky-up-slab:#d8cfba;--ky-up-slabedge:#c2b69c;--ky-up-seatc:#46342a;--ky-up-seatb:#2d211b;--ky-up-dais:#a0683a;--ky-up-dais-side:#6a4326;--ky-up-shrine:#c9b48f;--ky-up-shrine-side:#8f7a55;--ky-up-gal:#4d4037;--ky-up-aisle:#dcc196;--ky-up-panel:rgba(95,58,22,.3);--ky-up-alcove:#b58a52;--ky-up-purple:#5b2a6e;--ky-up-clock:#ffffff;--ky-up-rail:#3a2c1f;--ky-up-matedge:#2a2a26;--ky-up-sbframe:#1a1f1c;--ky-up-sbedge:#5b645e;--ky-up-sbline:#59615b;--ky-up-pole:#e9e7de;--ky-up-white:#f6f4ec;--ky-up-yellow:#f2c230;--ky-up-red:#c8372d;--ky-up-orange:#f26a1b;--ky-up-wood:#e3d4b4;--ky-up-leg:#474e49;--ky-up-pad:#2f6db0;--ky-up-table:#18243f;--ky-up-foot:rgba(0,0,0,.25);--ky-up-ground:#d9d5c7;--ky-up-wall:#2f4a36;--ky-up-clay:#a8703f;--ky-up-cap:#1d2a22;--ky-up-board:#ece9df;--ky-up-glass:rgba(138,190,232,.26);--ky-up-backboard:rgba(255,255,255,.88);--ky-up-outline:#f2f0e6;--ky-up-rim:#e8591a;--ky-up-mesh:rgba(24,30,27,.7);--ky-up-netfill:rgba(255,255,255,.2);--ky-up-tape:#fbfaf4;--ky-turn-bg:transparent;--ky-turn-ink:#1f2320;--ky-turn-rule:rgba(31,35,32,.22);--ky-turn-chip:rgba(255,255,255,.86);--ky-turn-chip-on:#1f2320;--ky-turn-chip-on-ink:#fff;${JUDGING_LIGHT}}
|
|
8
|
-
@media (prefers-color-scheme:dark){:where(html:not([data-theme=light]) .ky-turn:not([data-theme=light])){--ky-cr-bed:#242a32;--ky-cr-empty:#4a535f;--ky-cr-gap:#050709;--ky-cr-conc:#2a3038;--ky-cr-dim:.82;--ky-up-roof:rgba(60,66,62,.6);--ky-up-roofline:rgba(200,206,200,.5);--ky-up-fascia:#505650;--ky-up-door:#6a4f33;--ky-up-gal:#2d2621;--ky-up-aisle:#8f7752;--ky-up-alcove:#7d5c36;--ky-up-purple:#43204f;--ky-up-clock:#cfcbc0;--ky-up-room:#6d675a;--ky-up-roomback:#58534a;--ky-up-ceiling:#8c8a82;--ky-up-railw:#d9d6cc;--ky-up-riser:#251f1b;--ky-up-slab:#6b6455;--ky-up-slabedge:#585143;--ky-up-seatc:#2f231c;--ky-up-seatb:#1c1411;--ky-up-dais:#7d5230;--ky-up-dais-side:#52361f;--ky-up-sbframe:#0c0f0d;--ky-up-sbedge:#7a847d;--ky-up-sbline:#8a928c;--ky-up-pole:#d6d4ca;--ky-up-white:#e8e6dc;--ky-up-wood:#a89873;--ky-up-leg:#8a928c;--ky-up-ground:#242823;--ky-up-wall:#4d6b55;--ky-up-clay:#7d5231;--ky-up-cap:#c9d2cc;--ky-up-board:#8d928b;--ky-up-glass:rgba(150,200,240,.2);--ky-up-backboard:rgba(255,255,255,.34);--ky-up-outline:#e7e4d8;--ky-up-mesh:rgba(236,236,226,.62);--ky-up-netfill:rgba(255,255,255,.08);--ky-up-tape:#efede2;--ky-turn-ink:#ece8dc;--ky-turn-rule:rgba(236,232,220,.28);--ky-turn-chip:rgba(24,28,25,.82);--ky-turn-chip-on:#ece8dc;--ky-turn-chip-on-ink:#1f2320;${JUDGING_DARK}}}
|
|
9
|
-
:where(html[data-theme=dark] .ky-turn,.ky-turn[data-theme=dark]){--ky-cr-bed:#242a32;--ky-cr-empty:#4a535f;--ky-cr-gap:#050709;--ky-cr-conc:#2a3038;--ky-cr-dim:.82;--ky-up-roof:rgba(60,66,62,.6);--ky-up-roofline:rgba(200,206,200,.5);--ky-up-fascia:#505650;--ky-up-door:#6a4f33;--ky-up-gal:#2d2621;--ky-up-aisle:#8f7752;--ky-up-alcove:#7d5c36;--ky-up-purple:#43204f;--ky-up-clock:#cfcbc0;--ky-up-room:#6d675a;--ky-up-roomback:#58534a;--ky-up-ceiling:#8c8a82;--ky-up-railw:#d9d6cc;--ky-up-riser:#251f1b;--ky-up-slab:#6b6455;--ky-up-slabedge:#585143;--ky-up-seatc:#2f231c;--ky-up-seatb:#1c1411;--ky-up-dais:#7d5230;--ky-up-dais-side:#52361f;--ky-up-sbframe:#0c0f0d;--ky-up-sbedge:#7a847d;--ky-up-sbline:#8a928c;--ky-up-pole:#d6d4ca;--ky-up-white:#e8e6dc;--ky-up-wood:#a89873;--ky-up-leg:#8a928c;--ky-up-ground:#242823;--ky-up-wall:#4d6b55;--ky-up-clay:#7d5231;--ky-up-cap:#c9d2cc;--ky-up-board:#8d928b;--ky-up-glass:rgba(150,200,240,.2);--ky-up-backboard:rgba(255,255,255,.34);--ky-up-outline:#e7e4d8;--ky-up-mesh:rgba(236,236,226,.62);--ky-up-netfill:rgba(255,255,255,.08);--ky-up-tape:#efede2;--ky-turn-ink:#ece8dc;--ky-turn-rule:rgba(236,232,220,.28);--ky-turn-chip:rgba(24,28,25,.82);--ky-turn-chip-on:#ece8dc;--ky-turn-chip-on-ink:#1f2320;${JUDGING_DARK}}
|
|
7
|
+
:where(.ky-turn){--ky-left:#2f6db0;--ky-right:#b5452c;--ky-cr-home:#b5452c;--ky-cr-away:#2f6db0;--ky-cr-bed:#4a525d;--ky-cr-empty:#7d8794;--ky-cr-gap:#14181d;--ky-cr-conc:#8c929b;--ky-cr-dim:1;--ky-up-roof:rgba(214,218,212,.6);--ky-up-roofline:rgba(40,46,42,.55);--ky-up-fascia:#9aa09a;--ky-up-door:#8a6a46;--ky-up-window:rgba(150,200,240,.55);--ky-up-sash:#f2f0e6;--ky-up-banner:#26211d;--ky-up-bannerline:#c8b88a;--ky-up-room:#efe8d6;--ky-up-roomback:#d6cdb9;--ky-up-ceiling:#dedcd5;--ky-up-railw:#fbfaf6;--ky-up-wainline:#6b4a2a;--ky-up-riser:#3f342c;--ky-up-slab:#d8cfba;--ky-up-slabedge:#c2b69c;--ky-up-seatc:#46342a;--ky-up-seatb:#2d211b;--ky-up-dais:#a0683a;--ky-up-dais-side:#6a4326;--ky-up-shrine:#c9b48f;--ky-up-shrine-side:#8f7a55;--ky-up-gal:#4d4037;--ky-up-aisle:#dcc196;--ky-up-panel:rgba(95,58,22,.3);--ky-up-alcove:#b58a52;--ky-up-purple:#5b2a6e;--ky-up-clock:#ffffff;--ky-up-rail:#3a2c1f;--ky-up-matedge:#2a2a26;--ky-up-sbframe:#1a1f1c;--ky-up-sbedge:#5b645e;--ky-up-sbline:#59615b;--ky-up-pole:#e9e7de;--ky-up-white:#f6f4ec;--ky-up-yellow:#f2c230;--ky-up-red:#c8372d;--ky-up-orange:#f26a1b;--ky-up-wood:#e3d4b4;--ky-up-leg:#474e49;--ky-up-pad:#2f6db0;--ky-up-cagepad:#2a2d32;--ky-up-table:#18243f;--ky-up-foot:rgba(0,0,0,.25);--ky-up-ground:#d9d5c7;--ky-up-wall:#2f4a36;--ky-up-clay:#a8703f;--ky-up-cap:#1d2a22;--ky-up-board:#ece9df;--ky-up-glass:rgba(138,190,232,.26);--ky-up-backboard:rgba(255,255,255,.88);--ky-up-outline:#f2f0e6;--ky-up-rim:#e8591a;--ky-up-mesh:rgba(24,30,27,.7);--ky-up-netfill:rgba(255,255,255,.2);--ky-up-tape:#fbfaf4;--ky-turn-bg:transparent;--ky-turn-ink:#1f2320;--ky-turn-rule:rgba(31,35,32,.22);--ky-turn-chip:rgba(255,255,255,.86);--ky-turn-chip-on:#1f2320;--ky-turn-chip-on-ink:#fff;${JUDGING_LIGHT}}
|
|
8
|
+
@media (prefers-color-scheme:dark){:where(html:not([data-theme=light]) .ky-turn:not([data-theme=light])){--ky-cr-bed:#242a32;--ky-cr-empty:#4a535f;--ky-cr-gap:#050709;--ky-cr-conc:#2a3038;--ky-cr-dim:.82;--ky-up-roof:rgba(60,66,62,.6);--ky-up-roofline:rgba(200,206,200,.5);--ky-up-fascia:#505650;--ky-up-door:#6a4f33;--ky-up-gal:#2d2621;--ky-up-aisle:#8f7752;--ky-up-alcove:#7d5c36;--ky-up-purple:#43204f;--ky-up-clock:#cfcbc0;--ky-up-room:#6d675a;--ky-up-roomback:#58534a;--ky-up-ceiling:#8c8a82;--ky-up-railw:#d9d6cc;--ky-up-riser:#251f1b;--ky-up-slab:#6b6455;--ky-up-slabedge:#585143;--ky-up-seatc:#2f231c;--ky-up-seatb:#1c1411;--ky-up-dais:#7d5230;--ky-up-dais-side:#52361f;--ky-up-sbframe:#0c0f0d;--ky-up-sbedge:#7a847d;--ky-up-sbline:#8a928c;--ky-up-pole:#d6d4ca;--ky-up-white:#e8e6dc;--ky-up-wood:#a89873;--ky-up-leg:#8a928c;--ky-up-ground:#242823;--ky-up-cagepad:#8f969f;--ky-up-wall:#4d6b55;--ky-up-clay:#7d5231;--ky-up-cap:#c9d2cc;--ky-up-board:#8d928b;--ky-up-glass:rgba(150,200,240,.2);--ky-up-backboard:rgba(255,255,255,.34);--ky-up-outline:#e7e4d8;--ky-up-mesh:rgba(236,236,226,.62);--ky-up-netfill:rgba(255,255,255,.08);--ky-up-tape:#efede2;--ky-turn-ink:#ece8dc;--ky-turn-rule:rgba(236,232,220,.28);--ky-turn-chip:rgba(24,28,25,.82);--ky-turn-chip-on:#ece8dc;--ky-turn-chip-on-ink:#1f2320;${JUDGING_DARK}}}
|
|
9
|
+
:where(html[data-theme=dark] .ky-turn,.ky-turn[data-theme=dark]){--ky-cr-bed:#242a32;--ky-cr-empty:#4a535f;--ky-cr-gap:#050709;--ky-cr-conc:#2a3038;--ky-cr-dim:.82;--ky-up-roof:rgba(60,66,62,.6);--ky-up-roofline:rgba(200,206,200,.5);--ky-up-fascia:#505650;--ky-up-door:#6a4f33;--ky-up-gal:#2d2621;--ky-up-aisle:#8f7752;--ky-up-alcove:#7d5c36;--ky-up-purple:#43204f;--ky-up-clock:#cfcbc0;--ky-up-room:#6d675a;--ky-up-roomback:#58534a;--ky-up-ceiling:#8c8a82;--ky-up-railw:#d9d6cc;--ky-up-riser:#251f1b;--ky-up-slab:#6b6455;--ky-up-slabedge:#585143;--ky-up-seatc:#2f231c;--ky-up-seatb:#1c1411;--ky-up-dais:#7d5230;--ky-up-dais-side:#52361f;--ky-up-sbframe:#0c0f0d;--ky-up-sbedge:#7a847d;--ky-up-sbline:#8a928c;--ky-up-pole:#d6d4ca;--ky-up-white:#e8e6dc;--ky-up-wood:#a89873;--ky-up-leg:#8a928c;--ky-up-ground:#242823;--ky-up-cagepad:#8f969f;--ky-up-wall:#4d6b55;--ky-up-clay:#7d5231;--ky-up-cap:#c9d2cc;--ky-up-board:#8d928b;--ky-up-glass:rgba(150,200,240,.2);--ky-up-backboard:rgba(255,255,255,.34);--ky-up-outline:#e7e4d8;--ky-up-mesh:rgba(236,236,226,.62);--ky-up-netfill:rgba(255,255,255,.08);--ky-up-tape:#efede2;--ky-turn-ink:#ece8dc;--ky-turn-rule:rgba(236,232,220,.28);--ky-turn-chip:rgba(24,28,25,.82);--ky-turn-chip-on:#ece8dc;--ky-turn-chip-on-ink:#1f2320;${JUDGING_DARK}}
|
|
10
10
|
.ky-turn{position:relative;display:block;width:100%;color:var(--ky-turn-ink);font-family:var(--ky-font,system-ui,-apple-system,"Segoe UI","Hiragino Sans","Noto Sans JP",sans-serif);background:var(--ky-turn-bg)}
|
|
11
11
|
.ky-turn-view{position:relative;isolation:isolate;width:100%;aspect-ratio:var(--ky-turn-ratio,16/10);min-height:260px;overflow:hidden;touch-action:pan-y;cursor:grab;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;border-radius:12px;outline-offset:2px}
|
|
12
12
|
.ky-turn[data-touch=turn] .ky-turn-view{touch-action:none}
|
|
@@ -34,6 +34,11 @@ export const KYOGIJO_TURN_STYLE = `
|
|
|
34
34
|
.ky-turn .u-shadow{fill:#000;fill-opacity:.16}
|
|
35
35
|
.ky-turn .u-wall{fill:var(--ky-up-wall)}
|
|
36
36
|
.ky-turn .u-clay{fill:var(--ky-up-clay)}
|
|
37
|
+
.ky-turn .u-cagepad{fill:var(--ky-up-cagepad)}
|
|
38
|
+
.ky-turn .u-gateframe{stroke:var(--ky-up-cagepad)}
|
|
39
|
+
.ky-turn .u-deck-side{fill:color-mix(in srgb,var(--ky-bud-floor,#43484e) 70%,#000)}
|
|
40
|
+
.ky-turn .u-step{fill:color-mix(in srgb,var(--ky-bud-floor,#43484e) 76%,#fff)}
|
|
41
|
+
.ky-turn .u-step-side{fill:color-mix(in srgb,var(--ky-bud-floor,#43484e) 58%,#000)}
|
|
37
42
|
.ky-turn .u-clay-side{fill:color-mix(in srgb,var(--ky-dirt,var(--ky-up-clay)) 74%,#000)}
|
|
38
43
|
.ky-turn .u-cap{fill:var(--ky-up-cap)}
|
|
39
44
|
.ky-turn .u-board{fill:var(--ky-up-board)}
|
package/dist/types.d.ts
CHANGED
|
@@ -16,9 +16,11 @@ export type FieldSport = "lacrosse" | "rugby" | "afl" | "gaelic" | "cricket" | "
|
|
|
16
16
|
export type { PoolSport, PoolStyle };
|
|
17
17
|
/** The budō: the contest areas of judo and karate, the kendo shiai-jo, the sumo dohyō, the kyūdōjō, and a dojo of tatami. */
|
|
18
18
|
export type BudoSport = "judo" | "karate" | "kendo" | "sumo" | "kyudo" | "dojo";
|
|
19
|
+
/** The combat sports' rings, cages and mats, drawn by the same engine as the budō: the MMA cage (eight-sided, as a generic cage), and as they are added the boxing ring, the wrestling mats and the professional wrestling ring. */
|
|
20
|
+
export type CombatSport = "mma";
|
|
19
21
|
export type { BudoStyle, DojoSpec, BudoScore };
|
|
20
22
|
/** The surfaces: three football fields, a rink, a court, a ballpark, a soccer pitch, a curling sheet, twelve net, racket and court sports (tennis, volleyball, badminton, pickleball, table tennis, padel, squash, racquetball, sepak takraw, teqball, roundnet and netball), four pools (swimming, water polo, diving and artistic swimming), seven field sports (lacrosse, rugby, Australian football, Gaelic football and hurling, cricket, field hockey and handball) and the athletics stadium (the 400 m track with its infield, and the covered 200 m track). */
|
|
21
|
-
export type Sport = "nfl" | "cfl" | "ifaf" | "nhl" | "nba" | "mlb" | "soccer" | "curling" | "tennis" | "volleyball" | "badminton" | "pickleball" | "tabletennis" | "padel" | "squash" | "racquetball" | "sepaktakraw" | "teqball" | "roundnet" | "netball" | PoolSport | FieldSport | "athletics" | "skating" | BudoSport;
|
|
23
|
+
export type Sport = "nfl" | "cfl" | "ifaf" | "nhl" | "nba" | "mlb" | "soccer" | "curling" | "tennis" | "volleyball" | "badminton" | "pickleball" | "tabletennis" | "padel" | "squash" | "racquetball" | "sepaktakraw" | "teqball" | "roundnet" | "netball" | PoolSport | FieldSport | "athletics" | "skating" | BudoSport | CombatSport;
|
|
22
24
|
/** `auto` follows the device's light or dark setting (and `data-theme` on the page's root), the others force one. */
|
|
23
25
|
export type Theme = "auto" | "light" | "dark";
|
|
24
26
|
/** The language of the words the drawing says itself: its title, its description and its status labels. */
|
|
@@ -319,7 +321,7 @@ export interface CrowdOptions {
|
|
|
319
321
|
* `penalty-area`. Baseball: `infield`, `outfield`. The net sports: `half-court`. Curling: `sheet`, `half`, `house`, `folded`. Rugby: `half`, `twenty-two` (union) or `twenty` (league), `in-goal`. Lacrosse: `half`, `crease`. Australian football: `half`, `forward-fifty`, `centre-square`.
|
|
320
322
|
* Gaelic games: `half`, `large-rectangle`. Cricket: `pitch`, `circle`. Field hockey: `half`, `circle`, `twenty-three`. Handball: `half`, `goal-area`. Swimming: `half`, `pool-end`. Water polo: `half`, `goal-area`. Diving: `springboards`, `platforms`. Artistic swimming: `half`, `centre-stage`. Judo and karate: `contest-area`, `start`. Sumo: `ring`. Kyudo: `shajo`, `yamichi`, `azuchi`. Dojo: `kamiza`, `half`. Athletics: `bend`, `home-straight`, `back-straight`, `finish`, `start`, `infield`, a field event (`high-jump`, `pole-vault`, `long-jump`, `triple-jump`, `shot-put`, `discus-throw`, `hammer-throw`, `javelin-throw`) and `water-jump`. `RANGES` lists them for each sport.
|
|
321
323
|
*/
|
|
322
|
-
export type RangeName = "red-zone" | "between-the-20s" | "end-zone" | "field-of-play" | "own-half" | "opponent-half" | "offensive-zone" | "defensive-zone" | "neutral-zone" | "half" | "half-court" | "paint" | "final-third" | "defensive-third" | "middle-third" | "penalty-area" | "infield" | "outfield" | "sheet" | "house" | "folded" | "in-goal" | "twenty-two" | "twenty" | "crease" | "forward-fifty" | "centre-square" | "large-rectangle" | "pitch" | "circle" | "twenty-three" | "goal-area" | "pool-end" | "springboards" | "platforms" | "centre-stage" | "bend" | "home-straight" | "back-straight" | "finish" | "start" | "infield" | "high-jump" | "pole-vault" | "long-jump" | "triple-jump" | "shot-put" | "discus-throw" | "hammer-throw" | "javelin-throw" | "water-jump" | "crossing-straight" | "first-bend" | "second-bend" | "judges" | "kiss-and-cry" | "contest-area" | "ring" | "shajo" | "yamichi" | "azuchi" | "kamiza";
|
|
324
|
+
export type RangeName = "red-zone" | "between-the-20s" | "end-zone" | "field-of-play" | "own-half" | "opponent-half" | "offensive-zone" | "defensive-zone" | "neutral-zone" | "half" | "half-court" | "paint" | "final-third" | "defensive-third" | "middle-third" | "penalty-area" | "infield" | "outfield" | "sheet" | "house" | "folded" | "in-goal" | "twenty-two" | "twenty" | "crease" | "forward-fifty" | "centre-square" | "large-rectangle" | "pitch" | "circle" | "twenty-three" | "goal-area" | "pool-end" | "springboards" | "platforms" | "centre-stage" | "bend" | "home-straight" | "back-straight" | "finish" | "start" | "infield" | "high-jump" | "pole-vault" | "long-jump" | "triple-jump" | "shot-put" | "discus-throw" | "hammer-throw" | "javelin-throw" | "water-jump" | "crossing-straight" | "first-bend" | "second-bend" | "judges" | "kiss-and-cry" | "contest-area" | "ring" | "shajo" | "yamichi" | "azuchi" | "kamiza" | "cage" | "gate";
|
|
323
325
|
/** A named range at the end of your choice: `{ name: "offensive-zone", end: "left" }` is the offensive zone of a team that attacks the left. */
|
|
324
326
|
export interface RangeNamed {
|
|
325
327
|
name: RangeName;
|
package/dist/units.js
CHANGED
|
@@ -56,6 +56,8 @@ export const SURFACE_UNITS = Object.freeze({
|
|
|
56
56
|
sumo: "m",
|
|
57
57
|
kyudo: "m",
|
|
58
58
|
dojo: "m",
|
|
59
|
+
// The cage: the commissions' rules are written in feet and inches.
|
|
60
|
+
mma: "ft",
|
|
59
61
|
});
|
|
60
62
|
/** True when `unit` is one of the six. */
|
|
61
63
|
export const isUnit = (unit) => typeof unit === "string" && Object.prototype.hasOwnProperty.call(FEET_PER, unit);
|
package/dist/uprights.budo.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// box, so every point goes through `at`. The mound's height is the option's; the azuchi's (1.5 m or 1.8 m) and a dojo wall's (3 m) are ours: no rule gives them.
|
|
5
5
|
import { budoPlan } from "./budo/plan.js";
|
|
6
6
|
import { flat, n, plane, shy, wall } from "./turn.kit.js";
|
|
7
|
+
import { cageUprights } from "./uprights.cage.js";
|
|
7
8
|
const K = 1 / 0.3048;
|
|
8
9
|
/** The walls of a dojo, 3 m high (ours). */
|
|
9
10
|
export const DOJO_WALL = 3;
|
|
@@ -66,6 +67,8 @@ export function budoUprights(o, thin) {
|
|
|
66
67
|
const height = plan.sumo.height * K;
|
|
67
68
|
items.push({ id: "mound", kind: "mound", at: at(plan.sumo.centre[0], plan.sumo.centre[1]), height, planes: moundPlanes(plan, at, height) });
|
|
68
69
|
}
|
|
70
|
+
if (plan.mma !== undefined)
|
|
71
|
+
items.push(...cageUprights(plan, at, thin));
|
|
69
72
|
if (plan.kyudo !== undefined) {
|
|
70
73
|
const built = azuchiPlanes(plan, at);
|
|
71
74
|
items.push({ id: "azuchi", kind: "azuchi", at: at(plan.kyudo.target, plan.kyudo.lanes[0]), height: built.height, planes: built.mound });
|
|
@@ -89,6 +92,5 @@ export function budoUprights(o, thin) {
|
|
|
89
92
|
});
|
|
90
93
|
items.push({ id: "walls", kind: "walls", at: centre, height: h, planes });
|
|
91
94
|
}
|
|
92
|
-
|
|
93
|
-
return { items, lift, area, whole: plan.sumo !== undefined };
|
|
95
|
+
return { items, lift, area, whole: plan.sumo !== undefined || plan.mma !== undefined };
|
|
94
96
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BudoPlan } from "./budo/plan.ts";
|
|
2
|
+
import { type Upright } from "./turn.kit.ts";
|
|
3
|
+
/** What stands on a cage: the platform, the posts, the fence with its gates, and the steps. */
|
|
4
|
+
export declare function cageUprights(plan: BudoPlan, at: (x: number, y: number) => readonly [number, number], thin: number): Upright[];
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { box, flat, mesh, n, pole, shy, threads, wall } from "./turn.kit.js";
|
|
2
|
+
const K = 1 / 0.3048;
|
|
3
|
+
/** The mesh of the fence: a cell of 5 cm (a diamond of chain link, drawn as a square grid, ours). */
|
|
4
|
+
const CELL = 0.05 * K;
|
|
5
|
+
/** The planes of the platform: its four sides from the floor of the building up to the canvas, and a top that is the floor's own drawing in the platform's rectangle. */
|
|
6
|
+
function deckPlanes(plan, at, h) {
|
|
7
|
+
const b = plan.mma.platform;
|
|
8
|
+
const corners = [at(b.x0, b.y0), at(b.x1, b.y0), at(b.x1, b.y1), at(b.x0, b.y1)];
|
|
9
|
+
const planes = [];
|
|
10
|
+
corners.forEach((a, i) => {
|
|
11
|
+
const c = corners[(i + 1) % 4];
|
|
12
|
+
planes.push(wall(`deck-${i + 1}`, "wall", a[0], a[1], c[0], c[1], 0, h, `<rect width="${n(Math.hypot(c[0] - a[0], c[1] - a[1]))}" height="${n(h)}" class="u-deck-side"/>`));
|
|
13
|
+
});
|
|
14
|
+
planes.push({ ...flat("deck-top", "platform", corners[0][0], corners[0][1], corners[2][0], corners[2][1], h, ""), crop: true });
|
|
15
|
+
return planes;
|
|
16
|
+
}
|
|
17
|
+
/** The mesh of a fence panel w by h feet. */
|
|
18
|
+
const meshOf = (w, h) => `<rect width="${n(w)}" height="${n(h)}" class="u-netfill"/>${threads(mesh(w, h, CELL), CELL)}`;
|
|
19
|
+
/** What stands on a cage: the platform, the posts, the fence with its gates, and the steps. */
|
|
20
|
+
export function cageUprights(plan, at, thin) {
|
|
21
|
+
const L = plan.mma;
|
|
22
|
+
if (L === undefined)
|
|
23
|
+
return [];
|
|
24
|
+
const fig = plan.figures;
|
|
25
|
+
const h0 = L.height * K;
|
|
26
|
+
const top = h0 + L.fence * K;
|
|
27
|
+
const centre = at(L.centre[0], L.centre[1]);
|
|
28
|
+
const items = [];
|
|
29
|
+
items.push({ id: "deck", kind: "deck", at: centre, height: h0, planes: deckPlanes(plan, at, h0) });
|
|
30
|
+
// The steps: each tread a block as high as the treads below it and itself, the lowest the farthest from the platform.
|
|
31
|
+
if (L.steps.length > 0) {
|
|
32
|
+
const s = fig.platform.steps;
|
|
33
|
+
const planes = [];
|
|
34
|
+
for (const b of L.steps) {
|
|
35
|
+
const north = b.y1 <= 0.0001;
|
|
36
|
+
for (let t = 0; t < s.treads; t += 1) {
|
|
37
|
+
// The tread t from the ground: its depth lies further in as t grows.
|
|
38
|
+
const y0 = north ? b.y0 + t * s.tread : b.y0;
|
|
39
|
+
const y1 = north ? b.y1 : b.y1 - t * s.tread;
|
|
40
|
+
const [x0, ya] = at(b.x0, y0);
|
|
41
|
+
const [x1, yb] = at(b.x1, y1);
|
|
42
|
+
planes.push(...box(`step-${north ? "north" : "south"}-${t + 1}`, "platform", { x0, y0: ya, x1, y1: yb }, (h0 * (t + 1)) / s.treads, "u-step"));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
items.push({ id: "steps", kind: "deck", at: centre, height: h0, planes });
|
|
46
|
+
}
|
|
47
|
+
// The posts: padded, from the platform up a hand's breadth over the fence; solid, so two crossed strips as wide as the pad.
|
|
48
|
+
const padW = fig.post.pad * K;
|
|
49
|
+
const postTop = top + 0.15 * K;
|
|
50
|
+
const posts = L.posts.flatMap(([x, y], i) => {
|
|
51
|
+
const [px, py] = at(x, y);
|
|
52
|
+
return pole(`post-${i + 1}`, "post", px, py, h0, postTop, padW, "u-cagepad");
|
|
53
|
+
});
|
|
54
|
+
// The fence: one panel on each flat, in mesh, with a pad along the top and one along the foot. The panels give way to an eye that has them between it and the cage.
|
|
55
|
+
const rail = fig.post.rail * K;
|
|
56
|
+
const planes = [];
|
|
57
|
+
const doorH = fig.gates.height * K;
|
|
58
|
+
L.posts.forEach((p, i) => {
|
|
59
|
+
const q = L.posts[(i + 1) % L.posts.length];
|
|
60
|
+
const [ax, ay] = at(p[0], p[1]);
|
|
61
|
+
const [bx, by] = at(q[0], q[1]);
|
|
62
|
+
const len = Math.hypot(bx - ax, by - ay);
|
|
63
|
+
const gate = L.gates.find((g) => g.flat === i);
|
|
64
|
+
const wallOf = (id, x0, y0, x1, y1, z0, z1, svg, kind = "wall") => ({ ...shy(wall(id, kind, x0, y0, x1, y1, z0, z1, svg), centre), fadeTo: 0.3, fadeAt: 0.2 });
|
|
65
|
+
if (gate === undefined) {
|
|
66
|
+
planes.push(wallOf(`fence-${i + 1}`, ax, ay, bx, by, h0 + rail, top - rail, meshOf(len, top - rail - (h0 + rail)), "net"));
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
const [fx, fy] = at(gate.from[0], gate.from[1]);
|
|
70
|
+
const [tx, ty] = at(gate.to[0], gate.to[1]);
|
|
71
|
+
const left = Math.hypot(fx - ax, fy - ay);
|
|
72
|
+
const open = Math.hypot(tx - fx, ty - fy);
|
|
73
|
+
const right = Math.hypot(bx - tx, by - ty);
|
|
74
|
+
planes.push(wallOf(`fence-${i + 1}a`, ax, ay, fx, fy, h0 + rail, top - rail, meshOf(left, top - rail - (h0 + rail)), "net"));
|
|
75
|
+
planes.push(wallOf(`fence-${i + 1}b`, tx, ty, bx, by, h0 + rail, top - rail, meshOf(right, top - rail - (h0 + rail)), "net"));
|
|
76
|
+
// Over the door: mesh from the door's head to the top pad. The door itself is a frame of padded rails round mesh, closed.
|
|
77
|
+
planes.push(wallOf(`fence-${i + 1}-over`, fx, fy, tx, ty, h0 + doorH, top - rail, meshOf(open, top - rail - (h0 + doorH)), "net"));
|
|
78
|
+
const leafH = doorH - rail;
|
|
79
|
+
const frame = `<rect x="${n(rail / 2)}" y="${n(rail / 2)}" width="${n(open - rail)}" height="${n(leafH - rail)}" class="u-gateframe" fill="none" stroke-width="${n(rail)}"/>`;
|
|
80
|
+
planes.push(wallOf(`gate-${gate.side}`, fx, fy, tx, ty, h0 + rail, h0 + doorH, `<rect width="${n(open)}" height="${n(doorH - rail)}" class="u-netfill"/>${threads(mesh(open, doorH - rail, CELL), CELL)}${frame}`, "wall"));
|
|
81
|
+
}
|
|
82
|
+
// The pads: along the top (the whole flat), and along the foot (except across a gate).
|
|
83
|
+
planes.push(wallOf(`fence-top-${i + 1}`, ax, ay, bx, by, top - rail, top, `<rect width="${n(len)}" height="${n(rail)}" class="u-cagepad"/>`, "rail"));
|
|
84
|
+
if (gate === undefined)
|
|
85
|
+
planes.push(wallOf(`fence-foot-${i + 1}`, ax, ay, bx, by, h0, h0 + rail, `<rect width="${n(len)}" height="${n(rail)}" class="u-cagepad"/>`, "rail"));
|
|
86
|
+
});
|
|
87
|
+
items.push({ id: "fence", kind: "cage-fence", at: centre, height: top - h0, planes });
|
|
88
|
+
items.push({ id: "posts", kind: "cage-posts", at: centre, height: postTop - h0, planes: posts });
|
|
89
|
+
void thin;
|
|
90
|
+
return items;
|
|
91
|
+
}
|
package/dist/uprights.js
CHANGED
|
@@ -23,7 +23,7 @@ import { isPoolSport, poolPlan, feet as poolFeet } from "./pool.js";
|
|
|
23
23
|
import { poolUprights } from "./uprights.pools.js";
|
|
24
24
|
import { athleticsUprights, skatingUprights } from "./uprights.track.js";
|
|
25
25
|
import { budoUprights } from "./uprights.budo.js";
|
|
26
|
-
import { isBudoSport } from "./budo/plan.js";
|
|
26
|
+
import { isBudoSport, isMatSport } from "./budo/plan.js";
|
|
27
27
|
import { courtUprights, rinkUprights } from "./uprights.rinks.js";
|
|
28
28
|
import { convertLength } from "./units.js";
|
|
29
29
|
import { sheetFor } from "./sheet.js";
|
|
@@ -32,7 +32,7 @@ import { NO_VENUE, standsVenue } from "./venue.js";
|
|
|
32
32
|
/** All the planes of all the things. */
|
|
33
33
|
export const planesOf = (u) => u.items.flatMap((item) => item.planes);
|
|
34
34
|
/** The unit each sport's rulebook gives its heights in, when the options name none. */
|
|
35
|
-
const RULEBOOK_UNIT = { volleyball: "m", badminton: "m", tabletennis: "m", padel: "m", squash: "m", athletics: "m", skating: "m", judo: "m", karate: "m", kendo: "m", sumo: "m", kyudo: "m", dojo: "m", swimming: "m", waterpolo: "m", diving: "m", artisticswimming: "m", sepaktakraw: "m", teqball: "m", roundnet: "m", netball: "m", soccer: "m", handball: "m", fieldhockey: "m", rugby: "m", afl: "m", gaelic: "m" };
|
|
35
|
+
const RULEBOOK_UNIT = { volleyball: "m", badminton: "m", tabletennis: "m", padel: "m", squash: "m", athletics: "m", skating: "m", judo: "m", karate: "m", kendo: "m", sumo: "m", kyudo: "m", dojo: "m", mma: "ft", swimming: "m", waterpolo: "m", diving: "m", artisticswimming: "m", sepaktakraw: "m", teqball: "m", roundnet: "m", netball: "m", soccer: "m", handball: "m", fieldhockey: "m", rugby: "m", afl: "m", gaelic: "m" };
|
|
36
36
|
/** What stands on the surface the options draw: nothing on a curling sheet, which is flat. */
|
|
37
37
|
export function uprightsFor(o, settings = {}) {
|
|
38
38
|
const { sport, league } = chooseLeague(o);
|
|
@@ -107,7 +107,7 @@ export function uprightsFor(o, settings = {}) {
|
|
|
107
107
|
thin = thinnest(area.x1, area.y1);
|
|
108
108
|
items = skatingUprights({ ...o, sport }, thin).items;
|
|
109
109
|
}
|
|
110
|
-
else if (
|
|
110
|
+
else if (isMatSport(sport)) {
|
|
111
111
|
const built = budoUprights({ ...o, sport }, 0.3);
|
|
112
112
|
area = built.area;
|
|
113
113
|
thin = thinnest(area.x1, area.y1);
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The package's version: the same as package.json's, and a test holds them to each other. */
|
|
2
|
-
export declare const VERSION = "0.
|
|
2
|
+
export declare const VERSION = "0.20.0";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The package's version: the same as package.json's, and a test holds them to each other. */
|
|
2
|
-
export const VERSION = "0.
|
|
2
|
+
export const VERSION = "0.20.0";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/kyogijo-stadiums",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Kyogijo Stadiums 競技場,
|
|
3
|
+
"version": "0.20.0",
|
|
4
|
+
"description": "Kyogijo Stadiums 競技場, 40 sports' surfaces as SVG, drawn to scale from the rulebooks: NFL, CFL and IFAF football fields, an NHL rink, an NBA court, MLB ballparks, soccer pitches, curling sheets, athletics stadiums, speed skating, short track and figure skating rinks, swimming pools, water polo fields, diving wells, artistic swimming areas, and the courts and fields of tennis, volleyball (indoor, beach and sitting), badminton, pickleball, table tennis, padel, squash, racquetball, sepak takraw, teqball, roundnet, netball, lacrosse, rugby, Australian football, Gaelic games, cricket, field hockey and handball, and the budo of judo, karate, kendo, sumo and kyudo with a dojo of tatami laid as real units, the MMA cage, with each team's name and logo on its side and the score in the middle, stands and a crowd, a pageant of flags, and a 3D view. Light and dark, accessible, a compact badge for lists, a helper for React and a custom element. Zero dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sports",
|
|
7
7
|
"scoreboard",
|
|
@@ -50,7 +50,9 @@
|
|
|
50
50
|
"sumo",
|
|
51
51
|
"kyudo",
|
|
52
52
|
"dojo",
|
|
53
|
-
"tatami"
|
|
53
|
+
"tatami",
|
|
54
|
+
"mma",
|
|
55
|
+
"cage"
|
|
54
56
|
],
|
|
55
57
|
"homepage": "https://johnmorrisdotca.github.io/kyogijo-stadiums/",
|
|
56
58
|
"repository": {
|