Back to library
INTERACTION_144

Blob Follower.

A soft blob lags behind the pointer and deforms with speed. Centred and circular before the trigger; lerping the blob toward the pointer at 0.12 and scaling it along the velocity axis once pointer movement.

CATEGORY
Mouse
COMPLEXITY
Easy
TECH
CSS + JS
PLATFORM
Desktop
PERFORMANCE
Medium
LIVE PLAYGROUND
FOLLOW THE LIGHT
Desktop only
CSS / CSS
/* Blob Follower — A soft blob lags behind the pointer and deforms with speed. */
.blob-follower {
  --dur: continuous;
  --ease: linear;
  --stagger: 60ms;
  will-change: transform, opacity;
}

.blob-follower > * {
  opacity: 0;
  transform: translateY(14px);
  animation: blob-follower-in var(--dur) var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * var(--stagger));
}

/* centred and circular -> lerping the blob toward the pointer at 0.12 and scaling it along the velocity axis */
@keyframes blob-follower-in {
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blob-follower > * {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
React / TSX
import { useEffect, useRef } from "react";

/** Blob Follower — trigger: pointer movement */
export function BlobFollower({ children }: { children: React.ReactNode }) {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current;
    if (!el) return;
    if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
      el.dataset["state"] = "in";
      return;
    }
    const io = new IntersectionObserver(
      ([entry]) => {
        if (entry?.isIntersecting) {
          el.dataset["state"] = "in";
          io.unobserve(el);
        }
      },
      { threshold: 0.2 },
    );
    io.observe(el);
    return () => io.disconnect();
  }, []);

  return (
    <div ref={ref} className="blob-follower" data-state="out">
      {children}
    </div>
  );
}

IF YOU LIKE THIS, STEAL THESE TOO.

AMBIENT LIGHT
INTERACTION_013CSS + JS

Mouse Glow

Large ambient light that trails the pointer across a section.

Mouse / MediumView
FOLLOW THE LIGHT
Desktop only
INTERACTION_139CSS + JS

Cursor Spotlight

A wide soft light follows the pointer across a dark section.

Mouse / LightView
STUDIO WORKSELECTED PROJECTSCONTACT
Desktop only
INTERACTION_141CSS + JS

Cursor Trail

A short trail of fading dots follows the pointer.

Mouse / MediumView
Magnetic
Desktop only
INTERACTION_142CSS + JS

Magnetic Elements

Nearby controls are drawn toward the pointer.

Mouse / LightView