Skip to content
animorio
IT
Back to the library

AI workflow cable

Physics, HoverGSAP, CSS onlyAdvancedCompressed weight: Demo 12 KBGSAP 28 KBFreeDownload the zip

The canvas of a made-up workflow builder, Fernwire, with two nodes: the trigger (a contact form sent) and the AI step that drafts the reply. Out of the trigger's port you pull a real cable, a rope simulated by hand with Verlet (gravity, damping, distance constraints, a step never longer than 1/30 s): it dangles from the pointer, snaps into the other port on a spring, sags between the nodes and swings when the pointer brushes past it or a node is dragged. Once connected a light runs along it, the step says Reply drafted and the run counter rolls from 1,248 to 1,249. Let go anywhere else, the cable falls and winds back into its port.

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.

<!doctype html>
<!--
  "AI workflow cable" from Animorio · https://animorio.com
  License: free on your own sites and your clients’ sites, paid work included.
  Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Fernwire, Studio inbox: connect the AI step</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist@5.3.0/index.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- the canvas of a made-up workflow builder, Fernwire. Two nodes: a trigger (a contact form is sent) and an AI step
         (draft a reply). Pull a cable out of the trigger's port: it is a rope simulated by hand (Verlet, gravity, a step
         never longer than 1/30 s), it dangles from the cursor, snaps into the other port with a spring, sags between the
         nodes and swings when the pointer brushes past it or a node is dragged. Let go anywhere else and it falls and
         winds back into its port -->
    <header class="bar">
      <span class="brand">
        <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
          <path d="M4 15c3.5 0 4-6 8-6s4.5 6 8 6"/>
          <path d="M4 9c3.5 0 4 6 8 6s4.5-6 8-6" opacity=".45"/>
        </svg>
        <span class="brand__name">Fernwire</span>
      </span>
      <span class="crumb"><span class="crumb__muted">Flows</span><svg viewBox="0 0 8 12" aria-hidden="true"><path d="M2 2l4 4-4 4"/></svg><span>Studio inbox</span></span>
      <span class="saved" data-saved><span class="saved__in" data-saved-in>Draft</span></span>
    </header>

    <article class="node node--a" data-node="a" aria-label="Trigger: contact form sent">
      <div class="node__card">
        <div class="node__head">
          <span class="node__icon">
            <svg viewBox="0 0 20 20" aria-hidden="true"><rect x="3.5" y="3" width="13" height="14" rx="2.5"/><path d="M6.5 7.5h7M6.5 10.5h7M6.5 13.5h4"/></svg>
          </span>
          <span class="node__words">
            <span class="node__kind">Trigger</span>
            <span class="node__title">Contact form sent</span>
          </span>
        </div>
        <p class="node__meta">studio-site / contact</p>
      </div>
    </article>

    <article class="node node--b" data-node="b" aria-label="AI step: draft a reply">
      <div class="node__card">
        <div class="node__head">
          <span class="node__icon node__icon--ai">
            <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M10 2.8c.5 3.6 2.6 5.7 6.2 6.2-3.6.5-5.7 2.6-6.2 6.2-.5-3.6-2.6-5.7-6.2-6.2 3.6-.5 5.7-2.6 6.2-6.2z"/><path d="M15.4 13.6c.2 1.2.9 1.9 2.1 2.1-1.2.2-1.9.9-2.1 2.1-.2-1.2-.9-1.9-2.1-2.1 1.2-.2 1.9-.9 2.1-2.1z"/></svg>
          </span>
          <span class="node__words">
            <span class="node__kind">AI step</span>
            <span class="node__title">Draft a reply</span>
          </span>
        </div>
        <div class="node__foot">
          <span class="state" data-state>
            <svg class="state__tick" viewBox="0 0 14 14" aria-hidden="true"><path d="M3 7.4l2.6 2.5L11 4.4" data-tick/></svg>
            <span class="state__in" data-state-in>Not connected</span>
          </span>
          <span class="runs"><span class="runs__label">Runs</span><span class="runs__num" data-runs><span class="runs__in">1,248</span></span></span>
        </div>
      </div>
    </article>

    <svg class="wires" data-wires aria-hidden="true">
      <defs>
        <filter id="soft" x="-20%" y="-20%" width="140%" height="140%"><feGaussianBlur stdDeviation="2.6"/></filter>
        <filter id="glow" x="-20%" y="-20%" width="140%" height="140%"><feGaussianBlur stdDeviation="2"/></filter>
        <linearGradient id="live" gradientUnits="userSpaceOnUse" data-grad x1="0" y1="0" x2="100" y2="0">
          <stop offset="0" stop-color="var(--accent)"/>
          <stop offset="1" stop-color="var(--accent-2)"/>
        </linearGradient>
      </defs>
      <path class="wire__shadow" data-shadow filter="url(#soft)"/>
      <path class="wire__ink" data-ink/>
      <path class="wire__live" data-live stroke="url(#live)"/>
      <path class="wire__shine" data-shine/>
      <path class="wire__pulse-glow" data-glow pathLength="1000" filter="url(#glow)"/>
      <path class="wire__pulse" data-pulse pathLength="1000"/>
      <g class="plug" data-plug-a><rect x="5" y="-4.5" width="14" height="9" rx="3.5"/><path d="M8 -2h8"/><path class="plug__band" d="M16 -4.5v9"/></g>
      <g class="plug" data-plug-b><rect x="-19" y="-4.5" width="14" height="9" rx="3.5"/><path d="M-16 -2h8"/><path class="plug__band" d="M-16 -4.5v9"/></g>
      <g class="port" data-port-a><circle class="port__ring" r="6.5"/><circle class="port__core" r="3" data-core-a/></g>
      <g class="port" data-port-b><circle class="port__ring" r="6.5"/><circle class="port__core" r="3" data-core-b/></g>
    </svg>

    <p class="hint" aria-live="polite"><span class="hint__in" data-hint>Drag from the port to connect</span></p>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true">
      <path d="M5 3l13.5 8.2-6 1.3 3.4 6.6-2.6 1.3-3.4-6.6-4.9 3.9z"/>
    </svg>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

Playground

Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.

34 values to change

Or ask your AI assistant for it

With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:

Take “AI workflow cable” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a warm grey canvas with a dot grid and slightly darker corners, the Fernwire mark at the top (two intertwined waves in indigo), the path Flows / Studio inbox and on the right a pill that says Draft. In the middle two white nodes with a layered shadow and a line of light along the top edge: on the left the trigger Contact form sent, with the form icon and the path studio-site / contact in a mono face; lower on the right the AI step Draft a reply, with the indigo icon of little stars, the state Not connected and the counter Runs 1,248. On the edges of the nodes two ports, small white circles with a thin ring. A drawn cursor takes the trigger's port: the cable comes out and pays out behind it, hangs under its weight, bellies as the cursor goes down and up again, and as soon as it nears the other port the ring turns indigo and the plug goes in on a spring, one pixel past and back. The black cable lights up in a shaded indigo, the pill turns Saved, the state Listening; a white light runs along the cable from the trigger to the step, the port swells for a moment and settles, the state says Reply drafted with a drawn tick and the counter rolls to 1,249. Then the cursor sweeps fast through the cable, which moves aside and swings until it stops; it drags the AI node further away, the node follows on a spring and leans slightly, and the cable goes taut, slackens and sways; it brings it back, pulls the plug and lets go: the cable falls, waves and winds back into the port. With a mouse it is all yours: pull the cable from the port, plug it in, unplug it, move the nodes and brush past the cable to make it swing.

How it works

A Verlet rope

The cable is a row of 24 points. Every step each one moves by as much as it moved before (its position minus the old one), times 0.985 for damping, plus gravity times the step squared. No stored speeds: with Verlet the speed is the difference between the two positions, which is why pushing a point is enough to give it a push.

The constraints and the capped step

After the movement, fourteen passes over the segments bring every pair of points back to the right distance (the length of the cable divided by 23), half each; the first point stays pinned to the trigger's port and the last to the plug, if someone holds it. The step of each frame is never longer than 1/30 s and is split in two halves: coming back from another browser tab the cable does not explode.

The plug on a spring

The end of the cable does not jump onto the pointer or the port: it follows them on a spring (stiff and almost without bounce while held, softer with a damping of 0.42 in the port). As it plugs in it gets a little kick past the port, so it seats a pixel or two too far and comes back. The cable grows as it is pulled (1.12 times the distance from the port) and, once connected, slowly heads to 1.2 times the distance between the ports: the belly.

The pointer that moves the cable aside

The pointer's speed is the difference between two frames. Faster than 30 pixels a second, every point of the cable within 46 pixels is moved by that speed times 0.4 times the step, more the closer it is: with Verlet the shift turns by itself into a swing that dies away.

The nodes and the light

The nodes follow the pointer on a spring (stiffness 320, damping 0.6) and lean up to 3 degrees with their speed; the ports are recomputed from the nodes every step, so the cable goes taut and slack by itself. The running light is the same path with pathLength 1000 and a dash of 90 in 1000 sliding in 0.9 s, with a blurred copy under it; the lit cable has a gradient from port to port.

Values to change

NameFileDefaultWhat it changes
POINTSscript.js24Points of the rope: more is smoother and heavier to compute.
GRAVITYscript.js1500Pull of gravity on the cable, in pixels per second squared.
DAMPINGscript.js0.985How much of its speed the cable keeps every step (1 never stops swinging).
SLACKscript.js1.2Length of the connected cable against the straight distance between the ports.
STIFFNESSscript.js14Passes of the distance constraints every step: fewer is a stretchier cable.
BRUSHscript.js46Pixels around the pointer that push the cable when it passes.
BRUSH_FORCEscript.js0.4How much of the pointer's speed goes into the cable.
SNAPscript.js34Pixels from the port where the plug is pulled in.
NODE_SPRINGscript.js320Stiffness of a dragged node following the pointer.
PULSE_TIMEscript.js0.9Seconds of the light running along the connected cable.
LOOPscript.jstrueLeft alone, the drawn cursor connects, brushes, drags and unplugs again and again.

Try them in the Playground

When to use it

For the editor of an automation or AI agent app, for the page that presents a node-based product (integrations, data pipelines, workflows), for an onboarding that teaches how to connect two steps: when connecting should feel physical and the confirmation should come from the running light and the number going up, not from a toast.

On phones

The same animation with adapted sizes: one node above on the left, the other below on the right, the ports on the bottom and top edges, the cable hanging between them. With a finger you pull the cable from the port, plug it in, unplug it and move the nodes; sweeping fast over it makes it swing. No hover on the nodes, but the press with its lift stays.

With reduced motion

Nothing moves by itself: the cable is already in its port, still in its curve, lit, with the state Reply drafted, and the canvas fades in. No drawn cursor and no running light; the words change with a fade. Touched by hand the cable still responds.

Pitfalls

  • The time step must be capped: coming back from another tab the browser gives the first frame a dt of whole seconds, and gravity times the step squared throws the cable off the screen. Here never more than 1/30 s, split in two.
  • With Verlet the speed is not stored anywhere: to pin a point to the port it must be put back there on every pass of the constraints, not just at the end, or its neighbours drag it away and the port looks made of rubber.
  • If the plug jumps onto the port on release the cable jerks: the end has to follow the port on a spring, and the spring has to stay afterwards, because the port moves when the node is dragged.
  • GSAP and the CSS on the same element cancel each other's transform: the script moves the outer node, the hover lift sits on the card inside.

Libraries

GSAP 3.15.0, Geist (font variabile) 5.3.0, Geist Mono (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 12 KB; the libraries: GSAP 28 KB.

Testing

Tested on 10 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.

All animations