PlayerData
Copy as MarkdownThe table of a flow: its states, triggers and poses, as the export writes it (into the snippet, into
<base>.player.json, into a .rupaplay file). The keys are short because the table is pasted into every snippet.
mount checks a table it is given and leaves out a part that fails.
Example
Section titled “Example”// A card that runs a 300 ms "hover" state while the pointer is over it, and runs it back when it leaves.const data: PlayerData = { v: 1, r: "card", e: "idle", w: 0, m: 0, s: [ ["idle", null, 1, [["idle", 0]], null], ["hover", 300, 0, [["hover", 0]], 300], ], t: [["hover", ".card", "hover", 1]], p: [],};Properties
Section titled “Properties”
readonlye:string|null
The state of the default chain, which plays while data-rupa-state names none; null without one.
readonlym:0|1
1 when the export writes the reduced motion block: under prefers-reduced-motion no SMIL animation begins.
readonlyp: readonlyPlayerPose[]
The poses a state starts from (PlayerPose).
readonlyr:string
The root’s class (the export’s prefix): the root is the element with this class and data-rupa.
readonlys: readonlyPlayerState[]
The states (PlayerState).
readonlyt: readonlyPlayerTrigger[]
The triggers (PlayerTrigger).
readonlyv:1
The format’s version, 1: raised only when the format changes.
readonlyw:0|1
1 when the default chain waits for the root to enter the viewport before it starts.