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.
Looks exactly like lusion.co: brings its fonts and colours, namespaced so your own theme stays untouched.
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
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> ); }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-background font-sans" aria-label="Loading"> <div className="flex h-full items-center justify-center text-foreground text-periwinkle-h2"> <button onClick={() => setRun((r) => r + 1)} className="rounded-full bg-foreground px-6 py-3 text-card text-periwinkle-label focus-visible:outline focus-visible:outline-2 focus-visible:outline-periwinkle-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-foreground 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-card" /> <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-card"> <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-foreground/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-card tabular-nums"> {n} </div> </div> </section> ); }
Quality checks
Automated, in a real browser · today- Accessible: not passedARIA progressbar nodes must have an accessible name (1 element)
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: passedStill readable when installed in your theme and switched to dark mode.
- Themeable: not passed2 hard-coded colours (bg-[#e4e4e6], bg-[#e0e0e2]). These ignore the theme and break dark mode.
- Animates cleanly: not passedKeeps animating when reduced motion is turned on