@johnmorrisdotca/dougu-sports 0.0.0-stage → 0.0.1
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 +21 -0
- package/LICENSE +21 -0
- package/LICENSES/Apache-2.0.txt +55 -0
- package/LICENSES/CC-BY-3.0.md +15 -0
- package/LICENSES/MIT.txt +21 -0
- package/LICENSES/README.md +13 -0
- package/NOTICE.md +29 -0
- package/README.md +415 -2
- package/dist/emblems/award/medal.d.ts +2 -0
- package/dist/emblems/award/medal.js +19 -0
- package/dist/emblems/ball/soccer.d.ts +2 -0
- package/dist/emblems/ball/soccer.js +9 -0
- package/dist/emblems/emblem.api.d.ts +60 -0
- package/dist/emblems/emblem.api.js +88 -0
- package/dist/emblems/emblem.ball.d.ts +28 -0
- package/dist/emblems/emblem.ball.js +70 -0
- package/dist/emblems/emblem.core.d.ts +102 -0
- package/dist/emblems/emblem.core.js +67 -0
- package/dist/emblems/emblem.ids.d.ts +49 -0
- package/dist/emblems/emblem.ids.js +35 -0
- package/dist/emblems/emblem.registry.d.ts +4 -0
- package/dist/emblems/emblem.registry.js +7 -0
- package/dist/emblems/emblem.shapes.d.ts +21 -0
- package/dist/emblems/emblem.shapes.js +45 -0
- package/dist/emblems-entry.d.ts +8 -0
- package/dist/emblems-entry.js +5 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +8 -0
- package/dist/turn-entry.d.ts +2 -0
- package/dist/turn-entry.js +3 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +119 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are written here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.0.1] - 2026-10-14
|
|
10
|
+
|
|
11
|
+
First preview: the name, the API and two sample emblems. The full set of trophies, medals, crests, balls and gear follows.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- The scaffold: `renderEmblem(id, { style, size, tint, theme })` with the three styles `metal`, `line` and `color`; `emblemFrame` and `ballFrame` for turning; the `EmblemId` union and the groups `award`, `trophy`, `medal`, `crest`, `ball`, `gear` and `sport`; the thirty-three sports' names; one module per item under `./award/*`, `./ball/*` and `./gear/*`, so a bundler takes one emblem and leaves the rest.
|
|
16
|
+
- Two sample emblems that stand in for the art: `award:medal` (a flat emblem that flips like a coin) and `ball:soccer` (a ball that rolls).
|
|
17
|
+
- Tests for the drawing, the ids, the turns and the bundle size of one item; a package check that installs the packed tarball and bundles one item from it.
|
|
18
|
+
- The demo (a playground with a turn slider, and a gallery page), `docs/layout.md`, `docs/turning.md`, `docs/gallery.md`, the family header and footer, the CI, Pages and Release workflows, and `LICENSES/` and `NOTICE.md` ready for third-party art.
|
|
19
|
+
|
|
20
|
+
[Unreleased]: https://github.com/johnmorrisdotca/dougu-sports/compare/v0.0.1...HEAD
|
|
21
|
+
[0.0.1]: https://github.com/johnmorrisdotca/dougu-sports/releases/tag/v0.0.1
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 John Morris
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
|
|
5
|
+
http://www.apache.org/licenses/
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
1. Definitions.
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
16
|
+
|
|
17
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
18
|
+
|
|
19
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
20
|
+
|
|
21
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
22
|
+
|
|
23
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
24
|
+
|
|
25
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
26
|
+
|
|
27
|
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
28
|
+
|
|
29
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
30
|
+
|
|
31
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
32
|
+
|
|
33
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
34
|
+
|
|
35
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
36
|
+
|
|
37
|
+
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
38
|
+
|
|
39
|
+
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
40
|
+
|
|
41
|
+
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
42
|
+
|
|
43
|
+
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
44
|
+
|
|
45
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
46
|
+
|
|
47
|
+
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
48
|
+
|
|
49
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
50
|
+
|
|
51
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
52
|
+
|
|
53
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
54
|
+
|
|
55
|
+
END OF TERMS AND CONDITIONS
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Creative Commons Attribution 3.0 Unported
|
|
2
|
+
|
|
3
|
+
The icons of [game-icons.net](https://game-icons.net/) are under this licence, each by its own author. The full legal code is at
|
|
4
|
+
<https://creativecommons.org/licenses/by/3.0/legalcode>, and the summary a reader can follow is at
|
|
5
|
+
<https://creativecommons.org/licenses/by/3.0/>.
|
|
6
|
+
|
|
7
|
+
What the licence asks of this package, and what it does:
|
|
8
|
+
|
|
9
|
+
- **Credit the author**: every emblem made from a game-icons.net icon has a row in [NOTICE.md](../NOTICE.md) naming the icon, its
|
|
10
|
+
author and its page on game-icons.net, and the README and the demo point to that file.
|
|
11
|
+
- **Link to the licence**: the row names the licence and links to it.
|
|
12
|
+
- **Say that the icon was changed**: the row says how it was changed (recoloured to the three styles, scaled, its path simplified).
|
|
13
|
+
|
|
14
|
+
No emblem uses a game-icons.net icon yet. The legal code is linked and not copied here: the text a reader needs to check is the one
|
|
15
|
+
the Creative Commons publishes.
|
package/LICENSES/MIT.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 John Morris
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Licences
|
|
2
|
+
|
|
3
|
+
The code of this package is under the MIT licence: [MIT.txt](MIT.txt), the same text as [../LICENSE](../LICENSE).
|
|
4
|
+
|
|
5
|
+
Art taken from another project keeps its own licence, and that licence's text is kept in this folder, named for the licence, as soon as an emblem that uses it ships. [../NOTICE.md](../NOTICE.md) says which emblem comes from which source, under which licence, and what credit it asks for.
|
|
6
|
+
|
|
7
|
+
| File | Licence | Covers |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| [MIT.txt](MIT.txt) | MIT | The code of the package, and the art drawn for it (`source: "ours"`) |
|
|
10
|
+
| [Apache-2.0.txt](Apache-2.0.txt) | Apache License 2.0 | Material Symbols (Google), the Noto emoji and Noto fonts' shapes (Google), Pictogrammers Material Design Icons, where an emblem is taken from them |
|
|
11
|
+
| [CC-BY-3.0.md](CC-BY-3.0.md) | Creative Commons Attribution 3.0 | game-icons.net icons, each credited to its author in NOTICE.md |
|
|
12
|
+
|
|
13
|
+
A source that is not in the table is not used: a new one is added here and to NOTICE.md in the same change as the emblem that needs it.
|
package/NOTICE.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Notice: where the art comes from
|
|
2
|
+
|
|
3
|
+
The code of this package is under the MIT licence (see [LICENSE](LICENSE) and [LICENSES/MIT.txt](LICENSES/MIT.txt)). Every emblem is either drawn for this package (`source: "ours"` in `emblemInfo`) or made from one of the sources below, and each emblem made from a source has a row in the second table. The licence text of each source is in [LICENSES/](LICENSES/).
|
|
4
|
+
|
|
5
|
+
No emblem carries the name, mark or logo of a league, a team, a federation or an event: the trophies, crests and balls are descriptive and generic.
|
|
6
|
+
|
|
7
|
+
## The sources the art may come from
|
|
8
|
+
|
|
9
|
+
| Source | What it is | Licence | Text kept in | Credit it asks for |
|
|
10
|
+
| --- | --- | --- | --- | --- |
|
|
11
|
+
| Material Symbols, Google (https://fonts.google.com/icons) | Icons as paths | Apache License 2.0 | [LICENSES/Apache-2.0.txt](LICENSES/Apache-2.0.txt) | None required; named here |
|
|
12
|
+
| Noto Emoji and Noto Color Emoji, Google (https://github.com/googlefonts/noto-emoji) | Emoji drawings | Apache License 2.0 (the emoji; the fonts are under the SIL OFL 1.1, and none is used) | [LICENSES/Apache-2.0.txt](LICENSES/Apache-2.0.txt) | None required; named here |
|
|
13
|
+
| Material Design Icons, Pictogrammers (https://pictogrammers.com/library/mdi/) | Icons as paths | Apache License 2.0 | [LICENSES/Apache-2.0.txt](LICENSES/Apache-2.0.txt) | None required; named here |
|
|
14
|
+
| game-icons.net (https://game-icons.net/) | Icons by many authors | Creative Commons Attribution 3.0 | [LICENSES/CC-BY-3.0.md](LICENSES/CC-BY-3.0.md) | The author of each icon, with a link to the licence, and a note that it was changed |
|
|
15
|
+
| Drawn for this package | Everything marked `ours` | MIT | [LICENSES/MIT.txt](LICENSES/MIT.txt) | None |
|
|
16
|
+
|
|
17
|
+
## The emblems made from a source
|
|
18
|
+
|
|
19
|
+
None yet: the two emblems the package has so far, `award:medal` and `ball:soccer`, are drawn for it, from nothing but circles, a star and the corners of an icosahedron. A row is added in the same change as the emblem, in this form:
|
|
20
|
+
|
|
21
|
+
| Emblem | Made from | Author | How it was changed | Licence |
|
|
22
|
+
| --- | --- | --- | --- | --- |
|
|
23
|
+
|
|
24
|
+
## The demo and the docs
|
|
25
|
+
|
|
26
|
+
| What | Made from | Terms |
|
|
27
|
+
| --- | --- | --- |
|
|
28
|
+
| The demo's page | Written for this package, with the family stylesheet `demo/family.css` | MIT |
|
|
29
|
+
| The README's pictures (`docs/images`) | Taken by `scripts/screenshots.mjs` from the demo, which draws the package's own emblems | MIT |
|
package/README.md
CHANGED
|
@@ -1,3 +1,416 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">Dougu Sports <sub>道具</sub></h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center"><strong>Sports emblems as SVG strings, with optional 3D turning.</strong><br>
|
|
4
|
+
Trophies, medals, crests, and the ball and gear of every sport, each one a function that returns SVG: in metal, in one line, or in flat colour, light and dark, any size, any tint. Turn one about its axis and it is another string. Each emblem is its own module, so a page that wants one ball takes one ball. MIT, with no dependencies.</p>
|
|
5
|
+
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://github.com/johnmorrisdotca/dougu-sports/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/johnmorrisdotca/dougu-sports/actions/workflows/ci.yml/badge.svg"></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/@johnmorrisdotca/dougu-sports"><img alt="npm" src="https://img.shields.io/npm/v/@johnmorrisdotca/dougu-sports?color=2f5d4a"></a>
|
|
9
|
+
<a href="./LICENSE"><img alt="MIT licence" src="https://img.shields.io/badge/licence-MIT-2f5d4a"></a>
|
|
10
|
+
<img alt="No dependencies" src="https://img.shields.io/badge/dependencies-0-2f5d4a">
|
|
11
|
+
<img alt="TypeScript" src="https://img.shields.io/badge/types-TypeScript-3178c6">
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center"><a href="https://johnmorrisdotca.github.io/dougu-sports/"><strong>Open the demo →</strong></a> · <a href="https://johnmorrisdotca.github.io/dougu-sports/gallery.html">Gallery</a> · <a href="./docs/gallery.md">Every id</a> · <a href="./docs/turning.md">Turning</a> · <a href="./docs/layout.md">Layout</a></p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<picture>
|
|
18
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/hero-desk-dark.png">
|
|
19
|
+
<img alt="The package's two sample emblems, each in the three styles: a gold medal on a red ribbon, and a soccer ball, drawn in metal with gradients, as one outline, and in flat colour." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/hero-desk-light.png" width="760">
|
|
20
|
+
</picture>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<table align="center">
|
|
24
|
+
<tr>
|
|
25
|
+
<td align="center" valign="top">
|
|
26
|
+
<img alt="A soccer ball and a medal turned through five angles: the ball rolls, and the medal flips like a coin to show its plain back." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/turn-desk-light.png" width="470"><br><em>Turned: a ball rolls, a medal flips</em>
|
|
27
|
+
</td>
|
|
28
|
+
<td align="center" valign="top">
|
|
29
|
+
<img alt="The same emblems on a phone, light." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/phone-light.png" width="200"><br><em>On a phone</em>
|
|
30
|
+
</td>
|
|
31
|
+
</tr>
|
|
32
|
+
</table>
|
|
33
|
+
|
|
34
|
+
> **Status: scaffold.** The package so far holds the machinery and two sample emblems, `award:medal` and `ball:soccer`, that stand in for the art. The trophies, medals, crests and the ball and gear of 33 sports arrive group by group ([docs/layout.md](./docs/layout.md) says where each goes), and the README's counts are read from the code, so they grow with it. Not on npm yet.
|
|
35
|
+
|
|
36
|
+
## In 30 seconds
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
npm install @johnmorrisdotca/dougu-sports
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
44
|
+
|
|
45
|
+
const svg = renderEmblem("ball:soccer", { style: "color", size: 48 });
|
|
46
|
+
|
|
47
|
+
console.log(svg.startsWith("<svg")); // true
|
|
48
|
+
console.log(svg.includes("<title>Soccer ball</title>")); // true
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Put the string in a page (`element.innerHTML = svg`), write it to a file, or send it from a server: it is plain SVG, with no script, no font and no network. The outline takes the page's text colour, so an emblem follows light and dark mode as the text does.
|
|
52
|
+
|
|
53
|
+
## Who it is for
|
|
54
|
+
|
|
55
|
+
- **Sports sites** that mark a champion, a result or a list with a trophy, a medal or a crest, without licensing a logo.
|
|
56
|
+
- **Scoreboards and brackets** that want a generic emblem for a team that has no logo, tinted in the team's colour.
|
|
57
|
+
- **Anyone building a game or a card** who needs a ball or a piece of gear for a sport, in one style that matches the rest.
|
|
58
|
+
- **Pages that care about weight**: one emblem is one module and about 2 kB gzipped, and the package says `"sideEffects": false`.
|
|
59
|
+
|
|
60
|
+
## Features
|
|
61
|
+
|
|
62
|
+
- **Three styles** for every emblem: `metal` (full colour with gradients), `line` (one outline in the page's text colour) and `color` (flat fills); see [Theming](#theming).
|
|
63
|
+
- **Size, tint and theme** as options: a tint recolours the main part (a medal's metal, a ball's patches), a theme sets the outline for light, dark or either.
|
|
64
|
+
- **Turning**: `emblemFrame` and `ballFrame` return the emblem at an angle, in plain SVG; see [docs/turning.md](./docs/turning.md).
|
|
65
|
+
- **One module per item**, so a bundler takes only what is imported; see [Use it in your project](#use-it-in-your-project).
|
|
66
|
+
- **Typed ids**: `EmblemId` is a union of `award:*`, `trophy:*`, `medal:*`, `crest:*`, `ball:*`, `gear:*` and `sport:*` ids.
|
|
67
|
+
- **Generic by design**: no emblem carries a league's, a team's or a federation's name or mark.
|
|
68
|
+
- **Accessible**: every drawing is `role="img"` with a `<title>`; see [Accessibility](#accessibility).
|
|
69
|
+
- **Deterministic**: the same id and options give the same string; a gradient's id comes from its colour.
|
|
70
|
+
- **No dependencies**, ESM with types.
|
|
71
|
+
|
|
72
|
+
### What's in it
|
|
73
|
+
|
|
74
|
+
<table>
|
|
75
|
+
<tr>
|
|
76
|
+
<td align="center" valign="top"><img alt="A gold medal on a red ribbon with a star on its face, in metal, line and color." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/hero-desk-light.png" width="360"><br><em><code>award:medal</code> and <code>ball:soccer</code>, each in three styles</em></td>
|
|
77
|
+
<td align="center" valign="top"><img alt="A soccer ball and a medal turned through five angles." src="https://raw.githubusercontent.com/johnmorrisdotca/dougu-sports/main/docs/images/turn-desk-light.png" width="360"><br><em>Turned through five angles</em></td>
|
|
78
|
+
</tr>
|
|
79
|
+
</table>
|
|
80
|
+
|
|
81
|
+
The list of every emblem, with its names, kind, source and the import that takes it alone, is [docs/gallery.md](./docs/gallery.md), made from the built package.
|
|
82
|
+
|
|
83
|
+
## Use it in your project
|
|
84
|
+
|
|
85
|
+
### Install
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
npm install @johnmorrisdotca/dougu-sports
|
|
89
|
+
# or: pnpm add @johnmorrisdotca/dougu-sports
|
|
90
|
+
# or: yarn add @johnmorrisdotca/dougu-sports
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
It is ESM, and `require` works on Node 22.12 and later. It needs no DOM: the functions return strings.
|
|
94
|
+
|
|
95
|
+
### Install under another name
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
npm install emblems@npm:@johnmorrisdotca/dougu-sports
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```ts no-check
|
|
102
|
+
import { renderEmblem } from "emblems/emblems";
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The alias is a name in your `package.json` only: the same package, the same code.
|
|
106
|
+
|
|
107
|
+
### Entry points
|
|
108
|
+
|
|
109
|
+
| Import | What it holds |
|
|
110
|
+
| --- | --- |
|
|
111
|
+
| `@johnmorrisdotca/dougu-sports` | The full registry: every emblem by id, the functions, and each emblem as a constant |
|
|
112
|
+
| `@johnmorrisdotca/dougu-sports/emblems` | `renderEmblem`, the ids and the types, with no single drawing imported by name |
|
|
113
|
+
| `@johnmorrisdotca/dougu-sports/turn` | `emblemFrame` and `ballFrame` |
|
|
114
|
+
| `@johnmorrisdotca/dougu-sports/award/<name>` | One award, trophy, medal, crest or sport emblem, alone (`award/medal`) |
|
|
115
|
+
| `@johnmorrisdotca/dougu-sports/ball/<name>` | One ball, alone (`ball/soccer`) |
|
|
116
|
+
| `@johnmorrisdotca/dougu-sports/gear/<name>` | One piece of gear, alone |
|
|
117
|
+
|
|
118
|
+
### One emblem and nothing else
|
|
119
|
+
|
|
120
|
+
```js
|
|
121
|
+
import { BALL_SOCCER } from "@johnmorrisdotca/dougu-sports/ball/soccer";
|
|
122
|
+
|
|
123
|
+
console.log(BALL_SOCCER.id); // ball:soccer
|
|
124
|
+
console.log(BALL_SOCCER.svg({ size: 24 }).includes('width="24"')); // true
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
A bundler that imports this module takes the soccer ball and the small renderer for balls, and no other emblem: the package says `"sideEffects": false` and each constant is marked pure. `test/size.test.ts` bundles one item with esbuild and holds it under 3 kB gzipped; `pnpm test:package` does the same from the packed tarball.
|
|
128
|
+
|
|
129
|
+
### In a page
|
|
130
|
+
|
|
131
|
+
```html
|
|
132
|
+
<span id="trophy"></span>
|
|
133
|
+
<script type="module">
|
|
134
|
+
import { renderEmblem } from "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/dougu-sports@0/emblems";
|
|
135
|
+
document.getElementById("trophy").innerHTML = renderEmblem("award:medal", { size: 40 });
|
|
136
|
+
</script>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### On a server
|
|
140
|
+
|
|
141
|
+
```js no-run
|
|
142
|
+
import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
143
|
+
import { writeFileSync } from "node:fs";
|
|
144
|
+
|
|
145
|
+
writeFileSync("medal.svg", renderEmblem("award:medal", { size: 256, theme: "light" }));
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Examples
|
|
149
|
+
|
|
150
|
+
### Draw an emblem by its id
|
|
151
|
+
|
|
152
|
+
An id is `<group>:<name>`. `renderEmblem` takes an id, or an id with a style after a slash.
|
|
153
|
+
|
|
154
|
+
```js
|
|
155
|
+
import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
156
|
+
|
|
157
|
+
console.log(renderEmblem("award:medal/line") === renderEmblem("award:medal", { style: "line" })); // true
|
|
158
|
+
console.log(renderEmblem("award:medal") === renderEmblem("award:medal", { style: "metal" })); // true
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Tint an emblem in a team's colour
|
|
162
|
+
|
|
163
|
+
```js
|
|
164
|
+
import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
165
|
+
|
|
166
|
+
const svg = renderEmblem("ball:soccer", { style: "color", tint: "#0b6e4f" });
|
|
167
|
+
console.log(svg.includes('fill="#0b6e4f"')); // true
|
|
168
|
+
console.log(renderEmblem("ball:soccer", { tint: "not a colour" }) === renderEmblem("ball:soccer")); // true
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
A tint is `#rgb`, `#rrggbb` or `rgb(r, g, b)`; anything else is ignored, so a colour that comes from outside cannot reach the markup.
|
|
172
|
+
|
|
173
|
+
### Choose the outline for a theme
|
|
174
|
+
|
|
175
|
+
```js
|
|
176
|
+
import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
177
|
+
|
|
178
|
+
console.log(renderEmblem("award:medal", { theme: "dark" }).includes('color="#eef1f3"')); // true
|
|
179
|
+
console.log(renderEmblem("award:medal", { theme: "light" }).includes('color="#20262d"')); // true
|
|
180
|
+
console.log(renderEmblem("award:medal").includes(" color=")); // false
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Turn an emblem
|
|
184
|
+
|
|
185
|
+
```js
|
|
186
|
+
import { ballFrame, emblemFrame } from "@johnmorrisdotca/dougu-sports/turn";
|
|
187
|
+
import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
188
|
+
|
|
189
|
+
console.log(emblemFrame("award:medal", { yaw: 0 }) === renderEmblem("award:medal")); // true
|
|
190
|
+
console.log(ballFrame("ball:soccer", { yaw: 90 }) === ballFrame("ball:soccer", { yaw: 450 })); // true
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
More in [docs/turning.md](./docs/turning.md).
|
|
194
|
+
|
|
195
|
+
### Read what an emblem is
|
|
196
|
+
|
|
197
|
+
```js
|
|
198
|
+
import { emblemInfo, emblemName } from "@johnmorrisdotca/dougu-sports";
|
|
199
|
+
|
|
200
|
+
console.log(emblemInfo("award:medal").kind); // flat
|
|
201
|
+
console.log(emblemName("award:medal", "ja")); // メダル
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### List the emblems
|
|
205
|
+
|
|
206
|
+
```js
|
|
207
|
+
import { EMBLEM_GROUPS, EMBLEM_IDS, SPORT_NAMES } from "@johnmorrisdotca/dougu-sports";
|
|
208
|
+
|
|
209
|
+
console.log(Object.keys(EMBLEM_GROUPS).join(" ")); // award trophy medal crest ball gear sport
|
|
210
|
+
console.log(EMBLEM_IDS.includes("ball:soccer")); // true
|
|
211
|
+
console.log(SPORT_NAMES.length); // 33
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Check a string from outside
|
|
215
|
+
|
|
216
|
+
```js
|
|
217
|
+
import { isEmblemId, parseEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
218
|
+
|
|
219
|
+
console.log(isEmblemId("ball:soccer")); // true
|
|
220
|
+
console.log(parseEmblem("ball:soccer/line")?.style); // line
|
|
221
|
+
console.log(parseEmblem("ball:nonesuch")); // undefined
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### In React, Vue and the rest
|
|
225
|
+
|
|
226
|
+
The functions return strings, so a framework puts them where it puts any markup: `dangerouslySetInnerHTML={{ __html: renderEmblem("award:medal") }}` in React, `v-html` in Vue, `{@html …}` in Svelte. The string holds no script and no external reference.
|
|
227
|
+
|
|
228
|
+
```ts no-check
|
|
229
|
+
const Medal = () => <span dangerouslySetInnerHTML={{ __html: renderEmblem("award:medal", { size: 32 }) }} />;
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## The emblems
|
|
233
|
+
|
|
234
|
+
An emblem is a small object: `id`, `en` and `ja` names, a `source` (who drew it), a `kind`, the `model` it is drawn from, and two functions, `svg(options)` and `frame(options)`.
|
|
235
|
+
|
|
236
|
+
| Kind | What it is | A turn |
|
|
237
|
+
| --- | --- | --- |
|
|
238
|
+
| `flat` | A front and a back drawn from paths: a medal, a plaque, a rosette | Flips like a coin |
|
|
239
|
+
| `ball` | Marks on a sphere: a ball | Rolls |
|
|
240
|
+
| `lathe` | A body of revolution: a cup, a bowl, an urn | Keeps its outline, moves its light |
|
|
241
|
+
| `icon` | One path | Is not turned |
|
|
242
|
+
|
|
243
|
+
Only `flat` and `ball` exist so far; the others are named here because the art that is coming needs them.
|
|
244
|
+
|
|
245
|
+
### The groups
|
|
246
|
+
|
|
247
|
+
| Group | What it holds | Folder |
|
|
248
|
+
| --- | --- | --- |
|
|
249
|
+
| `award` | Awards: a medal on a ribbon, a crown, a star, a badge | `src/emblems/award/` |
|
|
250
|
+
| `trophy` | Cups, bowls, plaques, belts, wreaths | `src/emblems/award/` |
|
|
251
|
+
| `medal` | Gold, silver and bronze, and the places | `src/emblems/award/` |
|
|
252
|
+
| `crest` | Generic crests, tinted by a team's colour | `src/emblems/award/` |
|
|
253
|
+
| `ball` | The ball of each sport | `src/emblems/ball/` |
|
|
254
|
+
| `gear` | The gear of each sport: a stick, a racket, a helmet | `src/emblems/gear/` |
|
|
255
|
+
| `sport` | An icon for the sport itself | `src/emblems/award/` |
|
|
256
|
+
|
|
257
|
+
The thirty-three sports the ball, gear and sport emblems are made for are `SPORT_NAMES`: NFL, CFL, IFAF, NHL, NBA, MLB, soccer, curling, tennis, volleyball, badminton, pickleball, table tennis, padel, squash, racquetball, sepak takraw, teqball, roundnet, netball, swimming, water polo, diving, artistic swimming, lacrosse, rugby, Australian football, Gaelic games, cricket, field hockey, handball, athletics and skating.
|
|
258
|
+
|
|
259
|
+
## API
|
|
260
|
+
|
|
261
|
+
| Function or value | What it does |
|
|
262
|
+
| --- | --- |
|
|
263
|
+
| `renderEmblem(ref, options?)` | An emblem as SVG. `ref` is an id, an id with a style (`"award:medal/line"`), or an emblem |
|
|
264
|
+
| `emblemSvg` | The same as `renderEmblem` |
|
|
265
|
+
| `emblemFrame(ref, options?)` | An emblem turned by `yaw` and `pitch` degrees |
|
|
266
|
+
| `ballFrame(id, options?)` | A ball rolled; an id that is not a ball is an error |
|
|
267
|
+
| `parseEmblem(value)` | The id and style a string names, or `undefined` |
|
|
268
|
+
| `isEmblemId(value)`, `isBallId(value)` | Whether a value is the id of an emblem, or of a ball |
|
|
269
|
+
| `emblemOf(ref)` | The emblem object a reference names |
|
|
270
|
+
| `emblemInfo(id)`, `emblemName(id, language?)`, `emblemModel(id)` | What an emblem is: its names, kind and source, and the data it is drawn from |
|
|
271
|
+
| `EMBLEMS` | Every emblem as markup in the metal style at 64 pixels, by id |
|
|
272
|
+
| `EMBLEM_TABLE` | Every emblem object, by id |
|
|
273
|
+
| `AWARD_MEDAL`, `BALL_SOCCER` | The two emblems so far, as constants |
|
|
274
|
+
| `EMBLEM_IDS`, `EMBLEM_GROUPS`, `EMBLEM_FOLDERS` | Every id, the groups, and the folder of each group's art |
|
|
275
|
+
| `AWARD_IDS`, `TROPHY_IDS`, `MEDAL_IDS`, `CREST_IDS`, `BALL_IDS`, `GEAR_IDS`, `SPORT_IDS` | The ids of each group |
|
|
276
|
+
| `SPORT_NAMES` | The thirty-three sports |
|
|
277
|
+
| `EMBLEM_STYLES`, `EMBLEM_INK`, `EMBLEM_PAGE`, `METALS` | The styles, the ink and page colours the themes use, and the metals |
|
|
278
|
+
| `VERSION` | The package's version |
|
|
279
|
+
|
|
280
|
+
### Options
|
|
281
|
+
|
|
282
|
+
| Option | Values | Default |
|
|
283
|
+
| --- | --- | --- |
|
|
284
|
+
| `style` | `"metal"`, `"line"`, `"color"` | `"metal"` |
|
|
285
|
+
| `size` | A number of pixels, 4096 at most | `64` |
|
|
286
|
+
| `tint` | `#rgb`, `#rrggbb` or `rgb(r, g, b)` | the emblem's own colour |
|
|
287
|
+
| `theme` | `"inherit"`, `"auto"`, `"light"`, `"dark"` | `"inherit"` |
|
|
288
|
+
| `yaw`, `pitch` (turning only) | Degrees from the resting view | `0` |
|
|
289
|
+
|
|
290
|
+
The types are `EmblemId`, `EmblemRef`, `EmblemOptions`, `FrameOptions`, `EmblemStyle`, `EmblemTheme`, `Emblem`, `EmblemInfo`, `EmblemKind`, `EmblemSource`, `EmblemGroup`, `SportName`, and the id types of each group.
|
|
291
|
+
|
|
292
|
+
## Theming
|
|
293
|
+
|
|
294
|
+
Every emblem is drawn with its outline in `currentColor`, so it takes the colour of the text around it. The `theme` option changes that when the SVG is used where it cannot inherit (an `<img>`, a data address):
|
|
295
|
+
|
|
296
|
+
| `theme` | The outline |
|
|
297
|
+
| --- | --- |
|
|
298
|
+
| `inherit` | The page's text colour (`currentColor`): the default for markup put in a page |
|
|
299
|
+
| `auto` | Dark ink on a light device and pale ink on a dark one, by `prefers-color-scheme` |
|
|
300
|
+
| `light` | `#20262d`, made to read on `#ffffff` |
|
|
301
|
+
| `dark` | `#eef1f3`, made to read on `#14181c` |
|
|
302
|
+
|
|
303
|
+
The metals are `METALS` (gold `#d9a620`, silver `#aeb6c0`, bronze `#b8733a`). The `line` style has no fill, so it takes only the outline's colour.
|
|
304
|
+
|
|
305
|
+
## Limits
|
|
306
|
+
|
|
307
|
+
- Two sample emblems exist so far; the rest of the art is on its way (see the status note above).
|
|
308
|
+
- A turn is drawn in plain SVG, not in 3D: a flat emblem is squeezed, and a ball's patches are projected points, not a lit mesh. A patch round a ball's edge is flattened against it rather than clipped to the sphere.
|
|
309
|
+
- A tint is one colour. A second colour (a ribbon, a crest's band) is not an option yet.
|
|
310
|
+
- The size is a number of pixels up to 4096; the drawing is a vector at any size.
|
|
311
|
+
- No emblem carries a real league's, team's or federation's mark.
|
|
312
|
+
|
|
313
|
+
## Accessibility
|
|
314
|
+
|
|
315
|
+
- Every emblem is `role="img"` with a `<title>` that names it in English ("Medal", "Soccer ball"). `emblemName(id, "ja")` gives the Japanese name for a caller that writes its own label.
|
|
316
|
+
- Where an emblem is only decoration next to text that says the same, hide it from a screen reader with `aria-hidden="true"` on the element that holds it.
|
|
317
|
+
- Colour is never the only carrier of meaning: the `line` style has no colour at all.
|
|
318
|
+
- The outline reads at 4.5 to 1 against the page the `light` and `dark` themes name; the tests hold the pair.
|
|
319
|
+
- Nothing moves by itself: turning happens when the caller asks for a frame, and the demo's sliders are 44 pixels tall.
|
|
320
|
+
|
|
321
|
+
## Browser and runtime support
|
|
322
|
+
|
|
323
|
+
Any current browser, and Node 22 or later. The package is plain strings, so it also runs in Deno, Bun, a worker and an edge function. CI tests Node 22 and 24 on Linux, macOS and Windows, and the demo in Chromium and WebKit at a phone's width and a desk's.
|
|
324
|
+
|
|
325
|
+
## Languages
|
|
326
|
+
|
|
327
|
+
The package's own words are the emblems' names, in English (`en`) and Japanese (`ja`), read with `emblemName(id, language)`. The `<title>` inside a drawing is English. The demo's header and footer come in English and Japanese.
|
|
328
|
+
|
|
329
|
+
## Roadmap
|
|
330
|
+
|
|
331
|
+
- The art: trophies, medals, crests, then the ball and the gear of each of the 33 sports, group by group.
|
|
332
|
+
- Bodies of revolution (`lathe`), so a cup turns with its outline kept.
|
|
333
|
+
- A second colour as an option.
|
|
334
|
+
- Deliberately not: logos of real leagues and teams, a canvas or WebGL renderer, and a runtime dependency.
|
|
335
|
+
|
|
336
|
+
## Architecture
|
|
337
|
+
|
|
338
|
+
The code is `src/emblems/`: the core (options, colours, the wrapper), the id lists, the registry, the two renderers (flat and ball) and one module per emblem; [docs/layout.md](./docs/layout.md) has the folders and how to add one. The package has no state and no clock: every function is a pure function of its arguments.
|
|
339
|
+
|
|
340
|
+
## The name
|
|
341
|
+
|
|
342
|
+
Dougu (道具, *dōgu*, どうぐ) is Japanese for a tool or a piece of equipment: the things a task is done with. The package is the equipment of sport, as pictures.
|
|
343
|
+
|
|
344
|
+
## Where it comes from, and where it is used
|
|
345
|
+
|
|
346
|
+
The emblems are drawn for this package or made from the open sources listed in [NOTICE.md](./NOTICE.md), each with its licence in [LICENSES/](./LICENSES/). It is made for [spxn.com](https://spxn.com), the historical record of the NHL, NBA, MLB, NFL and CFL, and for the other packages of the family that draw sport.
|
|
347
|
+
|
|
348
|
+
### Used by
|
|
349
|
+
|
|
350
|
+
[Kyogijo Stadiums](https://github.com/johnmorrisdotca/kyogijo-stadiums) draws the same kind of emblems today, inside itself; they move here, and Kyogijo then imports them.
|
|
351
|
+
|
|
352
|
+
### The family
|
|
353
|
+
|
|
354
|
+
<!-- family:start (made by scripts/family-readme.mjs from scripts/family-template.mjs; change those, not this) -->
|
|
355
|
+
Dougu Sports is one of twenty-seven packages, each made for the same site, each at
|
|
356
|
+
[github.com/johnmorrisdotca](https://github.com/johnmorrisdotca). The code of every one is MIT.
|
|
357
|
+
|
|
358
|
+
- [Korokoro](https://github.com/johnmorrisdotca/korokoro) (コロコロ): dice, with notation, exact odds, real sounds and the dice of many games. [Demo](https://johnmorrisdotca.github.io/korokoro/).
|
|
359
|
+
- [Kyuubu](https://github.com/johnmorrisdotca/kyuubu) (キューブ): a turning cube for the browser, 2×2 to 7×7, with record solves to replay. [Demo](https://johnmorrisdotca.github.io/kyuubu/).
|
|
360
|
+
- [Hitotsu](https://github.com/johnmorrisdotca/hitotsu) (一つ): a colour-card shedding game for two to eight, with the house rules people play. [Demo](https://johnmorrisdotca.github.io/hitotsu/).
|
|
361
|
+
- [Toranpu](https://github.com/johnmorrisdotca/toranpu) (トランプ): a deck of playing cards, card games with computer players, and solitaires. [Demo](https://johnmorrisdotca.github.io/toranpu/).
|
|
362
|
+
- [Tane](https://github.com/johnmorrisdotca/tane) (種): seeded random numbers and daily seeds, the same in every browser and on every server. [Demo](https://johnmorrisdotca.github.io/tane/).
|
|
363
|
+
- [Narabe](https://github.com/johnmorrisdotca/narabe) (並べ): one rules engine for abstract board games, from gomoku and Reversi to Go and checkers. [Demo](https://johnmorrisdotca.github.io/narabe/).
|
|
364
|
+
- [Tenka](https://github.com/johnmorrisdotca/tenka) (天下): world conquest for two to six, on a map of the real world. [Demo](https://johnmorrisdotca.github.io/tenka/).
|
|
365
|
+
- [Kumimoji](https://github.com/johnmorrisdotca/kumimoji) (組み文字): a crossword tile race, in English and Japanese kana. [Demo](https://johnmorrisdotca.github.io/kumimoji/).
|
|
366
|
+
- [Tsunagi](https://github.com/johnmorrisdotca/tsunagi) (繋ぎ): a line-joining logic puzzle whose every level has exactly one answer. [Demo](https://johnmorrisdotca.github.io/tsunagi/).
|
|
367
|
+
- [Jarajara](https://github.com/johnmorrisdotca/jarajara) (ジャラジャラ): mahjong tiles drawn as SVG, stacked layouts, and the matching solitaire Awase. [Demo](https://johnmorrisdotca.github.io/jarajara/).
|
|
368
|
+
- [Suido](https://github.com/johnmorrisdotca/suido) (水道): a pipe puzzle: turn the pieces until the water reaches every drain. [Demo](https://johnmorrisdotca.github.io/suido/).
|
|
369
|
+
- [Domino](https://github.com/johnmorrisdotca/domino) (ドミノ): dominoes and Mexican Train. [Demo](https://johnmorrisdotca.github.io/domino/).
|
|
370
|
+
- [Kotoba](https://github.com/johnmorrisdotca/kotoba) (言葉): word lists and word-game rules in English, French, German and Japanese. [Demo](https://johnmorrisdotca.github.io/kotoba/).
|
|
371
|
+
- [Sugoroku](https://github.com/johnmorrisdotca/sugoroku) (双六): backgammon and its variants, with the doubling cube and match play. [Demo](https://johnmorrisdotca.github.io/sugoroku/).
|
|
372
|
+
- [Kazu](https://github.com/johnmorrisdotca/kazu) (数): grid number puzzles: Sudoku and its variants, Futoshiki and Skyscrapers. [Demo](https://johnmorrisdotca.github.io/kazu/).
|
|
373
|
+
- [Meikyuu](https://github.com/johnmorrisdotca/meikyuu) (迷宮): mazes on squares, hexagons, triangles and circles, made from a seed and drawn through with a finger or the mouse. [Demo](https://johnmorrisdotca.github.io/meikyuu/).
|
|
374
|
+
- [Hikidashi](https://github.com/johnmorrisdotca/hikidashi) (引き出し): a drawer of small Japanese text tools: era dates, kanji numerals, readings and sentence difficulty. [Demo](https://johnmorrisdotca.github.io/hikidashi/).
|
|
375
|
+
- [Chizu](https://github.com/johnmorrisdotca/chizu) (地図): maps of the world and of countries' regions, in English and Japanese, with a quiz and callouts. [Demo](https://johnmorrisdotca.github.io/chizu/).
|
|
376
|
+
- [Bushu](https://github.com/johnmorrisdotca/bushu) (部首): find a kanji by the parts it is made of. [Demo](https://johnmorrisdotca.github.io/bushu/).
|
|
377
|
+
- [Tobiishi](https://github.com/johnmorrisdotca/tobiishi) (飛び石): peg solitaire with nine boards and seeded solvable challenges. [Demo](https://johnmorrisdotca.github.io/tobiishi/).
|
|
378
|
+
- [Jirai](https://github.com/johnmorrisdotca/jirai) (地雷): minesweeper on shaped grids with verified no-guess boards. [Demo](https://johnmorrisdotca.github.io/jirai/).
|
|
379
|
+
- [Gunjin](https://github.com/johnmorrisdotca/gunjin) (軍人): five hidden-rank strategy games with pass-the-device play. [Demo](https://johnmorrisdotca.github.io/gunjin/).
|
|
380
|
+
- [Karakuri](https://github.com/johnmorrisdotca/karakuri) (からくり): eight hyper-casual puzzle games, some of them physics: draw a shield, pull pins, cut ropes, slide blocks, pour tubes. [Demo](https://johnmorrisdotca.github.io/karakuri/).
|
|
381
|
+
- [Houseki](https://github.com/johnmorrisdotca/houseki) (宝石): gem and stone matching puzzles: falling triplets, stone collapse, colour chains and gem swap. [Demo](https://johnmorrisdotca.github.io/houseki/).
|
|
382
|
+
- [Kyogijo Stadiums](https://github.com/johnmorrisdotca/kyogijo-stadiums) (競技場): sports fields, rinks, courts and ballparks drawn to scale as SVG, with each team and the score on them. [Demo](https://johnmorrisdotca.github.io/kyogijo-stadiums/).
|
|
383
|
+
- [Taisen Brackets](https://github.com/johnmorrisdotca/taisen-brackets) (対戦): a sport-agnostic tournament bracket, drawn as SVG, from a list of ties. [Demo](https://johnmorrisdotca.github.io/taisen-brackets/).
|
|
384
|
+
- [Dougu Sports](https://github.com/johnmorrisdotca/dougu-sports) (道具): sports emblems as SVG: trophies, medals, crests, and the ball and gear of every sport, with optional 3D turning. [Demo](https://johnmorrisdotca.github.io/dougu-sports/). Not on npm yet.
|
|
385
|
+
|
|
386
|
+
**This package is Dougu Sports.** The demos of all twenty-seven share one header and footer, so each links the rest.
|
|
387
|
+
<!-- family:end -->
|
|
388
|
+
|
|
389
|
+
## Development
|
|
390
|
+
|
|
391
|
+
```sh
|
|
392
|
+
pnpm install
|
|
393
|
+
pnpm check # lint, types, tests, the build and the packed package
|
|
394
|
+
pnpm dev # the demo on http://127.0.0.1:7200/
|
|
395
|
+
pnpm test:demo # the demo in a real browser
|
|
396
|
+
pnpm test:readme # the README's and the docs' examples, and docs/gallery.md
|
|
397
|
+
pnpm screenshots # retake the README's pictures
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
This package owns local ports 7200 to 7299 (see [CONTRIBUTING.md](./CONTRIBUTING.md)).
|
|
401
|
+
|
|
402
|
+
## Contributing
|
|
403
|
+
|
|
404
|
+
Bug reports and ideas go in the [issues](https://github.com/johnmorrisdotca/dougu-sports/issues); read [CONTRIBUTING.md](./CONTRIBUTING.md) first, and [docs/layout.md](./docs/layout.md) before adding an emblem.
|
|
405
|
+
|
|
406
|
+
## Changes
|
|
407
|
+
|
|
408
|
+
See [CHANGELOG.md](./CHANGELOG.md). 0.0.1 is the first preview: the name, the API and two sample emblems; the full set follows.
|
|
409
|
+
|
|
410
|
+
## Credits
|
|
411
|
+
|
|
412
|
+
The medal and the soccer ball are drawn for this package. Every other source is credited in [NOTICE.md](./NOTICE.md).
|
|
413
|
+
|
|
414
|
+
## Licence
|
|
415
|
+
|
|
416
|
+
The code, and the art drawn for this package, are [MIT](./LICENSE). Art taken from another project keeps its own licence, named in [NOTICE.md](./NOTICE.md), with its text in [LICENSES/](./LICENSES/).
|