Skip to content
animorio
IT
Back to the library

Particle sphere

WebGL, HoverGSAP, WebGLAdvancedCompressed weight: Demo 6.9 KBGSAP 28 KBThree.js 174 KBFreeDownload the zip

A sphere made of three thousand particles of violet light turning slowly on a near-black page, in the style of today’s interface libraries: where the pointer passes the particles move out of the way on a spring and come back with a small bounce; a tap sends a wave across the surface and a drag spins the sphere with inertia.

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>
<!--
  "Particle sphere" 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>Lumora</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
  <script type="importmap">
    { "imports": {
      "three": "https://cdn.jsdelivr.net/npm/three@0.178.0/build/three.module.min.js"
    } }
  </script>
</head>
<body>
  <!-- a made-up data platform, Lumora. A sphere made of a few thousand particles turns slowly on a near-black page;
       the particles near the pointer move out of the way on a spring and come back when it leaves; a tap sends a wave
       across the surface, and a drag spins the sphere with inertia -->
  <main class="palco" data-palco>
    <canvas class="tela" data-tela role="img" aria-label="A sphere made of glowing particles that move away from the pointer"></canvas>

    <!-- if WebGL is missing: a soft ring of light -->
    <div class="ripiego" data-ripiego aria-hidden="true"><span></span></div>

    <div class="racconto" data-racconto>
      <span class="etichetta">Lumora Graph</span>
      <h1 class="titolo">Every signal, in one place</h1>
      <p class="riga">Move closer and the data makes room.</p>
    </div>

    <!-- the drawn pointer of the preview, hidden as soon as someone moves a real one -->
    <svg class="finto" data-finto viewBox="0 0 24 24" aria-hidden="true">
      <path d="M5 3.5 L5 19 L9.2 15.2 L12 21 L14.6 19.8 L11.9 14.2 L17.6 14.2 Z" />
    </svg>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script type="module" 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.

14 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 “Particle sphere” 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 near-black page, with a faint violet light in the middle, there is a sphere made of three thousand particles evenly spread over its surface. It turns slowly on itself, a little tilted: the particles facing you are bigger and brighter, the ones behind small and dark, and each one flickers a little on its own. On opening the particles come in from a wider cloud and gather into the sphere. Where the pointer touches the sphere the nearby particles move away along the surface and a little outwards, more the closer they are, and brighten; when the pointer leaves they come back to their place on a spring, with a small bounce. A click or a tap sends a wave from the touched point that runs around the sphere; dragging spins the sphere, which then slows down on its own. Below, the small label, the headline and a line of a made-up data platform.

How it works

Particles on the spiral

The positions come from a Fibonacci spiral: each particle climbs an equal step in height and turns by the golden angle, so the surface is covered evenly with no crowded poles. They are a single THREE.Points with our own ShaderMaterial and additive blending.

Big in front, small behind

In the vertex shader the particle’s normal, taken into camera space, says how much it faces us: that sets the size of the point and, in the fragment shader, the colour, from the dark accent behind to the light one in front, with a sharp core and a soft glow.

The pointer on the sphere

The ray from the pointer meets the sphere with the intersection formula (no objects to hit), and the point is taken into the sphere’s space with worldToLocal, so it stays on the right particles while the sphere turns.

A spring for every particle

Each particle has an offset and a velocity: the pointer’s push fades with the square of the distance and carries it away along the surface and a little outwards, a damped spring brings it back with a small bounce. On a slow frame the step is split in two so the spring does not explode.

The wave and the inertia

A tap adds a wave: the angular distance from the touched point minus the advancing front gives a narrow band that swells the sphere for a moment and fades in just over two seconds. Dragging turns the sphere with the finger, and once released it slowly returns to its own speed.

Values to change

NameFileDefaultWhat it changes
PARTICLESscript.js3200How many particles make the sphere.
RADIUSscript.js1How big the area that moves away around the pointer is (1 = about a fifth of the sphere).
STRENGTHscript.js1How far the particles move away from the pointer.
SPRINGscript.js1How quickly they come back (higher = stiffer spring, shorter bounce).
SPINscript.js0.12How fast the sphere turns (radians per second).
GLOWscript.js1How much the particles and the halo behind the sphere glow.

Try them in the Playground

When to use it

For the hero of a data, AI or network product, a launch page, or as a living background behind a headline: a single calm object that answers whoever touches it.

On phones

The same animation with adapted sizes: the camera pulls back as far as needed for the whole sphere to fit the box above the words, the finger pushes the particles away and every tap sends the wave; dragging spins the sphere.

With reduced motion

The sphere stays still and already formed, with no rotation, springs or waves; the words fade in.

Pitfalls

  • Additive blending wants depthWrite off: with depth on, the front particles hide the back ones in little squares.
  • The touched point must be taken into the sphere’s space (worldToLocal) before comparing it with the particles, or the push slides away while the sphere turns.
  • A spring integrated with a long step explodes: dt must be capped and, on slow frames, split into two steps.
  • gl_PointSize ignores the pixel density: multiply it by hand (uScala) and recompute it on resize.

Libraries

Three.js 0.178.0, GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.9 KB; the libraries: GSAP 28 KB, Three.js 174 KB.

Testing

Tested on 25 October 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