@n1h/web-characters-cube-pets 0.0.0-stage → 0.1.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.
Files changed (78) hide show
  1. package/README.md +15 -2
  2. package/assets/License.txt +28 -0
  3. package/assets/Previews/animal-beaver.png +0 -0
  4. package/assets/Previews/animal-bee.png +0 -0
  5. package/assets/Previews/animal-bunny.png +0 -0
  6. package/assets/Previews/animal-cat.png +0 -0
  7. package/assets/Previews/animal-caterpillar.png +0 -0
  8. package/assets/Previews/animal-chick.png +0 -0
  9. package/assets/Previews/animal-cow.png +0 -0
  10. package/assets/Previews/animal-crab.png +0 -0
  11. package/assets/Previews/animal-deer.png +0 -0
  12. package/assets/Previews/animal-dog.png +0 -0
  13. package/assets/Previews/animal-elephant.png +0 -0
  14. package/assets/Previews/animal-fish.png +0 -0
  15. package/assets/Previews/animal-fox.png +0 -0
  16. package/assets/Previews/animal-giraffe.png +0 -0
  17. package/assets/Previews/animal-hog.png +0 -0
  18. package/assets/Previews/animal-koala.png +0 -0
  19. package/assets/Previews/animal-lion.png +0 -0
  20. package/assets/Previews/animal-monkey.png +0 -0
  21. package/assets/Previews/animal-panda.png +0 -0
  22. package/assets/Previews/animal-parrot.png +0 -0
  23. package/assets/Previews/animal-penguin.png +0 -0
  24. package/assets/Previews/animal-pig.png +0 -0
  25. package/assets/Previews/animal-polar.png +0 -0
  26. package/assets/Previews/animal-tiger.png +0 -0
  27. package/assets/Textures/colormap.png +0 -0
  28. package/assets/animal-beaver.glb +0 -0
  29. package/assets/animal-bee.glb +0 -0
  30. package/assets/animal-bunny.glb +0 -0
  31. package/assets/animal-cat.glb +0 -0
  32. package/assets/animal-caterpillar.glb +0 -0
  33. package/assets/animal-chick.glb +0 -0
  34. package/assets/animal-cow.glb +0 -0
  35. package/assets/animal-crab.glb +0 -0
  36. package/assets/animal-deer.glb +0 -0
  37. package/assets/animal-dog.glb +0 -0
  38. package/assets/animal-elephant.glb +0 -0
  39. package/assets/animal-fish.glb +0 -0
  40. package/assets/animal-fox.glb +0 -0
  41. package/assets/animal-giraffe.glb +0 -0
  42. package/assets/animal-hog.glb +0 -0
  43. package/assets/animal-koala.glb +0 -0
  44. package/assets/animal-lion.glb +0 -0
  45. package/assets/animal-monkey.glb +0 -0
  46. package/assets/animal-panda.glb +0 -0
  47. package/assets/animal-parrot.glb +0 -0
  48. package/assets/animal-penguin.glb +0 -0
  49. package/assets/animal-pig.glb +0 -0
  50. package/assets/animal-polar.glb +0 -0
  51. package/assets/animal-tiger.glb +0 -0
  52. package/package.json +33 -4
  53. package/src/beaver.ts +5 -0
  54. package/src/bee.ts +5 -0
  55. package/src/bunny.ts +5 -0
  56. package/src/cat.ts +5 -0
  57. package/src/caterpillar.ts +5 -0
  58. package/src/chick.ts +5 -0
  59. package/src/cow.ts +5 -0
  60. package/src/crab.ts +5 -0
  61. package/src/deer.ts +5 -0
  62. package/src/dog.ts +5 -0
  63. package/src/elephant.ts +5 -0
  64. package/src/fish.ts +5 -0
  65. package/src/fox.ts +5 -0
  66. package/src/giraffe.ts +5 -0
  67. package/src/hog.ts +5 -0
  68. package/src/index.ts +38 -0
  69. package/src/koala.ts +5 -0
  70. package/src/lion.ts +5 -0
  71. package/src/monkey.ts +5 -0
  72. package/src/panda.ts +5 -0
  73. package/src/parrot.ts +5 -0
  74. package/src/penguin.ts +5 -0
  75. package/src/pig.ts +5 -0
  76. package/src/polar.ts +5 -0
  77. package/src/spec.ts +77 -0
  78. package/src/tiger.ts +5 -0
package/README.md CHANGED
@@ -1,3 +1,16 @@
1
- # Temporary Holding Version
1
+ # @n1h/web-characters-cube-pets
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Kenney's 24 [Cube Pets](https://kenney.nl/assets/cube-pets), [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/), as [`@n1h/web-characters`](https://github.com/n0t-invented-here/catwalk) models.
4
+
5
+ ```ts
6
+ import { cat } from "@n1h/web-characters-cube-pets/cat"; // one animal: its file and the shared texture
7
+ import { CUBE_PETS } from "@n1h/web-characters-cube-pets"; // all 24, by name
8
+ import { PETS, petLabel } from "@n1h/web-characters-cube-pets/spec"; // the names, without the files
9
+ ```
10
+
11
+ - One module per animal, so a build ships only the animals a page imports.
12
+ - The animals: beaver, bee, bunny, cat, caterpillar, chick, cow, crab, deer, dog, elephant, fish, fox, giraffe, hog, koala, lion, monkey, panda, parrot, penguin, pig, polar, tiger.
13
+ - They idle, walk, run and dance. The chick, the parrot and the penguin also eat.
14
+ - Licence: [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/); Kenney's file is `assets/License.txt`.
15
+
16
+ Reference: [packs](https://github.com/n0t-invented-here/catwalk/blob/main/docs/packs.md).
@@ -0,0 +1,28 @@
1
+
2
+
3
+ Cube Pets (2.0)
4
+
5
+ Created/distributed by Kenney (www.kenney.nl)
6
+ Creation date: 26-03-2026 11:16
7
+
8
+ ------------------------------
9
+
10
+ License: (Creative Commons Zero, CC0)
11
+ http://creativecommons.org/publicdomain/zero/1.0/
12
+
13
+ You can use this content for personal, educational, and commercial purposes.
14
+
15
+ Support by crediting 'Kenney' or 'www.kenney.nl' (this is not a requirement)
16
+
17
+ ------------------------------
18
+
19
+ • Website : www.kenney.nl
20
+ • Donate : www.kenney.nl/donate
21
+
22
+ • Patreon : patreon.com/kenney
23
+
24
+ Follow on social media for updates:
25
+
26
+ • Twitter: twitter.com/KenneyNL
27
+ • BlueSky: kenney.bsky.social
28
+ • Instagram: instagram.com/kenney_nl
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,35 @@
1
1
  {
2
2
  "name": "@n1h/web-characters-cube-pets",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Kenney's 24 Cube Pets (CC0) as @n1h/web-characters models: one module per animal, so a build ships only the animals a page imports. The models, the shared texture and the licence are in the package.",
6
+ "license": "MIT OR 0BSD",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/n0t-invented-here/catwalk.git",
10
+ "directory": "packages/web-characters-cube-pets"
11
+ },
12
+ "homepage": "https://github.com/n0t-invented-here/catwalk#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/n0t-invented-here/catwalk/issues"
15
+ },
16
+ "files": [
17
+ "src",
18
+ "!src/**/*.test.ts",
19
+ "assets",
20
+ "README.md"
21
+ ],
22
+ "sideEffects": false,
23
+ "exports": {
24
+ ".": "./src/index.ts",
25
+ "./spec": "./src/spec.ts",
26
+ "./*": "./src/*.ts",
27
+ "./assets/*": "./assets/*"
28
+ },
29
+ "peerDependencies": {
30
+ "@n1h/web-characters": "^0.1.0"
31
+ },
32
+ "devDependencies": {
33
+ "@n1h/web-characters": "0.1.0"
34
+ }
35
+ }
package/src/beaver.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-beaver.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const beaver = cubePetSpec("beaver", url, { [PET_TEXTURE_FILE]: colormap });
package/src/bee.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-bee.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const bee = cubePetSpec("bee", url, { [PET_TEXTURE_FILE]: colormap });
package/src/bunny.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-bunny.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const bunny = cubePetSpec("bunny", url, { [PET_TEXTURE_FILE]: colormap });
package/src/cat.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-cat.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const cat = cubePetSpec("cat", url, { [PET_TEXTURE_FILE]: colormap });
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-caterpillar.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const caterpillar = cubePetSpec("caterpillar", url, { [PET_TEXTURE_FILE]: colormap });
package/src/chick.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-chick.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const chick = cubePetSpec("chick", url, { [PET_TEXTURE_FILE]: colormap });
package/src/cow.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-cow.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const cow = cubePetSpec("cow", url, { [PET_TEXTURE_FILE]: colormap });
package/src/crab.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-crab.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const crab = cubePetSpec("crab", url, { [PET_TEXTURE_FILE]: colormap });
package/src/deer.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-deer.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const deer = cubePetSpec("deer", url, { [PET_TEXTURE_FILE]: colormap });
package/src/dog.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-dog.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const dog = cubePetSpec("dog", url, { [PET_TEXTURE_FILE]: colormap });
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-elephant.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const elephant = cubePetSpec("elephant", url, { [PET_TEXTURE_FILE]: colormap });
package/src/fish.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-fish.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const fish = cubePetSpec("fish", url, { [PET_TEXTURE_FILE]: colormap });
package/src/fox.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-fox.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const fox = cubePetSpec("fox", url, { [PET_TEXTURE_FILE]: colormap });
package/src/giraffe.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-giraffe.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const giraffe = cubePetSpec("giraffe", url, { [PET_TEXTURE_FILE]: colormap });
package/src/hog.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-hog.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const hog = cubePetSpec("hog", url, { [PET_TEXTURE_FILE]: colormap });
package/src/index.ts ADDED
@@ -0,0 +1,38 @@
1
+ /// <reference types="@n1h/web-characters/assets" />
2
+ // Kenney's Cube Pets, with their files. Each animal is its own module
3
+ // (`@n1h/web-characters-cube-pets/cat`), importing its own glTF, so a build
4
+ // that imports the cat ships the cat's file and nothing else of the pack.
5
+ // This module imports all 24, for a page that wants the whole pack and
6
+ // ships it.
7
+
8
+ import type { ModelSpec } from "@n1h/web-characters/model";
9
+ import type { Pet } from "./spec";
10
+ export { PETS, BIRDS, isBird, isPet, petLabel, randomPet, type Pet, type PetAnimation } from "./spec";
11
+ import { beaver } from "./beaver";
12
+ import { bee } from "./bee";
13
+ import { bunny } from "./bunny";
14
+ import { cat } from "./cat";
15
+ import { caterpillar } from "./caterpillar";
16
+ import { chick } from "./chick";
17
+ import { cow } from "./cow";
18
+ import { crab } from "./crab";
19
+ import { deer } from "./deer";
20
+ import { dog } from "./dog";
21
+ import { elephant } from "./elephant";
22
+ import { fish } from "./fish";
23
+ import { fox } from "./fox";
24
+ import { giraffe } from "./giraffe";
25
+ import { hog } from "./hog";
26
+ import { koala } from "./koala";
27
+ import { lion } from "./lion";
28
+ import { monkey } from "./monkey";
29
+ import { panda } from "./panda";
30
+ import { parrot } from "./parrot";
31
+ import { penguin } from "./penguin";
32
+ import { pig } from "./pig";
33
+ import { polar } from "./polar";
34
+ import { tiger } from "./tiger";
35
+
36
+ export { beaver, bee, bunny, cat, caterpillar, chick, cow, crab, deer, dog, elephant, fish, fox, giraffe, hog, koala, lion, monkey, panda, parrot, penguin, pig, polar, tiger };
37
+
38
+ export const CUBE_PETS: Readonly<Record<Pet, ModelSpec>> = { beaver, bee, bunny, cat, caterpillar, chick, cow, crab, deer, dog, elephant, fish, fox, giraffe, hog, koala, lion, monkey, panda, parrot, penguin, pig, polar, tiger };
package/src/koala.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-koala.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const koala = cubePetSpec("koala", url, { [PET_TEXTURE_FILE]: colormap });
package/src/lion.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-lion.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const lion = cubePetSpec("lion", url, { [PET_TEXTURE_FILE]: colormap });
package/src/monkey.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-monkey.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const monkey = cubePetSpec("monkey", url, { [PET_TEXTURE_FILE]: colormap });
package/src/panda.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-panda.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const panda = cubePetSpec("panda", url, { [PET_TEXTURE_FILE]: colormap });
package/src/parrot.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-parrot.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const parrot = cubePetSpec("parrot", url, { [PET_TEXTURE_FILE]: colormap });
package/src/penguin.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-penguin.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const penguin = cubePetSpec("penguin", url, { [PET_TEXTURE_FILE]: colormap });
package/src/pig.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-pig.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const pig = cubePetSpec("pig", url, { [PET_TEXTURE_FILE]: colormap });
package/src/polar.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-polar.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const polar = cubePetSpec("polar", url, { [PET_TEXTURE_FILE]: colormap });
package/src/spec.ts ADDED
@@ -0,0 +1,77 @@
1
+ // Kenney's Cube Pets (CC0): 24 animals, one glTF each, all sharing one
2
+ // texture and the same eight clips. This module is the pack as data with no
3
+ // files in it: the names, the labels, the file names, which are birds, and
4
+ // the moods; each animal's module adds its file.
5
+
6
+ import type { ModelSpec, MoodSpec } from "@n1h/web-characters/model";
7
+
8
+ export const PETS = [
9
+ "beaver",
10
+ "bee",
11
+ "bunny",
12
+ "cat",
13
+ "caterpillar",
14
+ "chick",
15
+ "cow",
16
+ "crab",
17
+ "deer",
18
+ "dog",
19
+ "elephant",
20
+ "fish",
21
+ "fox",
22
+ "giraffe",
23
+ "hog",
24
+ "koala",
25
+ "lion",
26
+ "monkey",
27
+ "panda",
28
+ "parrot",
29
+ "penguin",
30
+ "pig",
31
+ "polar",
32
+ "tiger",
33
+ ] as const;
34
+
35
+ export type Pet = (typeof PETS)[number];
36
+
37
+ /** Every model has these, by name, in its animation groups. */
38
+ export type PetAnimation = "static" | "idle" | "walk" | "run" | "eat" | "dance" | "gesture-positive" | "gesture-negative";
39
+
40
+ /**
41
+ * The birds. The shared `eat` animation is a dip of the head to the ground,
42
+ * which reads as pecking: right on these, wrong on everything else, so only
43
+ * the birds ever play it.
44
+ */
45
+ export const BIRDS: ReadonlySet<Pet> = new Set<Pet>(["chick", "parrot", "penguin"]);
46
+ export const isBird = (pet: Pet): boolean => BIRDS.has(pet);
47
+
48
+ export const petLabel = (pet: Pet): string => (pet === "polar" ? "Polar bear" : pet[0]!.toUpperCase() + pet.slice(1));
49
+ export const isPet = (name: unknown): name is Pet => typeof name === "string" && (PETS as readonly string[]).includes(name);
50
+ export const randomPet = (): Pet => PETS[Math.floor(Math.random() * PETS.length)]!;
51
+
52
+ /** A pet's model file, relative to the pack folder (assets). */
53
+ export const petModelFile = (pet: Pet): string => `animal-${pet}.glb`;
54
+ /** The one texture every model references, relative to the pack folder; the models reference it by this path. */
55
+ export const PET_TEXTURE_FILE = "Textures/colormap.png";
56
+ /** Kenney's own 64x64 render of a pet, relative to the pack folder. */
57
+ export const petPreviewFile = (pet: Pet): string => `Previews/animal-${pet}.png`;
58
+
59
+ /** What the pets do on the ground, as the moods' names. `eat` is pecking: the birds get it, nobody else does. */
60
+ export type Mood = "idle" | "walk" | "run" | "eat" | "dance";
61
+
62
+ export const cubePetMoods = (pet: Pet): MoodSpec[] => [
63
+ { name: "idle", clip: "idle", weight: 2, seconds: [2, 6] },
64
+ { name: "walk", clip: "walk", weight: 3, speed: 55, seconds: [3, 8] }, // 55 px/s at scale 1, matched to the walk cycle
65
+ { name: "run", clip: "run", weight: 1, speed: 150, seconds: [1.5, 3.5] },
66
+ { name: "dance", clip: "dance", weight: 1, seconds: [3, 6] },
67
+ ...(isBird(pet) ? [{ name: "eat", clip: "eat", weight: 2, seconds: [2, 6] as [number, number] }] : []),
68
+ ];
69
+
70
+ /** The spec for a pet whose file (and the shared texture) is at these URLs. */
71
+ export const cubePetSpec = (pet: Pet, url: string, textures: Record<string, string>): ModelSpec => ({
72
+ name: petLabel(pet),
73
+ url,
74
+ textures,
75
+ clips: { idle: "idle", carried: "gesture-negative", falling: "gesture-negative", landed: "gesture-positive" },
76
+ moods: cubePetMoods(pet),
77
+ });
package/src/tiger.ts ADDED
@@ -0,0 +1,5 @@
1
+ import colormap from "../assets/Textures/colormap.png";
2
+ import url from "../assets/animal-tiger.glb";
3
+ import { PET_TEXTURE_FILE, cubePetSpec } from "./spec";
4
+
5
+ export const tiger = cubePetSpec("tiger", url, { [PET_TEXTURE_FILE]: colormap });