Compare commits

...
54 Commits
Author SHA1 Message Date
waoziandClaude Opus 5.5 e5da57ef3f Aim at the habit edit action from the open table's columns
Opening a habit's details makes the table scroll, and the scroll bar moves
the day columns 10 px left; the tap hit the edit button's edge with Noto
Sans and missed it by a pixel with CI's DejaVu Sans. Measure the columns
after opening and tap its middle.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 19:39:16 -03:00
waoziandClaude Opus 5.5 4e55fd44f1 Fix the storage SQL and habit table tests for 2.1.32
The storage SQL test schema gains habits' span columns and habit_changes;
the habit table test taps the edit action again if a slow runner drops it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 18:01:58 -03:00
waoziandClaude Opus 5.5 bfea2cca93 Give the Settings and Lumi Ziran tests the Plot package path
Statistics now draws Plot's band chart, and these tests compile modules
that reach it; CI failed with "package import plot/band_chart needs a
project".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 17:22:53 -03:00
waoziandClaude Opus 5.5 1bb872d4c6 Check that a restored account queues its habit changes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 17:14:23 -03:00
waoziandClaude Opus 5.5 53c9c090a8 Record the 2.1.32 phone check with the habit fixes: 57.7 fps
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 17:05:37 -03:00
waoziandClaude Opus 5.5 73373344b8 Show a habit entry's answers as question and value
An entry's card shows each question, muted, with its answer in bold
under it, and no longer repeats a span's start question. Entries of
habits that do not measure spans show no time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 17:02:24 -03:00
waoziandClaude Opus 5.5 27287d967d Note 2.1.32's habit fixes within the Play notes limit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 16:59:00 -03:00
waoziandClaude Opus 5.5 3b13f3d407 Fix habit spans and entries; judge habits against your average
- A tap on a running span's half-filled day opens it instead of ending
  it. Its end is picked there, set with Now, or cleared with the time
  picker's Clear so the span keeps running.
- Entries saved before entries existed open, edit and save again; their
  longer ids no longer fail to load.
- A habit linked to no practice no longer shows every practice's
  sessions.
- A span habit's time questions are its start and end, so the start is
  not asked twice; other habits' entries ask no time.
- Spans are good by their length, whenever they start: shorter or longer
  than your average, at least, at most or between hours and minutes.
- Number and time questions can be judged against your average; new ones
  start that way. Skip marks a day done without answers.
- Every change of a habit's settings is kept and synced, and each entry
  is judged by the goal it had then. Statistics charts shade the good
  range as it was each day, show a value's day and goal on hover or tap,
  and list the habit's changes.
- Lumi can set a span's good length and average goals.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 16:57:56 -03:00
waoziandClaude Opus 5.5 9f42816441 Paint the Tai Chi course with Tibetan cut-out characters
The studio now opens on the full form with a painted 2D Tibetan monk, in
the hand-painted cut-out style of Sun Salutation, and offers a second
painted character, a Tibetan woman. Both play every lesson and the full
form over the same solved body as the 3D figures.

Each character is a generated turnaround plus three part sheets (heads and
torsos in five views, limbs and hands, shoes), cut into transparent parts
by tools/cut-parts.py. src/painted/figure.js projects the solved joints
flat along the view, bends the painted arms and legs along their bones,
follows the spine with the torso, and switches head, torso, hand and shoe
drawings as each part turns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 16:00:33 -03:00
waoziandClaude Opus 5.5 6fd1dbbb27 Record the 2.1.32 phone check of the shorter app update question
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 15:57:12 -03:00
waoziandClaude Opus 5.5 466b5614d3 Answer the Apps update question in the web music test
The music check moves between screens through Apps, which now asks once
about app updates and would take the test's next click. Its setup declines
updates like the screenshot runs do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 15:54:26 -03:00
waoziandClaude Opus 5.5 54c3fce061 Say briefly that only the apps inside update themselves
Owner feedback: the Apps question had too much text. It now asks whether
Lumi, Diary and the other apps inside Inner Breeze may update themselves
from waozi.xyz, notes the store does not check them, and that Inner Breeze
itself still updates through the store. About lists only the apps inside
Inner Breeze; its restart notice for a downloaded root stays above them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 15:44:11 -03:00
waoziandClaude Opus 5.5 4615f6d558 Record the 2.1.32 phone check: 57.7 fps on the Moto
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 15:39:34 -03:00
waoziandClaude Opus 5.5 42965e39cd Note 2.1.32's habit, app update and counter changes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 15:34:41 -03:00
waoziandClaude Opus 5.5 88a81baf27 Draw circle counts and times in the accent's ink
The Ziran port dropped the circle-ink class, so the breathing count, the
meditation time and the practice window's label used the theme's text
color: white on the light accent circle in dark themes. Use circle-ink
again, now the accent's computed ink like the circle's ring and ticks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 15:34:37 -03:00
waoziandClaude Opus 5.5 f45362ef1b Pin Kryon with the time picker and strong titles
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 15:30:23 -03:00
waoziandClaude Opus 5.5 d9b20cc05c Pick habit times with a time picker
Times in the Habits screens are picked with a time picker instead of
typed as hours and minutes. The entry dialog's time, a span's start and
end, answers to time questions, and the times of a time question's good
range in the editor each open an hour and a minute column, with Now and
Done. A span's end stays empty while it runs, and an end before its
start is still on the next day. Number goals are typed as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 15:27:21 -03:00
waoziandClaude Opus 5.5 d468bbd351 Give the Habits pages clearer cards and titles
The Habits pages take the approved redesign. Titles are strong, labels
beside their figures are muted, and related things sit together on
rounded cards.

- Habits: an open habit's history, statistics and editor buttons and its
  streak and week sit together on a tinted panel, the figures on cards
  with the habit's colour along their edge.
- A day's screen: each entry is a card with its time, its buttons, and
  each answer on its own line; a running span's End now is on its card.
  Each practice's sessions and rounds share a card of their own.
- The entry dialog starts its strong title at the left with the day
  below it, and a number answer takes the dialog's width.
- The count dialog's title and count are strong, and Done is the
  dialog's main button.
- The editor's title is strong, each question has its own card, the
  week's days spread across the row, and Delete Habit is a quieter red
  beside Save, above a line that parts them from the form.
- Statistics: the habit's name and "Statistics" stay clear of the page
  as it scrolls; figures, charts and a written question's latest answers
  sit on rounded cards, and each question's title is strong.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 15:24:11 -03:00
waoziandClaude Opus 5.5 02a3ed19eb Ask in Apps before app packages update themselves; ship an F-Droid APK
Packages come from waozi.xyz, not the app store, so automatic updates now
wait for an answer. Apps asks once with two equal buttons and says the store
does not check these updates; Settings > About changes the answer. The new
key replaces cells_auto_update, which was saved as on without asking.

F-Droid rebuilds Inbe and compares it with our signed APK. Release builds
now also sign the universal APK built with -PfDroidBuild (self-update off)
and publish it as inbe-VERSION-fdroid.apk for F-Droid's Binaries field.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 15:20:29 -03:00
waoziandClaude Opus 5.5 ae88371737 Measure spans without a good length
A habit that measures spans from start to end now only measures them: the
editor no longer has a "Good length" row under "Measure start to end",
and a span is not judged good or bad. Its statistics show the spans'
average and longest length, a bar per span and when they started and
ended, without an on-target count or a goal line. Questions keep their
good answers.

Lumi's set_habit_tracking sets check, count with a target, or span, and
her context no longer lists a span goal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 14:47:20 -03:00
waoziandClaude Opus 5.5 9d985b69d1 Keep habit days as entries: spans, good ranges and Lumi setup
A habit's days now hold entries, several a day. An entry has its time,
or a span's start and end, and its answers. Tapping a day that is done
opens the day's screen, the same screen as a practice's sessions, which
lists its entries to change or delete, ends a running span, and adds
another entry. A habit with questions asks them in the entry dialog;
counting habits open the day's entries from their count dialog.

A habit can measure spans instead of counting, such as a fasting window:
a tap starts the span and the day shows half filled, the next tap ends
it. Number and time questions, yes or no questions and spans can say
what is good: at least, at most or between two values, after, before or
between two times, a yes or a no, or a good length. The habit's
statistics colour each value by its goal, count how many were on target,
draw the goal on the chart, and show spans' average and longest length
and when they started and ended.

Entries sync to the other devices as their own encrypted records, with
deletions; older versions of the app keep a habit's questions and span.
Answers from the build before entries become entries of their days.

Lumi sets a habit's tracking with set_habit_tracking (check, count to a
target, or spans with good lengths) and its questions and good answers
with set_habit_questions; a question that keeps its words keeps its
answers. Her context lists both for each habit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 14:38:38 -03:00
waoziandClaude Opus 5.5 2f7802661a Let a habit day's entry open over the day's screen too
The dialog that asks a habit's questions becomes the dialog of one entry
of a day. Besides the habits screen, it opens over the day's screen of
entries and sessions, where an entry is added or changed; its law now
states both screens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 14:38:16 -03:00
waoziandClaude Opus 5.5 bd08f39532 Upload Lists' lists and items as kept, not deleted
When a list or item was uploaded, the check for whether it had been
deleted ran an empty query and so always answered yes. Every list and
item reached the sync node marked deleted, and other devices dropped
them. The check now reads the record's deleted mark, so lists and items
arrive on other devices again; only deleted ones upload as deletions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 14:38:11 -03:00
waoziandClaude Opus 5.5 ab99d83b7a Keep habit checks and Off/On toggles inside their space
A completed day's check is now one smooth stroke centred on its dot and
sized to it, so it stays inside the dot at any display scale instead of
a jagged mark that reached its edge. The Off/On toggles of Counter mode
and the practice settings take the room their labels need and stay
inside their cards. Opening a habit's card in the habit list scrolls the
list so the whole card shows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 14:12:37 -03:00
waoziandClaude Opus 5.5 ad02c7d1cf Let habits ask questions when a day is done, with their statistics
A habit's editor now has "Ask when done": add questions, each with its
words and how it is answered, as text, a whole number, a time or yes or
no. A habit without questions works as before. With them, tapping an
open day shows the questions, and Done records the answers and marks the
day. Tapping a day that is done shows its answers to change, like a
practice's session data, with Not done to open the day again. Counting
habits show their questions under the count steps.

Each answer keeps its question's words, so earlier days read the same
after a question is reworded or removed. Questions travel with the habit
and answers with the day to every device, only inside the encrypted
records; older versions of the app keep them.

The habit's statistics add up each question over the last 30 days: the
average and earliest to latest of times, with a dot per day, bedtimes
around midnight averaging correctly; the average and total of numbers
with a bar per day; how often the answer was yes; and the latest written
answers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 13:56:21 -03:00
waoziandClaude Opus 5.5 af64e57a1d Give a habit's day questions their own dialog on the Habits screen
A habit's questions for a day, and the answers of a day that is done,
open in a dialog of their own. Like the count dialog, it belongs to the
Habits screen in either tab and closes when the app leaves it; a new law
states this, and the remaining dialogs may still appear anywhere.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 13:56:21 -03:00
waoziandClaude Opus 5.5 3efed6e1f4 Merge a waiting sync review instead of asking
When the server sends a full snapshot that would have stopped for a
review, the app now merges it as soon as the screen is idle: each record
keeps the side that changed it last, and local records stay. Only a
snapshot that cannot be read and applied whole still opens the review.
A desktop with Patterns sessions hit this on every full snapshot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 13:23:29 -03:00
waoziandClaude Opus 5.5 02c8c3793b Serve the Tai Chi studio on a port that is free here
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 02:11:13 -03:00
waoziandClaude Opus 5.5 baab6abf7a Ship Habits' off-day taps with the next release
Habits 1.0.5 could not be published on its own: other apps' packages
changed without new versions, and the node publishes them together.
Older apps never let a day off the schedule be tapped, so the change
only matters with the new app and goes out with it, versioned then.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 02:10:21 -03:00
waoziandClaude Opus 5.5 c79a92725e Animate a full Tai Chi course in a Three.js review studio
The Yang 24-form, taught in eight lessons after a Foundations module,
is written as choreography data rather than video: a 3D rig, a pose
solver with knee-over-toe leg IK, balance over the feet and planted
feet that never slide, and every movement as a demo, a slow breakdown
with cues, and a follow-along on both sides. Sage Bun and Sage Male
are the 3D figures.

design/tai-chi holds the studio, motion checks, headless review
renders and the export to docs/tai-chi-24.json. Inbe's code is not
changed; app playback is a later decision.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 02:08:17 -03:00
waoziandClaude Opus 5.5 7c490d8fdf Let habits repeat on a schedule that keeps their history
A habit's schedule now reads as one sentence in its editor: "Every week",
"Every 2 days", "Every month", "Every year", a formula, or no set days,
with - and + for how often. Weekly habits show the seven days as circles
lit in the habit's color; tap a day to turn it on or off. Monthly habits
pick days of the month, the last day, or a weekday such as the last
Friday; yearly habits pick a month and day. A formula plans days with
numbers such as days, weekday and nth, for example "days % 3 = 0".
"Remind me at" sends the habit's notification on its planned days, or is
Off.

A changed schedule plans the days from today on. Earlier days keep the
schedule they had and nothing recorded is removed. In the habit table
only planned days have a circle; a day off the schedule still opens, and
what was recorded on it shows faded. Schedules travel with the habit to
other devices; older versions of the app keep them and see a weekday
mask that matches where one can.

Lumi sets any of these schedules and the notification with the new
set_habit_schedule tool and reads each habit's schedule in her context.
The editor's sections are always open under plain headings, and the
icons show one row with ... for the rest. New and default habits start
without a notification instead of one at midnight. Habits 1.0.5 lets
days off the schedule be opened and counted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 01:55:41 -03:00
waoziandClaude Opus 5.5 556bdd3552 Give completed habit days the same raised look as open ones
The filled day circle was flat next to the open circle's rim, inset and
highlight. It now has a darker rim, a shaded lower edge and a highlight,
and a bold check stroked like Kryon's Checkbox, placed on whole pixels
so every day's check looks the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 01:17:23 -03:00
waoziandClaude Opus 5.5 c7ed67e2dc Open no tray icon during screenshot runs
A screenshot run on a private display still reached the session bus
through XDG_RUNTIME_DIR and added an Inner Breeze icon to the user's
panel, which came back with every test run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 01:08:51 -03:00
waoziandClaude Opus 5.5 f4fac28598 Select the daily target's number when it is tapped
Kryon 532c4d6c selects a numeric field's whole number when a tap focuses
it, so typing a new habit daily target replaces the old one instead of
adding digits to it; the lock moves to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 21:05:48 -03:00
waoziandClaude Opus 5.5 125484d157 Let habits have a daily target above 99
The daily target in the habit editor is now a number field between the
- and + buttons: it takes digits only, opens the number keyboard on
Android, and allows targets up to 9999 instead of stopping at 99.
Requested in Lumi feedback from Inner Breeze 2.1.31.

Kryon d7454f8f adds the numeric text field mode, so the Android activity
takes the numeric flag in setTextInputState; the lock moves to it (it
also brings fbc07f54, held-key repeat).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 19:11:08 -03:00
waoziandClaude Opus 5.5 e2b0b260d4 Record the 2.1.32 phone check: 57.7 fps on the Moto
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 18:53:43 -03:00
waoziandClaude Opus 5.5 08eb898ee3 Release Inner Breeze 2.1.32
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 18:49:19 -03:00
waoziandClaude Opus 5.5 aa36952508 Keep the habit table's hover highlight inside the table
A habit row, an inactive habit's row and the inactive habits' header
reacted across the table's full width, so their rounded hover and press
highlight covered the table's border and met the lines between rows at
odd corners. They now react a little inside the row, and the highlight
stays clear of both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 15:52:52 -03:00
waoziandClaude Opus 5.5 028b2db469 Give the fake key input in text tests the key repeat check
Text fields now ask raylib whether a held key repeated, so the tests that
stand in for raylib's keyboard answer that too. The text input test now
also checks that a held Backspace repeats and a held paste does not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 15:03:44 -03:00
waoziandClaude Opus 5.5 3c43b92209 Show inactive habits as a section at the end of the habit table
Inactive habits are no longer a dropdown pinned to the bottom of the
screen: their header row ends the habit table and scrolls with it, and a
tap shows or hides their rows below it. A habit dragged onto the section
becomes inactive; an inactive one dragged up into the habits becomes
active again in that place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 15:00:49 -03:00
waoziandClaude Opus 5.5 0a92b02cdf Fit the habit table to narrow screens and choose icons with GLM
On a narrow screen the habit table no longer runs past its edge: rows
show a smaller icon without the name, and when even that does not fit,
fewer past days. A habit without an icon of its own and no practice to
suggest one gets one chosen by the Waozi node's GLM service from the
habit icons, or keeps its first letter when none fits; an icon chosen in
the editor, including the letter, is never replaced.

Holding Backspace, Delete or an arrow key in a text field now repeats
like in any text editor instead of acting once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 14:55:59 -03:00
waoziandClaude Opus 5.5 ef652f8179 Show habits as a table with an icon for each habit
Habits is now one table: the day names across the top, today first, and
a row for each habit with its icon, its name and a circle for each of
the last seven days. Long names end in an ellipsis. Tapping a habit
opens its history, statistics, editor, streak and this week's count
below its row; rows drag to another place or into Inactive habits.

Each habit can choose one of 36 MingCute icons in its editor; without
one it shows its linked practice's icon or the first letter of its
name. The icon is a new habits.icon column (0 after the upgrade) and
travels in the habit's sync record. The Complete today button is gone,
since the Today column does the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 13:57:18 -03:00
waoziandClaude Opus 5.5 09702e144d Make habits inactive by dragging them into an Inactive habits dropdown
The Inactive habits dropdown is always below the habit list. A card
dragged onto it becomes inactive; a habit dragged out of it into the
list becomes active again. It replaces the Deactivate button.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 13:17:26 -03:00
waoziandClaude Opus 5.5 f6e340b2b7 Skip package publishing until a changed package has a new version
The node rightly refuses changed bytes under the version it serves, so
every source change without a version bump turned App packages red. The
publisher now compares with the served releases first: changes without
a new version wait for the next one with a notice, unchanged packages
upload nothing, and only a new version mixed with an unversioned change
still fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 13:09:27 -03:00
waoziandClaude Opus 5.5 b6a7743aca Put Deactivate on the open habit card and scroll while dragging at the edge
Deactivate was hidden in the habit editor; it is now the open card's
fourth action beside history, statistics and editing. A dragged card
held near the list's top or bottom, or past it, scrolls the list, faster
the further it goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 13:09:27 -03:00
waoziandClaude Opus 5.5 1d1eb49946 Let habit cards be dragged into another place
With a mouse a card follows a press that moves; on a touch screen a
card is lifted after a short hold, so a swipe still scrolls the list.
A card dropped on another takes that card's place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 12:40:02 -03:00
waoziandClaude Opus 5.5 7a81e00d5e Show the donation reminder only after a practice finished on this device
Sessions synced from another device raised the count past the next
reminder and opened it again on the desktop, after it had already been
shown and dismissed on the phone where the practice was finished.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 12:40:02 -03:00
waoziandClaude Opus 5.5 e83dae0e70 Show that a practice finished in the floating window
A practice that ended while Android showed it in the floating window
kept its last picture there, such as a meditation stuck at 0:00, and
opening the window back into the app returned to the dead practice page
instead of its results. The window now says Finished above the
practice's name and its main results: rounds and best hold for Wim Hof,
the duration for meditation, the duration and cycles for patterns and
the repetitions for Sun Salutation. A meditation waiting at its end to
be extended shows the same. The results change made outside the app's
frame is now reported to the router, so the app opens on the results.

Checked on an Android 12 Pixel 3a emulator: a one-minute meditation and
a five-minute pattern finished in the floating window, showed Finished
with their results, and opened back on the results screen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 22:35:02 -03:00
waoziandClaude Opus 5.5 c473e276cd Open the floating window when switching apps from Recents
During a practice, Home opened the floating window but switching to
another app through Recents or the quick switch along the gesture bar
did not. Android 12 keeps the app resumed behind Recents and moves Home
forward before opening the chosen app, so Android refused the floating
window when the app paused, even from onUserLeaveHint ("refused" is now
logged with its cause). The app now enters while still resumed, when
Recents announces itself by closing system dialogs with the reason
"recentapps". The notification shade sends no such reason and still
leaves the app in place.

Checked on an Android 12 Pixel 3a emulator: Home, Recents then another
app, gesture Recents then another app and the quick switch all open the
floating window; the notification shade does not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 22:28:49 -03:00
waoziandClaude Opus 5.5 a18e6bf419 Let habits be deactivated and dragged back into the list
A habit's editor now has Deactivate beside Delete. A deactivated habit
keeps its days but leaves the habit list, today's count, reminders, the
desktop tray and Lumi. A button at the bottom of Habits shows the
deactivated habits; dragging one into the list makes it active again in
the place it is dropped.

The flag is a new habits.deactivated column (the upgrade adds it as 0)
and travels in the habit's sync record. The server does not store it
yet, so each device keeps its own choice, as with schedules and
reminders.

Requested in Inner Breeze feedback from the owner's account (2.1.29,
Pixel 3a).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 22:25:47 -03:00
waoziandClaude Opus 5.5 7d65025806 Record the 2.1.31 phone check: 57.7 fps on the Moto
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 20:12:08 -03:00
waoziandClaude Opus 5.5 1eb5fd3de2 Release Inner Breeze 2.1.31
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 20:09:13 -03:00
waoziandClaude Opus 5.5 ccbad38a60 Fail the phone check when the app comes back shifted
The check measured the layout shift after leaving and resuming a practice
but only warned, so 2.1.28 to 2.1.30 passed with the app shifted after the
floating window. A shift above 2 now fails the check and the release gate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 20:04:47 -03:00
waoziandClaude Opus 5.5 4097ce5d79 Keep the app inside the screen after the floating window
Android's floating window gives Inbe's window a shadow that makes its
drawing surface 18 pixels larger on every side, and keeps it after the
window opens back to full screen. The app then sat under the camera and
status bar, ran into the navigation and lost its sides. The activity now
reports its window size and Kryon draws and takes touches inside the
window's part of the surface; the floating window itself still fills its
whole surface, without a border.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 20:04:47 -03:00
268 changed files with 26822 additions and 1499 deletions

No files matched your search

+1 -1
View File
@@ -134,7 +134,7 @@ jobs:
build/startup-quit-test/
build/lumi-ui-test/
build/lumi-history-ui-test/
build/habits-cards-ui-test/
build/habits-table-ui-test/
build/lists-ui-test/
build/sync-review-ui-test/
build/data-back-ui-test/
+13 -4
View File
@@ -122,7 +122,7 @@ jobs:
build/startup-quit-test/
build/lumi-ui-test/
build/lumi-history-ui-test/
build/habits-cards-ui-test/
build/habits-table-ui-test/
build/lists-ui-test/
build/sync-review-ui-test/
build/data-back-ui-test/
@@ -808,6 +808,14 @@ jobs:
--stacktrace
make android-copy-release-apks
make android-copy-bundle
# F-Droid rebuilds the universal APK with -PfDroidBuild and copies
# this APK's signature onto it, so the two must match byte for byte.
./droid/gradlew -p droid assembleRelease -PfDroidBuild=true \
-Pkeystore.path="$HOME/.android/inbe-release.keystore" \
-Pkeystore.alias="$KEY_ALIAS" \
-Pkeystore.password="$KEYSTORE_PASSWORD" \
--stacktrace
make android-copy-fdroid-apk
- name: Preserve Android Native Crash Symbols
uses: actions/upload-artifact@v4
@@ -826,7 +834,8 @@ jobs:
echo "Could not read APP_VERSION_STRING"
exit 1
fi
for apk in "build/android/inbe-$VERSION.apk" "build/android/inbe-$VERSION-gplay.apk"; do
for apk in "build/android/inbe-$VERSION.apk" "build/android/inbe-$VERSION-gplay.apk" \
"build/android/inbe-$VERSION-fdroid.apk"; do
if [ ! -f "$apk" ]; then
echo "Missing universal APK: $apk"
exit 1
@@ -983,12 +992,12 @@ jobs:
channels+=("--channel" "rpm-$arch=$rpm")
done
# Directly installed APKs update themselves from these channels;
# the Google Play build updates through the store.
# the Google Play and F-Droid builds update through their stores.
while IFS= read -r apk; do
abi="$(basename "$apk" .apk)"
abi="${abi#inbe-$VERSION}"
case "$abi" in
-gplay) continue ;;
-gplay|-fdroid) continue ;;
"") channels+=("--channel" "android=$apk") ;;
*) channels+=("--channel" "android$abi=$apk") ;;
esac
+18
View File
@@ -1,4 +1,22 @@
# Changelog
## [2.1.32] - 2026-10-13
### Added
- Drag habits to reorder or deactivate them.
- Habits get icons, schedules, times and daily questions.
- Questions can compare with your average.
- Apps asks before downloading app updates.
### Changed
- Habits is a table of the last seven days.
### Fixed
- Android: the floating practice window opens from Recents and shows results.
- The donation reminder shows on one device only.
- Held keys repeat in text fields.
- The breathing count is readable; older habit entries edit again.
## [2.1.31] - 2026-10-11
### Fixed
- Android: after the floating practice window, the app fits the screen again instead of running under the status bar and navigation and losing its sides.
## [2.1.30] - 2026-10-11
### Fixed
- Long menus, such as the colour theme, scroll by touch and open at your choice.
+34 -6
View File
@@ -675,7 +675,7 @@ MEDITATION_AUDIO_TRACKS := \
include mk/package-freebsd.mk
.PHONY: web-canvas web-canvas-smoke-test web-compare-test web-side-by-side-test all native kryon-host install install-user uninstall stage package-freebsd deb package-deb deb-check rpm package-rpm rpm-check snap package-snap snap-cache-clean flatpak package-flatpak podman-check validate-desktop run tui run-tui run-termi run-termi-direct run-fresh screenshot test ci dist appimage click click-verify vendor-prebuilds vendor-prebuilds-native vendor-prebuilds-web vendor-prebuilds-windows font-subsets font-bundle-check clean clean-linux clean-native clean-vendor-builds windows-setup windows-setup-check android-avd android-audio-e2e android-check-keystore android-copy-assets android-copy-debug-apks android-copy-release-apks android-copy-bundle android-smoke android-local-properties android-debug android-release android-bundle android-install android-install-release android-clean android-rebuild validate-meditation-audio package-unpackaged-assets windows-runtime-assets-check windows windows64 web web-tools-check web-smoke-test web-smoke-test-firefox web-smoke-test-librewolf site site-release-assets-check chrome-web-store chrome-web-store-test firefox-addons firefox-addons-lint firefox-addons-source-zip verify-firefox-addons sync-web-icons social-install social-login social-draft social-x-draft social-post social-x-post social-x-post-dry-run social-post-dry-run
.PHONY: web-canvas web-canvas-smoke-test web-compare-test web-side-by-side-test all native kryon-host install install-user uninstall stage package-freebsd deb package-deb deb-check rpm package-rpm rpm-check snap package-snap snap-cache-clean flatpak package-flatpak podman-check validate-desktop run tui run-tui run-termi run-termi-direct run-fresh screenshot test ci dist appimage click click-verify vendor-prebuilds vendor-prebuilds-native vendor-prebuilds-web vendor-prebuilds-windows font-subsets font-bundle-check clean clean-linux clean-native clean-vendor-builds windows-setup windows-setup-check android-avd android-audio-e2e android-check-keystore android-copy-assets android-copy-debug-apks android-copy-release-apks android-copy-fdroid-apk android-copy-bundle android-smoke android-local-properties android-debug android-release android-bundle android-install android-install-release android-clean android-rebuild validate-meditation-audio package-unpackaged-assets windows-runtime-assets-check windows windows64 web web-tools-check web-smoke-test web-smoke-test-firefox web-smoke-test-librewolf site site-release-assets-check chrome-web-store chrome-web-store-test firefox-addons firefox-addons-lint firefox-addons-source-zip verify-firefox-addons sync-web-icons social-install social-login social-draft social-x-draft social-post social-x-post social-x-post-dry-run social-post-dry-run
.PHONY: zi-check
.PHONY: clean-text-api-check package-check secret-check secret-check-history hooks-install test-tui-screenshot test-termi-screenshot test-termi-screenshot-direct
.NOTPARALLEL: all native test visual-test ci zi-check dist windows windows64 android-release android-bundle click deb package-deb rpm package-rpm snap package-snap flatpak package-flatpak
@@ -731,6 +731,12 @@ break-rules-test: $(ZI2C_BIN)
sun-salutation-test: $(ZI2C_BIN)
@sh tests/sun_salutation_zi_test.sh $(ZIRAN_BUILD_DIR)/bin
.PHONY: habits-table-layout-test
habits-table-layout-test: $(ZI2C_BIN)
@sh tests/habits_table_layout_test.sh $(ZIRAN_BUILD_DIR)/bin
test: habits-table-layout-test
.PHONY: sun-salutation-assets-test
sun-salutation-assets-test:
python3 tests/sun_salutation_assets_test.py
@@ -941,7 +947,7 @@ native-text-pixels-test: $(TARGET)
sh $(KRYON_DIR)/tests/raylib_text_pixels_test.sh
# Run every visual suite and retain a receipt even when an earlier suite fails.
VISUAL_TEST_TARGETS := practice-images-ui-test leaderboard-ui-test native-screenshot-test native-text-pixels-test native-zoom-test native-visual-test launcher-ui-test settings-sidebar-ui-test startup-quit-ui-test locale-render-ui-test lumi-ui-test lumi-history-ui-test habits-cards-ui-test lists-ui-test sync-review-ui-test data-back-ui-test
VISUAL_TEST_TARGETS := practice-images-ui-test leaderboard-ui-test native-screenshot-test native-text-pixels-test native-zoom-test native-visual-test launcher-ui-test settings-sidebar-ui-test startup-quit-ui-test locale-render-ui-test lumi-ui-test lumi-history-ui-test habits-table-ui-test habit-schedule-tool-test habit-tracking-tool-test lists-ui-test sync-review-ui-test data-back-ui-test
visual-test: $(TARGET) $(INBE_FULL_BUNDLE)
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u GDK_DISPLAY \
-u DBUS_SESSION_BUS_ADDRESS -u SESSION_MANAGER YUE_DESKTOP_RECOVERY=0 \
@@ -990,6 +996,7 @@ $(KRY_GEN_STAMP): Makefile ziran.lock $(ZI2C_BIN) $(ZI_SRCS) $(KRYON_ZI_MODULES)
--module-path $(KRYON_DIR)/src/backend \
--module-path $(GAME2D_DIR)/src \
--module-path qrcode=build/packages/qrcode/src \
--module-path plot=build/packages/plot/src \
--module-path $(ZIRAN_DIR)/std \
--module-path build/packages/daochi-client \
-o $(KRY_GEN_DIR) $(ZI_SRCS)
@@ -1005,6 +1012,7 @@ $(WEB_GEN_STAMP): Makefile ziran.lock $(ZI2C_BIN) $(ZI_SRCS) $(KRYON_ZI_MODULES)
--module-path $(KRYON_DIR)/src/backend \
--module-path $(GAME2D_DIR)/src \
--module-path qrcode=build/packages/qrcode/src \
--module-path plot=build/packages/plot/src \
--module-path $(ZIRAN_DIR)/std \
--module-path build/packages/daochi-client \
-o $(WEB_GEN_DIR) $(ZI_SRCS) $(KRYON_DIR)/src/backend/canvas_raster.zi $(KRYON_DIR)/src/backend/canvas_audio.zi $(KRYON_DIR)/src/backend/page_route.zi
@@ -1025,6 +1033,7 @@ $(WINDOWS_GEN_STAMP): Makefile ziran.lock $(ZI2C_BIN) $(ZI_SRCS) $(KRYON_ZI_MODU
--module-path $(KRYON_DIR)/src/backend \
--module-path $(GAME2D_DIR)/src \
--module-path qrcode=build/packages/qrcode/src \
--module-path plot=build/packages/plot/src \
--module-path $(ZIRAN_DIR)/std \
--module-path build/packages/daochi-client \
-o $(WINDOWS_GEN_DIR) $(ZI_SRCS)
@@ -1053,6 +1062,7 @@ zi-c-plan9: $(KRY_GEN_STAMP)
--module-path $(KRYON_DIR)/src/backend \
--module-path $(GAME2D_DIR)/src \
--module-path qrcode=build/packages/qrcode/src \
--module-path plot=build/packages/plot/src \
--module-path $(ZIRAN_DIR)/std \
--include-dir build/packages/kryon/include --include-dir src \
--include-dir $(KRY_GEN_DIR) --include-dir vendor-builds/sqlite \
@@ -1288,9 +1298,9 @@ embedded-image-assets-check: $(EMBEDDED_ASSETS_C)
icon-sheets-check: $(PACKAGES_MK)
python3 tests/icon_sheets_test.py $(KRYON_DIR)/src/ui/icon.zi
.PHONY: habits-cards-ui-test
habits-cards-ui-test: $(TARGET)
bash tests/habits_cards_ui_test.sh "$(abspath $(TARGET))"
.PHONY: habits-table-ui-test
habits-table-ui-test: $(TARGET)
bash tests/habits_table_ui_test.sh "$(abspath $(TARGET))"
.PHONY: lists-ui-test
lists-ui-test: $(TARGET)
@@ -1839,6 +1849,14 @@ test: style-apply-zi-test
appearance-ui-test: $(TARGET) $(INBE_FULL_BUNDLE)
sh tests/appearance_ui_test.sh $(abspath $(TARGET))
.PHONY: habit-schedule-tool-test
habit-schedule-tool-test: $(TARGET) $(INBE_FULL_BUNDLE)
sh tests/habit_schedule_tool_test.sh $(abspath $(TARGET))
.PHONY: habit-tracking-tool-test
habit-tracking-tool-test: $(TARGET) $(INBE_FULL_BUNDLE)
sh tests/habit_tracking_tool_test.sh $(abspath $(TARGET))
.PHONY: audio-settings-test
audio-settings-test: $(ZI2C_BIN)
@env -u DISPLAY -u WAYLAND_DISPLAY \
@@ -2628,6 +2646,16 @@ android-copy-release-apks: | $(ANDROID_BUILD_DIR)
fi; \
cp "$$gplay_universal" "$(ANDROID_BUILD_DIR)/$(APP_NAME)-$(APP_VERSION)-gplay.apk"
# F-Droid rebuilds this universal APK with -PfDroidBuild and copies its
# signature, so run after a signed assembleRelease -PfDroidBuild=true.
android-copy-fdroid-apk: | $(ANDROID_BUILD_DIR)
@fdroid_universal="$$(find droid/app/build/outputs/apk -path '*/release/*' -name "app-universal-release*.apk" | head -n 1)"; \
if [ -z "$$fdroid_universal" ] || [ ! -f "$$fdroid_universal" ]; then \
echo "No universal F-Droid APK was produced"; \
exit 1; \
fi; \
cp "$$fdroid_universal" "$(ANDROID_BUILD_DIR)/$(APP_NAME)-$(APP_VERSION)-fdroid.apk"
android-copy-bundle: | $(ANDROID_BUILD_DIR)
bash scripts/check-android-optimization.sh droid/app/build/outputs/bundle/gplay/app-gplay.aab
@found=0; \
@@ -2941,7 +2969,7 @@ test: sync-recovery-test
# Validate before producing release packages, including direct artifact targets.
$(APPIMAGE_TARGET) $(DEB_TARGET) $(RPM_TARGET) $(SNAP_TARGET) $(FLATPAK_TARGET) $(CLICK_TARGET) $(CHROME_WEB_STORE_ZIP) $(FIREFOX_ADDONS_ZIP): | version-check
android-release android-bundle android-copy-release-apks android-copy-bundle windows-setup site: version-check
android-release android-bundle android-copy-release-apks android-copy-fdroid-apk android-copy-bundle windows-setup site: version-check
# Actual artifacts are gated too, including direct and incremental builds.
$(TARGET) $(KRYON_HOST_TARGET) $(WIN64_TARGET) $(WEB_JS_TARGET) $(WEB_CANVAS_TARGET): $(SYNC_RETRY_SOURCE) | build-laws
+10 -2
View File
@@ -31,14 +31,22 @@ HabitsApply :: (message: HabitsMessage) -> HabitsMessage {
return message
}
if message.action == HABITS_DAY_ACTION {
if message.modal_active || message.index < 0 || message.index >= message.count ||
(!message.scheduled && !message.completed) {
// Days off the habit's schedule open and count like planned days.
if message.modal_active || message.index < 0 || message.index >= message.count {
return message
}
if message.counter_enabled != 0 {
message.day_action = ifx message.decrement then HABITS_DAY_DECREMENT else HABITS_DAY_COUNT
} else if message.linked_count > 0 {
message.day_action = HABITS_DAY_LINKED
} else if message.span {
// A tap starts the habit's span, the next ends it; a day with
// spans opens their data.
message.day_action = HABITS_DAY_SPAN
} else if message.question_count > 0 {
// The day opens its questions, or the data of a done day,
// instead of being marked or cleared.
message.day_action = HABITS_DAY_QUESTIONS
} else {
message.day_action = HABITS_DAY_TOGGLE
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+203
View File
@@ -218,6 +218,209 @@
"additionalProperties": false
}
},
{
"name": "set_habit_schedule",
"description": "Set which days a habit is planned, from today on, using its exact ID, and whether it sends a notification on those days. Earlier days keep the schedule they had, and nothing recorded is removed. repeat daily, weekly, monthly or yearly repeats every N (every) days, weeks, months or years from start. weekly plans weekdays. monthly plans month_days (31 also means a shorter month's last day) and last_day_of_month, or with week_of_month the weekdays in that week, such as the last fri. yearly repeats on start's month and day. formula plans each day where formula is not 0; its numbers are days, weeks, months and years since start, weekday (mon 1 to sun 7), day, month, year, yearday, daysleft (in the month) and nth (which such weekday of the month), with + - * / %, = != < > <= >=, and, or, not and parentheses, for example days % 3 = 0. none plans no days.",
"inputSchema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"repeat": {
"type": "string",
"enum": [
"daily",
"weekly",
"monthly",
"yearly",
"formula",
"none"
]
},
"every": {
"type": "integer",
"minimum": 1,
"maximum": 999
},
"weekdays": {
"type": "array",
"items": {
"type": "string",
"enum": [
"mon",
"tue",
"wed",
"thu",
"fri",
"sat",
"sun"
]
}
},
"month_days": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 31
}
},
"last_day_of_month": {
"type": "boolean"
},
"week_of_month": {
"type": "string",
"enum": [
"first",
"second",
"third",
"fourth",
"fifth",
"last"
]
},
"start": {
"type": "string",
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
},
"formula": {
"type": "string",
"maxLength": 119
},
"notification": {
"type": "boolean"
},
"notification_hour": {
"type": "integer",
"minimum": 0,
"maximum": 23
}
},
"required": [
"id",
"repeat"
],
"additionalProperties": false
}
},
{
"name": "set_habit_questions",
"description": "Set the questions a habit asks when a day is done, using its exact ID. They replace its questions; a question with the same words as one it has keeps that question's past answers. Each question is answered as text, number (a whole number), time (H:MM) or yes_no. good says which answers are good: above_average or below_average for numbers and times judges each answer against the average of the answers before it (higher or lower is better; for times below means earlier), at_least, at_most or between low and high for numbers (whole numbers) and times (H:MM, where at_least means after and at_most before, and between a later and an earlier time spans midnight), yes or no for yes_no questions, or none. Without good, numbers are good above their average and times below it. With an empty list the habit asks nothing.",
"inputSchema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"questions": {
"type": "array",
"maxItems": 8,
"items": {
"type": "object",
"properties": {
"text": {
"type": "string",
"minLength": 1,
"maxLength": 95
},
"answer": {
"type": "string",
"enum": [
"text",
"number",
"time",
"yes_no"
]
},
"good": {
"type": "string",
"enum": [
"none",
"above_average",
"below_average",
"at_least",
"at_most",
"between",
"yes",
"no"
]
},
"low": {
"type": [
"integer",
"string"
]
},
"high": {
"type": [
"integer",
"string"
]
}
},
"required": [
"text",
"answer"
],
"additionalProperties": false
}
}
},
"required": [
"id",
"questions"
],
"additionalProperties": false
}
},
{
"name": "set_habit_tracking",
"description": "Set how a habit tracks a day, using its exact ID: check marks the day done, count counts up to target a day, and span measures from a start to an end, where a tap starts it and the next ends it, for example a fasting window. A habit counts or measures spans, not both. For spans, good says which are good by their length: at_least, at_most or between low and high, written as hours and minutes H:MM (for example at_most 8:00 for an 8 hour eating window, at_least 16:00 for a fast), below_average for shorter than the average of the spans before (the default), above_average for longer, or none.",
"inputSchema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"mode": {
"type": "string",
"enum": [
"check",
"count",
"span"
]
},
"target": {
"type": "integer",
"minimum": 1,
"maximum": 9999
},
"good": {
"type": "string",
"enum": [
"none",
"above_average",
"below_average",
"at_least",
"at_most",
"between"
]
},
"low": {
"type": "string"
},
"high": {
"type": "string"
}
},
"required": [
"id",
"mode"
],
"additionalProperties": false
}
},
{
"name": "write_diary",
"description": "Append the requested text to today's diary with the current time. Preserve the user's wording.",
+5 -1
View File
@@ -36,6 +36,9 @@ Text.review-changed {
Text.review-detail {
foreground: muted;
}
Text.muted-detail {
foreground: muted;
}
Text.review-heading {
foreground: text;
}
@@ -55,8 +58,9 @@ Text.practice-heading {
Text.selected-navigation {
foreground: text;
}
// Counts and times drawn on the accent circle use the accent's own ink.
Text.circle-ink {
foreground: #171022;
foreground: accent-ink;
}
// Style packs pair their own accent-soft with accent text. Inbe replaces
+108
View File
@@ -0,0 +1,108 @@
# Tai Chi course animation
A complete Yang-style 24-form course for Inner Breeze, built as data first:
a 3D rig, a pose solver, choreography written as code, a Three.js review
studio, automatic motion checks and headless review renders. Inbe's own
code does not use any of this yet; how the app plays the course is decided
later (see "App playback" below).
## Course
- **Foundations**: posture and breathing, warm-up, standing meditation,
stances, stepping and hand shapes, each as short drills.
- **Lessons 1–8**: the 24 movements in the usual eight groups. Every
movement has three versions: a *demo* at normal speed, a *breakdown* that
plays slower and pauses on every step with its cue, and a *follow-along*
that does the movement, steps into the mirrored start, does it on the
other side and returns.
- **Full form**: normal tempo (front view, mirrored, so it moves like your
reflection) and a slow learning tempo (from behind).
## Run
```sh
cd design/tai-chi
npm install # Three.js, pinned in package.json
node tools/serve.mjs # studio at http://127.0.0.1:8771/ (opens on the full form)
node tools/check.mjs # motion checks for every item and figure
node tools/render.mjs --item lesson-2/brush-knee/demo --stills 3,6,9 --label
node tools/render.mjs --lessons --full --label # an MP4 per lesson and the full form
node tools/export.mjs [--bake] # writes docs/tai-chi-24.json
```
Renders run headless Chromium with SwiftShader and no display; the
inherited display and session variables are removed from its environment.
Output goes to `build/tai-chi/` (ignored).
Studio keys: Space plays, ←/→ step a frame (Shift: a second), `[`/`]`
jump between cued steps, 1–6 switch views. Dragging the view switches to
the free orbit camera.
## Painted characters
The studio opens on the full form with the painted Tibetan monk: a 2D
cut-out puppet in the hand-painted style of Sun Salutation, drawn over the
same solved body as the 3D figures, so every lesson, version and the full
form play with it. The second painted character is a Tibetan woman (braids
wound round her head, teal wrap vest, pangden-striped sash). Pick them in the
figure buttons (`?figure=monk`, `?figure=tibetanWoman`); the 3D figures are
still there.
- `characters/<id>/source/` keeps the generated turnaround and part sheets
with their prompts (Codex built-in image generation, the turnaround and
the approved Sun Salutation characters as references).
- `tools/cut-parts.py characters/<id>` cuts the sheets listed in
`sheets.json` into transparent `parts/`, recovering edges from the white
background and fading the cut edges that another part covers (hand into
forearm, ankle into trouser cuff).
- `characters/<id>/character.json` names each part's points as fractions of
its image: the neck and hips of the five torso views, the armholes, the
neck of the five head views, wrist and fingertips of the hands, heel and
toe of the shoes.
- `src/painted/figure.js` projects the solved joints flat along the view
and places the paintings as textured meshes in an orthographic scene:
arms and legs bend along their projected bones, the torso follows the
projected spine, and the head, torso, hands and shoes switch between
front, three-quarter, side, three-quarter back and back drawings as they
turn (mirrored for the other side, with a little hysteresis so a part on
a boundary does not flicker). Hands pick palm, back, edge, fist or hook
drawings from the hand's shape and which way the palm faces. Back arms,
legs, head, torso and front arms are drawn in that order.
## How it works
- `src/rig.js`: proportions as fractions of height, per figure.
- `src/pose.js`: the pose description (feet, weight, sinking, waist,
hands in chest axes, gaze) and mirroring.
- `src/form.js`: the choreography builder. Each key edits a copy of the
previous pose with side-relative calls (`place`, `pivot`, `load`, `waist`,
`hand`, `look`…), so the same code runs mirrored. Weight leaves a foot
before it steps, and a loaded foot waits for the weight to go before it
turns.
- `src/timeline.js`: monotone curves for the body (no overshoot), smooth
arcs for the hands, and feet that pivot exactly about the heel or ball or
lift off to step: planted feet never slide.
- `src/solve.js`: inverse kinematics for legs (knees track the toes) and
arms, spine twist, gaze that follows a hand, heels that rise when a light
back foot cannot reach, and a centre of mass placed over the weighted
contact between the feet.
- `src/checks.js`: foot sliding and floating, knee tracking, knee past the
toes, knee and wrist limits, arms locked out, hands in the body, feet and
knees colliding, balance over the feet, speed and jumps, facing at the end
of each movement, and the full form's duration.
- `form/`: the choreography. `lessonN.js` exports the lesson's movements;
`boundaries.js` holds the poses where lessons hand over.
- `src/view/`: the stage, camera views, the mannequin and the two 3D
characters (Sage Bun and Sage Male); `src/painted/` the painted 2D
figures (see above).
## App playback
Pre-rendered frames do not fit: Sun Salutation's 991 frames per character
are about 10 MB, and the app package budget is 38 MB in total, while the
24-form at the same frame rate would be about 100 MB per character. The
exported keyed poses for the whole course are about 350 KB (21 KB
gzipped); the full form baked to joint rotations at 30 fps is about 1.8 MB
per figure (1.2 MB gzipped). Either needs a player in
the app, which means a reusable 3D or projected-skeleton primitive in Kryon
first. That is a separate decision.
@@ -0,0 +1,45 @@
{
"id": "monk",
"name": "Tibetan Monk",
"figure": "monk",
"note": "Points are fractions of each part image: [x from the left, y from the top]. Views are painted facing the image's right; the renderer mirrors them for the other side.",
"head": {
"neck": "the middle of the cut at the bottom of the neck",
"views": {
"front": { "file": "parts/head-front.png", "neck": [0.5, 0.97] },
"threeQuarter": { "file": "parts/head-three-quarter.png", "neck": [0.42, 0.97] },
"side": { "file": "parts/head-side.png", "neck": [0.36, 0.97] },
"threeQuarterBack": { "file": "parts/head-three-quarter-back.png", "neck": [0.38, 0.97] },
"back": { "file": "parts/head-back.png", "neck": [0.49, 0.97] }
}
},
"torso": {
"views": {
"front": { "file": "parts/torso-front.png", "neck": [0.5, 0.1], "hip": [0.5, 0.93], "shoulders": [[0.1, 0.15], [0.9, 0.15]] },
"threeQuarter": { "file": "parts/torso-three-quarter.png", "neck": [0.53, 0.1], "hip": [0.5, 0.93], "shoulders": [[0.14, 0.17], [0.88, 0.15]] },
"side": { "file": "parts/torso-side.png", "neck": [0.52, 0.07], "hip": [0.5, 0.93], "shoulders": [[0.38, 0.17], [0.46, 0.15]] },
"threeQuarterBack": { "file": "parts/torso-three-quarter-back.png", "neck": [0.5, 0.08], "hip": [0.5, 0.93], "shoulders": [[0.08, 0.16], [0.86, 0.17]] },
"back": { "file": "parts/torso-back.png", "neck": [0.5, 0.07], "hip": [0.5, 0.93], "shoulders": [[0.08, 0.15], [0.92, 0.15]] }
}
},
"arm": { "file": "parts/arm.png", "root": [0.5, 0.09], "end": [0.5, 0.96], "anterior": 1, "thickness": 0.62 },
"leg": { "file": "parts/leg.png", "root": [0.5, 0.05], "end": [0.5, 0.94], "anterior": 1, "thickness": 0.66 },
"hands": {
"scale": "the palm's wrist-to-fingertip length is the rig's hand length; every hand drawing shares its scale",
"palm": { "file": "parts/hand-palm.png", "wrist": [0.5, 0.97], "tip": [0.55, 0.01], "across": "thumb", "sign": 1 },
"back": { "file": "parts/hand-back.png", "wrist": [0.5, 0.97], "tip": [0.48, 0.01], "across": "thumb", "sign": -1 },
"edge": { "file": "parts/hand-edge.png", "wrist": [0.5, 0.98], "tip": [0.45, 0.01], "across": "palm", "sign": 1 },
"fistFront": { "file": "parts/fist-front.png", "wrist": [0.5, 0.97], "tip": [0.5, 0.02], "across": "thumb", "sign": 1 },
"fistSide": { "file": "parts/fist-side.png", "wrist": [0.42, 0.97], "tip": [0.5, 0.02], "across": "palm", "sign": 1 },
"hook": { "file": "parts/hook.png", "wrist": [0.2, 0.97], "tip": [0.76, 0.86], "across": "palm", "sign": 1 }
},
"shoes": {
"scale": "the outer profile's heel-to-toe length is the rig's foot length; every shoe drawing shares its scale",
"outer": { "file": "parts/shoe-outer.png", "heel": [0.03, 0.955], "toe": [0.985, 0.955] },
"inner": { "file": "parts/shoe-inner.png", "heel": [0.03, 0.955], "toe": [0.985, 0.955] },
"front": { "file": "parts/shoe-front.png", "ankle": [0.5, 0.55] },
"back": { "file": "parts/shoe-back.png", "ankle": [0.5, 0.56] },
"threeQuarter": { "file": "parts/shoe-three-quarter.png", "ankle": [0.3, 0.52] },
"threeQuarterBack": { "file": "parts/shoe-three-quarter-back.png", "ankle": [0.3, 0.5] }
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

@@ -0,0 +1,266 @@
{
"head-front": {
"size": [
195,
272
],
"sheet": "source/atlas-body.png",
"at": [
65,
125
]
},
"head-three-quarter": {
"size": [
195,
275
],
"sheet": "source/atlas-body.png",
"at": [
372,
122
]
},
"head-side": {
"size": [
218,
273
],
"sheet": "source/atlas-body.png",
"at": [
666,
124
]
},
"head-three-quarter-back": {
"size": [
202,
270
],
"sheet": "source/atlas-body.png",
"at": [
965,
121
]
},
"head-back": {
"size": [
204,
272
],
"sheet": "source/atlas-body.png",
"at": [
1270,
121
]
},
"torso-front": {
"size": [
278,
455
],
"sheet": "source/atlas-body.png",
"at": [
23,
464
]
},
"torso-three-quarter": {
"size": [
272,
458
],
"sheet": "source/atlas-body.png",
"at": [
342,
461
]
},
"torso-side": {
"size": [
218,
453
],
"sheet": "source/atlas-body.png",
"at": [
660,
460
]
},
"torso-three-quarter-back": {
"size": [
256,
455
],
"sheet": "source/atlas-body.png",
"at": [
922,
463
]
},
"torso-back": {
"size": [
285,
459
],
"sheet": "source/atlas-body.png",
"at": [
1229,
460
]
},
"arm": {
"size": [
129,
480
],
"sheet": "source/atlas-limbs.png",
"at": [
150,
27
]
},
"leg": {
"size": [
165,
491
],
"sheet": "source/atlas-limbs.png",
"at": [
504,
18
]
},
"hand-palm": {
"size": [
178,
348
],
"sheet": "source/atlas-limbs.png",
"at": [
881,
116
]
},
"hand-back": {
"size": [
182,
348
],
"sheet": "source/atlas-limbs.png",
"at": [
1231,
116
]
},
"hand-edge": {
"size": [
104,
373
],
"sheet": "source/atlas-limbs.png",
"at": [
168,
562
]
},
"fist-front": {
"size": [
194,
253
],
"sheet": "source/atlas-limbs.png",
"at": [
473,
650
]
},
"fist-side": {
"size": [
169,
271
],
"sheet": "source/atlas-limbs.png",
"at": [
866,
643
]
},
"hook": {
"size": [
227,
286
],
"sheet": "source/atlas-limbs.png",
"at": [
1232,
606
]
},
"shoe-outer": {
"size": [
414,
266
],
"sheet": "source/atlas-shoes.png",
"at": [
68,
139
]
},
"shoe-inner": {
"size": [
434,
266
],
"sheet": "source/atlas-shoes.png",
"at": [
582,
137
]
},
"shoe-front": {
"size": [
215,
298
],
"sheet": "source/atlas-shoes.png",
"at": [
1172,
132
]
},
"shoe-back": {
"size": [
211,
309
],
"sheet": "source/atlas-shoes.png",
"at": [
145,
567
]
},
"shoe-three-quarter": {
"size": [
387,
319
],
"sheet": "source/atlas-shoes.png",
"at": [
598,
567
]
},
"shoe-three-quarter-back": {
"size": [
339,
305
],
"sheet": "source/atlas-shoes.png",
"at": [
1122,
567
]
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

+142
View File
@@ -0,0 +1,142 @@
{
"sheets": [
{
"file": "source/atlas-body.png",
"grid": [
5,
2
],
"rowEdges": [
0,
428,
1024
],
"tiles": [
"head-front",
"head-three-quarter",
"head-side",
"head-three-quarter-back",
"head-back",
"torso-front",
"torso-three-quarter",
"torso-side",
"torso-three-quarter-back",
"torso-back"
]
},
{
"file": "source/atlas-limbs.png",
"grid": [
4,
2
],
"tiles": [
"arm",
"leg",
"hand-palm",
"hand-back",
"hand-edge",
"fist-front",
"fist-side",
"hook"
],
"fade": {
"arm": {
"bottom": [
0.95,
1.0
]
},
"hand-palm": {
"bottom": [
0.92,
1.0
]
},
"hand-back": {
"bottom": [
0.92,
1.0
]
},
"hand-edge": {
"bottom": [
0.92,
1.0
]
},
"fist-front": {
"bottom": [
0.92,
1.0
]
},
"fist-side": {
"bottom": [
0.92,
1.0
]
},
"hook": {
"bottom": [
0.92,
1.0
]
}
}
},
{
"file": "source/atlas-shoes.png",
"grid": [
3,
2
],
"tiles": [
"shoe-outer",
"shoe-inner",
"shoe-front",
"shoe-back",
"shoe-three-quarter",
"shoe-three-quarter-back"
],
"fade": {
"shoe-outer": {
"top": [
0.22,
0.32
]
},
"shoe-inner": {
"top": [
0.22,
0.32
]
},
"shoe-front": {
"top": [
0.3,
0.42
]
},
"shoe-back": {
"top": [
0.3,
0.42
]
},
"shoe-three-quarter": {
"top": [
0.2,
0.3
]
},
"shoe-three-quarter-back": {
"top": [
0.2,
0.3
]
}
}
}
]
}
@@ -0,0 +1,6 @@
Use your built-in image generation tool to create exactly ONE image (landscape 1536x1024). Do not write code or files yourself; just generate the image.
Asset: a cut-out parts sheet with TEN pieces in FIVE equal columns and TWO rows. The five columns are the five turnaround views of reference image 1, in the same order: (1) front view, (2) three-quarter front view turned toward the image's right, (3) exact right-facing side profile, (4) three-quarter back view turning away toward the right, (5) back view.
Row 1, one per column: the monk's HEAD with the COMPLETE BARE NECK in that view. The neck continues straight down below the jaw and ends in a plain horizontal cut at the base of the neck. Head and neck only: no shoulders, no collarbones, no clothing, no piping.
Row 2, one per column: the monk's TORSO garment panel in that same view: the saffron dhonka from the shoulders down to the hem at the hips, with the blue-piped crossed neckline, blue-piped armholes and the maroon sash at the waist. NO head, NO neck, NO arms: the armholes are closed with the blue piping where the arms will be attached as separate pieces. In the front and three-quarter front views, the small triangle of bare chest skin inside the crossed neckline is painted. The torso panels are drawn upright and at the same scale as each other, all hems on one line.
All ten pieces share one scale: each head is about one seventh of the full body height, as in reference image 1.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

@@ -0,0 +1,6 @@
Use your built-in image generation tool to create exactly ONE image (landscape 1536x1024). Do not write code or files yourself; just generate the image.
Asset: a cut-out parts sheet with EIGHT pieces in FOUR equal columns and TWO rows, all at the scale of reference image 1.
Row 1: (1) one straight BARE ARM hanging perfectly vertically, from the rounded shoulder cap at the top to the wrist at the bottom, seen from the outer side, warm medium-brown skin, NO hand (cut cleanly at the wrist), no clothing; (2) one straight loose deep-maroon TROUSER LEG hanging perfectly vertically, from a horizontal cut at the upper hip at the top down to the gathered elastic ankle cuff at the bottom, NO foot and no shoe, seen from the side; (3) an open relaxed RIGHT HAND, PALM facing the viewer, fingers together pointing straight UP, thumb relaxed at the side, the wrist cut cleanly at the bottom; (4) an open relaxed RIGHT HAND, BACK of the hand facing the viewer, fingers together pointing straight UP, wrist cut at the bottom.
Row 2: (5) an open flat hand seen exactly EDGE-ON from the THUMB side, fingers together pointing straight UP, wrist cut at the bottom; (6) a loose FIST seen from the front, the knuckles and backs of the fingers toward the viewer, wrist cut at the bottom; (7) a loose FIST seen from the THUMB side, the thumb resting over the curled fingers, wrist cut at the bottom; (8) a Tai Chi HOOK HAND seen from the side: the wrist at the bottom, the back of the hand rising from the wrist and bending over so all five fingertips gather together into a single point that hangs downward, like a crane's beak.
All hands are the same size and skin colour as each other.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

@@ -0,0 +1,5 @@
Use your built-in image generation tool to create exactly ONE image (landscape 1536x1024). Do not write code or files yourself; just generate the image.
Asset: a cut-out parts sheet with SIX pieces in THREE equal columns and TWO rows: the monk's black cloth slip-on SHOE worn on his bare foot, each with a short piece of the bare ankle rising above the shoe opening and cut off horizontally just above the ankle bone, all at the same scale. Matte black cotton uppers, thin light-beige soles.
Row 1: (1) the right foot in exact SIDE PROFILE pointing to the image's RIGHT, seen from the outer side, the sole flat and horizontal; (2) the left foot in exact SIDE PROFILE pointing to the image's RIGHT, seen from the inner (arch) side, the sole flat and horizontal; (3) the foot seen exactly from the FRONT, toe pointing at the viewer.
Row 2: (4) the foot seen exactly from BEHIND, heel toward the viewer; (5) the foot in THREE-QUARTER FRONT view, toe pointing toward the viewer and to the image's right; (6) the foot in THREE-QUARTER BACK view, heel toward the viewer and toe pointing away to the image's right.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

@@ -0,0 +1,3 @@
Reference image 1 is the approved turnaround of this exact Tibetan monk: copy his face, shaved head, warm medium-brown skin, saffron-yellow sleeveless dhonka with thin royal-blue piping, deep maroon waist sash, loose deep-maroon trousers gathered at the ankles, black cloth shoes, colours, line quality and painting style exactly. Reference image 2 is the app's style reference (warm hand-painted storybook look, matte gouache/watercolor textures, subtle paper grain, restrained warm brown contour lines).
These are separate cut-out pieces for a 2D puppet animation: every piece is isolated, complete, centred in its own equal tile with generous white margins, never touching or overlapping another piece, with its own closed contour line.
Background: perfectly flat plain pure white (#FFFFFF), no floor, no shadows, no gradients, no grid lines, no tile borders, no text, no labels, no numbers. No extra pieces.
@@ -0,0 +1,11 @@
Use your built-in image generation tool to create exactly ONE image (landscape 1536x1024). Do not write any code or files yourself; just generate the image.
Use case: character turnaround sheet for a 2D cut-out animation of the Yang Tai Chi 24-form in the Inner Breeze meditation app.
Reference image 1 shows the app's existing approved characters: match their illustration style exactly (warm hand-painted storybook look, matte gouache/watercolor textures, subtle paper grain inside painted areas, restrained warm brown contour lines, natural adult proportions, calm faces with small relaxed eyes).
Character: a young adult Tibetan Buddhist monk, about 30 years old, slim and calm. Clean-shaven head with a smooth natural scalp, warm medium-brown skin, gentle peaceful face with small relaxed dark eyes and a faint kind smile, natural ears.
Clothing (Tai Chi practice outfit in traditional Tibetan monastic colours): a sleeveless saffron-yellow dhonka shirt with a crossed wrap neckline and thin royal-blue piping along the neckline and the armholes; a deep maroon cloth sash wrapped twice around the waist; the shirt hem reaches the hips over the sash; loose deep-maroon trousers that are gathered at the ankles; simple black cloth slip-on shoes with thin off-white soles. Bare arms. No jewellery, no mala, no shawl, no hat.
Layout: FIVE full-body standing views of the SAME monk side by side, all the same height, feet on one shared baseline, arms hanging relaxed slightly away from the body, standing upright and still: (1) front view facing the viewer, (2) three-quarter front view turned toward the right side of the image, (3) exact right-facing side profile, (4) three-quarter back view turning away toward the right, (5) back view.
Background: perfectly flat plain white, with no floor, no shadows, no gradient, no texture.
Constraints: no text, no labels, no numbers, no grid lines, no frames, no extra characters, no props. Identical colours, proportions and costume details in all five views.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

@@ -0,0 +1,45 @@
{
"id": "tibetan-woman",
"name": "Tibetan Woman",
"figure": "tibetanWoman",
"note": "Points are fractions of each part image: [x from the left, y from the top]. Views are painted facing the image's right; the renderer mirrors them for the other side.",
"head": {
"neck": "the middle of the cut at the bottom of the neck; the front view's crown is the top of the skull under the braids",
"views": {
"front": { "file": "parts/head-front.png", "neck": [0.5, 0.97], "crown": [0.5, 0.06] },
"threeQuarter": { "file": "parts/head-three-quarter.png", "neck": [0.42, 0.97] },
"side": { "file": "parts/head-side.png", "neck": [0.45, 0.97] },
"threeQuarterBack": { "file": "parts/head-three-quarter-back.png", "neck": [0.43, 0.97] },
"back": { "file": "parts/head-back.png", "neck": [0.5, 0.97] }
}
},
"torso": {
"views": {
"front": { "file": "parts/torso-front.png", "neck": [0.5, 0.08], "hip": [0.5, 0.93], "shoulders": [[0.08, 0.17], [0.92, 0.17]] },
"threeQuarter": { "file": "parts/torso-three-quarter.png", "neck": [0.52, 0.07], "hip": [0.5, 0.93], "shoulders": [[0.12, 0.18], [0.9, 0.17]] },
"side": { "file": "parts/torso-side.png", "neck": [0.42, 0.05], "hip": [0.5, 0.93], "shoulders": [[0.26, 0.2], [0.32, 0.17]] },
"threeQuarterBack": { "file": "parts/torso-three-quarter-back.png", "neck": [0.5, 0.05], "hip": [0.5, 0.93], "shoulders": [[0.05, 0.17], [0.87, 0.18]] },
"back": { "file": "parts/torso-back.png", "neck": [0.5, 0.05], "hip": [0.5, 0.93], "shoulders": [[0.06, 0.17], [0.94, 0.17]] }
}
},
"arm": { "file": "parts/arm.png", "root": [0.5, 0.09], "end": [0.53, 0.975], "anterior": 1, "thickness": 0.6 },
"leg": { "file": "parts/leg.png", "root": [0.5, 0.04], "end": [0.5, 0.94], "anterior": 1, "thickness": 0.62 },
"hands": {
"scale": "the palm's wrist-to-fingertip length is the rig's hand length; every hand drawing shares its scale",
"palm": { "file": "parts/hand-palm.png", "wrist": [0.5, 0.97], "tip": [0.53, 0.01], "across": "thumb", "sign": 1 },
"back": { "file": "parts/hand-back.png", "wrist": [0.5, 0.97], "tip": [0.52, 0.01], "across": "thumb", "sign": -1 },
"edge": { "file": "parts/hand-edge.png", "wrist": [0.5, 0.98], "tip": [0.4, 0.01], "across": "palm", "sign": 1 },
"fistFront": { "file": "parts/fist-front.png", "wrist": [0.5, 0.97], "tip": [0.5, 0.02], "across": "thumb", "sign": -1 },
"fistSide": { "file": "parts/fist-side.png", "wrist": [0.45, 0.97], "tip": [0.5, 0.02], "across": "palm", "sign": 1 },
"hook": { "file": "parts/hook.png", "wrist": [0.03, 0.29], "tip": [0.03, 0.95], "across": "palm", "sign": 1 }
},
"shoes": {
"scale": "the outer profile's heel-to-toe length is the rig's foot length; every shoe drawing shares its scale",
"outer": { "file": "parts/shoe-outer.png", "heel": [0.03, 0.955], "toe": [0.985, 0.955] },
"inner": { "file": "parts/shoe-inner.png", "heel": [0.03, 0.955], "toe": [0.985, 0.955] },
"front": { "file": "parts/shoe-front.png", "ankle": [0.5, 0.55] },
"back": { "file": "parts/shoe-back.png", "ankle": [0.5, 0.56] },
"threeQuarter": { "file": "parts/shoe-three-quarter.png", "ankle": [0.3, 0.52] },
"threeQuarterBack": { "file": "parts/shoe-three-quarter-back.png", "ankle": [0.3, 0.5] }
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

@@ -0,0 +1,266 @@
{
"head-front": {
"size": [
211,
275
],
"sheet": "source/atlas-body.png",
"at": [
64,
106
]
},
"head-three-quarter": {
"size": [
217,
277
],
"sheet": "source/atlas-body.png",
"at": [
357,
103
]
},
"head-side": {
"size": [
233,
273
],
"sheet": "source/atlas-body.png",
"at": [
660,
107
]
},
"head-three-quarter-back": {
"size": [
220,
275
],
"sheet": "source/atlas-body.png",
"at": [
950,
106
]
},
"head-back": {
"size": [
223,
277
],
"sheet": "source/atlas-body.png",
"at": [
1253,
104
]
},
"torso-front": {
"size": [
306,
483
],
"sheet": "source/atlas-body.png",
"at": [
18,
447
]
},
"torso-three-quarter": {
"size": [
301,
482
],
"sheet": "source/atlas-body.png",
"at": [
342,
447
]
},
"torso-side": {
"size": [
234,
478
],
"sheet": "source/atlas-body.png",
"at": [
666,
449
]
},
"torso-three-quarter-back": {
"size": [
280,
476
],
"sheet": "source/atlas-body.png",
"at": [
917,
452
]
},
"torso-back": {
"size": [
296,
481
],
"sheet": "source/atlas-body.png",
"at": [
1220,
449
]
},
"arm": {
"size": [
151,
513
],
"sheet": "source/atlas-limbs.png",
"at": [
140,
44
]
},
"leg": {
"size": [
196,
532
],
"sheet": "source/atlas-limbs.png",
"at": [
491,
26
]
},
"hand-palm": {
"size": [
186,
414
],
"sheet": "source/atlas-limbs.png",
"at": [
854,
112
]
},
"hand-back": {
"size": [
187,
418
],
"sheet": "source/atlas-limbs.png",
"at": [
1230,
108
]
},
"hand-edge": {
"size": [
101,
389
],
"sheet": "source/atlas-limbs.png",
"at": [
153,
583
]
},
"fist-front": {
"size": [
200,
265
],
"sheet": "source/atlas-limbs.png",
"at": [
464,
699
]
},
"fist-side": {
"size": [
183,
295
],
"sheet": "source/atlas-limbs.png",
"at": [
846,
671
]
},
"hook": {
"size": [
244,
280
],
"sheet": "source/atlas-limbs.png",
"at": [
1210,
662
]
},
"shoe-outer": {
"size": [
416,
275
],
"sheet": "source/atlas-shoes.png",
"at": [
95,
126
]
},
"shoe-inner": {
"size": [
417,
276
],
"sheet": "source/atlas-shoes.png",
"at": [
607,
125
]
},
"shoe-front": {
"size": [
205,
300
],
"sheet": "source/atlas-shoes.png",
"at": [
1183,
125
]
},
"shoe-back": {
"size": [
201,
308
],
"sheet": "source/atlas-shoes.png",
"at": [
163,
574
]
},
"shoe-three-quarter": {
"size": [
391,
314
],
"sheet": "source/atlas-shoes.png",
"at": [
600,
573
]
},
"shoe-three-quarter-back": {
"size": [
328,
298
],
"sheet": "source/atlas-shoes.png",
"at": [
1149,
570
]
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

@@ -0,0 +1,155 @@
{
"sheets": [
{
"file": "source/atlas-body.png",
"grid": [
5,
2
],
"columnEdges": [
0,
335,
660,
912,
1212,
1536
],
"rowEdges": [
0,
415,
1024
],
"tiles": [
"head-front",
"head-three-quarter",
"head-side",
"head-three-quarter-back",
"head-back",
"torso-front",
"torso-three-quarter",
"torso-side",
"torso-three-quarter-back",
"torso-back"
]
},
{
"file": "source/atlas-limbs.png",
"grid": [
4,
2
],
"rowEdges": [
0,
570,
1024
],
"tiles": [
"arm",
"leg",
"hand-palm",
"hand-back",
"hand-edge",
"fist-front",
"fist-side",
"hook"
],
"fade": {
"arm": {
"bottom": [
0.95,
1.0
]
},
"hand-palm": {
"bottom": [
0.92,
1.0
]
},
"hand-back": {
"bottom": [
0.92,
1.0
]
},
"hand-edge": {
"bottom": [
0.92,
1.0
]
},
"fist-front": {
"bottom": [
0.92,
1.0
]
},
"fist-side": {
"bottom": [
0.92,
1.0
]
},
"hook": {
"left": [
0.0,
0.08
]
}
}
},
{
"file": "source/atlas-shoes.png",
"grid": [
3,
2
],
"tiles": [
"shoe-outer",
"shoe-inner",
"shoe-front",
"shoe-back",
"shoe-three-quarter",
"shoe-three-quarter-back"
],
"fade": {
"shoe-outer": {
"top": [
0.22,
0.32
]
},
"shoe-inner": {
"top": [
0.22,
0.32
]
},
"shoe-front": {
"top": [
0.3,
0.42
]
},
"shoe-back": {
"top": [
0.3,
0.42
]
},
"shoe-three-quarter": {
"top": [
0.2,
0.3
]
},
"shoe-three-quarter-back": {
"top": [
0.2,
0.3
]
}
}
}
]
}
@@ -0,0 +1,7 @@
Use your built-in image generation tool to create exactly ONE image (landscape 1536x1024). Do not write code or files yourself; just generate the image.
Asset: a cut-out parts sheet with TEN pieces in FIVE equal columns and TWO rows. The five columns are the five turnaround views of reference image 1, in the same order: (1) front view, (2) three-quarter front view turned toward the image's right, (3) exact right-facing side profile, (4) three-quarter back view turning away toward the right, (5) back view.
Row 1, one per column: the woman's HEAD, with her braids wound around it, and the COMPLETE BARE NECK in that view. The neck continues straight down below the jaw and ends in a plain horizontal cut at the base of the neck. Head and neck only: no shoulders, no collar, no clothing.
Row 2, one per column: her TORSO garment panel in that same view, from the shoulders down to the hem at the hips: the cream blouse's small standing collar and shoulders with the teal wrap vest over it and the rainbow sash at the waist. NO head, NO neck, NO arms and NO sleeves: each shoulder ends in a smooth rounded cream shoulder where a separate sleeve will be attached. The collar opening is empty where the neck goes. The torso panels are drawn upright and at the same scale as each other, all hems on one line.
All ten pieces share one scale: each head is about one seventh of the full body height, as in reference image 1.
Keep the pieces well inside their tiles: leave a clear white gap between the bottom of each neck in row 1 and the top of each torso in row 2.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

@@ -0,0 +1,6 @@
Use your built-in image generation tool to create exactly ONE image (landscape 1536x1024). Do not write code or files yourself; just generate the image.
Asset: a cut-out parts sheet with EIGHT pieces in FOUR equal columns and TWO rows, all at the scale of reference image 1.
Row 1: (1) one straight ARM in the cream-white silk SLEEVE hanging perfectly vertically, from the rounded shoulder cap at the top down to the gathered cuff at the wrist, seen from the outer side, with only a short bit of bare wrist below the cuff, cut cleanly at the wrist, NO hand; (2) one straight loose dark indigo TROUSER LEG hanging perfectly vertically, from a horizontal cut at the upper hip at the top down to the gathered elastic ankle cuff at the bottom, NO foot and no shoe, seen from the side; (3) an open relaxed RIGHT HAND, PALM facing the viewer, fingers together pointing straight UP, thumb relaxed at the side, the wrist cut cleanly at the bottom; (4) an open relaxed RIGHT HAND, BACK of the hand facing the viewer, fingers together pointing straight UP, wrist cut at the bottom.
Row 2: (5) an open flat hand seen exactly EDGE-ON from the THUMB side, fingers together pointing straight UP, wrist cut at the bottom; (6) a loose FIST seen from the front, the curled fingers toward the viewer, wrist cut at the bottom; (7) a loose FIST seen from the THUMB side, the thumb resting over the curled fingers, wrist cut at the bottom; (8) a Tai Chi HOOK HAND seen from the side: the wrist at the bottom, the back of the hand rising from the wrist and bending over so all five fingertips gather together into a single point that hangs downward, like a crane's beak.
All hands are slender, the same size and skin colour as each other.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

@@ -0,0 +1,5 @@
Use your built-in image generation tool to create exactly ONE image (landscape 1536x1024). Do not write code or files yourself; just generate the image.
Asset: a cut-out parts sheet with SIX pieces in THREE equal columns and TWO rows: the woman's dark red cloth slip-on SHOE worn on her bare foot, each with a short piece of the bare ankle rising above the shoe opening and cut off horizontally just above the ankle bone, all at the same scale. Matte dark red cotton uppers, thin light-beige soles.
Row 1: (1) the right foot in exact SIDE PROFILE pointing to the image's RIGHT, seen from the outer side, the sole flat and horizontal; (2) the left foot in exact SIDE PROFILE pointing to the image's RIGHT, seen from the inner (arch) side, the sole flat and horizontal; (3) the foot seen exactly from the FRONT, toe pointing at the viewer.
Row 2: (4) the foot seen exactly from BEHIND, heel toward the viewer; (5) the foot in THREE-QUARTER FRONT view, toe pointing toward the viewer and to the image's right; (6) the foot in THREE-QUARTER BACK view, heel toward the viewer and toe pointing away to the image's right.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

@@ -0,0 +1,3 @@
Reference image 1 is the approved turnaround of this exact Tibetan woman: copy her face, braids wound around her head with red yarn and turquoise and coral beads, warm medium-brown skin, cream-white long-sleeved silk blouse with a small standing collar, sleeveless deep teal-blue wrap vest, pangden rainbow-striped waist sash, loose dark indigo trousers gathered at the ankles, dark red cloth shoes, colours, line quality and painting style exactly. Reference image 2 is the app's style reference (warm hand-painted storybook look, matte gouache/watercolor textures, subtle paper grain, restrained warm brown contour lines).
These are separate cut-out pieces for a 2D puppet animation: every piece is isolated, complete, centred in its own equal tile with generous white margins, never touching or overlapping another piece, with its own closed contour line.
Background: perfectly flat plain pure white (#FFFFFF), no floor, no shadows, no gradients, no grid lines, no tile borders, no text, no labels, no numbers. No extra pieces.
@@ -0,0 +1,11 @@
Use your built-in image generation tool to create exactly ONE image (landscape 1536x1024). Do not write any code or files yourself; just generate the image.
Use case: character turnaround sheet for a 2D cut-out animation of the Yang Tai Chi 24-form in the Inner Breeze meditation app.
Reference image 1 is the approved turnaround of a Tibetan monk character from the same animation: match its illustration style, line quality, proportions, sheet layout and lighting exactly. Reference image 2 shows the app's other approved characters (warm hand-painted storybook look, matte gouache/watercolor textures, subtle paper grain, restrained warm brown contour lines, natural adult proportions, calm faces with small relaxed eyes).
Character: a Tibetan woman, about 35 years old, slim and calm, warm medium-brown skin with rosy cheeks, gentle peaceful face with small relaxed dark eyes and a faint kind smile. Her long black hair is braided into two braids that are wound neatly around the crown of her head like a circlet, tied with red yarn and a few small turquoise and coral beads; no hair hangs down.
Clothing (Tai Chi practice outfit with traditional Tibetan touches): a cream-white long-sleeved silk blouse (wonju) with a small standing collar and plain cuffs at the wrists; over it a sleeveless deep teal-blue wrap vest that crosses over the chest to the right side and reaches the hips; a waist sash woven in the traditional Tibetan pangden rainbow stripes (narrow horizontal bands of red, orange, yellow, green and blue) wrapped around the waist; loose dark indigo trousers gathered at the ankles; simple dark red cloth slip-on shoes with thin off-white soles. No jewellery except the beads in the hair, no apron, no hat.
Layout: FIVE full-body standing views of the SAME woman side by side, all the same height, feet on one shared baseline, arms hanging relaxed slightly away from the body, standing upright and still: (1) front view facing the viewer, (2) three-quarter front view turned toward the right side of the image, (3) exact right-facing side profile, (4) three-quarter back view turning away toward the right, (5) back view.
Background: perfectly flat plain white, with no floor, no shadows, no gradient, no texture.
Constraints: no text, no labels, no numbers, no grid lines, no frames, no extra characters, no props. Identical colours, proportions and costume details in all five views.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

+64
View File
@@ -0,0 +1,64 @@
// Poses where one lesson hands over to the next. A lesson that ends here
// should finish in this pose (positions may differ; stance, facing, weight
// and hands should match), and the next lesson's standalone preview starts
// from it.
import { Form } from '../src/form.js'
import { standingPose } from '../src/pose.js'
import { SINK, STEP, TRACK, pressByHip } from './hands.js'
// Built with the same choreography calls as the form, from standing.
function build(edit) {
const form = new Form(standingPose())
form.key(1, edit)
return form.pose
}
// End of Single Whip (lessons 4 → 5): left bow stance facing 90, left palm
// pushing forward, right hand a hook out to the right.
export function singleWhipPose() {
return build((k) => {
k.turn(90)
k.toes('R', 45, 'ball')
k.place('L', { from: 'R', fwd: STEP, out: TRACK })
k.load('L', 0.7)
k.sink(SINK)
k.hips(-10)
k.chest(-15)
k.hand('L', { at: [0.1, -0.03, 0.48], palm: 'fwd+out', fingers: 'up', shape: 'palm', elbow: [0.4, -1, 0] })
k.hand('R', { at: [0.66, -0.02, 0.2], palm: 'back+mid', fingers: 'down', shape: 'hook', elbow: [0.3, -1, 0] })
k.look('L')
})
}
// End of Golden Rooster on the right leg (lessons 6 → 7): facing 270,
// standing on the right leg, left knee lifted, left hand up over the knee,
// right hand pressing by the right hip.
export function goldenRoosterRightPose() {
return build((k) => {
k.turn(270)
k.toes('R', 0, 'ball')
k.load('R')
k.sink(0.06)
k.place('L', { from: 'R', fwd: 0.16, out: 0.1, pitch: -25, lift: 0.36 })
k.hand('L', { at: [0.12, 0.08, 0.32], palm: 'mid', fingers: 'up', shape: 'palm', elbow: [0.1, -1, 0.3] })
pressByHip(k, 'R')
k.look('fwd')
})
}
// End of Fan Through the Back (lessons 7 → 8): left bow stance facing 270,
// right hand held above the right temple palm out, left palm pushing.
export function fanThroughBackPose() {
return build((k) => {
k.turn(270)
k.toes('R', 45, 'ball')
k.place('L', { from: 'R', fwd: STEP, out: TRACK })
k.load('L', 0.7)
k.sink(SINK)
k.waist(-10)
k.hand('R', { at: [0.2, 0.18, 0.18], palm: 'out+up', fingers: 'mid+fwd', shape: 'palm', elbow: [0.8, -1, 0] })
k.hand('L', { at: [0.06, -0.02, 0.5], palm: 'fwd', fingers: 'up', shape: 'palm', elbow: [0.4, -1, 0] })
k.look('fwd')
})
}
+792
View File
@@ -0,0 +1,792 @@
// Foundations: posture, warm-ups, standing, stances, stepping and hand shapes.
//
// Every drill starts standing with the feet together and ends standing, so
// it can loop. Drills done on both sides are written for the left and run
// again with the form mirrored.
import { SINK, STEP, TRACK, handsDown, pressByHip, pushPalm } from './hands.js'
// Shoulder width between the feet, measured centre to centre.
const SHOULDER_WIDTH = 0.3
// Hands resting on the hips, fingers forward.
function handsOnHips(k) {
k.hands({ at: [0.19, -0.5, 0.02], palm: 'mid', fingers: 'fwd+down', shape: 'palm', elbow: [1, -0.4, -0.5] })
}
// Arms relaxed at the sides, a little away from the body.
function armsHanging(k) {
k.hands({ at: [0.21, -0.57, 0.05], palm: 'mid', fingers: 'down', shape: 'palm', elbow: [0.35, -1, -0.25] })
}
// Both palms side by side in front of the belly.
function palmsAtBelly(k, palm = 'up', { up = -0.42, fwd = 0.2 } = {}) {
k.hands({ at: [0.12, up, fwd], palm, fingers: 'mid+fwd', shape: 'palm', elbow: [0.6, -1, -0.3] })
}
// Bends the knees a little before the weight moves: straight legs cannot
// shift the weight smoothly.
function softenKnees(f, depth = 0.04) {
f.key(1.2, (k) => {
k.sink(depth)
}, 'Soften the knees')
}
// Steps the left foot out to `width` from feet together, toes first.
function stepOut(f, width = SHOULDER_WIDTH, cue = 'Step out to shoulder width, toes first') {
softenKnees(f, 0.03)
f.key(1.3, (k) => {
k.load('R')
}, 'Settle the weight onto the right foot')
f.key(0.9, (k) => {
k.lift('L', 0.03, -12)
}, 'Lift the left heel, then the foot')
f.key(1.1, (k) => {
k.place('L', { from: 'other', out: width, pitch: -10 })
}, cue)
f.key(1.3, (k) => {
k.ground('L')
k.load(0.5)
}, 'Lower the heel and centre the weight')
}
// Brings the left foot back beside the right and stands up.
function stepIn(f, cue = 'Bring the left foot back beside the right') {
f.key(1.3, (k) => {
k.load('R')
armsHanging(k)
k.look('fwd')
}, 'Shift the weight onto the right foot')
f.key(1.2, (k) => {
k.place('L', { from: 'other', out: 0.1, pitch: -10 })
}, cue)
f.key(1.3, (k) => {
k.ground('L')
k.load(0.5)
k.sink(0)
k.waist(0)
handsDown(k)
}, 'Centre the weight and stand tall')
}
// ── 1. Posture and breathing ───────────────────────────────────────────
function standingPosture(f) {
f.hold(2.0, 'Stand with the feet together, arms relaxed, eyes level')
stepOut(f)
f.key(3.0, (k) => {
k.sink(0.04)
armsHanging(k)
}, 'Soften the knees; let the shoulders drop and the arms hang')
f.hold(3.5, 'Lift the crown of the head, tuck the chin in slightly')
f.key(3.0, (k) => {
k.sink(0.05)
}, 'Relax the lower back; feel the weight sink into the feet')
f.hold(3.5, 'Breathe naturally through the nose')
stepIn(f)
}
function breathing(f) {
stepOut(f)
f.key(2.5, (k) => {
k.sink(0.05)
palmsAtBelly(k, 'up')
}, 'Bring the hands in front of the belly, palms up')
for (let round = 0; round < 3; round += 1) {
f.key(4.0, (k) => {
k.sink(0.03)
palmsAtBelly(k, 'up', { up: -0.2, fwd: 0.26 })
}, 'Breathe in: the palms float up to the chest')
f.key(1.2, (k) => {
palmsAtBelly(k, 'down', { up: -0.18, fwd: 0.27 })
}, 'Turn the palms down')
f.key(4.0, (k) => {
k.sink(0.07)
palmsAtBelly(k, 'down', { up: -0.44, fwd: 0.21 })
}, 'Breathe out: the palms sink, the knees soften')
f.key(1.2, (k) => {
palmsAtBelly(k, 'up', { up: -0.42, fwd: 0.2 })
}, 'Turn the palms up')
}
stepIn(f, 'Lower the arms and bring the left foot back')
}
// ── 2. Warm-up ─────────────────────────────────────────────────────────
function neck(f) {
stepOut(f)
f.key(3.0, (k) => {
k.look({ yaw: 60 })
}, 'Turn the head slowly to the left')
f.key(2.5, (k) => {
k.look('fwd')
}, 'Back to the centre')
f.key(3.0, (k) => {
k.look({ yaw: -60 })
}, 'Turn the head slowly to the right')
f.key(2.5, (k) => {
k.look('fwd')
}, 'Back to the centre')
f.key(3.0, (k) => {
k.look({ pitch: 35 })
}, 'Nod the chin gently toward the chest')
f.key(3.0, (k) => {
k.look({ pitch: -20 })
}, 'Lift the gaze gently, without dropping the head back')
f.key(2.5, (k) => {
k.look('fwd')
}, 'Eyes level again')
stepIn(f)
}
function armCircles(f) {
stepOut(f)
const front = { at: [0.18, -0.04, 0.5], palm: 'down', fingers: 'fwd', elbow: [0.3, -1, -0.3] }
const overhead = { at: [0.15, 0.54, 0.08], palm: 'mid', fingers: 'up', elbow: [0.6, -0.2, -0.4] }
const side = { at: [0.7, 0.0, 0.05], palm: 'down', fingers: 'out', elbow: [0, -1, -0.4] }
const low = { at: [0.2, -0.56, 0.08], palm: 'mid', fingers: 'down', elbow: [0.35, -1, -0.25] }
for (let round = 0; round < 2; round += 1) {
f.key(2.2, (k) => k.hands(front), round === 0 ? 'Shoulder circles: raise both arms forward' : null)
f.key(2.0, (k) => k.hands(overhead), round === 0 ? 'Continue up overhead' : null)
f.key(2.2, (k) => k.hands(side), round === 0 ? 'Open the arms out to the sides' : null)
f.key(2.0, (k) => k.hands(low), round === 0 ? 'Lower them and let the shoulders roll down' : null)
}
for (let round = 0; round < 2; round += 1) {
f.key(2.2, (k) => k.hands(side), round === 0 ? 'Now the other way: raise the arms out to the sides' : null)
f.key(2.0, (k) => k.hands(overhead), round === 0 ? 'Up overhead' : null)
f.key(2.2, (k) => k.hands(front), round === 0 ? 'Down in front' : null)
f.key(2.0, (k) => k.hands(low), round === 0 ? 'Relax the arms down' : null)
}
stepIn(f)
}
// One loose waist turn toward `side`: the arms swing round with the body.
function swing(k, side) {
const sign = side === 'L' ? 1 : -1
const other = side === 'L' ? 'R' : 'L'
k.chest(55 * sign)
k.hips(25 * sign)
k.load(side, 0.6)
k.hand(other, { at: [-0.1, -0.16, 0.3], palm: 'back', fingers: 'mid', shape: 'palm', elbow: [0.6, -1, 0] })
k.hand(side, { at: [0.22, -0.5, -0.12], palm: 'mid+fwd', fingers: 'down+back', shape: 'palm', elbow: [0.5, -1, -0.5] })
k.look({ yaw: 25 * sign })
}
// Passing through the centre between two swings, arms hanging wide.
function swingThrough(k) {
k.waist(0)
k.load(0.5)
k.hands({ at: [0.25, -0.52, 0.06], palm: 'mid', fingers: 'down', shape: 'palm', elbow: [0.35, -1, -0.25] })
k.look('fwd')
}
function waistTurns(f) {
stepOut(f, 0.4, 'Step out a little wider than the shoulders')
f.key(2.0, (k) => {
k.sink(0.06)
}, 'Soften the knees; keep the knees still as the waist turns')
for (let round = 0; round < 3; round += 1) {
f.key(2.0, (k) => swing(k, 'L'), round === 0 ? 'Turn the waist left; the arms swing loosely with it' : null)
f.key(1.3, swingThrough, round === 0 ? 'Through the centre, arms hanging' : null)
f.key(2.0, (k) => swing(k, 'R'), round === 0 ? 'Turn the waist right; the arms follow' : null)
f.key(1.3, swingThrough)
}
f.key(2.4, (k) => {
k.waist(0)
k.load(0.5)
armsHanging(k)
k.look('fwd')
}, 'Come back to the centre')
f.key(1.3, (k) => {
k.load('R')
k.sink(0.03)
}, 'Shift the weight onto the right foot')
f.key(1.3, (k) => {
k.place('L', { from: 'other', out: 0.1, pitch: -10 })
}, 'Bring the left foot back beside the right')
f.key(1.3, (k) => {
k.ground('L')
k.load(0.5)
k.sink(0)
handsDown(k)
}, 'Centre the weight and stand tall')
}
function kneeCircles(f) {
softenKnees(f, 0.03)
f.key(1.3, (k) => {
k.load('R')
}, 'Settle onto the right foot')
f.key(1.2, (k) => {
k.place('L', { from: 'other', out: 0.2, pitch: -10 })
}, 'Step out to hip width')
f.key(1.5, (k) => {
k.ground('L')
k.load(0.5)
k.sink(0.07)
handsOnHips(k)
}, 'Hands on the hips, knees soft')
const ring = [[0.045, 0], [0, 0.045], [-0.03, 0], [0, -0.045]]
for (let round = 0; round < 3; round += 1) {
ring.forEach(([fwd, side], index) => {
f.key(1.1, (k) => {
k.shift(fwd, side)
k.sink(0.07 + (fwd > 0 ? 0.02 : 0))
}, round === 0 && index === 0 ? 'Circle the knees: forward, left, back, right' : null)
})
}
for (let round = 0; round < 3; round += 1) {
[...ring].reverse().forEach(([fwd, side], index) => {
f.key(1.1, (k) => {
k.shift(fwd, side)
k.sink(0.07 + (fwd > 0 ? 0.02 : 0))
}, round === 0 && index === 0 ? 'And the other way round' : null)
})
}
f.key(1.5, (k) => {
k.shift(0, 0)
k.sink(0.02)
k.load('R')
armsHanging(k)
}, 'Settle and shift onto the right foot')
f.key(1.2, (k) => {
k.place('L', { from: 'other', out: 0.1, pitch: -10 })
}, 'Bring the left foot back')
f.key(1.3, (k) => {
k.ground('L')
k.load(0.5)
k.sink(0)
handsDown(k)
}, 'Stand tall')
}
// ── 3. Standing meditation ─────────────────────────────────────────────
function hugTheTree(f) {
const arms = (k, fwd, up = -0.15) => {
k.hands({ at: [0.15, up, fwd], palm: 'back+mid', fingers: 'mid', shape: 'palm', elbow: [0.9, -0.55, -0.1] })
}
stepOut(f)
f.key(2.5, (k) => {
k.sink(0.1)
palmsAtBelly(k, 'back', { up: -0.4, fwd: 0.22 })
}, 'Sink a little; bring the hands in front of the belly')
f.key(3.0, (k) => {
arms(k, 0.38)
}, 'Raise the arms into a circle at chest height, as if hugging a tree')
f.hold(2.0, 'Elbows soft and a little lower than the wrists; shoulders down')
for (let round = 0; round < 4; round += 1) {
f.key(4.0, (k) => {
k.sink(0.09)
arms(k, 0.41, -0.14)
}, round === 0 ? 'Breathe in: the circle of the arms swells slightly' : null)
f.key(4.0, (k) => {
k.sink(0.11)
arms(k, 0.37, -0.16)
}, round === 0 ? 'Breathe out: sink into the legs, let the arms settle' : null)
}
f.key(3.0, (k) => {
palmsAtBelly(k, 'down', { up: -0.42, fwd: 0.2 })
k.sink(0.06)
}, 'Lower the hands slowly to the belly')
stepIn(f)
}
// ── 4. Stances ─────────────────────────────────────────────────────────
function horseStance(f) {
softenKnees(f, 0.06)
f.key(1.4, (k) => {
k.load('R')
k.sink(0.12)
handsOnHips(k)
}, 'Shift onto the right leg and sink a little')
f.key(0.9, (k) => {
k.lift('L', 0.04, -12)
}, 'Lift the left foot')
f.key(1.6, (k) => {
k.place('L', { from: 'other', out: 0.46, turn: 8, pitch: -10 })
}, 'Step wide to the side, toes first')
f.key(2.2, (k) => {
k.ground('L')
k.load(0.5)
k.sink(0.19)
k.hands({ at: [0.12, -0.18, 0.36], palm: 'back+mid', fingers: 'mid', shape: 'palm', elbow: [0.9, -0.6, -0.1] })
}, 'Horse stance: weight even, knees over the toes, back upright')
f.hold(4.0, 'Hold: knees press gently outward, tailbone drops')
f.key(2.2, (k) => {
k.load('R')
k.sink(0.13)
handsOnHips(k)
}, 'Shift onto the right leg')
f.key(1.6, (k) => {
k.place('L', { from: 'other', out: 0.1, pitch: -10 })
}, 'Bring the left foot back')
f.key(1.5, (k) => {
k.ground('L')
k.load(0.5)
k.sink(0)
handsDown(k)
}, 'Stand tall')
}
// A bow stance with the left foot in front, from feet together and back.
function bowLeft(f) {
softenKnees(f)
f.key(1.3, (k) => {
k.load('L')
handsOnHips(k)
}, 'Shift onto the left foot')
f.key(1.0, (k) => {
k.toes('R', 45)
}, 'Turn the right toes out on the heel')
f.key(1.4, (k) => {
k.load('R')
k.sink(SINK)
}, 'Sit onto the right leg')
f.key(1.5, (k) => {
k.place('L', { from: 'other', fwd: STEP, out: TRACK, pitch: 18 })
}, 'Step the left heel forward, a little to the side')
f.key(2.2, (k) => {
k.ground('L')
k.load('L', 0.7)
pushPalm(k, 'L', { out: 0.16, up: -0.08, fwd: 0.46 })
pushPalm(k, 'R', { out: 0.16, up: -0.08, fwd: 0.46 })
}, 'Bow stance: 70% forward, front knee over the foot, back leg long')
f.hold(2.5, 'Hips and chest face forward; the back heel stays down')
f.key(2.2, (k) => {
k.load('R', 0.7)
k.hands({ at: [0.15, -0.3, 0.22], palm: 'fwd+down', fingers: 'up+fwd', shape: 'palm', elbow: [0.5, -1, -0.4] })
}, 'Sit back: 70% on the back leg')
f.key(2.2, (k) => {
k.load('L', 0.7)
pushPalm(k, 'L', { out: 0.16, up: -0.08, fwd: 0.46 })
pushPalm(k, 'R', { out: 0.16, up: -0.08, fwd: 0.46 })
}, 'And shift forward again')
f.key(2.0, (k) => {
k.load('R')
k.pitch('L', 15)
handsOnHips(k)
}, 'Sit all the way back; the front toes lift')
f.key(2.0, (k) => {
k.place('L', { from: 'other', out: 0.15, pitch: -10 })
}, 'Draw the left foot back beside the right')
f.key(1.3, (k) => {
k.ground('L')
k.load('L')
}, 'Shift onto the left foot')
f.key(1.0, (k) => {
k.toes('R', 0)
}, 'Turn the right toes back in')
f.key(1.4, (k) => {
k.load(0.5)
k.sink(0)
handsDown(k)
}, 'Centre and stand tall')
}
// An empty stance with the left foot in front: toes first, then heel.
function emptyLeft(f) {
softenKnees(f)
f.key(1.3, (k) => {
k.load('L')
}, 'Shift onto the left foot')
f.key(1.0, (k) => {
k.toes('R', 45)
}, 'Turn the right toes out on the heel')
f.key(1.5, (k) => {
k.load('R')
k.sink(0.12)
}, 'Sit onto the right leg')
f.key(1.6, (k) => {
k.place('L', { from: 'other', fwd: 0.3, out: 0.12, pitch: -16 })
k.hand('L', { at: [0.06, -0.04, 0.42], palm: 'mid', fingers: 'up+fwd', shape: 'palm', elbow: [0.4, -1, 0] })
k.hand('R', { at: [-0.02, -0.24, 0.24], palm: 'mid', fingers: 'up+fwd', shape: 'palm', elbow: [0.4, -1, -0.2] })
k.look('L')
}, 'Empty stance: the left toes touch lightly, all the weight stays back')
f.hold(3.0, 'The front foot carries no weight; it could lift at any moment')
f.key(1.4, (k) => {
k.lift('L', 0.03, -8)
}, 'Lift the front foot')
f.key(1.4, (k) => {
k.place('L', { from: 'self', pitch: 18 })
}, 'Set it down on the heel, toes raised')
f.hold(3.0, 'Heel empty stance, as in Play the Lute')
f.key(1.6, (k) => {
k.place('L', { from: 'other', out: 0.15, pitch: -10 })
k.look('fwd')
armsHanging(k)
}, 'Draw the left foot back')
f.key(1.3, (k) => {
k.ground('L')
k.load('L')
}, 'Shift onto the left foot')
f.key(1.0, (k) => {
k.toes('R', 0)
}, 'Turn the right toes back in')
f.key(1.4, (k) => {
k.load(0.5)
k.sink(0)
handsDown(k)
}, 'Centre and stand tall')
}
// Standing on the right leg with the left knee raised.
function singleLegLeft(f) {
softenKnees(f, 0.05)
f.key(1.5, (k) => {
k.load('R')
k.sink(0.06)
}, 'Shift all the weight onto the right foot')
f.key(1.3, (k) => {
k.place('L', { from: 'other', fwd: 0.08, out: 0.1, pitch: -20, lift: 0.16 })
k.hand('L', { at: [0.15, -0.34, 0.3], palm: 'mid', fingers: 'fwd', shape: 'palm', elbow: [0.3, -1, 0] })
pressByHip(k, 'R')
}, 'Raise the left knee; the left hand comes forward')
f.key(1.5, (k) => {
k.place('L', { from: 'other', fwd: 0.2, out: 0.1, pitch: -25, lift: 0.42 })
k.hand('L', { at: [0.12, 0.08, 0.32], palm: 'mid', fingers: 'up', shape: 'palm', elbow: [0.1, -1, 0.3] })
}, 'Knee at hip height; the left hand rises above it, fingers up')
f.hold(3.5, 'Standing leg soft, toes of the raised foot relaxed down')
f.key(1.4, (k) => {
k.place('L', { from: 'other', fwd: 0.08, out: 0.1, pitch: -18, lift: 0.14 })
k.hand('L', { at: [0.16, -0.34, 0.28], palm: 'mid', fingers: 'fwd', shape: 'palm', elbow: [0.3, -1, 0] })
}, 'Lower the knee; the hand comes down in front')
f.key(1.4, (k) => {
k.place('L', { from: 'other', fwd: 0.02, out: 0.1, pitch: -12, lift: 0.04 })
armsHanging(k)
}, 'Lower the foot slowly')
f.key(1.2, (k) => {
k.place('L', { from: 'other', out: 0.1, pitch: -8 })
}, 'Toes touch down beside the right foot')
f.key(1.4, (k) => {
k.ground('L')
k.load(0.5)
k.sink(0)
handsDown(k)
}, 'Centre and stand tall')
}
// Runs `drill` for the left, then mirrored for the right.
function bothSides(drill) {
return (f) => {
drill(f)
f.mirrored = true
drill(f)
f.mirrored = false
}
}
// ── 5. Stepping ────────────────────────────────────────────────────────
// One forward step with `side`, from the ball held on the other foot: heel
// first, shift forward, then turn the toes out and draw the back foot in.
function stepForward(f, side, first) {
const back = side === 'L' ? 'R' : 'L'
f.key(1.6, (k) => {
k.place(side, { from: 'other', fwd: STEP, out: TRACK, pitch: 18 })
}, first ? 'Step forward, heel first, like a cat: no weight yet' : null)
f.key(2.0, (k) => {
k.ground(side)
k.load(side, 0.7)
}, first ? 'Roll onto the foot and shift forward into a bow stance' : null)
f.key(1.2, (k) => {
k.load(back, 0.75)
k.pitch(side, 20)
}, first ? 'Sit back a little and raise the front toes' : null)
f.key(0.9, (k) => {
k.pivot(side, 45, 'heel')
}, first ? 'Turn the front toes out' : null)
f.key(1.4, (k) => {
k.ground(side)
k.load(side, 0.85)
}, first ? 'Shift forward onto the turned foot' : null)
f.key(1.7, (k) => {
k.load(side)
k.place(back, { from: 'other', out: 0.12, pitch: -22 })
}, first ? 'Draw the back foot in beside it, toes touching' : null)
}
function forwardStepping(f) {
softenKnees(f, 0.06)
f.key(1.5, (k) => {
k.load('R')
k.sink(SINK)
handsOnHips(k)
}, 'Hands on the hips; sit onto the right leg')
f.key(1.0, (k) => {
k.place('L', { from: 'other', out: 0.12, pitch: -22 })
}, 'Left toes touch beside the right foot')
stepForward(f, 'L', true)
stepForward(f, 'R', false)
stepForward(f, 'L', false)
stepForward(f, 'R', false)
f.key(1.4, (k) => {
k.ground('L')
k.load('L')
}, 'Set the left heel down and shift onto it')
f.key(1.0, (k) => {
k.toes('R', 0)
}, 'Turn the right toes back in')
f.key(1.5, (k) => {
k.load(0.5)
k.sink(0)
handsDown(k)
}, 'Centre and stand tall')
}
// One step backward with `side`: toes touch down behind, the heel lowers
// turning out, the weight sits back and the front foot straightens.
function stepBack(f, side, first) {
const front = side === 'L' ? 'R' : 'L'
f.key(1.0, (k) => {
k.lift(side, 0.05, -10)
}, first ? 'Lift the foot that carries no weight' : null)
f.key(1.6, (k) => {
k.place(side, { from: 'other', fwd: -0.42, out: 0.22, turn: 20, pitch: -20 })
}, first ? 'Step back and a little to the side, toes first' : null)
f.key(1.4, (k) => {
k.pivot(side, 25, 'ball')
k.pitch(side, 0)
}, first ? 'Lower the heel as the toes turn out' : null)
f.key(1.5, (k) => {
k.load(side)
}, first ? 'Sit back onto it' : null)
f.key(1.0, (k) => {
k.toes(front, 0, 'ball')
k.pitch(front, -14)
}, first ? 'The empty front foot straightens on its ball, heel light' : null)
}
function backwardStepping(f) {
softenKnees(f, 0.06)
f.key(1.5, (k) => {
k.load('R')
k.sink(SINK)
handsOnHips(k)
}, 'Hands on the hips; sit onto the right leg')
stepBack(f, 'L', true)
stepBack(f, 'R', false)
stepBack(f, 'L', false)
stepBack(f, 'R', false)
f.key(1.4, (k) => {
k.pitch('L', 0)
k.place('L', { from: 'other', fwd: 0, out: 0.16, pitch: -10 })
}, 'Draw the front foot back beside the other')
f.key(1.3, (k) => {
k.ground('L')
k.load('L')
}, 'Shift onto the left foot')
f.key(1.0, (k) => {
k.toes('R', 0)
}, 'Turn the right toes back in')
f.key(1.5, (k) => {
k.load(0.5)
k.sink(0)
handsDown(k)
}, 'Centre and stand tall')
}
function sideStepping(f) {
stepOut(f, SHOULDER_WIDTH)
f.key(1.5, (k) => {
k.sink(SINK)
handsOnHips(k)
}, 'Hands on the hips; sink into the legs')
for (let round = 0; round < 3; round += 1) {
const first = round === 0
f.key(1.5, (k) => {
k.load('R')
}, first ? 'Shift onto the right leg' : null)
f.key(1.6, (k) => {
k.place('L', { from: 'other', out: 0.48, pitch: -10 })
}, first ? 'Step the left foot out to the side, toes first' : null)
f.key(1.5, (k) => {
k.ground('L')
k.load('L')
}, first ? 'Lower the heel and shift onto the left leg' : null)
f.key(1.6, (k) => {
k.place('R', { from: 'other', out: 0.22, pitch: -10 })
}, first ? 'Bring the right foot in, feet parallel' : null)
f.key(1.2, (k) => {
k.ground('R')
k.load(0.5)
}, first ? 'Lower the heel; the height stays level' : null)
}
f.key(1.5, (k) => {
k.load('L')
k.sink(0.04)
}, 'Shift onto the left leg and rise a little')
f.key(1.2, (k) => {
k.place('R', { from: 'other', out: 0.1, pitch: -10 })
}, 'Bring the right foot beside the left')
f.key(1.4, (k) => {
k.ground('R')
k.load(0.5)
k.sink(0)
handsDown(k)
}, 'Centre and stand tall')
}
// ── 6. Hand shapes ─────────────────────────────────────────────────────
// A hand drawn back to the waist, palm up.
function palmAtWaist(k, side) {
k.hand(side, { at: [0.17, -0.46, 0.1], palm: 'up', fingers: 'fwd', shape: 'palm', elbow: [0.4, -1, -0.6] })
}
function fistAtWaist(k, side) {
k.hand(side, { at: [0.17, -0.45, 0.06], palm: 'up', fingers: 'fwd', shape: 'fist', elbow: [0.3, -1, -0.7] })
}
function palmDrill(f) {
stepOut(f)
f.key(2.2, (k) => {
k.sink(0.08)
palmAtWaist(k, 'L')
palmAtWaist(k, 'R')
}, 'Draw both hands to the waist, palms up')
f.key(2.2, (k) => {
k.hands({ at: [0.14, -0.1, 0.34], palm: 'fwd', fingers: 'up', shape: 'palm', elbow: [0.4, -1, -0.2] })
}, 'Tai Chi palm: fingers relaxed and slightly apart, wrist settled')
for (let round = 0; round < 2; round += 1) {
for (const side of ['R', 'L']) {
const other = side === 'L' ? 'R' : 'L'
f.key(2.4, (k) => {
k.waist(side === 'R' ? 15 : -15)
k.hand(side, { at: [0.02, -0.06, 0.52], palm: [0, -0.35, 1], fingers: [0, 1, 0.35], shape: 'palm', elbow: [0.4, -1, 0] })
palmAtWaist(k, other)
k.look(side)
}, round === 0 ? `Push the ${side === 'L' ? 'left' : 'right'} palm forward; the other returns to the waist` : null)
}
}
f.key(2.2, (k) => {
k.waist(0)
palmAtWaist(k, 'L')
palmAtWaist(k, 'R')
k.look('fwd')
}, 'Both hands back to the waist')
stepIn(f)
}
function fistDrill(f) {
stepOut(f)
f.key(2.2, (k) => {
k.sink(0.08)
fistAtWaist(k, 'L')
fistAtWaist(k, 'R')
}, 'Close the hands into loose fists at the waist')
for (let round = 0; round < 2; round += 1) {
for (const side of ['R', 'L']) {
const other = side === 'L' ? 'R' : 'L'
f.key(2.2, (k) => {
k.waist(side === 'R' ? 12 : -12)
k.hand(side, { at: [0.03, -0.16, 0.5], palm: 'mid', fingers: 'fwd', shape: 'fist', elbow: [0.3, -1, -0.2] })
fistAtWaist(k, other)
k.look('fwd')
}, round === 0 ? `Punch with the ${side === 'L' ? 'left' : 'right'}: the fist turns upright, never locked straight` : null)
}
}
f.key(2.2, (k) => {
k.waist(0)
fistAtWaist(k, 'L')
fistAtWaist(k, 'R')
}, 'Both fists back to the waist')
f.key(1.8, (k) => {
palmAtWaist(k, 'L')
palmAtWaist(k, 'R')
}, 'Open the hands')
stepIn(f)
}
function hookDrill(f) {
stepOut(f)
f.key(2.2, (k) => {
k.sink(0.08)
k.hand('R', { at: [0.1, -0.12, 0.36], palm: 'up', fingers: 'fwd', shape: 'palm', elbow: [0.4, -1, -0.2] })
palmAtWaist(k, 'L')
}, 'Raise the right hand in front, palm up')
f.key(2.2, (k) => {
k.hand('R', { at: [0.22, -0.08, 0.4], palm: 'back+mid', fingers: 'down+fwd', shape: 'hook', elbow: [0.4, -1, -0.2] })
}, 'Gather the fingertips together and let the wrist drop: the hook')
f.key(2.6, (k) => {
k.waist(-25)
k.hand('R', { at: [0.6, 0.0, 0.16], palm: 'back+mid', fingers: 'down', shape: 'hook', elbow: [0, -0.3, -1] })
k.look('R')
}, 'Extend the hook out to the right at shoulder height')
f.key(2.6, (k) => {
k.waist(10)
k.hand('L', { at: [0.1, -0.04, 0.46], palm: 'fwd+out', fingers: 'up', shape: 'palm', elbow: [0.4, -1, 0] })
k.look('L')
}, 'Turn left and push the left palm forward, as in Single Whip')
f.hold(2.0, 'Hook and palm stretch gently apart; shoulders stay down')
f.key(2.4, (k) => {
k.waist(0)
k.hand('R', { at: [0.2, -0.3, 0.3], palm: 'down', fingers: 'fwd', shape: 'palm', elbow: [0.4, -1, -0.3] })
k.hand('L', { at: [0.2, -0.3, 0.3], palm: 'down', fingers: 'fwd', shape: 'palm', elbow: [0.4, -1, -0.3] })
k.look('fwd')
}, 'Open the hook and bring both hands in front')
stepIn(f)
}
export const FOUNDATIONS = [
{
id: 'posture',
title: 'Posture and breathing',
summary: 'How to stand, and how the breath moves with the hands.',
drills: [
{ id: 'standing-posture', title: 'Standing posture', summary: 'Feet shoulder width, knees soft, crown lifted, arms relaxed.', view: 'front', build: standingPosture },
{ id: 'breathing', title: 'Breathing with the hands', summary: 'Palms rise with the in-breath and sink with the out-breath.', view: 'front', build: breathing },
],
},
{
id: 'warm-up',
title: 'Warm-up',
summary: 'Gentle loosening of the neck, shoulders, waist and knees.',
drills: [
{ id: 'neck', title: 'Neck turns and nods', summary: 'Slow head turns and nods, never forced.', view: 'front', build: neck },
{ id: 'arm-circles', title: 'Arm and shoulder circles', summary: 'Large slow arm circles, forward and back.', view: 'threeQuarter', build: armCircles },
{ id: 'waist-turns', title: 'Waist turns', summary: 'The waist turns, the arms swing loosely, the knees stay still.', view: 'front', build: waistTurns },
{ id: 'knee-circles', title: 'Knee circles', summary: 'Hands on the hips, small circles of the knees both ways.', view: 'threeQuarter', build: kneeCircles },
],
},
{
id: 'standing-meditation',
title: 'Standing meditation',
summary: 'Zhan zhuang: standing still with rounded arms and quiet breath.',
drills: [
{ id: 'hug-the-tree', title: 'Hug the tree', summary: 'Arms rounded at chest height, knees soft, breathing slowly.', view: 'threeQuarter', build: hugTheTree },
],
},
{
id: 'stances',
title: 'Stances',
summary: 'The stances every movement of the form is built from.',
drills: [
{ id: 'horse-stance', title: 'Horse stance', summary: 'Wide stance, weight even, knees over the toes.', view: 'front', build: horseStance },
{ id: 'bow-stance', title: 'Bow stance', summary: '70% on the bent front leg, back leg long; left, then right.', view: 'side', build: bothSides(bowLeft) },
{ id: 'empty-stance', title: 'Empty stance', summary: 'All the weight on the back leg, the front foot light; left, then right.', view: 'side', build: bothSides(emptyLeft) },
{ id: 'single-leg-stance', title: 'Single-leg stance', summary: 'Standing on one leg with the other knee raised; left, then right.', view: 'front', build: bothSides(singleLegLeft) },
],
},
{
id: 'stepping',
title: 'Stepping',
summary: 'Moving the weight completely before a foot moves.',
drills: [
{ id: 'forward-stepping', title: 'Forward stepping', summary: 'Cat step: heel first, shift, toes out, draw in.', view: 'side', build: forwardStepping },
{ id: 'backward-stepping', title: 'Backward stepping', summary: 'Toes first behind, heel turns out, sit back, as in Repulse the Monkey.', view: 'side', build: backwardStepping },
{ id: 'side-stepping', title: 'Side stepping', summary: 'Stepping sideways at one height, as in Cloud Hands.', view: 'front', build: sideStepping },
],
},
{
id: 'hand-shapes',
title: 'Hand shapes',
summary: 'The open palm, the fist and the hook.',
drills: [
{ id: 'palm', title: 'Open palm', summary: 'Alternating palm pushes with a small waist turn.', view: 'threeQuarter', build: palmDrill },
{ id: 'fist', title: 'Fist', summary: 'A loose fist punching from the waist, turning upright.', view: 'threeQuarter', build: fistDrill },
{ id: 'hook', title: 'Hook', summary: 'Fingertips gathered, wrist dropped, as in Single Whip.', view: 'threeQuarter', build: hookDrill },
],
},
]
+44
View File
@@ -0,0 +1,44 @@
// Hand shapes and positions that recur through the form.
//
// Positions are [out, up, fwd] metres from the point between the shoulders
// in the chest frame; `out` is toward the hand's own side, so a negative
// value crosses the midline.
export function other(side) {
return side === 'L' ? 'R' : 'L'
}
// Arms relaxed at the sides.
export function handsDown(k) {
k.hands({ at: [0.2, -0.58, 0.04], palm: 'mid', fingers: 'down', shape: 'palm', elbow: [0.35, -1, -0.25] })
}
// Holding a ball in front of the `side` chest: that hand on top palm down,
// the other hand underneath palm up.
export function holdBall(k, side, { size = 1, fwd = 0.27 } = {}) {
const top = side
const bottom = other(side)
k.hand(top, { at: [0.1, -0.13, fwd], palm: 'down', fingers: 'mid+fwd', shape: 'palm', elbow: [0.6, -1, -0.2] })
k.hand(bottom, { at: [-0.06, -0.13 - 0.3 * size, fwd - 0.02], palm: 'up', fingers: 'mid+fwd', shape: 'palm', elbow: [0.4, -1, -0.3] })
}
// A hand pressing down beside the hip, fingers forward.
export function pressByHip(k, side, { fwd = 0.14 } = {}) {
k.hand(side, { at: [0.22, -0.52, fwd], palm: 'down', fingers: 'fwd', shape: 'palm', elbow: [0.5, -1, -0.4] })
}
// A hand raised in front at eye level, palm obliquely up and in.
export function raiseToEyes(k, side, { out = 0.08, up = 0.1, fwd = 0.42 } = {}) {
k.hand(side, { at: [out, up, fwd], palm: [-0.55, 0.75, -0.3], fingers: 'fwd+up+out', shape: 'palm', elbow: [0.3, -1, 0] })
}
// A standing palm pushing forward, fingers up.
export function pushPalm(k, side, { out = 0.06, up = -0.04, fwd = 0.5 } = {}) {
k.hand(side, { at: [out, up, fwd], palm: 'fwd', fingers: 'up', shape: 'palm', elbow: [0.4, -1, 0] })
}
// Height and stance sizes for the reference figure. The form stays at one
// height once it has sunk: no bobbing up and down between movements.
export const SINK = 0.14
export const STEP = 0.48
export const TRACK = 0.2
+37
View File
@@ -0,0 +1,37 @@
// The 24-form in order, and the lessons that teach it.
//
// Facing (degrees, positive turns left) runs continuously through the
// form: the opening travels to the left (90), Grasp the Bird's Tail turns
// right to -90, Single Whip back to 90, the kicks turn round to 270, and
// Cross Hands returns to the starting direction (0, a full turn later).
import * as lesson1 from './lesson1.js'
import * as lesson2 from './lesson2.js'
import * as lesson3 from './lesson3.js'
import * as lesson4 from './lesson4.js'
import * as lesson5 from './lesson5.js'
import * as lesson6 from './lesson6.js'
import * as lesson7 from './lesson7.js'
import * as lesson8 from './lesson8.js'
const MODULES = [lesson1, lesson2, lesson3, lesson4, lesson5, lesson6, lesson7, lesson8]
const TITLES = [
'Opening',
'Brushing and repulsing',
'Grasp the Bird\'s Tail',
'Single Whip and Cloud Hands',
'Kicks and strikes',
'Snake Creeps Down',
'Shuttles, Needle and Fan',
'Closing',
]
export const LESSONS = MODULES.map((module, index) => ({
number: index + 1,
title: TITLES[index],
startPose: module.startPose ?? null,
moves: module.MOVES,
}))
export const FORM_MOVES = MODULES.flatMap((module) => module.MOVES)
+132
View File
@@ -0,0 +1,132 @@
// Lesson 1: Commencing, Part the Wild Horse's Mane, White Crane Spreads
// Its Wings. The form starts facing the audience; the first movements
// travel to the practitioner's left.
import { SINK, STEP, TRACK, holdBall, other, pressByHip, raiseToEyes } from './hands.js'
// 1. Commencing.
export function commencing(f) {
f.hold(2.0, 'Stand naturally: feet together, arms relaxed, eyes level')
f.key(1.3, (k) => {
k.load('R')
}, 'Settle the weight onto the right foot')
f.key(0.9, (k) => {
k.lift('L', 0.03, -12)
}, 'Lift the left heel, then the foot')
f.key(1.1, (k) => {
k.place('L', { from: 'R', out: 0.3, pitch: -10 })
}, 'Step out to shoulder width, toes first')
f.key(1.3, (k) => {
k.ground('L')
k.load(0.5)
}, 'Lower the heel and centre the weight')
f.key(3.2, (k) => {
k.hands({ at: [0.18, -0.02, 0.48], palm: 'down', fingers: 'fwd', elbow: [0.3, -1, -0.3] })
}, 'Float both arms up to shoulder height, palms down')
f.key(3.2, (k) => {
k.sink(0.1)
k.hands({ at: [0.17, -0.44, 0.25], palm: 'down', fingers: 'fwd', elbow: [0.45, -1, -0.45] })
}, 'Bend the knees and press the palms down to the belly')
}
// One Part the Wild Horse's Mane to `side`, starting from the ball held on
// the other side with the `side` foot drawn in.
function partMane(f, side, { turn = 0, backPivot = 0 } = {}) {
const back = other(side)
f.key(1.2, (k) => {
k.turn(turn)
k.place(side, { from: back, fwd: STEP, out: TRACK, pitch: 18 })
k.waist(side === 'L' ? -20 : 20)
}, `Step the ${side === 'L' ? 'left' : 'right'} heel out to the front`)
f.key(2.0, (k) => {
k.ground(side)
if (backPivot) {
k.pivot(back, backPivot, 'ball')
}
k.load(side, 0.7)
k.sink(SINK)
k.waist(0)
raiseToEyes(k, side)
pressByHip(k, back)
k.look(side)
}, 'Bow stance: the front hand opens to eye level, the back hand presses down')
}
// Sits back, turns the front toes out and gathers the ball on that side.
function gatherBall(f, side) {
const back = other(side)
f.key(1.2, (k) => {
k.load(back, 0.75)
k.pitch(side, 20)
k.waist(side === 'L' ? 8 : -8)
}, 'Sit back and raise the front toes')
f.key(0.8, (k) => {
k.pivot(side, 45, 'heel')
}, 'Turn the front toes out')
f.key(1.3, (k) => {
k.ground(side)
k.load(side, 0.8)
k.waist(side === 'L' ? 30 : -30)
holdBall(k, side)
k.look(side)
}, `Shift forward and hold the ball on the ${side === 'L' ? 'left' : 'right'}`)
f.key(1.7, (k) => {
k.load(side)
k.place(back, { from: side, out: 0.12, fwd: 0, pitch: -24 })
}, 'Draw the back foot in, toes touching')
}
// 2. Part the Wild Horse's Mane, left, right, left.
export function wildHorse(f) {
f.key(1.4, (k) => {
k.load('R')
k.sink(SINK)
k.waist(-30)
holdBall(k, 'R')
k.look('R')
}, 'Turn slightly right and hold the ball on the right')
f.key(1.0, (k) => {
k.place('L', { from: 'R', out: 0.12, pitch: -24 })
}, 'Draw the left foot in, toes touching')
// Turn to the left: the right heel pushes out behind the new direction.
partMane(f, 'L', { turn: 90, backPivot: -45 })
gatherBall(f, 'L')
partMane(f, 'R')
gatherBall(f, 'R')
partMane(f, 'L')
}
// 3. White Crane Spreads Its Wings.
export function whiteCrane(f) {
f.key(1.3, (k) => {
k.load('L', 0.95)
k.waist(20)
holdBall(k, 'L')
k.look('L')
}, 'Turn slightly left and hold the ball on the left')
f.key(1.0, (k) => {
k.load('L')
k.place('R', { from: 'L', fwd: -0.34, out: 0.12, turn: 45, pitch: -15 })
}, 'Bring the right foot a half step in behind')
f.key(1.2, (k) => {
k.ground('R')
k.load('R')
k.waist(-25)
k.hand('R', { at: [0.18, 0.08, 0.3], palm: 'mid+back', fingers: 'up+mid', elbow: [0.6, -1, 0] })
k.hand('L', { at: [0.15, -0.35, 0.28], palm: 'down', fingers: 'fwd+mid' })
k.look('R')
}, 'Sit back onto the right leg and turn slightly right')
f.key(1.8, (k) => {
k.place('L', { from: 'R', fwd: 0.3, out: 0.12, pitch: -16 })
k.waist(0)
k.hand('R', { at: [0.2, 0.22, 0.28], palm: 'mid+back', fingers: 'up+mid', elbow: [0.6, -1, 0] })
k.hand('L', { at: [0.2, -0.5, 0.18], palm: 'down', fingers: 'fwd' })
k.look('fwd')
}, 'Empty stance: right hand rises by the temple, left hand presses by the hip')
}
export const MOVES = [
{ id: 'commencing', number: 1, lesson: 1, title: 'Commencing', build: commencing, endFacing: 0 },
{ id: 'wild-horse', number: 2, lesson: 1, title: 'Part the Wild Horse\'s Mane', build: wildHorse, endFacing: 90 },
{ id: 'white-crane', number: 3, lesson: 1, title: 'White Crane Spreads Its Wings', build: whiteCrane, endFacing: 90 },
]
+167
View File
@@ -0,0 +1,167 @@
// Lesson 2: Brush Knee and Push, Play the Lute, Repulse the Monkey. The
// form keeps travelling toward 90; the monkey walks back along the same line.
import { STEP, TRACK, other, pressByHip, pushPalm } from './hands.js'
import { commencing, whiteCrane, wildHorse } from './lesson1.js'
import { Form } from '../src/form.js'
import { standingPose } from '../src/pose.js'
const TURN = { L: 1, R: -1 }
// A hand circled back to ear height beside the body, palm up.
function handBack(k, side) {
k.hand(side, { at: [0.38, 0.03, 0.0], palm: 'up+out', fingers: 'out+fwd', shape: 'palm', elbow: [0.4, -1, -0.5] })
}
// A hand bent by the ear, about to push.
function handByEar(k, side) {
k.hand(side, { at: [0.2, 0.08, 0.14], palm: 'fwd+mid', fingers: 'up+fwd', shape: 'palm', elbow: [0.5, -1, -0.2] })
}
// Gathers for a Brush Knee to `side`: the other hand circles back to the
// ear, this hand crosses in front of the other shoulder, the foot comes in.
function gatherBrush(f, side) {
const back = other(side)
f.key(1.2, (k) => {
k.load(back, 0.75)
k.pitch(side, 20)
k.waist(-8 * TURN[side])
}, 'Sit back and raise the front toes')
f.key(0.8, (k) => {
k.pivot(side, 45, 'heel')
}, 'Turn the front toes out')
f.key(1.3, (k) => {
k.ground(side)
k.load(side, 0.8)
k.waist(35 * TURN[side])
handBack(k, side)
k.hand(back, { at: [-0.06, -0.12, 0.28], palm: 'down', fingers: 'mid', shape: 'palm', elbow: [0.6, -1, -0.2] })
k.look(side)
}, 'Shift forward; one hand circles back to the ear, the other crosses in front')
f.key(1.6, (k) => {
k.load(side)
k.place(back, { from: side, out: 0.12, pitch: -24 })
}, 'Draw the back foot in, toes touching')
}
// One Brush Knee and Push leading with the `side` foot: the `side` hand
// brushes past the knee, the other hand pushes from the ear.
function brushKnee(f, side) {
const pusher = other(side)
f.key(1.2, (k) => {
k.place(side, { from: pusher, fwd: STEP, out: TRACK, pitch: 18 })
k.waist(20 * TURN[pusher])
handByEar(k, pusher)
k.hand(side, { at: [0.04, -0.34, 0.3], palm: 'down', fingers: 'mid+fwd', shape: 'palm', elbow: [0.5, -1, -0.3] })
}, `Step the ${side === 'L' ? 'left' : 'right'} heel forward; the hand by the ear bends`)
f.key(2.0, (k) => {
k.ground(side)
k.load(side, 0.7)
k.waist(0)
pushPalm(k, pusher)
pressByHip(k, side)
k.look('fwd')
}, 'Bow stance: push forward and brush past the knee to the hip')
}
// 4. Brush Knee and Push, left, right, left.
export function brushKneePush(f) {
f.key(1.2, (k) => {
k.waist(15)
k.hand('R', { at: [0.08, -0.12, 0.32], palm: 'down+mid', fingers: 'fwd+mid', elbow: [0.5, -1, -0.2] })
k.hand('L', { at: [0.26, -0.24, 0.24], palm: 'down+out', fingers: 'fwd', elbow: [0.5, -1, -0.2] })
}, 'Turn slightly left; the right hand starts to fall')
f.key(1.6, (k) => {
k.waist(-38)
handBack(k, 'R')
k.hand('L', { at: [-0.06, -0.12, 0.28], palm: 'down', fingers: 'mid', shape: 'palm', elbow: [0.6, -1, -0.2] })
k.place('L', { from: 'R', out: 0.12, pitch: -24 })
k.look('R')
}, 'Turn right: right hand circles back to the ear, left hand comes in front, left foot in')
brushKnee(f, 'L')
gatherBrush(f, 'L')
brushKnee(f, 'R')
gatherBrush(f, 'R')
brushKnee(f, 'L')
}
// 5. Play the Lute.
export function playLute(f) {
f.key(1.3, (k) => {
k.load('L')
k.place('R', { from: 'L', fwd: -0.34, out: 0.12, turn: 45, pitch: -15 })
k.hand('R', { at: [0.06, -0.06, 0.46], palm: 'fwd+down', fingers: 'up+fwd' })
}, 'The right foot follows a half step, toes first')
f.key(1.1, (k) => {
k.ground('R')
k.load('R')
k.waist(-20)
k.hand('L', { at: [0.18, -0.24, 0.32], palm: 'mid+up', fingers: 'fwd+up+out' })
k.hand('R', { at: [0.06, -0.08, 0.32], palm: 'mid+down', fingers: 'fwd+up' })
}, 'Sit back onto the right leg and turn slightly right')
f.key(1.8, (k) => {
k.place('L', { from: 'R', fwd: 0.32, out: 0.12, pitch: 18 })
k.waist(0)
k.hand('L', { at: [0.04, 0.1, 0.4], palm: 'mid', fingers: 'up+fwd', shape: 'palm', elbow: [0.3, -1, -0.2] })
k.hand('R', { at: [-0.02, -0.13, 0.22], palm: 'mid', fingers: 'up+fwd', shape: 'palm', elbow: [0.4, -1, -0.3] })
k.look('L')
}, 'Left heel forward: the hands hold the lute, left in front at nose height')
}
// One Repulse the Monkey: `side` steps back, the other hand pushes.
function repulse(f, side, first) {
const pusher = other(side)
f.key(1.0, (k) => {
k.waist(35 * TURN[pusher])
k.hand(pusher, { at: [0.26, -0.36, 0.14], palm: 'up', fingers: 'fwd+out', shape: 'palm', elbow: [0.4, -1, -0.4] })
k.hand(side, { at: [0.08, -0.04, 0.42], palm: 'up', fingers: 'fwd', shape: 'palm', elbow: [0.3, -1, -0.2] })
}, first ? 'Turn the palms up; the right hand drops past the hip' : 'Turn the palms up; the back hand drops past the hip')
f.key(1.1, (k) => {
k.waist(40 * TURN[pusher])
handBack(k, pusher)
k.look(pusher)
}, 'Circle it back and up to shoulder height, eyes following')
f.key(1.1, (k) => {
k.place(side, { from: pusher, out: 0.14, pitch: -15, lift: 0.05 })
k.waist(20 * TURN[pusher])
handByEar(k, pusher)
k.hand(side, { at: [0.12, -0.16, 0.34], palm: 'up', fingers: 'fwd', elbow: [0.3, -1, -0.3] })
k.look('fwd')
}, `Lift the ${side === 'L' ? 'left' : 'right'} foot past the standing foot`)
f.key(1.1, (k) => {
k.place(side, { from: pusher, fwd: -0.42, out: 0.18, turn: 40, pitch: -15 })
k.hand(side, { at: [0.18, -0.32, 0.22], palm: 'up', fingers: 'fwd', elbow: [0.3, -1, -0.4] })
}, 'Step back, landing on the ball of the foot')
f.key(1.9, (k) => {
k.ground(side)
k.load(side)
k.toes(pusher, 0, 'ball')
k.pitch(pusher, -10)
k.waist(0)
pushPalm(k, pusher)
k.hand(side, { at: [0.22, -0.42, 0.1], palm: 'up', fingers: 'fwd', elbow: [0.4, -1, -0.5] })
}, 'Sit back and straighten the front foot; push forward, draw the other hand to the hip')
}
// 6. Repulse the Monkey, four times.
export function repulseMonkey(f) {
repulse(f, 'L', true)
repulse(f, 'R', false)
repulse(f, 'L', false)
repulse(f, 'R', false)
}
export const MOVES = [
{ id: 'brush-knee', number: 4, lesson: 2, title: 'Brush Knee and Push', build: brushKneePush, endFacing: 90 },
{ id: 'play-lute', number: 5, lesson: 2, title: 'Play the Lute', build: playLute, endFacing: 90 },
{ id: 'repulse-monkey', number: 6, lesson: 2, title: 'Repulse the Monkey', build: repulseMonkey, endFacing: 90 },
]
// The end of lesson 1.
export function startPose() {
const form = new Form(standingPose())
commencing(form)
wildHorse(form)
whiteCrane(form)
return form.pose
}
+140
View File
@@ -0,0 +1,140 @@
// Lesson 3: Grasp the Bird's Tail, left (facing 90) and right (turning
// round to -90): ward off, roll back, press and push.
import { STEP, TRACK, holdBall, other, pressByHip } from './hands.js'
import { brushKneePush, playLute, repulseMonkey, startPose as lessonTwoStart } from './lesson2.js'
import { Form } from '../src/form.js'
const TURN = { L: 1, R: -1 }
// Ward off, roll back, press and push with the `side` foot and forearm
// leading, starting with the `side` heel stepping out from the ball held
// on the other side.
function graspTail(f, side) {
const back = other(side)
const turn = TURN[side]
f.key(1.2, (k) => {
k.place(side, { from: back, fwd: STEP, out: TRACK, pitch: 18 })
k.waist(-15 * turn)
}, `Step the ${side === 'L' ? 'left' : 'right'} heel out to the front`)
f.key(2.0, (k) => {
k.ground(side)
k.load(side, 0.7)
k.waist(0)
k.hand(side, { at: [-0.02, -0.07, 0.42], palm: 'back', fingers: 'mid', shape: 'palm', elbow: [1, -0.45, 0] })
pressByHip(k, back)
k.look(side)
}, 'Ward off: the forearm rounds forward at shoulder height, the other hand presses down')
// Roll back.
f.key(1.1, (k) => {
k.waist(12 * turn)
k.hand(side, { at: [0.07, -0.03, 0.5], palm: 'down+mid', fingers: 'fwd', elbow: [0.6, -1, 0] })
k.hand(back, { at: [-0.03, -0.14, 0.38], palm: 'up+mid', fingers: 'fwd+mid', shape: 'palm', elbow: [0.4, -1, -0.2] })
k.look('fwd')
}, 'Reach forward: front palm turns down, the other palm turns up beneath the forearm')
f.key(1.1, (k) => {
k.load(back, 0.6)
k.waist(-20 * turn)
k.hand(side, { at: [0.05, -0.3, 0.32], palm: 'back+down', fingers: 'mid+fwd', elbow: [0.6, -1, -0.2] })
k.hand(back, { at: [0.12, -0.38, 0.24], palm: 'up', fingers: 'fwd+mid', elbow: [0.4, -1, -0.3] })
k.look(back)
}, 'Roll back: sit back and draw both hands down past the belly')
f.key(1.2, (k) => {
k.load(back, 0.85)
k.waist(-45 * turn)
k.hand(side, { at: [0.0, -0.13, 0.27], palm: 'back', fingers: 'mid', elbow: [0.9, -0.6, 0] })
k.hand(back, { at: [0.37, 0.0, 0.0], palm: 'up+out', fingers: 'out+fwd', elbow: [0.4, -1, -0.5] })
}, 'The back hand circles up behind to shoulder height; the front forearm comes across the chest')
// Press.
f.key(1.2, (k) => {
k.waist(0)
k.hand(side, { at: [0.02, -0.12, 0.3], palm: 'back', fingers: 'mid', elbow: [0.9, -0.6, 0] })
k.hand(back, { at: [0.0, -0.1, 0.24], palm: 'fwd', fingers: 'up+mid', elbow: [0.5, -1, -0.3] })
k.look('fwd')
}, 'Turn to the front; the back palm comes to the inside of the front wrist')
f.key(1.8, (k) => {
k.load(side, 0.7)
k.hand(side, { at: [0.02, -0.1, 0.47] })
k.hand(back, { at: [0.0, -0.08, 0.41] })
}, 'Press: shift forward and press both hands out together')
// Push.
f.key(1.0, (k) => {
k.hand(side, { at: [0.14, -0.07, 0.46], palm: 'down', fingers: 'fwd', elbow: [0.5, -1, -0.1] })
k.hand(back, { at: [0.14, -0.07, 0.46], palm: 'down', fingers: 'fwd', elbow: [0.5, -1, -0.1] })
}, 'Turn both palms down and separate them to shoulder width')
f.key(1.6, (k) => {
k.load(back, 0.8)
k.pitch(side, 16)
k.hands({ at: [0.15, -0.33, 0.24], palm: 'fwd+down', fingers: 'up+fwd', elbow: [0.5, -1, -0.4] })
}, 'Sit back, front toes up, and draw the hands back to the belly')
f.key(2.0, (k) => {
k.ground(side)
k.load(side, 0.7)
k.hands({ at: [0.15, -0.04, 0.48], palm: 'fwd', fingers: 'up', elbow: [0.45, -1, -0.1] })
}, 'Push: shift forward and push both palms out at shoulder height')
}
// 7. Grasp the Bird's Tail, left.
export function graspLeft(f) {
f.key(1.3, (k) => {
k.waist(-40)
k.hand('R', { at: [0.37, 0.02, 0.0], palm: 'up+out', fingers: 'out+fwd', shape: 'palm', elbow: [0.4, -1, -0.5] })
k.hand('L', { at: [0.1, -0.08, 0.4], palm: 'down', fingers: 'fwd+mid', shape: 'palm' })
k.look('R')
}, 'Turn right: the right hand circles back and up, palm up')
f.key(1.5, (k) => {
k.waist(-30)
holdBall(k, 'R')
k.load('R')
k.place('L', { from: 'R', out: 0.12, pitch: -24 })
}, 'Hold the ball on the right and draw the left foot in')
graspTail(f, 'L')
}
// 8. Grasp the Bird's Tail, right: turn round to the right first.
export function graspRight(f) {
f.key(1.3, (k) => {
k.load('R', 0.85)
k.pitch('L', 16)
k.waist(-40)
k.hand('R', { at: [0.3, -0.04, 0.4], palm: 'out+fwd', fingers: 'up+out', elbow: [0.5, -1, 0] })
k.hand('L', { at: [0.18, -0.08, 0.42], palm: 'fwd+out', fingers: 'up', elbow: [0.5, -1, 0] })
k.look('R')
}, 'Sit back, raise the left toes and turn right')
f.key(1.4, (k) => {
k.turn(-90)
k.pivot('L', -135, 'heel')
k.waist(-40)
k.hand('R', { at: [0.45, -0.02, 0.22], palm: 'out+fwd', fingers: 'up+out', elbow: [0.5, -1, 0] })
}, 'Turn the left toes in; the right hand sweeps out to the right')
f.key(1.4, (k) => {
k.ground('L')
k.load('L', 0.9)
k.turn(-90)
k.waist(45)
holdBall(k, 'L')
k.look('L')
}, 'Shift onto the left leg and hold the ball on the left')
f.key(1.6, (k) => {
k.load('L')
k.place('R', { from: 'L', out: 0.12, pitch: -24 })
}, 'Draw the right foot in, toes touching')
graspTail(f, 'R')
}
export const MOVES = [
{ id: 'grasp-left', number: 7, lesson: 3, title: 'Grasp the Bird\'s Tail, Left', build: graspLeft, endFacing: 90 },
{ id: 'grasp-right', number: 8, lesson: 3, title: 'Grasp the Bird\'s Tail, Right', build: graspRight, endFacing: -90 },
]
// The end of lesson 2.
export function startPose() {
const form = new Form(lessonTwoStart())
brushKneePush(form)
playLute(form)
repulseMonkey(form)
return form.pose
}
+163
View File
@@ -0,0 +1,163 @@
// Lesson 4: Single Whip, Wave Hands Like Clouds, Single Whip. Single Whip
// turns back to 90; Cloud Hands face the front (0) and step sideways
// toward 90.
import { STEP, TRACK } from './hands.js'
import { graspLeft, graspRight, startPose as lessonThreeStart } from './lesson3.js'
import { Form } from '../src/form.js'
// The right hand gathers into a hook out to the right; the left hand
// arrives in front of the right shoulder; the left foot comes in.
function hookAndGather(f, { turnToStep }) {
f.key(1.2, (k) => {
k.load('R', 0.85)
k.waist(-30)
k.hand('R', { at: [0.55, -0.02, 0.24], palm: 'out+fwd', fingers: 'up+out', shape: 'palm', elbow: [0.4, -1, 0] })
k.hand('L', { at: [-0.02, -0.3, 0.28], palm: 'back+up', fingers: 'mid', shape: 'palm', elbow: [0.5, -1, -0.3] })
k.look('R')
}, 'Turn right: the right hand sweeps out to the right, the left hand passes the belly')
f.key(1.0, (k) => {
k.load('R')
k.waist(-35)
k.hand('R', { at: [0.66, -0.02, 0.2], palm: 'back+mid', fingers: 'down', shape: 'hook', elbow: [0.3, -1, 0] })
k.hand('L', { at: [-0.12, -0.11, 0.28], palm: 'back', fingers: 'up+mid', shape: 'palm', elbow: [0.6, -1, -0.2] })
k.look('L')
}, 'The right hand gathers into a hook; the left hand comes to the right shoulder')
f.key(1.0, (k) => {
k.turn(turnToStep)
k.waist(-35 - turnToStep)
k.place('L', { from: 'R', out: 0.14, pitch: -24 })
}, 'Draw the left foot in, toes touching')
}
// Steps out into Single Whip toward the facing direction.
function openWhip(f, { backPivot = 0 } = {}) {
f.key(1.2, (k) => {
k.place('L', { from: 'R', fwd: STEP, out: TRACK, pitch: 18 })
k.waist(-35)
k.look('L')
}, 'Turn left and step the left heel out to the front')
f.key(2.2, (k) => {
k.ground('L')
if (backPivot) {
k.pivot('R', backPivot, 'ball')
}
k.load('L', 0.7)
k.hips(-10)
k.chest(-15)
k.hand('L', { at: [0.1, -0.03, 0.48], palm: 'fwd+out', fingers: 'up', shape: 'palm', elbow: [0.4, -1, 0] })
k.hand('R', { at: [0.66, -0.02, 0.2], palm: 'back+mid', fingers: 'down', shape: 'hook', elbow: [0.3, -1, 0] })
}, 'Bow stance: the left palm turns and pushes forward, the hook stays out to the right')
}
// 9. Single Whip, from Grasp the Bird's Tail on the right.
export function singleWhip(f) {
f.key(1.3, (k) => {
k.load('L', 0.85)
k.pitch('R', 16)
k.waist(25)
k.hand('L', { at: [0.2, -0.06, 0.42], palm: 'fwd+out', fingers: 'up', elbow: [0.5, -1, 0] })
k.hand('R', { at: [0.12, -0.16, 0.42], palm: 'down+mid', fingers: 'fwd', elbow: [0.5, -1, 0] })
k.look('L')
}, 'Sit back onto the left leg, raise the right toes and turn left')
f.key(1.5, (k) => {
k.turn(90)
k.pivot('R', -135, 'heel')
k.waist(35)
k.hand('L', { at: [0.45, -0.03, 0.24], palm: 'out+fwd', fingers: 'up+out', elbow: [0.4, -1, 0] })
k.hand('R', { at: [-0.1, -0.36, 0.22], palm: 'up+back', fingers: 'mid', elbow: [0.5, -1, -0.3] })
}, 'Turn the right toes in; the left hand sweeps left, the right hand passes the belly')
f.key(1.0, (k) => {
k.ground('R')
k.load('R', 0.6)
k.waist(0)
k.hand('R', { at: [0.24, -0.2, 0.32], palm: 'back+out', fingers: 'up+mid' })
k.hand('L', { at: [0.12, -0.3, 0.3], palm: 'back', fingers: 'mid+up' })
k.look('R')
}, 'Shift the weight back toward the right leg')
hookAndGather(f, { turnToStep: 90 })
openWhip(f)
}
// One Cloud Hands turn to `side`: that hand passes in front of the face and
// turns out, the other hand passes the belly and rises to the shoulder.
function cloudTurn(f, side) {
const sign = side === 'L' ? 1 : -1
const lower = side === 'L' ? 'R' : 'L'
f.key(1.3, (k) => {
k.ground('L')
k.ground('R')
k.load(0.5)
k.waist(0)
k.hand(side, { at: [0.03, 0.05, 0.32], palm: 'back', fingers: 'up+mid', shape: 'palm', elbow: [0.6, -1, -0.2] })
k.hand(lower, { at: [0.02, -0.42, 0.26], palm: 'back+up', fingers: 'mid+down', shape: 'palm', elbow: [0.4, -1, -0.3] })
k.look(side)
}, `Turn ${side === 'L' ? 'left' : 'right'}: the upper hand passes in front of the face, the lower hand past the belly`)
f.key(1.3, (k) => {
k.load(side)
k.waist(40 * sign)
k.hand(side, { at: [0.25, -0.02, 0.32], palm: 'out+fwd', fingers: 'up+mid' })
k.hand(lower, { at: [-0.12, -0.12, 0.3], palm: 'back', fingers: 'up+mid' })
}, 'Weight across; the upper palm turns out, the lower hand rises to the shoulder')
}
// 10. Wave Hands Like Clouds, three times.
export function cloudHands(f) {
f.key(1.3, (k) => {
k.load('R', 0.8)
k.pitch('L', 16)
k.waist(-25)
k.hand('R', { at: [0.6, -0.02, 0.22], palm: 'out+fwd', fingers: 'up+out', shape: 'palm', elbow: [0.4, -1, 0] })
}, 'Shift the weight right, raise the left toes and open the hook')
f.key(1.4, (k) => {
k.turn(-90)
k.toes('L', 0)
k.waist(-35)
k.hand('L', { at: [-0.12, -0.12, 0.3], palm: 'back', fingers: 'up+mid', shape: 'palm', elbow: [0.6, -1, -0.2] })
k.hand('R', { at: [0.25, -0.02, 0.32], palm: 'out+fwd', fingers: 'up+mid', shape: 'palm', elbow: [0.5, -1, -0.1] })
k.look('R')
}, 'Turn the left toes in to face the front; the hook opens, the left hand rises to the right shoulder')
for (let round = 0; round < 3; round += 1) {
cloudTurn(f, 'L')
f.key(1.5, (k) => {
k.place('R', { from: 'L', out: 0.17, pitch: -12 })
}, 'Bring the right foot in beside the left, toes first')
if (round < 2) {
cloudTurn(f, 'R')
f.key(1.5, (k) => {
k.place('L', { from: 'R', out: 0.42, pitch: -12 })
}, 'Step the left foot out to the side, toes first')
}
}
f.key(0.9, (k) => {
k.ground('R')
k.load(0.5)
}, 'Set the right foot down')
}
// 11. Single Whip, from Cloud Hands.
export function singleWhipAgain(f) {
f.key(1.3, (k) => {
k.load('R', 0.7)
k.waist(-10)
k.hand('R', { at: [0.1, 0.03, 0.32], palm: 'back', fingers: 'up+mid', elbow: [0.6, -1, -0.2] })
k.hand('L', { at: [0.04, -0.4, 0.26], palm: 'back+up', fingers: 'mid+down', elbow: [0.4, -1, -0.3] })
k.look('R')
}, 'Turn right; the right hand passes in front of the face')
hookAndGather(f, { turnToStep: 90 })
openWhip(f, { backPivot: -45 })
}
export const MOVES = [
{ id: 'single-whip', number: 9, lesson: 4, title: 'Single Whip', build: singleWhip, endFacing: 90 },
{ id: 'cloud-hands', number: 10, lesson: 4, title: 'Wave Hands Like Clouds', build: cloudHands, endFacing: 0 },
{ id: 'single-whip-again', number: 11, lesson: 4, title: 'Single Whip', build: singleWhipAgain, endFacing: 90 },
]
// The end of lesson 3.
export function startPose() {
const form = new Form(lessonThreeStart())
graspLeft(form)
graspRight(form)
return form.pose
}
+178
View File
@@ -0,0 +1,178 @@
// Lesson 5: High Pat on Horse, Kick with Right Heel, Strike the Opponent's
// Ears with Both Fists, Turn and Kick with Left Heel. It starts from Single
// Whip facing 90, kicks to the right-front, strikes facing 60, then turns
// round to the left to kick facing 270.
import { SINK, STEP, TRACK } from './hands.js'
import { singleWhipPose } from './boundaries.js'
// Standing a little taller on one leg for the kicks.
const KICK_SINK = 0.06
// Wrists crossed in front of the chest, `outer` hand on the outside, both
// palms facing the body.
function crossHands(k, outer) {
const inner = outer === 'L' ? 'R' : 'L'
k.hand(outer, { at: [-0.03, -0.1, 0.31], palm: 'back+mid', fingers: 'up+mid', shape: 'palm', elbow: [0.7, -1, -0.2] })
k.hand(inner, { at: [-0.02, -0.13, 0.25], palm: 'back+mid', fingers: 'up+mid', shape: 'palm', elbow: [0.7, -1, -0.2] })
}
// Both arms opened out at shoulder height, elbows soft, palms facing out;
// the `kick` side arm reaches over the kicking leg.
function spreadArms(k, kick) {
const back = kick === 'L' ? 'R' : 'L'
k.hand(kick, { at: [0.42, 0.02, 0.36], palm: 'out+fwd', fingers: 'up', shape: 'palm', elbow: [0.4, -1, -0.2] })
k.hand(back, { at: [0.56, 0.02, 0.02], palm: 'out', fingers: 'up', shape: 'palm', elbow: [0.3, -1, -0.3] })
}
// Arms circling out and down at the sides, palms turned down and out.
function circleDown(k) {
k.hands({ at: [0.42, -0.22, 0.3], palm: 'down+out', fingers: 'fwd+out', shape: 'palm', elbow: [0.5, -1, -0.3] })
}
// 12. High Pat on Horse.
export function highPat(f) {
f.key(2.0, (k) => {
k.load('L')
k.sink(0.12)
k.place('R', { from: 'L', fwd: -0.3, out: 0.15, turn: 45 })
}, 'Bring the right foot a half step forward')
f.key(2.2, (k) => {
k.load('R')
k.sink(SINK)
k.pitch('L', -14)
k.waist(-22)
k.hand('R', { at: [0.42, 0.02, 0.3], palm: 'up', fingers: 'out+fwd', shape: 'palm', elbow: [0.3, -1, -0.3] })
k.hand('L', { at: [0.1, -0.06, 0.46], palm: 'up', fingers: 'fwd', shape: 'palm', elbow: [0.3, -1, 0] })
k.look({ yaw: 15 })
}, 'Sit back onto the right leg; open the hook and turn both palms up')
f.key(3.0, (k) => {
k.place('L', { from: 'R', fwd: 0.33, out: 0.12, pitch: -18 })
k.waist(0)
k.hand('R', { at: [0.03, 0.1, 0.46], palm: 'fwd+down', fingers: 'up+mid+fwd', shape: 'palm', elbow: [0.5, -1, -0.2] })
k.hand('L', { at: [0.16, -0.5, 0.14], palm: 'up', fingers: 'fwd+mid', shape: 'palm', elbow: [0.5, -1, -0.4] })
k.look('R')
}, 'Turn back to the front: the right palm pats forward past the ear, the left draws to the waist')
}
// 13. Kick with Right Heel.
export function rightHeelKick(f) {
f.key(2.0, (k) => {
k.hand('L', { at: [0.0, 0.04, 0.42], palm: 'up+mid', fingers: 'fwd+mid', shape: 'palm', elbow: [0.4, -1, 0] })
k.hand('R', { at: [0.02, 0.07, 0.47], palm: 'down+fwd', fingers: 'fwd+mid', shape: 'palm', elbow: [0.5, -1, -0.2] })
k.look('fwd')
}, 'Reach the left hand forward under the right wrist; the hands cross')
f.key(2.4, (k) => {
k.place('L', { from: 'R', fwd: 0.48, out: 0.24, turn: 20, pitch: 18 })
k.waist(10)
k.hands({ at: [0.4, 0.0, 0.38], palm: [0.7, -0.5, 0.2], fingers: [0.55, 0.35, 0.75], shape: 'palm', elbow: [0.5, -1, -0.2] })
}, 'Separate the hands; step the left heel out to the left-front')
f.key(2.2, (k) => {
k.ground('L')
k.load('L', 0.75)
k.sink(SINK)
k.waist(0)
circleDown(k)
}, 'Shift forward into a left bow stance as the hands circle down')
f.key(2.4, (k) => {
k.load('L')
k.place('R', { from: 'L', fwd: 0.0, out: 0.16, turn: 30, pitch: -24 })
crossHands(k, 'R')
k.look({ yaw: -30 })
}, 'Draw the right foot in, toes touching; cross the wrists at the chest, right hand outside')
f.key(2.2, (k) => {
k.sink(KICK_SINK)
k.place('R', { from: 'L', fwd: 0.16, out: 0.2, turn: 30, pitch: -20, lift: 0.34 })
}, 'Stand up on the left leg and lift the right knee')
f.key(3.2, (k) => {
k.place('R', { from: 'L', fwd: 0.66, out: 0.48, turn: 30, pitch: 22, lift: 0.6 })
k.chest(-18)
k.hips(-8)
spreadArms(k, 'R')
k.look('R')
}, 'Open both arms and press the right heel out slowly to the right-front')
f.hold(1.2, 'Hold the kick: arms level, right arm over the right leg')
}
// 14. Strike the Opponent's Ears with Both Fists.
export function strikeEars(f) {
f.key(2.4, (k) => {
k.place('R', { from: 'L', fwd: 0.24, out: 0.24, turn: 30, pitch: -20, lift: 0.34 })
k.chest(-25)
k.hips(-15)
k.lean(8)
k.hand('R', { at: [0.22, -0.36, 0.38], palm: 'up', fingers: 'fwd', shape: 'palm', elbow: [0.4, -1, -0.3] })
k.hand('L', { at: [0.0, -0.36, 0.36], palm: 'up', fingers: 'fwd', shape: 'palm', elbow: [0.6, -1, -0.3] })
k.look('fwd')
}, 'Draw the right leg back, knee up; both palms turn up and come down beside the knee')
f.key(2.2, (k) => {
k.turn(-30)
k.lean(0)
k.sink(SINK)
k.place('R', { from: 'L', fwd: STEP, out: TRACK, pitch: 18 })
k.waist(0)
k.hands({ at: [0.28, -0.46, 0.18], palm: 'up+mid', fingers: 'fwd', shape: [0.6, 0.4, 0], elbow: [0.5, -1, -0.4] })
}, 'Step the right heel down to the right-front; the hands drop to the sides')
f.key(3.2, (k) => {
k.ground('R')
k.load('R', 0.7)
k.hands({ at: [0.09, 0.12, 0.42], palm: 'out+down', fingers: 'fwd+mid+up', shape: 'fist', elbow: [0.7, -1, -0.1] })
k.look('fwd')
}, 'Bow stance: the fists circle up and in to ear height, like pincers')
}
// 15. Turn and Kick with Left Heel. The body turns round to the left to
// face 240; the left heel kicks 30° further left, along 270, where the
// form continues.
export function turnLeftHeelKick(f) {
f.key(2.2, (k) => {
k.load('L', 0.8)
k.pitch('R', 22)
k.waist(15)
k.hands({ at: [0.3, 0.06, 0.4], palm: 'fwd', fingers: 'up+out', shape: 'palm', elbow: [0.5, -1, -0.2] })
}, 'Sit back onto the left leg and raise the right toes; the fists open')
f.key(2.8, (k) => {
k.pivot('R', -120, 'heel')
k.turn(150)
k.waist(0)
k.hands({ at: [0.55, 0.0, 0.2], palm: 'fwd+out', fingers: 'up+out', shape: 'palm', elbow: [0.4, -1, -0.3] })
k.look('L')
}, 'Hook the right toes in and turn to the left; the arms open to the sides')
f.key(1.4, (k) => {
k.ground('R')
k.load('R', 0.6)
k.waist(-10)
}, 'Set the right foot down and shift toward it')
f.key(2.6, (k) => {
k.turn(30)
k.load('R')
k.waist(0)
k.place('L', { from: 'R', fwd: 0.02, out: 0.2, pitch: -24 })
crossHands(k, 'L')
k.look({ yaw: 30 })
}, 'Weight onto the right leg; draw the left foot in and cross the wrists, left hand outside')
f.key(2.2, (k) => {
k.sink(KICK_SINK)
k.place('L', { from: 'R', fwd: 0.16, out: 0.22, turn: 30, pitch: -20, lift: 0.34 })
}, 'Stand up on the right leg and lift the left knee')
f.key(3.2, (k) => {
k.turn(30)
k.place('L', { from: 'R', fwd: 0.8, out: 0.2, turn: 0, pitch: 22, lift: 0.6 })
k.chest(-12)
k.hips(-22)
spreadArms(k, 'L')
k.look('L')
}, 'Open both arms and press the left heel out slowly to the left-front')
f.hold(1.2, 'Hold the kick: arms level, left arm over the left leg')
}
export const MOVES = [
{ id: 'high-pat', number: 12, lesson: 5, title: 'High Pat on Horse', build: highPat, endFacing: 90 },
{ id: 'right-heel-kick', number: 13, lesson: 5, title: 'Kick with Right Heel', build: rightHeelKick, endFacing: 90 },
{ id: 'strike-ears', number: 14, lesson: 5, title: 'Strike the Ears with Both Fists', build: strikeEars, endFacing: 60 },
{ id: 'turn-left-heel-kick', number: 15, lesson: 5, title: 'Turn and Kick with Left Heel', build: turnLeftHeelKick, endFacing: 270 },
]
export function startPose() {
return singleWhipPose()
}
+139
View File
@@ -0,0 +1,139 @@
// Lesson 6: Push Down and Stand on One Leg (Snake Creeps Down and Golden
// Rooster), left and right. Both crouches stretch a leg out along 270,
// the line the form travels; the body faces across the line while low and
// turns into it as it rises.
import { Form } from '../src/form.js'
import { pressByHip } from './hands.js'
import { singleWhipPose } from './boundaries.js'
import { MOVES as LESSON_5 } from './lesson5.js'
const CROUCH_SINK = 0.44
const RISING_SINK = 0.26
const LONG_BOW_SINK = 0.24
const ROOSTER_SINK = 0.06
// A hook hand held out to the `side`, fingertips pointing down.
function hook(k, side, at = [0.68, -0.06, 0.18]) {
k.hand(side, { at, palm: 'back+mid', fingers: 'down', shape: 'hook', elbow: [0.5, -0.7, -0.6] })
}
// One Snake Creeps Down and Golden Rooster. `low` is the leg that
// stretches out along the line; `stand` is the crouching leg. The body
// faces across the line, turned 80° toward the standing side's
// direction (`across`: -1 turns right, +1 turns left).
function snakeAndRooster(f, low, across) {
const stand = low === 'L' ? 'R' : 'L'
const lowName = low === 'L' ? 'left' : 'right'
const standName = stand === 'L' ? 'left' : 'right'
f.key(3.2, (k) => {
k.deep(true)
k.sink(CROUCH_SINK)
k.load(stand)
k.pitch(stand, 0)
k.place(low, { from: stand, fwd: 0.76, out: 0.08, turn: -80 })
k.lean(15)
k.chest(across * 70)
k.hips(across * 75)
k.hand(low, { at: [0.05, -0.36, 0.3], palm: 'out', fingers: 'down+fwd', shape: 'palm', elbow: [0.4, -1, -0.2] })
k.look(stand)
}, `Crouch on the ${standName} leg and stretch the ${lowName} leg out along the line`)
f.key(2.8, (k) => {
k.load(stand, 0.82)
k.lean(20)
k.chest(across * 30)
k.hips(across * 50)
k.hand(low, { at: [0.08, -0.4, 0.4], palm: 'mid', fingers: 'fwd', shape: 'palm', elbow: [0.3, -1, 0] })
hook(k, stand, [0.64, -0.02, -0.25])
k.look(low)
}, `Thread the ${lowName} hand forward along the inside of the ${lowName} leg`)
f.key(0.9, (k) => {
k.pitch(low, 18)
k.load(low, 0.3)
k.lean(16)
}, `Raise the ${lowName} toes`)
f.key(2.0, (k) => {
k.pivot(low, 80, 'heel')
k.pitch(stand, 10)
k.load(low, 0.5)
k.sink(RISING_SINK)
k.lean(10)
k.chest(across * 10)
k.hips(across * 25)
k.hand(low, { at: [0.08, -0.12, 0.5], palm: 'mid', fingers: 'up+fwd', shape: 'palm', elbow: [0.4, -1, 0] })
k.hand(stand, { at: [0.28, -0.34, -0.22], palm: 'up+mid', fingers: 'back+up', shape: 'hook', elbow: [0.3, -1, -0.2] })
}, `Turn the ${lowName} toes out and rise forward`)
f.key(2.2, (k) => {
k.deep(false)
k.ground(low)
k.pivot(stand, -45, 'heel')
k.ground(stand)
k.load(low, 0.75)
k.sink(LONG_BOW_SINK)
k.lean(0)
k.waist(0)
k.hand(low, { at: [0.08, -0.02, 0.48], palm: 'mid+fwd', fingers: 'up', shape: 'palm', elbow: [0.4, -1, 0] })
k.hand(stand, { at: [0.3, -0.3, -0.24], palm: 'up+mid', fingers: 'back+up', shape: 'hook', elbow: [0.3, -1, -0.2] })
k.look(low)
}, `Bow onto the ${lowName} leg and hook the ${standName} toes in`)
f.key(0.9, (k) => {
k.load(low)
k.sink(0.2)
}, `Settle all the weight onto the ${lowName} leg`)
f.key(3.0, (k) => {
k.sink(ROOSTER_SINK)
k.place(stand, { from: low, fwd: 0.16, out: 0.1, pitch: -25, lift: 0.36 })
k.hand(stand, { at: [0.12, 0.08, 0.32], palm: 'mid', fingers: 'up', shape: 'palm', elbow: [0.1, -1, 0.3] })
pressByHip(k, low)
k.look('fwd')
}, `Golden Rooster: stand on the ${lowName} leg, ${standName} knee and hand rise together`)
f.hold(1.0, 'Stand tall and still on one leg')
}
// 16. Push Down and Stand on One Leg, left.
export function snakeLeft(f) {
f.key(2.4, (k) => {
k.sink(0.12)
k.place('L', { from: 'R', fwd: 0.1, out: 0.22, turn: -30, pitch: -20, lift: 0.3 })
k.chest(-80)
k.hips(-60)
hook(k, 'R')
k.hand('L', { at: [-0.12, -0.02, 0.24], palm: 'back+out', fingers: 'up+mid', shape: 'palm', elbow: [0.6, -1, -0.2] })
k.look('R')
}, 'Draw the left leg back bent; turn right and form the right hook')
snakeAndRooster(f, 'L', -1)
}
// 17. Push Down and Stand on One Leg, right.
export function snakeRight(f) {
f.key(2.2, (k) => {
k.sink(0.1)
k.place('R', { from: 'L', fwd: 0.3, out: 0.25, pitch: -15 })
k.pitch('L', -6)
k.hand('R', { at: [0.2, -0.1, 0.3], palm: 'mid+down', fingers: 'fwd+up', shape: 'palm', elbow: [0.3, -1, -0.2] })
k.hand('L', { at: [0.2, -0.45, 0.16], palm: 'down', fingers: 'fwd', shape: 'palm', elbow: [0.5, -1, -0.4] })
}, 'Set the right foot down ahead of the left, on its ball')
f.key(2.2, (k) => {
k.pivot('L', 80, 'ball')
k.chest(80)
k.hips(60)
hook(k, 'L')
k.hand('R', { at: [-0.12, -0.02, 0.24], palm: 'back+out', fingers: 'up+mid', shape: 'palm', elbow: [0.6, -1, -0.2] })
k.look('L')
}, 'Turn on the left ball to the left and form the left hook')
snakeAndRooster(f, 'R', 1)
}
export const MOVES = [
{ id: 'snake-left', number: 16, lesson: 6, title: 'Push Down and Stand on One Leg, Left', build: snakeLeft, endFacing: 270 },
{ id: 'snake-right', number: 17, lesson: 6, title: 'Push Down and Stand on One Leg, Right', build: snakeRight, endFacing: 270 },
]
// Lesson 5 played from Single Whip ends where this lesson begins.
export function startPose() {
const form = new Form(singleWhipPose())
for (const move of LESSON_5) {
move.build(form)
}
return form.pose
}
+172
View File
@@ -0,0 +1,172 @@
// Lesson 7: Fair Lady Works at Shuttles, Needle at Sea Bottom, Fan Through
// the Back. The lesson starts on the right leg after Golden Rooster, facing
// 270, and travels along that line: the shuttles go out to the two front
// diagonals (225 and 315) and the needle and fan face 270 again.
import { goldenRoosterRightPose } from './boundaries.js'
import { SINK, STEP, TRACK, holdBall, other, pressByHip } from './hands.js'
const SIDE_NAME = { L: 'left', R: 'right' }
// The hand that blocks above the forehead, palm turned out and up, the
// forearm across the brow.
function blockAboveForehead(k, side) {
k.hand(side, { at: [0.14, 0.26, 0.3], palm: 'up+fwd+out', fingers: 'mid', shape: 'palm', elbow: [0.9, -0.5, 0.1] })
}
// The other hand pushes forward at nose height.
function pushAtNose(k, side) {
k.hand(side, { at: [0.06, 0.1, 0.48], palm: 'fwd', fingers: 'up', shape: 'palm', elbow: [0.4, -1, 0] })
}
// One shuttle to the `side` front diagonal, from the ball held on the other
// side with the `side` foot drawn in. `turn` is the change of facing and
// `backPivot` turns the back foot in behind the new line.
function shuttle(f, side, { turn, backPivot }) {
const back = other(side)
f.key(2.0, (k) => {
k.turn(turn)
k.place(side, { from: back, fwd: STEP, out: TRACK, pitch: 18 })
k.waist(side === 'L' ? -30 : 30)
k.hand(side, { at: [0.02, 0.0, 0.3], palm: 'back+mid', fingers: 'up+mid', shape: 'palm', elbow: [0.6, -1, 0] })
k.hand(back, { at: [-0.02, -0.3, 0.3], palm: 'down+fwd', fingers: 'mid+fwd', shape: 'palm' })
k.look(side)
}, `Turn and step the ${SIDE_NAME[side]} heel out to the front corner`)
f.key(2.4, (k) => {
k.ground(side)
k.load(side, 0.7)
k.sink(SINK)
k.waist(0)
k.hand(side, { at: [0.1, 0.14, 0.3], palm: 'fwd+up', fingers: 'mid+up', shape: 'palm', elbow: [0.9, -0.6, 0.1] })
k.hand(back, { at: [0.04, 0.02, 0.4], palm: 'fwd', fingers: 'up', shape: 'palm', elbow: [0.4, -1, 0] })
k.look(back)
}, 'Shift forward into the bow stance as the hands rise')
f.key(1.6, (k) => {
k.pivot(back, backPivot, 'ball')
k.load(side, 0.75)
blockAboveForehead(k, side)
pushAtNose(k, back)
}, `Turn the back heel out: the ${SIDE_NAME[side]} hand blocks above the forehead, the other palm pushes`)
}
// 18. Fair Lady Works at Shuttles, right and left.
export function shuttles(f) {
f.key(2.6, (k) => {
k.place('L', { from: 'R', fwd: 0.32, out: 0.12, turn: 30, pitch: 12 })
k.sink(SINK)
k.waist(15)
k.hand('L', { at: [0.12, -0.08, 0.3], palm: 'down+mid', fingers: 'mid+fwd', shape: 'palm', elbow: [0.6, -1, -0.2] })
k.hand('R', { at: [0.1, -0.38, 0.26], palm: 'up', fingers: 'mid+fwd', shape: 'palm' })
k.look('L')
}, 'Lower the left foot to the front, toes turned out')
f.key(2.6, (k) => {
k.ground('L')
k.load('L', 0.85)
k.waist(30)
holdBall(k, 'L')
k.look('L')
}, 'Sit into both knees and hold the ball on the left')
f.key(2.2, (k) => {
k.load('L')
k.place('R', { from: 'L', out: 0.22, fwd: -0.06, pitch: -24 })
}, 'Draw the right foot in, toes touching')
shuttle(f, 'R', { turn: -45, backPivot: -30 })
f.key(2.0, (k) => {
k.load('R', 0.3)
k.pitch('R', 18)
k.waist(-8)
k.hand('R', { at: [0.16, 0.1, 0.32], palm: 'fwd+out', fingers: 'mid+up', shape: 'palm', elbow: [0.8, -1, 0] })
k.hand('L', { at: [0.08, -0.06, 0.42], palm: 'fwd+down', fingers: 'up+fwd', shape: 'palm' })
}, 'Sit back a little and raise the right toes')
f.key(1.2, (k) => {
k.pivot('R', 20, 'heel')
}, 'Turn the right toes out a little')
f.key(2.4, (k) => {
k.ground('R')
k.load('R', 0.85)
k.pitch('L', -25)
k.waist(-30)
holdBall(k, 'R')
k.look('R')
}, 'Shift forward and hold the ball on the right')
f.key(2.2, (k) => {
k.load('R')
k.place('L', { from: 'R', out: 0.2, fwd: -0.06, pitch: -24 })
}, 'Draw the left foot in, toes touching')
shuttle(f, 'L', { turn: 90, backPivot: -65 })
}
// 19. Needle at Sea Bottom.
export function needle(f) {
f.key(1.6, (k) => {
k.load('L', 0.95)
k.shift(-0.05)
k.pitch('R', -40)
k.waist(10)
k.hand('R', { at: [0.1, -0.1, 0.45], palm: 'fwd+mid', fingers: 'up+fwd', shape: 'palm', elbow: [0.5, -1, -0.1] })
k.hand('L', { at: [0.12, -0.05, 0.42], palm: 'down+fwd', fingers: 'mid+fwd', shape: 'palm', elbow: [0.6, -1, 0] })
}, 'Shift the weight onto the left foot; the right heel lifts')
f.key(2.0, (k) => {
k.turn(-45)
k.load('L')
k.place('R', { from: 'L', fwd: -0.3, out: 0.12, turn: 45, pitch: -12 })
k.waist(0)
k.hand('R', { at: [0.18, -0.25, 0.3], palm: 'mid+down', fingers: 'fwd', shape: 'palm', elbow: [0.4, -1, -0.3] })
k.hand('L', { at: [0.1, -0.2, 0.4], palm: 'down', fingers: 'fwd+mid', shape: 'palm' })
k.look('fwd')
}, 'Bring the right foot a half step in behind')
f.key(2.4, (k) => {
k.ground('R')
k.load('R')
k.shift(0)
k.waist(-25)
k.hand('R', { at: [0.16, 0.06, 0.3], palm: 'mid', fingers: [0, 0.3, 1], shape: 'palm', elbow: [0.3, -1, 0] })
k.hand('L', { at: [0.12, -0.36, 0.34], palm: 'down', fingers: 'fwd+mid', shape: 'palm' })
k.look('R')
}, 'Sit back onto the right leg; draw the right hand up by the ear')
f.key(1.6, (k) => {
k.place('L', { from: 'R', fwd: 0.38, out: 0.12, pitch: -16 })
k.waist(-10)
k.look('fwd')
}, 'Ease the left foot forward, toes touching')
f.key(3.2, (k) => {
k.waist(0)
k.lean(32)
k.sink(SINK + 0.02)
k.hand('R', { at: [0.02, -0.34, 0.44], palm: 'mid', fingers: 'fwd+down', shape: 'palm', elbow: [0.3, -1, -0.3] })
pressByHip(k, 'L', { fwd: 0.22 })
k.look({ pitch: 18 })
}, 'Lean forward and thrust the right fingers down in front')
}
// 20. Fan Through the Back.
export function fanThroughBack(f) {
f.key(2.4, (k) => {
k.lean(0)
k.sink(SINK)
k.waist(-15)
k.place('L', { from: 'R', fwd: STEP, out: TRACK, pitch: 18 })
k.hand('R', { at: [0.06, -0.04, 0.38], palm: 'mid', fingers: 'fwd+up', shape: 'palm', elbow: [0.4, -1, -0.2] })
k.hand('L', { at: [-0.02, -0.06, 0.28], palm: 'mid+fwd', fingers: 'up', shape: 'palm', elbow: [0.4, -1, 0] })
k.look('fwd')
}, 'Rise, lift both hands and step the left heel forward')
f.key(3.0, (k) => {
k.ground('L')
k.load('L', 0.7)
k.waist(-10)
k.hand('R', { at: [0.2, 0.24, 0.24], palm: 'out+up', fingers: 'mid+fwd', shape: 'palm', elbow: [0.8, -1, 0] })
k.hand('L', { at: [0.06, -0.02, 0.5], palm: 'fwd', fingers: 'up', shape: 'palm', elbow: [0.4, -1, 0] })
k.look('L')
}, 'Bow stance: the right hand opens above the temple, the left palm pushes')
}
export const MOVES = [
{ id: 'shuttles', number: 18, lesson: 7, title: 'Fair Lady Works at Shuttles', build: shuttles, endFacing: 315 },
{ id: 'needle', number: 19, lesson: 7, title: 'Needle at Sea Bottom', build: needle, endFacing: 270 },
{ id: 'fan-through-back', number: 20, lesson: 7, title: 'Fan Through the Back', build: fanThroughBack, endFacing: 270 },
]
// The lesson starts on the right leg after Golden Rooster.
export function startPose() {
return goldenRoosterRightPose()
}
+186
View File
@@ -0,0 +1,186 @@
// Lesson 8: Turn, Deflect, Parry and Punch, Apparent Close Up, Cross Hands,
// Closing Form. The lesson starts in the left bow stance of Fan Through the
// Back, facing 270, turns right to face 90 for the punch and the push, and
// turns right again to finish facing the starting direction (0).
//
// A foot that carries weight never pivots straight from flat: its toes
// rise in one key, it turns in the next, and it lowers after, so the weight
// moves onto the heel gradually.
import { fanThroughBackPose } from './boundaries.js'
import { SINK, STEP, handsDown, pressByHip } from './hands.js'
// 21. Turn, Deflect, Parry and Punch.
export function deflectParryPunch(f) {
f.key(2.2, (k) => {
k.load('R', 0.85)
k.pitch('L', 20)
k.waist(-30)
k.hand('R', { at: [0.42, 0.04, 0.26], palm: 'fwd+out', fingers: 'up+out', shape: 'palm', elbow: [0.7, -1, 0] })
k.hand('L', { at: [0.14, 0.12, 0.36], palm: 'fwd+up', fingers: 'up+mid', shape: 'palm', elbow: [0.5, -1, 0] })
k.look('R')
}, 'Sit back onto the right leg and raise the left toes')
f.key(1.8, (k) => {
k.turn(-120)
k.pivot('L', -135, 'heel')
k.waist(0)
k.hand('R', { at: [0.3, -0.32, 0.26], palm: 'back+down', fingers: 'fwd+down', shape: 'fist', elbow: [0.5, -1, -0.3] })
k.hand('L', { at: [0.12, 0.18, 0.3], palm: 'up+fwd', fingers: 'mid+fwd', shape: 'palm', elbow: [0.6, -1, 0] })
k.look('fwd')
}, 'Turn the left toes in and turn right; the right hand sinks into a fist')
f.key(2.0, (k) => {
k.turn(-60)
k.ground('L')
k.load('L', 0.9)
k.waist(10)
k.hand('R', { at: [-0.06, -0.36, 0.24], palm: 'down', fingers: 'mid+fwd', shape: 'fist', elbow: [0.6, -1, -0.2] })
k.hand('L', { at: [0.1, 0.18, 0.3], palm: 'up+fwd', fingers: 'mid', shape: 'palm', elbow: [0.6, -1, 0] })
}, 'Shift onto the left leg; the right fist circles to the left ribs')
f.key(1.2, (k) => {
k.load('L')
k.place('R', { from: 'L', fwd: 0.1, out: 0.12, turn: 30, lift: 0.04, pitch: -10 })
k.hand('R', { at: [0.0, -0.2, 0.26], palm: 'back+down', fingers: 'up+mid', shape: 'fist', elbow: [0.5, -1, -0.2] })
}, 'Draw the right foot back without stopping')
f.key(1.6, (k) => {
k.place('R', { from: 'L', fwd: 0.4, out: 0.12, turn: 45, pitch: 15 })
k.waist(-20)
k.hand('R', { at: [0.06, -0.1, 0.42], palm: 'up', fingers: 'fwd', shape: 'fist', elbow: [0.4, -1, -0.2] })
pressByHip(k, 'L')
k.look('R')
}, 'Step it forward, toes out, as the right fist rolls over the top')
f.key(1.8, (k) => {
k.ground('R')
k.load('R')
k.waist(-30)
k.hand('R', { at: [0.14, -0.2, 0.36], palm: 'up', fingers: 'fwd+out', shape: 'fist', elbow: [0.4, -1, -0.3] })
k.hand('L', { at: [0.3, -0.3, 0.2], palm: 'down+mid', fingers: 'fwd+out', shape: 'palm', elbow: [0.5, -1, -0.2] })
}, 'Shift onto the right leg')
f.key(1.9, (k) => {
k.place('L', { from: 'R', fwd: STEP, out: 0.22, pitch: 18 })
k.waist(0)
k.hand('L', { at: [0.06, -0.04, 0.44], palm: 'mid+fwd', fingers: 'up+fwd', shape: 'palm', elbow: [0.4, -1, 0] })
k.hand('R', { at: [0.18, -0.46, 0.08], palm: 'up', fingers: 'fwd', shape: 'fist', elbow: [0.4, -1, -0.6] })
k.look('L')
}, 'Step the left heel forward; the left hand parries, the right fist draws back')
f.key(2.6, (k) => {
k.ground('L')
k.load('L', 0.7)
k.sink(SINK)
k.hand('R', { at: [0.02, -0.12, 0.5], palm: 'mid', fingers: 'fwd', shape: 'fist', elbow: [0.3, -1, -0.2] })
k.hand('L', { at: [-0.02, -0.08, 0.32], palm: 'mid', fingers: 'up', shape: 'palm', elbow: [0.5, -1, 0] })
k.look('R')
}, 'Left bow stance: punch with the right fist, the left palm beside the forearm')
}
// 22. Apparent Close Up.
export function apparentClose(f) {
f.key(1.8, (k) => {
k.hand('L', { at: [-0.02, -0.2, 0.44], palm: 'up', fingers: 'fwd', shape: 'palm', elbow: [0.5, -1, -0.1] })
k.hand('R', { at: [0.02, -0.12, 0.46], palm: 'up', fingers: 'fwd', shape: 'palm', elbow: [0.3, -1, -0.2] })
k.look('fwd')
}, 'Thread the left hand forward under the right wrist; open the fist')
f.key(1.6, (k) => {
k.hands({ at: [0.15, -0.12, 0.44], palm: 'up', fingers: 'fwd', shape: 'palm', elbow: [0.4, -1, -0.2] })
}, 'Turn both palms up and separate them')
f.key(2.4, (k) => {
k.load('R', 0.85)
k.pitch('L', 18)
k.hands({ at: [0.15, -0.14, 0.26], palm: 'mid+up+back', fingers: 'fwd+up', elbow: [0.5, -1, -0.4] })
}, 'Sit back, raise the left toes and draw the palms to the chest')
f.key(1.4, (k) => {
k.hands({ at: [0.15, -0.36, 0.28], palm: 'down+fwd', fingers: 'fwd', elbow: [0.5, -1, -0.4] })
}, 'Turn the palms down past the belly')
f.key(2.6, (k) => {
k.ground('L')
k.load('L', 0.7)
k.hands({ at: [0.15, -0.04, 0.48], palm: 'fwd', fingers: 'up', elbow: [0.4, -1, 0] })
}, 'Bow stance: push both palms forward at shoulder height')
}
// 23. Cross Hands.
export function crossHands(f) {
f.key(2.0, (k) => {
k.load('R', 0.8)
k.pitch('L', 18)
k.waist(-30)
k.hands({ at: [0.24, 0.08, 0.38], palm: 'fwd', fingers: 'up', elbow: [0.5, -1, 0] })
k.look('R')
}, 'Sit back onto the right leg and raise the left toes')
f.key(2.0, (k) => {
k.turn(-90)
k.pivot('L', -90, 'heel')
k.waist(-20)
k.hands({ at: [0.56, 0.03, 0.22], palm: 'fwd', fingers: 'out+fwd', elbow: [0.4, -1, -0.2] })
}, 'Turn the left toes in and face the front; the arms sweep open')
f.key(1.8, (k) => {
k.ground('L')
k.load('L', 0.7)
k.pitch('R', 15)
k.waist(-10)
}, 'Ease the weight to the left and raise the right toes')
f.key(1.2, (k) => {
k.pivot('R', 65, 'heel')
}, 'Turn the right toes out')
f.key(2.0, (k) => {
k.ground('R')
k.load('R', 0.7)
k.waist(-20)
k.hands({ at: [0.62, 0.02, 0.16], palm: 'fwd', fingers: 'out', elbow: [0.4, -1, -0.2] })
}, 'Side bow stance to the right: the arms open wide at shoulder height')
f.key(2.2, (k) => {
k.load('L', 0.85)
k.pitch('R', 15)
k.waist(0)
k.hands({ at: [0.45, -0.4, 0.26], palm: 'mid+fwd', fingers: 'out+down', elbow: [0.4, -1, -0.2] })
k.look('fwd')
}, 'Shift onto the left leg; the arms circle down; raise the right toes')
f.key(1.4, (k) => {
k.pivot('R', -20, 'heel')
k.hands({ at: [0.28, -0.52, 0.26], palm: 'mid+up', fingers: 'down+fwd', elbow: [0.4, -1, -0.3] })
}, 'Turn the right toes in')
f.key(2.0, (k) => {
k.load('L')
k.place('R', { from: 'L', out: 0.3 })
k.hands({ at: [0.08, -0.3, 0.34], palm: 'back+up', fingers: 'up+mid+fwd', elbow: [0.5, -1, -0.2] })
}, 'Draw the right foot in to shoulder width as the hands scoop up')
f.key(2.4, (k) => {
k.load(0.5)
k.sink(0.05)
k.hand('R', { at: [-0.04, -0.1, 0.36], palm: 'back', fingers: 'up+mid', shape: 'palm', elbow: [0.6, -1, 0] })
k.hand('L', { at: [-0.04, -0.12, 0.3], palm: 'back', fingers: 'up+mid', shape: 'palm', elbow: [0.6, -1, 0] })
}, 'Rise a little and cross the wrists at the chest, right hand outside')
}
// 24. Closing Form.
export function closing(f) {
f.key(2.0, (k) => {
k.hands({ at: [0.16, -0.08, 0.4], palm: 'down', fingers: 'fwd', shape: 'palm', elbow: [0.4, -1, -0.3] })
}, 'Turn the palms down and separate them to shoulder width')
f.key(3.2, (k) => {
k.sink(0.03)
handsDown(k)
}, 'Lower the arms slowly to the sides and stand up')
f.key(1.6, (k) => {
k.load('R')
}, 'Settle the weight onto the right foot')
f.key(1.4, (k) => {
k.place('L', { from: 'R', out: 0.1 })
}, 'Bring the left foot in beside the right')
f.key(1.6, (k) => {
k.load(0.5)
k.sink(0)
}, 'Centre the weight and straighten up')
f.hold(2.0, 'Stand quietly and breathe naturally')
}
export const MOVES = [
{ id: 'deflect-parry-punch', number: 21, lesson: 8, title: 'Turn, Deflect, Parry and Punch', build: deflectParryPunch, endFacing: 90 },
{ id: 'apparent-close', number: 22, lesson: 8, title: 'Apparent Close Up', build: apparentClose, endFacing: 90 },
{ id: 'cross-hands', number: 23, lesson: 8, title: 'Cross Hands', build: crossHands, endFacing: 0 },
{ id: 'closing', number: 24, lesson: 8, title: 'Closing Form', build: closing, endFacing: 0 },
]
// The lesson starts in the bow stance of Fan Through the Back.
export function startPose() {
return fanThroughBackPose()
}
+170
View File
@@ -0,0 +1,170 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Tai Chi Studio</title>
<link rel="icon" href="data:,">
<script type="importmap">
{
"imports": {
"three": "./node_modules/three/build/three.module.js",
"three/addons/": "./node_modules/three/examples/jsm/"
}
}
</script>
<style>
:root {
--bg: #f1ece0;
--panel: #faf7f0;
--panel-2: #f3eee3;
--ink: #2e3a33;
--muted: #6f776f;
--line: #ddd5c4;
--accent: #5f8a64;
--accent-ink: #ffffff;
--left: #3b8f87;
--right: #d0714f;
--warn: #b5562f;
--shadow: 0 1px 2px rgba(40, 40, 30, 0.08), 0 6px 20px rgba(40, 40, 30, 0.06);
color-scheme: light;
}
:root[data-theme="dark"] {
--bg: #141c22;
--panel: #1a242b;
--panel-2: #212d35;
--ink: #e6ece8;
--muted: #9aa8a2;
--line: #2c3a43;
--accent: #86b48a;
--accent-ink: #10181c;
--left: #5cc0b5;
--right: #f0936f;
--warn: #f0936f;
--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
font: 14px/1.4 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; }
button { font: inherit; color: inherit; }
.app { display: grid; grid-template-columns: 300px 1fr; height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 10px 30px; }
.brand { padding: 4px 8px 14px; }
.brand h1 { font-size: 17px; margin: 0; letter-spacing: 0.2px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.module { margin-top: 10px; }
.module > h2 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.9px; color: var(--muted); margin: 14px 8px 6px; }
.lesson { border-radius: 10px; margin: 2px 0; }
.lesson > summary { list-style: none; cursor: pointer; padding: 7px 8px; border-radius: 8px; display: flex; gap: 8px; align-items: baseline; }
.lesson > summary::-webkit-details-marker { display: none; }
.lesson > summary:hover { background: var(--panel-2); }
.lesson > summary .name { font-weight: 600; }
.lesson > summary .sub { color: var(--muted); font-size: 12.5px; }
.lesson[open] > summary { background: var(--panel-2); }
.entries { padding: 4px 0 8px 8px; }
.entry { padding: 5px 8px; border-radius: 8px; }
.entry .title { display: block; font-size: 13px; cursor: pointer; }
.entry .title:hover { color: var(--accent); }
.entry.active-row { background: var(--panel-2); }
.versions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 2px 9px; font-size: 12px; cursor: pointer; color: var(--muted); }
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.main { position: relative; display: grid; grid-template-rows: 1fr auto; min-width: 0; }
.viewport { position: relative; overflow: hidden; }
canvas#view { width: 100%; height: 100%; display: block; }
canvas#view.mirrored { transform: scaleX(-1); }
.hud-top { position: absolute; top: 12px; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none; }
.hud-title { background: color-mix(in srgb, var(--panel) 88%, transparent); border-radius: 12px; padding: 9px 13px; box-shadow: var(--shadow); max-width: 46%; pointer-events: auto; }
.hud-title .lesson-name { color: var(--muted); font-size: 12px; }
.hud-title .move-name { font-weight: 650; font-size: 16px; }
.hud-title .version { color: var(--accent); font-size: 12.5px; font-weight: 600; }
.toolbar { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: auto; }
.group { display: flex; gap: 2px; background: color-mix(in srgb, var(--panel) 90%, transparent); border-radius: 10px; padding: 3px; box-shadow: var(--shadow); }
.group button { border: 0; background: transparent; border-radius: 7px; padding: 5px 9px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.group button:hover { color: var(--ink); background: var(--panel-2); }
.group button.on { background: var(--accent); color: var(--accent-ink); }
.cue { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: min(720px, 80%);
background: color-mix(in srgb, var(--panel) 92%, transparent); border-radius: 14px; padding: 10px 18px; font-size: 17px; text-align: center; box-shadow: var(--shadow); transition: opacity 0.3s; }
.cue .step { color: var(--muted); font-size: 12px; display: block; margin-bottom: 2px; }
.cue:empty { opacity: 0; }
.weight { position: absolute; left: 14px; bottom: 22px; background: color-mix(in srgb, var(--panel) 90%, transparent); border-radius: 12px; padding: 8px 10px; box-shadow: var(--shadow); width: 170px; }
.weight .label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.weight .bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--line); }
.weight .bar .l { background: var(--left); }
.weight .bar .r { background: var(--right); }
.weight .numbers { display: flex; justify-content: space-between; font-size: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.checks { position: absolute; right: 14px; bottom: 22px; width: 300px; max-height: 45%; overflow: auto; background: color-mix(in srgb, var(--panel) 95%, transparent); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 12.5px; }
.checks h3 { margin: 0 0 6px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.checks .ok { color: var(--accent); }
.checks .bad { color: var(--warn); }
.checks ul { margin: 0; padding: 0; list-style: none; }
.checks li { padding: 4px 0; border-top: 1px solid var(--line); cursor: pointer; }
.checks li:hover { color: var(--accent); }
.checks .time { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 6px; }
.checks.hidden { display: none; }
.transport { display: flex; align-items: center; gap: 10px; padding: 10px 14px 12px; background: var(--panel); border-top: 1px solid var(--line); }
.transport .play { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; font-size: 15px; flex: none; }
.transport .time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; width: 104px; text-align: center; flex: none; }
.track { position: relative; flex: 1; height: 40px; cursor: pointer; user-select: none; }
.track .lane { position: absolute; left: 0; right: 0; top: 16px; height: 8px; background: var(--line); border-radius: 4px; }
.track .seg { position: absolute; top: 0; height: 14px; font-size: 10.5px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-left: 1px solid var(--line); padding-left: 3px; }
.track .fill { position: absolute; left: 0; top: 16px; height: 8px; background: var(--accent); border-radius: 4px; opacity: 0.55; }
.track .tick { position: absolute; top: 26px; width: 1px; height: 6px; background: var(--muted); opacity: 0.45; }
.track .head { position: absolute; top: 11px; width: 4px; height: 18px; border-radius: 2px; background: var(--accent); transform: translateX(-2px); }
.transport select, .transport .small { border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 5px 7px; font-size: 12.5px; cursor: pointer; }
.transport .small.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
body.render .sidebar, body.render .transport, body.render .toolbar, body.render .checks { display: none; }
body.render .app { grid-template-columns: 1fr; }
</style>
</head>
<body>
<div class="app">
<aside class="sidebar">
<div class="brand">
<h1>Tai Chi · Yang 24-form</h1>
<p>Inner Breeze course studio: animation review</p>
</div>
<nav id="outline"></nav>
</aside>
<section class="main">
<div class="viewport" id="viewport">
<canvas id="view"></canvas>
<div class="hud-top">
<div class="hud-title" id="hud-title"></div>
<div class="toolbar">
<div class="group" id="views"></div>
<div class="group" id="figures"></div>
<div class="group" id="toggles"></div>
</div>
</div>
<div class="weight" id="weight">
<div class="label"><span>Left</span><span>Weight</span><span>Right</span></div>
<div class="bar"><div class="l" id="weight-l"></div><div class="r" id="weight-r"></div></div>
<div class="numbers"><span id="weight-ln"></span><span id="weight-rn"></span></div>
</div>
<div class="cue" id="cue"></div>
<div class="checks hidden" id="checks"></div>
<div class="loading" id="loading">Loading…</div>
</div>
<div class="transport">
<button class="play" id="play" title="Play / pause (Space)">▶</button>
<div class="time" id="time">0:00.0 / 0:00</div>
<div class="track" id="track"></div>
<select id="speed" title="Playback speed">
<option value="0.25">0.25×</option>
<option value="0.5">0.5×</option>
<option value="0.75">0.75×</option>
<option value="1" selected>1×</option>
<option value="1.5">1.5×</option>
<option value="2">2×</option>
</select>
<button class="small on" id="loop" title="Loop">Loop</button>
</div>
</section>
</div>
<script type="module" src="./src/studio.js"></script>
</body>
</html>
+19
View File
@@ -0,0 +1,19 @@
{
"name": "inbe-tai-chi-studio",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "inbe-tai-chi-studio",
"dependencies": {
"three": "0.169.0"
}
},
"node_modules/three": {
"version": "0.169.0",
"resolved": "https://registry.npmjs.org/three/-/three-0.169.0.tgz",
"integrity": "sha512-Ed906MA3dR4TS5riErd4QBsRGPcx+HBDX2O5yYE5GqJeFQTPU+M56Va/f/Oph9X7uZo3W3o4l2ZhBZ6f6qUv0w==",
"license": "MIT"
}
}
}
+15
View File
@@ -0,0 +1,15 @@
{
"name": "inbe-tai-chi-studio",
"private": true,
"type": "module",
"description": "Tai Chi course animation: rig, solver, choreography, Three.js studio, checks and review renders",
"scripts": {
"studio": "node tools/serve.mjs",
"check": "node tools/check.mjs",
"export": "node tools/export.mjs",
"render": "node tools/render.mjs"
},
"dependencies": {
"three": "0.169.0"
}
}
+340
View File
@@ -0,0 +1,340 @@
// Motion checks: things a teacher would correct and things that betray an
// animation. Each check samples the timeline and reports the time ranges
// where it fails.
import { Vector3 } from 'three'
import { solvePose } from './solve.js'
const SIDES = ['L', 'R']
const DEG = Math.PI / 180
// Limits, in metres, seconds and degrees for the figure being checked.
export const LIMITS = {
footSlide: 0.008,
footFloat: 0.006,
kneeTrackAngle: 25,
kneePastToes: 0.04,
kneeFlexion: 128,
kneeFlexionDeep: 150,
wristBend: 85,
wristBendHook: 115,
handInBody: 0.0,
balanceMargin: 0.03,
handSpeed: 2.2,
footSpeed: 1.6,
pelvisSpeed: 0.75,
headSpeed: 1.0,
jumpSpeed: 3.5,
feetApart: 0.05,
kneesApart: 0.07,
facingTolerance: 12,
}
const SPEED_LIMITS = {
palmL: LIMITS.handSpeed,
palmR: LIMITS.handSpeed,
pelvis: LIMITS.pelvisSpeed,
headTop: LIMITS.headSpeed,
ankleL: LIMITS.footSpeed,
ankleR: LIMITS.footSpeed,
}
function angleBetween(a, b) {
const dot = a.clone().normalize().dot(b.clone().normalize())
return Math.acos(Math.min(1, Math.max(-1, dot))) / DEG
}
// Distance from point p to segment ab.
function segmentDistance(p, a, b) {
const ab = b.clone().sub(a)
const t = Math.min(1, Math.max(0, p.clone().sub(a).dot(ab) / Math.max(ab.lengthSq(), 1e-9)))
return p.distanceTo(a.clone().addScaledVector(ab, t))
}
function segmentSegmentDistance(a0, a1, b0, b1) {
let best = Infinity
for (let index = 0; index <= 8; index += 1) {
const point = a0.clone().lerp(a1, index / 8)
best = Math.min(best, segmentDistance(point, b0, b1))
}
return best
}
// Convex hull of floor points (x, z), counter-clockwise.
function hull(points) {
const sorted = [...points].sort((a, b) => a.x - b.x || a.z - b.z)
if (sorted.length < 3) {
return sorted
}
const cross = (o, a, b) => (a.x - o.x) * (b.z - o.z) - (a.z - o.z) * (b.x - o.x)
const lower = []
for (const point of sorted) {
while (lower.length >= 2 && cross(lower[lower.length - 2], lower[lower.length - 1], point) <= 0) {
lower.pop()
}
lower.push(point)
}
const upper = []
for (let index = sorted.length - 1; index >= 0; index -= 1) {
const point = sorted[index]
while (upper.length >= 2 && cross(upper[upper.length - 2], upper[upper.length - 1], point) <= 0) {
upper.pop()
}
upper.push(point)
}
upper.pop()
lower.pop()
return lower.concat(upper)
}
// How far a point lies outside a convex polygon (0 inside).
function outsideDistance(point, polygon) {
if (polygon.length === 0) {
return Infinity
}
if (polygon.length < 3) {
let best = Infinity
for (let index = 0; index < polygon.length; index += 1) {
const a = polygon[index]
const b = polygon[(index + 1) % polygon.length]
best = Math.min(best, segmentDistance(new Vector3(point.x, 0, point.z), new Vector3(a.x, 0, a.z), new Vector3(b.x, 0, b.z)))
}
return best
}
let inside = true
let best = Infinity
for (let index = 0; index < polygon.length; index += 1) {
const a = polygon[index]
const b = polygon[(index + 1) % polygon.length]
const crossValue = (b.x - a.x) * (point.z - a.z) - (b.z - a.z) * (point.x - a.x)
if (crossValue < 0) {
inside = false
}
best = Math.min(best, segmentDistance(new Vector3(point.x, 0, point.z), new Vector3(a.x, 0, a.z), new Vector3(b.x, 0, b.z)))
}
return inside ? 0 : best
}
// The floor outline a planted foot covers, given its solved points.
function footprintPoints(solved, side, rig) {
const heel = solved.joints[`heel${side}`]
const toe = solved.joints[`toe${side}`]
const ball = solved.joints[`ball${side}`]
const along = toe.clone().sub(heel).setY(0).normalize()
const across = new Vector3(-along.z, 0, along.x).multiplyScalar(rig.footHalfWidth)
const points = []
const onFloor = (point) => point.y < 0.012
for (const point of [heel, ball, toe]) {
if (onFloor(point)) {
points.push({ x: point.x + across.x, z: point.z + across.z })
points.push({ x: point.x - across.x, z: point.z - across.z })
}
}
if (points.length === 0 && ball.y < 0.02) {
points.push({ x: ball.x, z: ball.z })
}
return points
}
class IssueLog {
constructor(step) {
this.step = step
this.open = new Map()
this.issues = []
}
// Records a failing sample; consecutive samples merge into one issue.
fail(time, check, part, message, value, severity = 'error') {
const id = `${check}:${part}`
const current = this.open.get(id)
if (current && time - current.end <= this.step * 1.5) {
current.end = time
if (Math.abs(value) > Math.abs(current.worst)) {
current.worst = value
current.message = message
current.at = time
}
return
}
const issue = { check, part, message, start: time, end: time, at: time, worst: value, severity }
this.open.set(id, issue)
this.issues.push(issue)
}
}
export function checkTimeline(timeline, rig, { fps = 30, moves = [], expectDuration = null } = {}) {
const step = 1 / fps
const log = new IssueLog(step)
const anchors = { L: null, R: null }
let previous = null
const frames = Math.floor(timeline.duration * fps) + 1
for (let frame = 0; frame < frames; frame += 1) {
const time = Math.min(frame * step, timeline.duration)
const sample = timeline.sample(timeline.start + time)
const pose = sample.pose
const solved = solvePose(pose, rig)
const joints = solved.joints
for (const side of SIDES) {
const foot = pose.feet[side]
const leg = solved.legs[side]
const share = side === 'L' ? solved.load : 1 - solved.load
const planted = (foot.lift ?? 0) < 0.0015
// Feet on the floor reach it and do not slide.
if (planted && leg.reachError > LIMITS.footFloat) {
log.fail(time, 'foot-reach', side, `${side} foot hangs ${(leg.reachError * 100).toFixed(1)} cm short of the floor`, leg.reachError)
}
const heel = joints[`heel${side}`]
const ball = joints[`ball${side}`]
const heelDown = heel.y < 0.004
const ballDown = ball.y < 0.004
if (planted && (heelDown || ballDown)) {
const anchor = anchors[side]
if (anchor) {
if (heelDown && anchor.heel) {
const moved = heel.distanceTo(anchor.heel)
if (moved > LIMITS.footSlide) {
log.fail(time, 'foot-slide', side, `${side} heel slides ${(moved * 100).toFixed(1)} cm while planted`, moved)
anchor.heel = heel.clone()
}
}
if (ballDown && anchor.ball) {
const moved = ball.distanceTo(anchor.ball)
if (moved > LIMITS.footSlide) {
log.fail(time, 'foot-slide', side, `${side} ball slides ${(moved * 100).toFixed(1)} cm while planted`, moved)
anchor.ball = ball.clone()
}
}
anchor.heel = heelDown ? anchor.heel ?? heel.clone() : null
anchor.ball = ballDown ? anchor.ball ?? ball.clone() : null
} else {
anchors[side] = { heel: heelDown ? heel.clone() : null, ball: ballDown ? ball.clone() : null }
}
} else {
anchors[side] = null
}
// Knees bend the way the toes point, and a front knee stays
// behind its toes.
const knee = joints[`knee${side}`]
const ankle = joints[`ankle${side}`]
const hip = joints[`hip${side}`]
const toward = joints[`toe${side}`].clone().sub(heel).setY(0).normalize()
const axis = ankle.clone().sub(hip).normalize()
const onAxis = hip.clone().addScaledVector(axis, knee.clone().sub(hip).dot(axis))
const bendDirection = knee.clone().sub(onAxis)
const toesAcross = toward.clone().addScaledVector(axis, -toward.dot(axis))
if (planted && share > 0.4 && bendDirection.length() > 0.04 && toesAcross.length() > 0.2) {
const offTrack = angleBetween(bendDirection, toesAcross)
if (offTrack > LIMITS.kneeTrackAngle) {
log.fail(time, 'knee-track', side, `${side} knee bends ${offTrack.toFixed(0)}° away from the toes`, offTrack, 'warn')
}
}
const otherHeel = joints[`heel${side === 'L' ? 'R' : 'L'}`]
const facingVector = new Vector3(Math.sin(pose.facing), 0, Math.cos(pose.facing))
const inFront = heel.clone().sub(otherHeel).dot(facingVector) > 0.25
const otherPlanted = (pose.feet[side === 'L' ? 'R' : 'L'].lift ?? 0) < 0.0015
if (planted && otherPlanted && inFront && share > 0.5) {
const pastToes = knee.clone().sub(ankle).setY(0).dot(toward) - rig.toeTip
if (pastToes > LIMITS.kneePastToes) {
log.fail(time, 'knee-past-toes', side, `${side} front knee is ${(pastToes * 100).toFixed(0)} cm past the toes`, pastToes, 'warn')
}
}
const flexion = 180 - angleBetween(hip.clone().sub(knee), ankle.clone().sub(knee))
const deepAllowed = (sample.from.pose.deep || sample.to.pose.deep)
const flexionLimit = deepAllowed ? LIMITS.kneeFlexionDeep : LIMITS.kneeFlexion
if (flexion > flexionLimit) {
log.fail(time, 'knee-flexion', side, `${side} knee bends ${flexion.toFixed(0)}°`, flexion)
}
// Wrists stay within comfortable bends; arms do not overreach.
const elbow = joints[`elbow${side}`]
const wrist = joints[`wrist${side}`]
const fingertip = joints[`fingertip${side}`]
const hand = solved.hands[side]
const wristBend = angleBetween(wrist.clone().sub(elbow), fingertip.clone().sub(wrist))
const wristLimit = (hand.shape[2] ?? 0) > 0.5 ? LIMITS.wristBendHook : LIMITS.wristBend
if (wristBend > wristLimit) {
log.fail(time, 'wrist-bend', side, `${side} wrist bends ${wristBend.toFixed(0)}°`, wristBend, 'warn')
}
if (hand.stretched) {
log.fail(time, 'arm-reach', side, `${side} hand target is out of reach; the arm locks straight`, 1, 'warn')
}
// Hands stay outside the torso.
const palm = joints[`palm${side}`]
const torsoRadius = 0.085 * rig.height
const inside = torsoRadius - segmentDistance(palm, joints.pelvis.clone().add(new Vector3(0, 0.03 * rig.height, 0)), joints.neckBase.clone().add(new Vector3(0, -0.06 * rig.height, 0)))
if (inside > 0.015) {
log.fail(time, 'hand-in-body', side, `${side} hand sinks ${(inside * 100).toFixed(0)} cm into the body`, inside)
}
if (palm.y < 0.06) {
log.fail(time, 'hand-floor', side, `${side} hand touches the floor`, palm.y)
}
}
// Feet and knees do not collide.
const footGap = segmentSegmentDistance(joints.heelL, joints.toeL, joints.heelR, joints.toeR) - 2 * rig.footHalfWidth
if (footGap < -0.005) {
log.fail(time, 'feet-overlap', 'feet', `The feet overlap by ${(-footGap * 100).toFixed(1)} cm`, -footGap)
}
const kneeGap = joints.kneeL.distanceTo(joints.kneeR)
if (kneeGap < LIMITS.kneesApart) {
log.fail(time, 'knees-collide', 'knees', `The knees come within ${(kneeGap * 100).toFixed(0)} cm`, kneeGap, 'warn')
}
// Balance: the centre of mass stays over the feet.
const support = []
for (const side of SIDES) {
if ((pose.feet[side].lift ?? 0) < 0.0015) {
support.push(...footprintPoints(solved, side, rig))
}
}
const outside = outsideDistance({ x: joints.com.x, z: joints.com.z }, hull(support))
if (outside > LIMITS.balanceMargin) {
log.fail(time, 'balance', 'body', `Centre of mass is ${(outside * 100).toFixed(0)} cm outside the feet`, outside)
}
// Smooth: no jumps, no rushing.
const tracked = { palmL: joints.palmL, palmR: joints.palmR, pelvis: joints.pelvis, headTop: joints.headTop, ankleL: joints.ankleL, ankleR: joints.ankleR }
if (previous) {
for (const [name, point] of Object.entries(tracked)) {
const speed = point.distanceTo(previous[name]) / step
if (speed > LIMITS.jumpSpeed) {
log.fail(time, 'jump', name, `${name} jumps (${speed.toFixed(1)} m/s)`, speed)
continue
}
const limit = SPEED_LIMITS[name]
if (speed > limit) {
log.fail(time, 'speed', name, `${name} moves at ${speed.toFixed(2)} m/s`, speed, 'warn')
}
}
}
previous = Object.fromEntries(Object.entries(tracked).map(([name, point]) => [name, point.clone()]))
}
// Facing at the end of each movement.
for (const move of moves) {
if (move.endFacing === undefined || move.end === undefined) {
continue
}
const pose = timeline.sample(timeline.start + move.end).pose
let difference = pose.facing / DEG - move.endFacing
difference = ((difference % 360) + 540) % 360 - 180
if (Math.abs(difference) > LIMITS.facingTolerance) {
log.fail(move.end, 'facing', move.id, `${move.title} ends facing ${(pose.facing / DEG).toFixed(0)}°, expected ${move.endFacing}°`, difference)
}
}
if (expectDuration) {
const [low, high] = expectDuration
if (timeline.duration < low || timeline.duration > high) {
log.fail(0, 'duration', 'form', `Lasts ${(timeline.duration / 60).toFixed(2)} min, expected ${(low / 60).toFixed(1)}–${(high / 60).toFixed(1)} min`, timeline.duration)
}
}
const issues = log.issues.sort((a, b) => a.start - b.start)
return {
issues,
errors: issues.filter((issue) => issue.severity === 'error').length,
warnings: issues.filter((issue) => issue.severity === 'warn').length,
frames,
}
}
Loaded 100 of 268 files, more files were not shown because too many files have changed in this diff. Show more