Skip to content

Hover Transitions

Eight hover effects for React profile cards: morph blob, diagonal wipe, pixel dissolve, iris, slices, focus and a liquid lens.

  • Scroll & Hover Effects
  • AI agency
  • React only · 0 deps
  • 1 file
Full screen

Browser support · Evergreen browsers. Blob morph needs @property; the liquid lens uses an SVG filter on HTML (Chromium, Firefox; Safari crossfades).

Install. One command, or copy the file.

$npx shadcn@latest add https://freedesignmd.com/r/hover-transitions.json
  • Byte-identical to the preview
  • No Tailwind or config needed
  • SSR-safe · keyboard accessible
  • Respects reduced motion & transparency
components/effects/hover-transitions.tsx
1/**
2 * HoverRevealCard, a profile/media card with eight interchangeable hover
3 * transitions. Pass one piece of artwork as `media`; the card renders a muted
4 * (greyscale) base and a full-colour reveal, and the chosen transition moves
5 * between them while an info overlay slides in.
6 *
7 * Effects: "blob" (organic morph reveal), "diagonal" (corner wipe with sheen),
8 * "strips" (vertical shutters sweep through), "pixels" (mosaic dissolve),
9 * "iris" (circle opens from the cursor), "slices" (rows slide in from
10 * alternating sides), "focus" (blur to sharp + info panel), "liquid" (an SVG
11 * displacement lens that bulges under the cursor).
12 *
13 * Props: effect, media, name, role, caption, info (ReactNode), accent.
14 * CSS vars: --fd-ht-accent, --fd-ht-radius, --fd-ht-ink.
15 *
16 * Browser support: evergreen. "blob" uses @property (falls back to an instant
17 * swap without it). "liquid" uses an SVG filter on HTML (Chromium, Firefox;
18 * Safari shows the crossfade only).
19 * Accessibility: cards are focusable and the reveal state also follows
20 * keyboard focus; on touch, a tap toggles it. Reduced motion swaps state with
21 * a ≤120ms fade.
22 *
23 * Demo images: /img/people/p1.webp … p8.webp (placeholder portraits, included in
24 * the repo's public/img/people, copy them next to your page or swap in your own).
25 */
26import { useEffect, useId, useRef, useState } from "react";
27import type { CSSProperties, ReactNode } from "react";
28
29export type HoverEffect = "blob" | "diagonal" | "strips" | "pixels" | "iris" | "slices" | "focus" | "liquid";
30
31export interface HoverRevealCardProps {
32 effect: HoverEffect;
33 media: ReactNode;
34 name: string;
35 role: string;
36 caption?: string;
37 info?: ReactNode;
38 accent?: string;
39 className?: string;
40 style?: CSSProperties;
41}
42
43const PIX_COLS = 6;
44const PIX_ROWS = 8;
45// deterministic pseudo-random delays so SSR and client markup match
46const pixDelay = (i: number) => {
47 const x = Math.sin(i * 91.7 + 13.3) * 43758.5453;
48 return Math.round((x - Math.floor(x)) * 220);
49};
50
51function bulgeMap(): string {
52 const n = 256;
53 const c = document.createElement("canvas");
54 c.width = c.height = n;
55 const ctx = c.getContext("2d");
56 if (!ctx) return "";
57 const img = ctx.createImageData(n, n);
58 for (let y = 0; y < n; y++) {
59 for (let x = 0; x < n; x++) {
60 const dx = (x / (n - 1)) * 2 - 1;
61 const dy = (y / (n - 1)) * 2 - 1;
62 const d = Math.min(1, Math.hypot(dx, dy));
63 const f = d < 1 ? Math.pow(1 - d * d, 1.6) : 0;
64 const i = (y * n + x) * 4;
65 // sample toward the centre → magnified lens
66 img.data[i] = 128 - dx * f * 127;
67 img.data[i + 1] = 128 - dy * f * 127;
68 img.data[i + 2] = 128;
69 img.data[i + 3] = 255;
70 }
71 }
72 ctx.putImageData(img, 0, 0);
73 return c.toDataURL();
74}
75
76export function HoverRevealCard({ effect, media, name, role, caption, info, accent = "#0A84FF", className, style }: HoverRevealCardProps) {
77 const ref = useRef<HTMLElement>(null);
78 const mediaRef = useRef<HTMLDivElement>(null);
79 const feImg = useRef<SVGFEImageElement>(null);
80 const feDisp = useRef<SVGFEDisplacementMapElement>(null);
81 const [on, setOn] = useState(false);
82 const [touched, setTouched] = useState(false);
83 const fid = `fd-ht-f${useId().replace(/:/g, "")}`;
84 const lens = useRef({ on: false, x: 0, y: 0, s: 0, v: 0, raf: 0, last: 0, reduced: false });
85
86 useEffect(() => {
87 const el = ref.current;
88 if (!el) return;
89 lens.current.reduced = !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
90 if (effect === "liquid" && feImg.current && !lens.current.reduced) {
91 const url = bulgeMap();
92 feImg.current.setAttribute("href", url);
93 feImg.current.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", url);
94 }
95 return () => cancelAnimationFrame(lens.current.raf);
96 }, [effect]);
97
98 const LENS = 180;
99 const placeLens = () => {
100 const L = lens.current;
101 if (!feImg.current || !feDisp.current) return;
102 feImg.current.setAttribute("x", String(L.x - LENS / 2));
103 feImg.current.setAttribute("y", String(L.y - LENS / 2));
104 feDisp.current.setAttribute("scale", (L.s * 64).toFixed(2));
105 };
106 const tickLens = (t: number) => {
107 const L = lens.current;
108 const dt = Math.min(0.032, (t - L.last) / 1000 || 0.016);
109 L.last = t;
110 const goal = L.on ? 1 : 0;
111 for (let i = 0; i < 2; i++) {
112 const h = dt / 2;
113 L.v += (-380 * (L.s - goal) - 30 * L.v) * h;
114 L.s += L.v * h;
115 }
116 placeLens();
117 if (Math.abs(L.s - goal) < 0.002 && Math.abs(L.v) < 0.002) {
118 L.s = goal;
119 placeLens();
120 L.raf = 0;
121 } else L.raf = requestAnimationFrame(tickLens);
122 };
123 const kickLens = () => {
124 const L = lens.current;
125 if (effect !== "liquid" || L.reduced) return;
126 if (!L.raf) {
127 L.last = performance.now();
128 L.raf = requestAnimationFrame(tickLens);
129 } else placeLens();
130 };
131
132 const point = (cx: number, cy: number) => {
133 const m = mediaRef.current;
134 if (!m) return;
135 const r = m.getBoundingClientRect();
136 const x = cx - r.left;
137 const y = cy - r.top;
138 m.style.setProperty("--fd-ht-x", `${x.toFixed(1)}px`);
139 m.style.setProperty("--fd-ht-y", `${y.toFixed(1)}px`);
140 m.style.setProperty("--fd-ht-px", `${((x / r.width) * 100).toFixed(1)}%`);
141 m.style.setProperty("--fd-ht-py", `${((y / r.height) * 100).toFixed(1)}%`);
142 lens.current.x = x;
143 lens.current.y = y;
144 };
145 const center = () => {
146 const m = mediaRef.current;
147 if (!m) return;
148 const r = m.getBoundingClientRect();
149 point(r.left + r.width / 2, r.top + r.height / 2);
150 };
151 const set = (v: boolean) => {
152 setTouched(true);
153 setOn(v);
154 lens.current.on = v;
155 kickLens();
156 };
157
158 return (
159 <article
160 ref={ref}
161 tabIndex={0}
162 className={`fd-ht${className ? " " + className : ""}`}
163 data-fx={effect}
164 data-on={on ? "" : undefined}
165 data-touched={touched ? "" : undefined}
166 aria-label={`${name}, ${role}`}
167 style={{ ["--fd-ht-accent" as string]: accent, ...style }}
168 onPointerEnter={(e) => {
169 if (e.pointerType === "touch") return;
170 point(e.clientX, e.clientY);
171 set(true);
172 }}
173 onPointerMove={(e) => {
174 if (e.pointerType === "touch") return;
175 point(e.clientX, e.clientY);
176 if (effect === "liquid") kickLens();
177 }}
178 onPointerLeave={(e) => {
179 if (e.pointerType === "touch") return;
180 point(e.clientX, e.clientY);
181 set(false);
182 }}
183 onPointerUp={(e) => {
184 if (e.pointerType !== "touch") return;
185 point(e.clientX, e.clientY);
186 set(!on);
187 }}
188 onFocus={(e) => {
189 if (!e.currentTarget.matches(":focus-visible")) return;
190 center();
191 set(true);
192 }}
193 onBlur={() => set(false)}
194 >
195 <div
196 ref={mediaRef}
197 className="fd-ht-media"
198 style={effect === "liquid" ? { filter: `url(#${fid})` } : undefined}
199 >
200 {effect === "liquid" && (
201 <svg className="fd-ht-defs" aria-hidden="true" width="0" height="0">
202 <filter id={fid} x="0" y="0" width="100%" height="100%" colorInterpolationFilters="sRGB">
203 <feFlood floodColor="rgb(128,128,128)" result="flat" />
204 <feImage ref={feImg} result="lens" x="-200" y="-200" width={LENS} height={LENS} preserveAspectRatio="none" />
205 <feComposite in="lens" in2="flat" operator="over" result="map" />
206 <feDisplacementMap ref={feDisp} in="SourceGraphic" in2="map" scale="0" xChannelSelector="R" yChannelSelector="G" />
207 </filter>
208 </svg>
209 )}
210 <div className="fd-ht-layer fd-ht-base" aria-hidden="true">
211 {media}
212 </div>
213
214 {effect === "slices" ? (
215 [0, 1, 2].map((i) => (
216 <div key={i} className="fd-ht-slice" data-i={i} aria-hidden="true">
217 <div className="fd-ht-slice-art">{media}</div>
218 </div>
219 ))
220 ) : effect === "blob" ? (
221 <>
222 <div className="fd-ht-layer fd-ht-blob fd-ht-blob-lead" aria-hidden="true" />
223 <div className="fd-ht-layer fd-ht-blob fd-ht-reveal" aria-hidden="true">
224 {media}
225 </div>
226 </>
227 ) : (
228 <div className="fd-ht-layer fd-ht-reveal" aria-hidden="true">
229 {media}
230 </div>
231 )}
232
233 {effect === "diagonal" && <span className="fd-ht-sheen" aria-hidden="true" />}
234 {effect === "iris" && <span className="fd-ht-ring" aria-hidden="true" />}
235 {effect === "liquid" && <span className="fd-ht-drop" aria-hidden="true" />}
236 {effect === "strips" && (
237 <div className="fd-ht-strips" aria-hidden="true">
238 {[0, 1, 2, 3, 4].map((i) => (
239 <span key={i} className="fd-ht-strip" style={{ ["--i" as string]: i }} />
240 ))}
241 </div>
242 )}
243 {effect === "pixels" && (
244 <div className="fd-ht-pix" aria-hidden="true">
245 {Array.from({ length: PIX_COLS * PIX_ROWS }, (_, i) => (
246 <span key={i} className="fd-ht-tile" style={{ ["--d" as string]: `${pixDelay(i)}ms` }} />
247 ))}
248 </div>
249 )}
250
251 {info && <div className="fd-ht-info">{info}</div>}
252 </div>
253 <div className="fd-ht-meta">
254 <div className="fd-ht-who">
255 <h3 className="fd-ht-name">{name}</h3>
256 <p className="fd-ht-role">{role}</p>
257 </div>
258 {caption && <span className="fd-ht-cap">{caption}</span>}
259 </div>
260 <style>{css}</style>
261 </article>
262 );
263}
264
265// organic blob, drawn in a 100×100 box
266const BLOB =
267 "data:image/svg+xml;utf8," +
268 encodeURIComponent(
269 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M52 6c13 1 27 6 34 18 8 13 9 27 4 41-5 15-17 27-32 30-16 4-33-2-44-14C4 69 2 52 8 38 15 22 33 5 52 6z"/></svg>',
270 );
271
272const css = `
273.fd-ht{
274 --fd-ease-out:cubic-bezier(0.22,1,0.36,1);--fd-ease-in-out:cubic-bezier(0.65,0,0.35,1);
275 --fd-spring:cubic-bezier(0.34,1.56,0.64,1);
276 --fd-dur-1:120ms;--fd-dur-2:240ms;--fd-dur-3:420ms;--fd-dur-4:700ms;
277 --fd-ht-radius:20px;--fd-ht-ink:#0B0B0F;
278 --fd-ht-sans:ui-sans-serif,-apple-system,BlinkMacSystemFont,"SF Pro Text","Inter","Segoe UI",Roboto,sans-serif;
279 --fd-ht-mono:ui-monospace,"SF Mono","JetBrains Mono",Menlo,monospace;
280 position:relative;display:flex;flex-direction:column;gap:14px;margin:0;padding:0;
281 color:#F5F5F7;background:transparent;outline:none;cursor:default;-webkit-tap-highlight-color:transparent;
282}
283.fd-ht,.fd-ht *,.fd-ht *::before,.fd-ht *::after{box-sizing:border-box}
284.fd-ht:focus-visible .fd-ht-media{outline:2px solid color-mix(in srgb,#0A84FF 70%,transparent);outline-offset:2px}
285.fd-ht-media{
286 --fd-ht-x:50%;--fd-ht-y:50%;
287 position:relative;display:block;aspect-ratio:4/5;width:100%;margin:0;padding:0;overflow:hidden;
288 border-radius:var(--fd-ht-radius);background:#16161B;isolation:isolate;
289 box-shadow:0 0 0 1px rgba(255,255,255,.06) inset;
290}
291.fd-ht-defs{position:absolute;width:0;height:0;overflow:hidden}
292.fd-ht-layer{position:absolute;inset:0;margin:0;padding:0}
293.fd-ht-layer > *,.fd-ht-slice-art > *,.fd-ht-blob-art > *{display:block;width:100%;height:100%}
294.fd-ht-base{filter:grayscale(1) contrast(1.06) brightness(.86)}
295.fd-ht-reveal{z-index:1}
296
297/* info overlay */
298.fd-ht-info{
299 position:absolute;left:0;right:0;bottom:0;z-index:6;margin:0;padding:48px 18px 16px;
300 background:linear-gradient(to top,rgba(8,8,11,.82),rgba(8,8,11,0));color:#F5F5F7;
301 font:400 0.8125rem/1.45 var(--fd-ht-sans);letter-spacing:0;
302 opacity:0;transform:translate3d(0,14px,0);
303 transition:opacity var(--fd-dur-2) var(--fd-ease-out),transform var(--fd-dur-3) var(--fd-ease-out);
304 pointer-events:none;
305}
306.fd-ht[data-on] .fd-ht-info{opacity:1;transform:none;transition-delay:160ms}
307
308/* meta */
309.fd-ht-meta{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0;padding:0 2px}
310.fd-ht-who{min-width:0;margin:0;padding:0}
311.fd-ht-name{margin:0;padding:0;color:#F5F5F7;font:600 0.9375rem/1.25 var(--fd-ht-sans);letter-spacing:-0.005em}
312.fd-ht-role{margin:3px 0 0;padding:0;color:rgba(245,245,247,.56);font:400 0.8125rem/1.3 var(--fd-ht-sans);letter-spacing:0}
313.fd-ht-cap{
314 flex:none;margin:2px 0 0;padding:0;color:rgba(245,245,247,.4);
315 font:500 0.625rem/1.3 var(--fd-ht-mono);letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;
316}
317.fd-ht[data-on] .fd-ht-cap{color:var(--fd-ht-accent)}
318
319/* 1 · blob, an organic SVG mask that grows from the cursor, led by an accent blob */
320.fd-ht-blob{
321 -webkit-mask-image:url("${BLOB}");mask-image:url("${BLOB}");
322 -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
323 -webkit-mask-position:var(--fd-ht-px,50%) var(--fd-ht-py,50%);mask-position:var(--fd-ht-px,50%) var(--fd-ht-py,50%);
324 -webkit-mask-size:0% 0%;mask-size:0% 0%;
325 transition:-webkit-mask-size var(--fd-dur-3) var(--fd-ease-in-out),mask-size var(--fd-dur-3) var(--fd-ease-in-out);
326}
327.fd-ht-blob-lead{z-index:1;background:var(--fd-ht-accent)}
328.fd-ht-blob.fd-ht-reveal{z-index:2}
329.fd-ht[data-on] .fd-ht-blob{
330 -webkit-mask-size:340% 300%;mask-size:340% 300%;
331 transition:-webkit-mask-size 900ms var(--fd-ease-out),mask-size 900ms var(--fd-ease-out);
332}
333.fd-ht[data-on] .fd-ht-blob.fd-ht-reveal{transition-delay:90ms}
334.fd-ht:not([data-on]) .fd-ht-blob-lead{transition-delay:80ms}
335
336/* 2 · diagonal */
337.fd-ht[data-fx="diagonal"] .fd-ht-reveal{
338 clip-path:polygon(0 100%,0 100%,0 100%);
339 transition:clip-path var(--fd-dur-4) var(--fd-ease-in-out);
340}
341.fd-ht[data-fx="diagonal"][data-on] .fd-ht-reveal{clip-path:polygon(0 100%,0 -100%,200% 100%)}
342.fd-ht-sheen{
343 position:absolute;left:-50%;top:50%;width:200%;height:2px;z-index:2;pointer-events:none;
344 background:linear-gradient(90deg,transparent,rgba(255,255,255,.9) 50%,transparent);
345 box-shadow:0 0 18px 4px var(--fd-ht-accent);
346 transform:translate3d(-70%,70%,0) rotate(-51deg);opacity:0;
347 transition:transform var(--fd-dur-4) var(--fd-ease-in-out),opacity var(--fd-dur-4) var(--fd-ease-in-out);
348}
349.fd-ht[data-on] .fd-ht-sheen{transform:translate3d(30%,-60%,0) rotate(-51deg);opacity:0;animation:fd-ht-sheen var(--fd-dur-4) var(--fd-ease-in-out)}
350@keyframes fd-ht-sheen{0%,100%{opacity:0}20%,70%{opacity:1}}
351
352/* 3 · strips */
353.fd-ht-strips{position:absolute;inset:0;z-index:3;display:grid;grid-template-columns:repeat(5,1fr);pointer-events:none}
354.fd-ht-strip{
355 display:block;margin:0 -1px 0 0;height:100%;background:var(--fd-ht-accent);
356 transform:translate3d(0,101%,0);
357 transition:transform var(--fd-dur-4) var(--fd-ease-in-out) calc(var(--i) * 45ms);
358}
359.fd-ht[data-on] .fd-ht-strip{transform:translate3d(0,-101%,0)}
360.fd-ht[data-fx="strips"] .fd-ht-reveal{opacity:0;transition:opacity 1ms linear 380ms}
361.fd-ht[data-fx="strips"][data-on] .fd-ht-reveal{opacity:1}
362
363/* 4 · pixels */
364.fd-ht-pix{position:absolute;inset:0;z-index:3;display:grid;grid-template-columns:repeat(${PIX_COLS},1fr);grid-template-rows:repeat(${PIX_ROWS},1fr);pointer-events:none}
365.fd-ht-tile{display:block;margin:0 -1px -1px 0;background:var(--fd-ht-ink);opacity:0}
366.fd-ht-tile:nth-child(3n){background:var(--fd-ht-accent)}
367.fd-ht-tile:nth-child(5n+1){background:color-mix(in srgb,var(--fd-ht-accent) 45%,var(--fd-ht-ink))}
368.fd-ht-tile:nth-child(7n+2){background:color-mix(in srgb,var(--fd-ht-accent) 70%,#fff)}
369/* each tile: on at its delay, all covered at 230ms (swap), off ~240ms later */
370.fd-ht[data-touched] .fd-ht-tile{animation:fd-ht-pix-b 480ms linear var(--d) both}
371.fd-ht[data-touched][data-on] .fd-ht-tile{animation-name:fd-ht-pix-a}
372@keyframes fd-ht-pix-a{0%{opacity:0}1%,50%{opacity:1}51%,100%{opacity:0}}
373@keyframes fd-ht-pix-b{0%{opacity:0}1%,50%{opacity:1}51%,100%{opacity:0}}
374.fd-ht[data-fx="pixels"] .fd-ht-reveal{opacity:0;transition:opacity 1ms linear 230ms}
375.fd-ht[data-fx="pixels"][data-on] .fd-ht-reveal{opacity:1}
376
377/* 5 · iris */
378.fd-ht[data-fx="iris"] .fd-ht-reveal{
379 clip-path:circle(0px at var(--fd-ht-x) var(--fd-ht-y));
380 transition:clip-path var(--fd-dur-4) var(--fd-ease-in-out);
381}
382.fd-ht[data-fx="iris"][data-on] .fd-ht-reveal{clip-path:circle(120% at var(--fd-ht-x) var(--fd-ht-y))}
383.fd-ht[data-fx="iris"]:not([data-on]) .fd-ht-reveal{transition-timing-function:var(--fd-ease-in-out);transition-duration:var(--fd-dur-3)}
384.fd-ht-ring{
385 position:absolute;left:var(--fd-ht-x);top:var(--fd-ht-y);width:40px;height:40px;margin:-20px 0 0 -20px;z-index:2;
386 border-radius:50%;border:1.5px solid rgba(255,255,255,.85);pointer-events:none;
387 transform:scale(0);opacity:0;
388}
389.fd-ht[data-on] .fd-ht-ring{animation:fd-ht-ring var(--fd-dur-4) var(--fd-ease-out) both}
390@keyframes fd-ht-ring{0%{transform:scale(0);opacity:1}100%{transform:scale(14);opacity:0}}
391
392/* 6 · slices */
393.fd-ht-slice{position:absolute;left:0;width:100%;height:33.4%;overflow:hidden;z-index:1;background:var(--fd-ht-accent);transform:translate3d(-101%,0,0);
394 transition:transform var(--fd-dur-3) var(--fd-ease-in-out)}
395.fd-ht-slice[data-i="0"]{top:0}
396.fd-ht-slice[data-i="1"]{top:33.3%;transform:translate3d(101%,0,0);transition-delay:60ms}
397.fd-ht-slice[data-i="2"]{top:66.6%;transition-delay:120ms}
398.fd-ht-slice-art{position:absolute;left:0;top:0;width:100%;height:300%}
399.fd-ht-slice[data-i="1"] .fd-ht-slice-art{top:-100%}
400.fd-ht-slice[data-i="2"] .fd-ht-slice-art{top:-200%}
401.fd-ht-slice-art{transform:translate3d(-14%,0,0);transition:transform var(--fd-dur-4) var(--fd-ease-out)}
402.fd-ht-slice[data-i="1"] .fd-ht-slice-art{transform:translate3d(14%,0,0)}
403.fd-ht[data-on] .fd-ht-slice,.fd-ht[data-on] .fd-ht-slice .fd-ht-slice-art{transform:none}
404
405/* 7 · focus */
406.fd-ht[data-fx="focus"] .fd-ht-base{filter:grayscale(.6) blur(10px) brightness(.8);transform:scale(1.12)}
407.fd-ht[data-fx="focus"] .fd-ht-reveal{opacity:0;transform:scale(1.08);
408 transition:opacity var(--fd-dur-3) var(--fd-ease-out),transform var(--fd-dur-4) var(--fd-ease-out)}
409.fd-ht[data-fx="focus"][data-on] .fd-ht-reveal{opacity:1;transform:none}
410.fd-ht[data-fx="focus"] .fd-ht-info{
411 top:auto;padding:16px 18px 18px;background:rgba(247,247,249,.94);color:#0B0B0F;
412 border-radius:0;transform:translate3d(0,100%,0);opacity:1;
413 -webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);
414}
415.fd-ht[data-fx="focus"] .fd-ht-info *{color:#0B0B0F}
416.fd-ht[data-fx="focus"][data-on] .fd-ht-info{transform:none;transition-delay:80ms}
417
418/* 8 · liquid */
419.fd-ht-drop{
420 position:absolute;left:var(--fd-ht-x);top:var(--fd-ht-y);width:170px;height:170px;margin:-85px 0 0 -85px;z-index:2;
421 border-radius:50%;pointer-events:none;opacity:0;transform:scale(.4);
422 background:radial-gradient(circle at 34% 30%,rgba(255,255,255,.55) 0,rgba(255,255,255,0) 22%),
423 radial-gradient(circle at 50% 50%,rgba(255,255,255,0) 58%,rgba(255,255,255,.18) 70%,rgba(255,255,255,0) 74%);
424 transition:opacity var(--fd-dur-2) var(--fd-ease-out),transform var(--fd-dur-3) var(--fd-spring);
425}
426.fd-ht[data-on] .fd-ht-drop{opacity:1;transform:none}
427.fd-ht[data-fx="liquid"] .fd-ht-reveal{opacity:0;transition:opacity var(--fd-dur-3) var(--fd-ease-out)}
428.fd-ht[data-fx="liquid"][data-on] .fd-ht-reveal{opacity:1}
429
430@media (prefers-reduced-motion: reduce){
431 .fd-ht *,.fd-ht *::before{animation:none !important;transition-duration:120ms !important;transition-delay:0ms !important}
432 .fd-ht-strips,.fd-ht-pix,.fd-ht-ring,.fd-ht-sheen{display:none}
433 .fd-ht-blob{-webkit-mask-image:none;mask-image:none}
434 .fd-ht-blob-lead{display:none}
435 .fd-ht .fd-ht-reveal{clip-path:none !important;transform:none !important;opacity:0;transition:opacity 120ms linear}
436 .fd-ht[data-on] .fd-ht-reveal{opacity:1}
437 .fd-ht-slice,.fd-ht-slice-art{transform:none !important;opacity:0;transition:opacity 120ms linear}
438 .fd-ht[data-on] .fd-ht-slice{opacity:1}
439 .fd-ht[data-on] .fd-ht-slice-art{opacity:1}
440}
441@media (prefers-contrast: more){.fd-ht-media{box-shadow:0 0 0 1px #F5F5F7 inset}}
442`;
443
444/* ------------------------------------------------------------------ Demo */
445
446const LOOK: Record<string, string> = { p1: "a woman with a gray bob", p2: "a bearded man with dark hair", p3: "a woman with braided hair", p4: "a man with short curly hair", p5: "a smiling man with a short beard", p6: "a woman with long wavy dark hair", p7: "a bearded man in round glasses", p8: "a smiling man with swept-back hair" };
447
448function Portrait({ photo, bg, name, role }: { photo: string; bg: [string, string]; name: string; role: string }) {
449 return (
450 <div className="fd-ht-demo-photo" style={{ background: `linear-gradient(165deg, ${bg[0]}, ${bg[1]})` }}>
451 <img src={`/img/people/${photo}.webp`} width={328} height={328} alt={`${name}, ${role.toLowerCase()}: portrait of ${LOOK[photo] ?? "a person"} in a black sweater`} loading="lazy" decoding="async" />
452 </div>
453 );
454}
455
456const TEAM: {
457 name: string;
458 role: string;
459 effect: HoverEffect;
460 label: string;
461 accent: string;
462 bio: string;
463 focus: string;
464 photo: string;
465 bg: [string, string];
466}[] = [
467 {
468 name: "Amara Okafor",
469 role: "Founder & CEO",
470 effect: "blob",
471 label: "Morph blob",
472 accent: "#FF6B3D",
473 bio: "Ex-DeepMind product. Started Northlight to put agents into regulated industries.",
474 focus: "London",
475 photo: "p1", bg: ["#FFB48A", "#B2462A"],
476 },
477 {
478 name: "Jonas Weber",
479 role: "Head of Research",
480 effect: "diagonal",
481 label: "Diagonal wipe",
482 accent: "#4C7DFF",
483 bio: "Retrieval and long-context reasoning. 31 papers, 2 that actually shipped.",
484 focus: "Berlin",
485 photo: "p2", bg: ["#A7C0FF", "#2C3F8F"],
486 },
487 {
488 name: "Mei Lin Zhao",
489 role: "Principal ML Engineer",
490 effect: "strips",
491 label: "Vertical strips",
492 accent: "#2FBF8F",
493 bio: "Builds the eval harness every model has to pass before it reaches a client.",
494 focus: "Singapore",
495 photo: "p3", bg: ["#9EE6C9", "#1E6E55"],
496 },
497 {
498 name: "Sofia Marquez",
499 role: "Design Director",
500 effect: "pixels",
501 label: "Pixel dissolve",
502 accent: "#F2B33D",
503 bio: "Designs interfaces for systems that think out loud. Previously at a Lisbon type foundry.",
504 focus: "Lisbon",
505 photo: "p4", bg: ["#FFD98A", "#B07A1E"],
506 },
507 {
508 name: "Kwame Mensah",
509 role: "Applied AI Lead",
510 effect: "iris",
511 label: "Circle iris",
512 accent: "#B07BFF",
513 bio: "Turns prototypes into agents that file claims, reconcile ledgers and don’t hallucinate.",
514 focus: "Accra",
515 photo: "p5", bg: ["#D2B6FF", "#5B3AA8"],
516 },
517 {
518 name: "Elin Lindqvist",
519 role: "Product Lead",
520 effect: "slices",
521 label: "Slice shift",
522 accent: "#FF5C8A",
523 bio: "Owns the agent console. Believes every AI feature needs an undo button.",
524 focus: "Stockholm",
525 photo: "p6", bg: ["#FFB3C8", "#A8325A"],
526 },
527 {
528 name: "Ravi Sharma",
529 role: "Infrastructure",
530 effect: "focus",
531 label: "Blur to sharp",
532 accent: "#3DB8F5",
533 bio: "Runs 1.2B tokens a day across three clouds at a 99.98% success rate.",
534 focus: "Bengaluru",
535 photo: "p7", bg: ["#9FDBFA", "#1F6E96"],
536 },
537 {
538 name: "Noor Haddad",
539 role: "Evaluation & Safety",
540 effect: "liquid",
541 label: "Liquid bulge",
542 accent: "#7FD45A",
543 bio: "Red-teams every release. Wrote the playbook our clients’ auditors now ask for.",
544 focus: "Amman",
545 photo: "p8", bg: ["#C6EFA8", "#3F7A2A"],
546 },
547];
548
549export function Demo() {
550 return (
551 <div className="fd-ht-demo">
552 <style>{demoCss}</style>
553 <header className="fd-ht-demo-head">
554 <p className="fd-ht-demo-eyebrow">Northlight Labs, Team</p>
555 <h2 className="fd-ht-demo-h">Eight people. Every agent we ship.</h2>
556 <p className="fd-ht-demo-sub">Hover or tap a portrait, every card uses a different transition.</p>
557 </header>
558 <div className="fd-ht-demo-grid">
559 {TEAM.map((m, i) => (
560 <HoverRevealCard
561 key={m.name}
562 effect={m.effect}
563 accent={m.accent}
564 name={m.name}
565 role={m.role}
566 caption={`${String(i + 1).padStart(2, "0")} · ${m.label}`}
567 media={<Portrait photo={m.photo} bg={m.bg} name={m.name} role={m.role} />}
568 info={
569 <>
570 <span className="fd-ht-demo-loc">{m.focus}</span>
571 <span className="fd-ht-demo-bio">{m.bio}</span>
572 </>
573 }
574 />
575 ))}
576 </div>
577 </div>
578 );
579}
580
581const demoCss = `
582.fd-ht-demo{display:block;margin:0;padding:clamp(40px,6vw,72px) clamp(16px,4vw,56px) 72px;background:#0B0B0F;color:#F5F5F7;min-height:100vh}
583.fd-ht-demo,.fd-ht-demo *{box-sizing:border-box}
584.fd-ht-demo-head{max-width:1200px;margin:0 auto 36px;padding:0}
585.fd-ht-demo-eyebrow{margin:0 0 12px;padding:0;color:rgba(245,245,247,.5);font:500 0.75rem/1.2 ui-monospace,"SF Mono","JetBrains Mono",Menlo,monospace;letter-spacing:.06em;text-transform:uppercase}
586.fd-ht-demo-h{margin:0;padding:0;color:#F5F5F7;font:650 clamp(2rem,4.4vw,2.75rem)/1.04 "SF Pro Display",ui-sans-serif,-apple-system,"Inter Display","Inter","Segoe UI",sans-serif;letter-spacing:-0.03em}
587.fd-ht-demo-sub{margin:12px 0 0;padding:0;color:rgba(245,245,247,.6);font:400 1.0625rem/1.45 ui-sans-serif,-apple-system,"Inter","Segoe UI",sans-serif}
588.fd-ht-demo-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:36px 20px;max-width:1200px;margin:0 auto;padding:0}
589@media (max-width:900px){.fd-ht-demo-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:28px 12px}}
590.fd-ht-demo-photo{display:block;width:100%;height:100%;margin:0;padding:0}
591.fd-ht-demo-photo img{display:block;width:100%;height:100%;max-width:none;margin:0;padding:0;object-fit:cover;object-position:center top;mix-blend-mode:multiply}
592.fd-ht-demo-loc{display:block;margin:0 0 4px;font:500 0.6875rem/1.2 ui-monospace,"SF Mono","JetBrains Mono",Menlo,monospace;letter-spacing:.06em;text-transform:uppercase;opacity:.7}
593.fd-ht-demo-bio{display:block;margin:0;font:400 0.8125rem/1.45 ui-sans-serif,-apple-system,"Inter","Segoe UI",sans-serif}
594@media (max-width:600px){.fd-ht-demo .fd-ht-cap{display:none}.fd-ht-demo .fd-ht-info{padding:36px 12px 12px}.fd-ht-demo-bio{font-size:0.75rem}}
595`;

More Scroll & Hover Effects. Same file contract.

Scroll Split Card, effects preview: Scroll animation card in React: a pinned card splits into three panels that fan out in 3D and flip to reveal…

Scroll Split Card

Scroll animation card in React: a pinned card splits into three panels that fan out in 3D and flip to reveal services.

Sticky Storytelling, effects preview: Scrollytelling section for React: pinned media morphs between four states while text steps scroll past a…

Sticky Storytelling

Scrollytelling section for React: pinned media morphs between four states while text steps scroll past a progress rail.

Text Reveal on Scroll, effects preview: Scroll text reveal: a manifesto whose words light up as you scroll, with hand-drawn marker underlines on key…

Text Reveal on Scroll

Scroll text reveal: a manifesto whose words light up as you scroll, with hand-drawn marker underlines on key words.

Questions about Hover Transitions

Run npx shadcn@latest add https://freedesignmd.com/r/hover-transitions.json, or open the page and copy the file into your project. It has zero dependencies besides React. What you copy is the exact file that renders the live demo.

Eight hover effects for React profile cards: morph blob, diagonal wipe, pixel dissolve, iris, slices, focus and a liquid lens. It is a free, MIT-licensed React scroll & hover effects component from the freedesignmd library.

Yes. It is free and MIT-licensed, use, modify and ship it in personal and commercial projects without attribution.

Evergreen browsers. Blob morph needs @property; the liquid lens uses an SVG filter on HTML (Chromium, Firefox; Safari crossfades).

Yes. It is a plain React component with its own styles, so it runs in Next.js, Vite, Remix and Lovable projects, and it needs no Tailwind setup. It has zero dependencies besides React.