Repository navigation
Butterfly kit (T1) - #132
Merged
Merged
Conversation
src/cast/butterfly.js now draws the player's butterfly open and side-on, the egg, a caterpillar that grows, the chrysalis, and any species from its spec, with wings and body as data-parts so the garden's flutter flaps them. src/data/butterflies.json holds 22 species: one per course, practice habit and preset, and a pool of five for habits people make, each with checked field-guide lines and their sources. Habit colours for the wing panels. tools/butterflies.html renders it all at 200, 96 and 48 px, light and dark.
The body, head and antennae (and the caterpillar's feelers) paint with var(--butterfly-body), falling back to the ink; styles.css sets it pale for dark. Each drawing takes an optional body colour for places with no CSS; tools/icon.js passes the ink. The chequered swallowtail loses four spots to stay under 3 KB.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
T1 from docs/WINGBEAT.md. No app wiring.
butterfly) and side-on (butterflySide),egg,caterpillar(growth),chrysalis, and any species from its spec (open,side). Wings aredata-part="wings"and the bodydata-part="body", so garden/scene.jsanimateVisitor(el, 'butterfly')flaps them with no new motion code. The two halves now share one pair of clip paths, which keeps the full butterfly under 3 KB. tools/icon.js still runs, and the icon looks the same, so the generated icon files are left alone.speciesFor(id, ownIndex)). Each field-guide line has its source (Australian Museum, Butterfly House, or Kyoto Prefecture for the Great Purple Emperor).HABIT_COLOURS,OWN_COLOURS,habitColour) for the wing panels.Dark butterflies have a pale fringe on the wing edge, so they stay visible on dark backgrounds.