hd-motion
The motion kit around anything: plays a motion when value changes, wiggles while busy, and shakes when a command ends with value where it began (refused, or never answered). Follows the motion level: reduced motion only fades (a pulse while busy), e-ink shows nothing.
| Attribute | What it is |
|---|---|
value | What it follows, e.g. {{ cap.onoff.value }}; a change plays play. |
play | What a change of value plays.One of settle, success, press, refused, none. Default settle. |
busy | A command is on its way: present, or true (false is not busy), e.g. {% if pending.onoff %} busy{% endif %} or busy="{{ b.busy }}". |
refused | What a refused command plays.One of refused, settle, none. Default refused. |
press | A tap on it plays the press motion. |
block | Takes the full width instead of fitting its content. |
<hd-motion value="{{ cap.onoff.value }}" play="success" press> <button data-hd-on-click="toggle('onoff')">{% if cap.onoff.value %}On{% else %}Off{% endif %}</button></hd-motion>