Wildlife: hamster and hamster wheel prefabs

Ported from the thaiai.lol easter egg (thaiai iso/hamster/lib/hamster.rhai);
the data-centre joke parts stay there.

- hamster (Animals): golden, grey or cream with a white belly, pink nose,
  ears and paws, buck teeth and whiskers; standing, running on the spot or
  asleep (eyes shut, z Z); n and spread like the herds; life size (about
  17 cm) at scale 1, up to 40 times.
- hamster_wheel (Animals): diameter (0.3 m life size, up to 12 m), running,
  A-frame stand or a cage-wall axle stub, fur colour. Running legs and the
  rungs are flipbooks of 4 poses, 0.1 s each; the spokes turn by a CSS
  rotation in a matrix that maps the wheel's plane onto the screen.
- draw_parts learns loft2 (two-tone lofts), eye and flip parts;
  place_parts scales and moves any part list; loft and loft2 share
  loft_rings (the other animals draw byte for byte as before).
- Things under 2 m are drawn ten times bigger in a group that scales them
  back (fine_begin / fine_end), so a life-size hamster keeps its shape on
  the drawing's 0.1-unit grid; sort boxes stay real size.
- The legs push back on the ground and swing forward lifted (the original
  lifted them on the way back).
- Theme: hamster, hamsterg, hamsterc, hamsterw, hamsterp, hwheel, hwhub,
  whisker and hamz in both palettes, materials, rules for eyes, whiskers,
  rims, spokes, hub, rungs and the z Z. Viewer CSS: iso-flip4,
  iso-wheelspin, iso-runbob, iso-zzz; beast edges take --bw (default .3).
- Test hamsters_run_in_wheels_from_every_side: no sort cycles in any
  rotation, flipbook counts, scaled groups, real-size sort boxes, tooltips.
- README, ROADMAP, SCRIPTING and the MCP instructions list them.
This commit is contained in:
grabowski committed 2026-10-27 16:39:43 +07:00
1 parent c8becc2e59
commit 9619d0f267
8 files changed
+609 -29

No files matched your search

+11 -1
View File
@@ -74,7 +74,7 @@
.iso-sprites path, .iso-sprites ellipse, .iso-sprites circle { stroke: var(--iso-edge); stroke-width: var(--iso-edgew); stroke-linejoin: round; }
.iso-ground path, .iso-ground ellipse { stroke: none; }
/* animals: each face edged in its own shade (no seams, no wireframe), so a body reads as one surface */
.iso-sprites .iso-beast { stroke-width: .3; }
.iso-sprites .iso-beast { stroke-width: var(--bw, .3); }
.iso-sprites .iso-beast.iso-t { stroke: var(--b, #888); }
.iso-sprites .iso-beast.iso-l { stroke: color-mix(in srgb, var(--b, #888) var(--iso-kl), var(--iso-shade)); }
.iso-sprites .iso-beast.iso-c { stroke: color-mix(in srgb, var(--b, #888) var(--iso-kc), var(--iso-shade)); }
@@ -139,6 +139,13 @@ html[data-theme=light] .iso-svg .iso-glint { display: inline; }
.iso-svg .iso-flap { transform-box: fill-box; transform-origin: center; animation: iso-flap .8s ease-in-out infinite alternate; }
.iso-svg .iso-flutter { transform-box: fill-box; transform-origin: center; animation: iso-flap .3s ease-in-out infinite alternate; }
.iso-svg .iso-hop { animation: iso-hop 3.4s ease-out infinite; }
/* hamsters: running legs and wheel rungs are flipbooks of 4 poses, 0.1 s each (delays set the turn;
unanimated the first); spokes turn in the wheel's plane; runners bob, sleepers snore */
.iso-svg .iso-flip4 { visibility: hidden; animation: iso-flip4 .4s step-end infinite; }
.iso-svg .iso-flip4.iso-pose0 { visibility: visible; }
.iso-svg .iso-wheelspin { transform-box: fill-box; transform-origin: center; animation: iso-spin 9.6s linear infinite; }
.iso-svg .iso-runbob { animation: iso-runbob .4s ease-in-out infinite; }
.iso-svg .iso-zzz { animation: iso-zzz 3.2s ease-out infinite; }
.iso-svg .iso-park { display: none; }
/* route movers: each piece's copy shows only while a mover is on it (keyframes made per piece);
not .iso-a, so unanimated views pause them where they are instead of hiding them */
@@ -168,6 +175,9 @@ html[data-theme=light] .iso-svg .iso-glint { display: inline; }
@keyframes iso-pose2b { 0% { visibility: hidden; } 65%, 100% { visibility: visible; } }
@keyframes iso-flap { from { transform: scaleX(1); } to { transform: scaleX(.25); } }
@keyframes iso-hop { 0%, 70%, 100% { transform: translate(0, 0); } 78% { transform: translate(0, -4px); } 86% { transform: translate(0, 0); } 91% { transform: translate(0, -2px); } }
@keyframes iso-flip4 { 0% { visibility: visible; } 25%, 100% { visibility: hidden; } }
@keyframes iso-runbob { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(0, var(--hb, -1px)); } }
@keyframes iso-zzz { 0% { transform: translate(0, 0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(var(--zx, 3px), var(--zy, -7px)); opacity: 0; } }
@keyframes iso-ram { 0%, 20%, 100% { transform: translate(0, 0); } 45%, 55% { transform: translate(var(--dx), var(--dy)); } }
@keyframes iso-move { from { transform: translate(0, 0); } to { transform: translate(var(--dx), var(--dy)); } }
@keyframes iso-shuttle {