{
  "wisp": "0.1",
  "name": "ghost-wave",
  "description": "A little ghost that floats, squashes when clicked and waves its arm. Click anywhere to make it wave; it returns to idle by itself. Pointer proximity brightens its eyes.",
  "artboard": {
    "width": 300,
    "height": 260,
    "background": "#141a26"
  },
  "nodes": [
    {
      "id": "ghost",
      "type": "group",
      "origin": [
        150,
        190
      ],
      "children": [
        {
          "id": "body",
          "type": "path",
          "d": "M96 190 C96 118 118 78 150 78 C182 78 204 118 204 190 C186 178 168 196 150 186 C132 196 114 178 96 190 Z",
          "fill": "#e8eefc"
        },
        {
          "id": "eyeL",
          "type": "ellipse",
          "cx": 132,
          "cy": 132,
          "rx": 7,
          "ry": 9,
          "fill": "#22304a"
        },
        {
          "id": "eyeR",
          "type": "ellipse",
          "cx": 168,
          "cy": 132,
          "rx": 7,
          "ry": 9,
          "fill": "#22304a"
        },
        {
          "id": "mouth",
          "type": "ellipse",
          "cx": 150,
          "cy": 156,
          "rx": 6,
          "ry": 8,
          "fill": "#22304a"
        },
        {
          "id": "armR",
          "type": "group",
          "origin": [
            196,
            140
          ],
          "children": [
            {
              "id": "armRShape",
              "type": "path",
              "d": "M196 140 C214 146 222 160 220 176",
              "fill": null,
              "stroke": {
                "color": "#e8eefc",
                "width": 12,
                "cap": "round"
              }
            }
          ]
        }
      ]
    }
  ],
  "clips": {
    "float": {
      "duration": 3,
      "loop": "loop",
      "tracks": {
        "ghost.y": [
          {
            "t": 0,
            "v": 0
          },
          {
            "t": 1.5,
            "v": -10,
            "ease": "inOutSine"
          },
          {
            "t": 3,
            "v": 0
          }
        ]
      }
    },
    "wave": {
      "duration": 0.9,
      "loop": "once",
      "tracks": {
        "ghost.scaleY": [
          {
            "t": 0,
            "v": 1
          },
          {
            "t": 0.1,
            "v": 0.88,
            "ease": "inQuad"
          },
          {
            "t": 0.28,
            "v": 1.08,
            "ease": "outQuad"
          },
          {
            "t": 0.9,
            "v": 1
          }
        ],
        "ghost.scaleX": [
          {
            "t": 0,
            "v": 1
          },
          {
            "t": 0.1,
            "v": 1.12,
            "ease": "inQuad"
          },
          {
            "t": 0.28,
            "v": 0.95,
            "ease": "outQuad"
          },
          {
            "t": 0.9,
            "v": 1
          }
        ],
        "armR.rotation": [
          {
            "t": 0,
            "v": 0
          },
          {
            "t": 0.18,
            "v": -26,
            "ease": "outBack"
          },
          {
            "t": 0.42,
            "v": 14,
            "ease": "inOutSine"
          },
          {
            "t": 0.62,
            "v": -22,
            "ease": "inOutSine"
          },
          {
            "t": 0.9,
            "v": 0,
            "ease": "outSine"
          }
        ],
        "mouth.scaleY": [
          {
            "t": 0,
            "v": 1
          },
          {
            "t": 0.2,
            "v": 0.6,
            "ease": "inOutSine"
          },
          {
            "t": 0.9,
            "v": 1
          }
        ]
      }
    }
  },
  "machine": {
    "inputs": {
      "hi": {
        "type": "trigger",
        "note": "fired by a click"
      }
    },
    "layers": [
      {
        "name": "base",
        "initial": "idle",
        "states": {
          "idle": {
            "clip": "float"
          }
        }
      },
      {
        "name": "gesture",
        "initial": "none",
        "states": {
          "none": {
            "pose": "still"
          },
          "wave": {
            "clip": "wave"
          }
        },
        "transitions": [
          {
            "from": "none",
            "to": "wave",
            "when": "hi",
            "duration": 0.08
          },
          {
            "from": "wave",
            "to": "none",
            "onDone": true,
            "duration": 0.2
          }
        ]
      }
    ],
    "listeners": [
      {
        "on": "click",
        "do": [
          {
            "fire": "hi"
          }
        ]
      }
    ]
  },
  "bindings": [
    {
      "target": "eyeL.rx",
      "expr": "7 + 2 * smoothstep(200, 40, dist(pointer.x, pointer.y, wx(\"eyeL\"), wy(\"eyeL\")))",
      "mode": "set",
      "spring": {
        "smooth": 0.14
      }
    },
    {
      "target": "eyeR.rx",
      "expr": "7 + 2 * smoothstep(200, 40, dist(pointer.x, pointer.y, wx(\"eyeR\"), wy(\"eyeR\")))",
      "mode": "set",
      "spring": {
        "smooth": 0.14
      }
    }
  ],
  "poses": {
    "still": {
      "armR.rotation": 0,
      "mouth.scaleY": 1
    }
  }
}
