diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 01770e9..783dc7d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,11 +2,12 @@ 1. Make a skin in [Plinth's skin format](https://github.com/rubycatco/plinth/blob/main/docs/SKINS.md) and try it in Plinth at each fish size. 2. Put it in `skins//`, where `` is lowercase letters, digits and hyphens, such as `paper-crane`. The id names the download, so choose one you'll keep. -3. In `skin.json`, besides `name`, and optionally `strike` and `voice`, add: +3. In `skin.json`, besides `name`, and optionally `names`, `strike` and `voice`, add: ```json { "name": "Paper Crane", + "names": { "zh-Hans": "纸鹤" }, "author": "Your Name (@you)", "license": "CC0-1.0", "voice": "bamboo" @@ -28,7 +29,7 @@ - `idle.png` exists. Every PNG is square, has a transparent background, and frames are all the same size. - Only skin files: `idle`, `blink` and `hit` frames (single or numbered from 1), `mallet.png`, `impact.png` and `skin.json`. No folders or links. - The whole skin is under 3 MB. -- `skin.json` is valid JSON with `name`, `author` and `license`; `voice` is one of Plinth's twelve; `strike` is two numbers from 0 to 1. +- `skin.json` is valid JSON with `name`, `author` and `license`; `names`, if there, maps language codes to names; `voice` is one of Plinth's twenty-one; `strike` is two numbers from 0 to 1. ## Real people diff --git a/README.md b/README.md index db4d07b..c2f6217 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Plinth Skins -Skins for [Plinth](https://github.com/rubycatco/plinth), the wooden fish on your Mac's desktop, made by the people who knock it. +Skins for [Plinth](https://github.com/rubycatco/plinth), the wooden fish on your Mac's desktop, made by the people who knock it. The first six shipped with Plinth itself before they moved here. ## Install a skin @@ -11,7 +11,14 @@ To get them all at once, download `all-skins.zip` from the [latest release](http ## Gallery -No skins yet. [Add the first one](CONTRIBUTING.md). +| | Skin | By | Knock | | +| :-: | --- | --- | --- | --- | +| | **Abacus** · 算盘 | Plinth | `bead` | [Download](https://github.com/rubycatco/plinth-skins/releases/latest/download/abacus.plinthskin) | +| | **CRT Terminal** · CRT 终端 | Plinth | `crt` | [Download](https://github.com/rubycatco/plinth-skins/releases/latest/download/crt-terminal.plinthskin) | +| | **Mug** · 马克杯 | Plinth | `ceramic` | [Download](https://github.com/rubycatco/plinth-skins/releases/latest/download/mug.plinthskin) | +| | **Piston** · 活塞 | Plinth | `piston` | [Download](https://github.com/rubycatco/plinth-skins/releases/latest/download/piston.plinthskin) | +| | **Seal** · 印章 | Plinth | `stamp` | [Download](https://github.com/rubycatco/plinth-skins/releases/latest/download/seal.plinthskin) | +| | **Space Key** · 空格键 | Plinth | `key` | [Download](https://github.com/rubycatco/plinth-skins/releases/latest/download/space-key.plinthskin) | ## Add yours diff --git a/scripts/skins.py b/scripts/skins.py index 327077b..c0e3ff1 100644 --- a/scripts/skins.py +++ b/scripts/skins.py @@ -22,8 +22,10 @@ DIST = os.path.join(ROOT, "dist") RELEASE = "https://github.com/rubycatco/plinth-skins/releases/latest/download" +# KnockSynth.voices, in Plinth's Sources/PlinthCore/KnockSynth.swift. VOICES = {"wood", "lacquer", "ink", "cartoon", "pixel", "jade", "bowl", "key", - "bamboo", "stone", "piston", "crt"} + "bamboo", "stone", "piston", "crt", "bead", "plate", "porcelain", + "bell", "stamp", "chime", "board", "ceramic", "temple"} LICENSES = {"CC0-1.0", "CC-BY-4.0"} FRAMES = re.compile(r"^(idle|blink|hit)(-[1-9][0-9]*)?\.png$") OTHER = {"mallet.png", "impact.png", "skin.json"} @@ -98,6 +100,10 @@ def check(skin): for key in ("name", "author"): if not isinstance(meta.get(key), str) or not meta[key].strip(): problems.append(f"skin.json: \"{key}\" is required") + names = meta.get("names") + if names is not None and not (isinstance(names, dict) and names + and all(isinstance(v, str) and v.strip() for v in names.values())): + problems.append("skin.json: \"names\" must map language codes to names, such as {\"zh-Hans\": \"纸鹤\"}") if meta.get("license") not in LICENSES: problems.append(f"skin.json: \"license\" must be one of {sorted(LICENSES)}") if "voice" in meta and meta["voice"] not in VOICES: @@ -132,8 +138,10 @@ def gallery(skins): for name, meta in skins: voice = meta.get("voice", "wood") author = meta["author"].replace("|", "\\|") - title = meta["name"].replace("|", "\\|") - rows.append(f'| | **{title}** | {author} | ' + # The name, then its names in other languages. + others = meta.get("names", {}) + title = " · ".join([f"**{meta['name']}**"] + [others[k] for k in sorted(others)]).replace("|", "\\|") + rows.append(f'| | {title} | {author} | ' f"`{voice}` | [Download]({RELEASE}/{name}.plinthskin) |") return "\n".join(rows) diff --git a/skins/.gitkeep b/skins/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/skins/abacus/hit.png b/skins/abacus/hit.png new file mode 100644 index 0000000..d96eec9 Binary files /dev/null and b/skins/abacus/hit.png differ diff --git a/skins/abacus/idle.png b/skins/abacus/idle.png new file mode 100644 index 0000000..19e3101 Binary files /dev/null and b/skins/abacus/idle.png differ diff --git a/skins/abacus/impact.png b/skins/abacus/impact.png new file mode 100644 index 0000000..bf928f2 Binary files /dev/null and b/skins/abacus/impact.png differ diff --git a/skins/abacus/mallet.png b/skins/abacus/mallet.png new file mode 100644 index 0000000..1b76f27 Binary files /dev/null and b/skins/abacus/mallet.png differ diff --git a/skins/abacus/skin.json b/skins/abacus/skin.json new file mode 100644 index 0000000..e57f30a --- /dev/null +++ b/skins/abacus/skin.json @@ -0,0 +1,9 @@ +{ + "name": "Abacus", + "names": { "zh-Hans": "算盘" }, + "author": "Plinth", + "license": "CC0-1.0", + "strike": [0.5, 0.325], + "voice": "bead", + "glow": "#F0BA44" +} diff --git a/skins/crt-terminal/hit.png b/skins/crt-terminal/hit.png new file mode 100644 index 0000000..3830acf Binary files /dev/null and b/skins/crt-terminal/hit.png differ diff --git a/skins/crt-terminal/idle.png b/skins/crt-terminal/idle.png new file mode 100644 index 0000000..09502da Binary files /dev/null and b/skins/crt-terminal/idle.png differ diff --git a/skins/crt-terminal/impact.png b/skins/crt-terminal/impact.png new file mode 100644 index 0000000..043ea38 Binary files /dev/null and b/skins/crt-terminal/impact.png differ diff --git a/skins/crt-terminal/mallet.png b/skins/crt-terminal/mallet.png new file mode 100644 index 0000000..165ba8e Binary files /dev/null and b/skins/crt-terminal/mallet.png differ diff --git a/skins/crt-terminal/skin.json b/skins/crt-terminal/skin.json new file mode 100644 index 0000000..2269065 --- /dev/null +++ b/skins/crt-terminal/skin.json @@ -0,0 +1,8 @@ +{ + "name": "CRT Terminal", + "names": { "zh-Hans": "CRT 终端" }, + "author": "Plinth", + "license": "CC0-1.0", + "strike": [0.52, 0.395], + "voice": "crt" +} diff --git a/skins/mug/idle.png b/skins/mug/idle.png new file mode 100644 index 0000000..9585569 Binary files /dev/null and b/skins/mug/idle.png differ diff --git a/skins/mug/impact.png b/skins/mug/impact.png new file mode 100644 index 0000000..e7abb7c Binary files /dev/null and b/skins/mug/impact.png differ diff --git a/skins/mug/mallet.png b/skins/mug/mallet.png new file mode 100644 index 0000000..6eef6a5 Binary files /dev/null and b/skins/mug/mallet.png differ diff --git a/skins/mug/skin.json b/skins/mug/skin.json new file mode 100644 index 0000000..2e5c9df --- /dev/null +++ b/skins/mug/skin.json @@ -0,0 +1,9 @@ +{ + "name": "Mug", + "names": { "zh-Hans": "马克杯" }, + "author": "Plinth", + "license": "CC0-1.0", + "strike": [0.56, 0.36], + "voice": "ceramic", + "glow": "#F6BE3D" +} diff --git a/skins/piston/hit.png b/skins/piston/hit.png new file mode 100644 index 0000000..ed67f04 Binary files /dev/null and b/skins/piston/hit.png differ diff --git a/skins/piston/idle.png b/skins/piston/idle.png new file mode 100644 index 0000000..322ae0f Binary files /dev/null and b/skins/piston/idle.png differ diff --git a/skins/piston/impact.png b/skins/piston/impact.png new file mode 100644 index 0000000..bf5b0a9 Binary files /dev/null and b/skins/piston/impact.png differ diff --git a/skins/piston/mallet.png b/skins/piston/mallet.png new file mode 100644 index 0000000..812b1f4 Binary files /dev/null and b/skins/piston/mallet.png differ diff --git a/skins/piston/skin.json b/skins/piston/skin.json new file mode 100644 index 0000000..33b609f --- /dev/null +++ b/skins/piston/skin.json @@ -0,0 +1,8 @@ +{ + "name": "Piston", + "names": { "zh-Hans": "活塞" }, + "author": "Plinth", + "license": "CC0-1.0", + "strike": [0.52, 0.39], + "voice": "piston" +} diff --git a/skins/seal/idle.png b/skins/seal/idle.png new file mode 100644 index 0000000..a692364 Binary files /dev/null and b/skins/seal/idle.png differ diff --git a/skins/seal/impact.png b/skins/seal/impact.png new file mode 100644 index 0000000..9d6bc35 Binary files /dev/null and b/skins/seal/impact.png differ diff --git a/skins/seal/mallet.png b/skins/seal/mallet.png new file mode 100644 index 0000000..3f1060d Binary files /dev/null and b/skins/seal/mallet.png differ diff --git a/skins/seal/skin.json b/skins/seal/skin.json new file mode 100644 index 0000000..99bac9f --- /dev/null +++ b/skins/seal/skin.json @@ -0,0 +1,9 @@ +{ + "name": "Seal", + "names": { "zh-Hans": "印章" }, + "author": "Plinth", + "license": "CC0-1.0", + "strike": [0.55, 0.39], + "voice": "stamp", + "glow": "#F95240" +} diff --git a/skins/space-key/hit.png b/skins/space-key/hit.png new file mode 100644 index 0000000..d011690 Binary files /dev/null and b/skins/space-key/hit.png differ diff --git a/skins/space-key/idle.png b/skins/space-key/idle.png new file mode 100644 index 0000000..08e1c1e Binary files /dev/null and b/skins/space-key/idle.png differ diff --git a/skins/space-key/impact.png b/skins/space-key/impact.png new file mode 100644 index 0000000..6bb046d Binary files /dev/null and b/skins/space-key/impact.png differ diff --git a/skins/space-key/mallet.png b/skins/space-key/mallet.png new file mode 100644 index 0000000..a566b00 Binary files /dev/null and b/skins/space-key/mallet.png differ diff --git a/skins/space-key/skin.json b/skins/space-key/skin.json new file mode 100644 index 0000000..ed5fcc0 --- /dev/null +++ b/skins/space-key/skin.json @@ -0,0 +1,8 @@ +{ + "name": "Space Key", + "names": { "zh-Hans": "空格键" }, + "author": "Plinth", + "license": "CC0-1.0", + "strike": [0.52, 0.515], + "voice": "key" +}