Motion & effects / Animated graphics

Tilted Panel Loader

Full-screen black intro with rotated white and light-grey rectangular panels forming an L shape, with soft 3D render fragments inside. A huge white counter numeral sits cropped at the bottom left.

Rebuilt from lusion.co in the Periwinkle Studio Float style.

npx shadcn@latest add https://justyoink.it/r/periwinkle-studio-float/blocks/tilted-panel-loader.json

Looks exactly like lusion.co: brings its fonts and colours, namespaced so your own theme stays untouched.

Images2 in this component. Swap any for a library image or one of your own.All images in this style →

Choose an image

Image

Loading…

Usage

Props: duration (ms for the counter, default 3200), imageSrc and imageSrc2 for the render fragments inside the panels. The overlay counts to 100, then wipes upward; press 'Replay intro' to run it again.

components/tilted-panel-loader.tsx
import { useEffect, useState } from "react";

export default function TiltedPanelLoader({
  duration = 3200,
  imageSrc = "https://justyoink.it/gen/object-frosted-orb.webp",
  imageSrc2 = "https://justyoink.it/gen/object-chrome-blob.webp",
}: {
  duration?: number;
  imageSrc?: string;
  imageSrc2?: string;
}) {
  const [n, setN] = useState(0);
  const [done, setDone] = useState(false);
  const [run, setRun] = useState(0);

  useEffect(() => {
    let raf = 0;
    const start = performance.now();
    const tick = (t: number) => {
      const p = Math.min(1, (t - start) / duration);
      setN(Math.round(100 * (1 - Math.pow(1 - p, 2))));
      if (p < 1) raf = requestAnimationFrame(tick);
      else setTimeout(() => setDone(true), 400);
    };
    setDone(false);
    raf = requestAnimationFrame(tick);
    return () => cancelAnimationFrame(raf);
  }, [duration, run]);

  const p = n / 100;

  return (
    <section className="relative h-[100svh] min-h-[480px] w-full overflow-hidden bg-canvas font-sans" aria-label="Loading">
      <div className="flex h-full items-center justify-center text-ink text-h2">
        <button onClick={() => setRun((r) => r + 1)} className="rounded-pill bg-slate px-6 py-3 text-paper text-label focus-visible:outline focus-visible:outline-2 focus-visible:outline-electric-blue">Replay intro</button>
      </div>
      <div
        role="progressbar"
        aria-valuenow={n}
        aria-valuemin={0}
        aria-valuemax={100}
        className={"absolute inset-0 overflow-hidden bg-night transition-transform duration-[1100ms] ease-[cubic-bezier(0.76,0,0.24,1)] " + (done ? "-translate-y-full" : "translate-y-0")}
      >
        <div className="absolute inset-0" style={{ transform: `rotate(${-7 + p * 4}deg) translateY(${(1 - p) * 40}px)`, transformOrigin: "50% 50%" }}>
          <div className="absolute left-[38%] top-[-20%] h-[50%] w-[18%] bg-paper" />
          <div className="absolute left-[38%] top-[30%] h-[40%] w-[18%] overflow-hidden bg-[#e4e4e6]">
            <img src={imageSrc} alt="" width={400} height={400} className="h-full w-full object-cover opacity-70 mix-blend-multiply" />
          </div>
          <div className="absolute left-[38%] top-[70%] h-[40%] w-[36%] bg-paper">
            <div className="h-[75%] w-full overflow-hidden bg-[#e0e0e2]">
              <img src={imageSrc2} alt="" width={600} height={340} className="h-full w-full object-cover opacity-60 mix-blend-multiply" />
            </div>
          </div>
        </div>
        <div className="pointer-events-none absolute inset-y-0 right-0 w-1/2 bg-gradient-to-l from-night/50 to-transparent" />
        <div className="absolute -bottom-[0.18em] left-2 select-none text-[clamp(8rem,22vw,20rem)] font-light leading-none tracking-[-0.06em] text-paper tabular-nums">
          {n}
        </div>
      </div>
    </section>
  );
}

Quality checks

Automated, in a real browser · today
—

More from Periwinkle Studio Float

The whole style →

Floating Pill Header

Headers & nav bars

Oversized Section Heading with Side Blurb

Feature sections

Rounded Project Tile

Cards

Dot-Separated Category Tags

Badges & tags

Plus Crosshair Grid Markers

Animated backgrounds

Persistent WebGL Backdrop

Animated backgrounds