Designer portfolio
A one-page portfolio where hovering a project row summons its cover image, which glides after the cursor and tilts with its speed.
"use client";
import { useEffect, useRef, useState, type PointerEvent } from "react";
import "./designer-portfolio.css";
type Project = {
title: string;
kind: string;
year: string;
image: string;
tone: string;
};
const PROJECTS: Project[] = [
{
title: "Tidewater",
kind: "Banking app",
year: "2026",
image: "/images/portfolio-designer-project-01.jpg",
tone: "#ff5a1f",
},
{
title: "Field Notes",
kind: "Journaling app",
year: "2025",
image: "/images/portfolio-designer-project-02.jpg",
tone: "#2b35ff",
},
{
title: "Kiln",
kind: "Ceramics shop",
year: "2025",
image: "/images/portfolio-designer-project-03.jpg",
tone: "#0e0e10",
},
{
title: "Overpass",
kind: "Transit maps",
year: "2024",
image: "/images/portfolio-designer-project-04.jpg",
tone: "#c6a15b",
},
];
/** Cover image over a tone-colored placeholder (shown until the real file exists). */
function Cover({ p, className }: { p: Project; className: string }) {
const img = useRef<HTMLImageElement>(null);
useEffect(() => {
const el = img.current;
if (el && el.complete && el.naturalWidth === 0) el.style.display = "none";
}, []);
return (
<div className={className} style={{ ["--tone" as string]: p.tone }}>
<span className="gu-folio__ph-label">{p.title}</span>
<img
ref={img}
src={p.image}
alt=""
loading="lazy"
onError={(e) => (e.currentTarget.style.display = "none")}
/>
</div>
);
}
/**
* DesignerPortfolio: one-page portfolio for "Lena Ortiz".
* Mouse: hovering a project shows a floating cover that follows the cursor
* with a soft lag and tilts in the direction it moves.
* Touch: covers are shown inside each row instead.
*/
export function DesignerPortfolio() {
const root = useRef<HTMLDivElement>(null);
const float = useRef<HTMLDivElement>(null);
const [active, setActive] = useState<number | null>(null);
const target = useRef({ x: 0, y: 0 });
// Smoothly chase the pointer (lerp) and tilt by horizontal speed.
useEffect(() => {
const reduce = window.matchMedia(
"(prefers-reduced-motion: reduce)",
).matches;
let x = 0,
y = 0,
raf = 0;
const loop = () => {
const t = target.current;
const dx = (t.x - x) * 0.14;
x += dx;
y += (t.y - y) * 0.14;
const tilt = reduce ? 0 : Math.max(-12, Math.min(12, dx * 0.6));
if (float.current && !reduce)
float.current.style.transform = `translate3d(${x}px, ${y}px, 0) translate(-50%, -50%) rotate(${tilt}deg)`;
raf = requestAnimationFrame(loop);
};
raf = requestAnimationFrame(loop);
return () => cancelAnimationFrame(raf);
}, []);
const onMove = (e: PointerEvent<HTMLDivElement>) => {
const r = root.current?.getBoundingClientRect();
if (r) target.current = { x: e.clientX - r.left, y: e.clientY - r.top };
};
return (
<div className="gu-folio" ref={root} onPointerMove={onMove}>
<header className="gu-folio__top">
<a href="#" className="gu-folio__name">
Lena Ortiz
</a>
<a href="mailto:lena@example.com" className="gu-folio__mail">
lena@example.com
</a>
</header>
<section className="gu-folio__hero">
<h1>
Product designer making <em>calm</em> software for busy people.
</h1>
<p>
Currently leading design at a small fintech team. Previously at two
studios and one very loud startup.
</p>
</section>
<section aria-labelledby="gu-folio-work">
<h2 id="gu-folio-work" className="gu-folio__label">
Selected work
</h2>
<ul className="gu-folio__list" onPointerLeave={() => setActive(null)}>
{PROJECTS.map((p, i) => (
<li
key={p.title}
onPointerEnter={(e) => e.pointerType === "mouse" && setActive(i)}
>
<a
href="#"
className="gu-folio__row"
onFocus={() => setActive(i)}
onBlur={() => setActive(null)}
>
<span className="gu-folio__title">{p.title}</span>
<span className="gu-folio__kind">{p.kind}</span>
<span className="gu-folio__year">{p.year}</span>
<Cover p={p} className="gu-folio__inline" />
</a>
</li>
))}
</ul>
</section>
{/* The floating cover, mouse only */}
<div
ref={float}
className="gu-folio__float"
data-show={active !== null || undefined}
aria-hidden="true"
>
{PROJECTS.map((p, i) => (
<div
key={p.title}
className="gu-folio__float-item"
data-on={i === active || undefined}
>
<Cover p={p} className="gu-folio__float-cover" />
</div>
))}
</div>
<footer className="gu-folio__footer">
<p>Open to freelance work from spring.</p>
<a href="mailto:lena@example.com">Say hello</a>
</footer>
</div>
);
}
Paste this into ChatGPT, Claude, Cursor, v0, Lovable or Bolt. It describes the layout, motion, colors and accessibility and includes the code, so the AI can rebuild it in any framework.
# Build this UI piece: Designer portfolio
You are a senior front-end engineer. Recreate the piece below in my project. If I don't say which framework I use, ask once, then build it in that framework (React, Vue, Svelte, Angular, Astro, plain HTML/CSS/JS or anything else). Keep the behavior, motion, colors, spacing and accessibility exactly as described. Keep the code clean and commented for beginners.
## What it is
A light, one-page portfolio for a product designer ("Lena Ortiz"). Big statement headline, then a list of projects as huge typographic rows. Hovering a row (mouse) summons that project's cover image, which glides after the cursor with a soft lag, tilts with horizontal speed and wipes between projects. On touch screens each cover is shown inside its row instead.
## Palette
Background #f3eee3, text #0e0e10, muted #57534b, hairlines rgba(14,14,16,0.16), accent #ff5a1f. Placeholder tones per project: #ff5a1f, #2b35ff, #0e0e10, #c6a15b.
## Layout
- Container queries (container-type: inline-size on the root), 20px side padding, root position relative and overflow hidden.
- Top bar: name left, email right (muted), bold.
- Hero: h1 max 15ch, weight 800, clamp(2.4rem, 8cqi, 5.4rem), line-height 0.95, letter-spacing -0.05em; the word "calm" in an italic serif (Georgia) weight 400. Paragraph muted, max 44ch.
- "Selected work" small muted label, then rows: grid with title (clamp(2rem, 7cqi, 4.4rem), weight 900) and year on the right, project type below in muted text; hairline borders between rows.
- Covers: 4:3 floating card (width clamp(220px, 30cqi, 360px), 18px radius, long soft shadow) or 16:10 inline image (16px radius) on touch devices. While the real image is missing, the frame shows a radial gradient of the project tone with faint diagonal stripes and the project title in white; the <img> hides itself on error.
## Motion
- Hovering the list dims all titles to 25% ink; the hovered title returns to full ink and slides right 14px (0.5s, cubic-bezier(0.16,1,0.3,1)).
- Floating cover: a requestAnimationFrame loop lerps its position toward the pointer (factor 0.14) relative to the root; tilt = clamp(dx × 0.6, −12deg, 12deg). It fades and scales from 0.6 to 1 when the list is hovered.
- Switching projects: each cover sits in the same frame and wipes in from the bottom with clip-path inset(100% 0 0 0) → inset(0) over 0.55s.
- Only devices with (hover: hover) and (pointer: fine) get the floating cover.
## Accessibility
- Rows are links; keyboard focus also activates the matching cover. Floating cover is aria-hidden (decorative); inline covers have empty alt because the title is the link text.
- Focus: 2px orange outline. Footer CTA "Say hello" is a 48px orange pill.
- prefers-reduced-motion: the floating cover rests in the lower right, no chasing, no tilt, no title slide.
## Reference implementation
The original is written in React with one plain CSS file. Dependencies: none (plain React and CSS). Translate it faithfully; do not add new libraries unless my framework needs them.
### DesignerPortfolio.tsx
```tsx
"use client";
import { useEffect, useRef, useState, type PointerEvent } from "react";
import "./designer-portfolio.css";
type Project = {
title: string;
kind: string;
year: string;
image: string;
tone: string;
};
const PROJECTS: Project[] = [
{
title: "Tidewater",
kind: "Banking app",
year: "2026",
image: "/images/portfolio-designer-project-01.jpg",
tone: "#ff5a1f",
},
{
title: "Field Notes",
kind: "Journaling app",
year: "2025",
image: "/images/portfolio-designer-project-02.jpg",
tone: "#2b35ff",
},
{
title: "Kiln",
kind: "Ceramics shop",
year: "2025",
image: "/images/portfolio-designer-project-03.jpg",
tone: "#0e0e10",
},
{
title: "Overpass",
kind: "Transit maps",
year: "2024",
image: "/images/portfolio-designer-project-04.jpg",
tone: "#c6a15b",
},
];
/** Cover image over a tone-colored placeholder (shown until the real file exists). */
function Cover({ p, className }: { p: Project; className: string }) {
const img = useRef<HTMLImageElement>(null);
useEffect(() => {
const el = img.current;
if (el && el.complete && el.naturalWidth === 0) el.style.display = "none";
}, []);
return (
<div className={className} style={{ ["--tone" as string]: p.tone }}>
<span className="gu-folio__ph-label">{p.title}</span>
<img
ref={img}
src={p.image}
alt=""
loading="lazy"
onError={(e) => (e.currentTarget.style.display = "none")}
/>
</div>
);
}
/**
* DesignerPortfolio: one-page portfolio for "Lena Ortiz".
* Mouse: hovering a project shows a floating cover that follows the cursor
* with a soft lag and tilts in the direction it moves.
* Touch: covers are shown inside each row instead.
*/
export function DesignerPortfolio() {
const root = useRef<HTMLDivElement>(null);
const float = useRef<HTMLDivElement>(null);
const [active, setActive] = useState<number | null>(null);
const target = useRef({ x: 0, y: 0 });
// Smoothly chase the pointer (lerp) and tilt by horizontal speed.
useEffect(() => {
const reduce = window.matchMedia(
"(prefers-reduced-motion: reduce)",
).matches;
let x = 0,
y = 0,
raf = 0;
const loop = () => {
const t = target.current;
const dx = (t.x - x) * 0.14;
x += dx;
y += (t.y - y) * 0.14;
const tilt = reduce ? 0 : Math.max(-12, Math.min(12, dx * 0.6));
if (float.current && !reduce)
float.current.style.transform = `translate3d(${x}px, ${y}px, 0) translate(-50%, -50%) rotate(${tilt}deg)`;
raf = requestAnimationFrame(loop);
};
raf = requestAnimationFrame(loop);
return () => cancelAnimationFrame(raf);
}, []);
const onMove = (e: PointerEvent<HTMLDivElement>) => {
const r = root.current?.getBoundingClientRect();
if (r) target.current = { x: e.clientX - r.left, y: e.clientY - r.top };
};
return (
<div className="gu-folio" ref={root} onPointerMove={onMove}>
<header className="gu-folio__top">
<a href="#" className="gu-folio__name">
Lena Ortiz
</a>
<a href="mailto:lena@example.com" className="gu-folio__mail">
lena@example.com
</a>
</header>
<section className="gu-folio__hero">
<h1>
Product designer making <em>calm</em> software for busy people.
</h1>
<p>
Currently leading design at a small fintech team. Previously at two
studios and one very loud startup.
</p>
</section>
<section aria-labelledby="gu-folio-work">
<h2 id="gu-folio-work" className="gu-folio__label">
Selected work
</h2>
<ul className="gu-folio__list" onPointerLeave={() => setActive(null)}>
{PROJECTS.map((p, i) => (
<li
key={p.title}
onPointerEnter={(e) => e.pointerType === "mouse" && setActive(i)}
>
<a
href="#"
className="gu-folio__row"
onFocus={() => setActive(i)}
onBlur={() => setActive(null)}
>
<span className="gu-folio__title">{p.title}</span>
<span className="gu-folio__kind">{p.kind}</span>
<span className="gu-folio__year">{p.year}</span>
<Cover p={p} className="gu-folio__inline" />
</a>
</li>
))}
</ul>
</section>
{/* The floating cover, mouse only */}
<div
ref={float}
className="gu-folio__float"
data-show={active !== null || undefined}
aria-hidden="true"
>
{PROJECTS.map((p, i) => (
<div
key={p.title}
className="gu-folio__float-item"
data-on={i === active || undefined}
>
<Cover p={p} className="gu-folio__float-cover" />
</div>
))}
</div>
<footer className="gu-folio__footer">
<p>Open to freelance work from spring.</p>
<a href="mailto:lena@example.com">Say hello</a>
</footer>
</div>
);
}
```
### designer-portfolio.css
```css
.gu-folio {
--bg: #f3eee3;
--text: #0e0e10;
--muted: #57534b;
--line: rgb(14 14 16 / 0.16);
--accent: #ff5a1f;
position: relative;
container-type: inline-size;
overflow: hidden;
padding: 0 20px;
background: var(--bg);
color: var(--text);
font-family: system-ui, sans-serif;
}
.gu-folio a {
color: inherit;
text-decoration: none;
}
.gu-folio a:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 4px;
}
.gu-folio__top {
display: flex;
justify-content: space-between;
gap: 12px;
padding: 22px 0;
font-weight: 700;
}
.gu-folio__mail {
color: var(--muted) !important;
}
.gu-folio__hero {
padding: 48px 0 72px;
}
.gu-folio__hero h1 {
max-width: 15ch;
margin: 0;
font-size: clamp(2.4rem, 8cqi, 5.4rem);
font-weight: 800;
line-height: 0.95;
letter-spacing: -0.05em;
}
.gu-folio__hero em {
font-family: Georgia, "Times New Roman", serif;
font-weight: 400;
font-style: italic;
letter-spacing: -0.03em;
}
.gu-folio__hero p {
max-width: 44ch;
margin: 24px 0 0;
color: var(--muted);
line-height: 1.55;
}
.gu-folio__label {
margin: 0 0 8px;
color: var(--muted);
font-size: 0.9rem;
}
/* Project rows */
.gu-folio__list {
margin: 0;
padding: 0;
list-style: none;
border-bottom: 1px solid var(--line);
}
.gu-folio__row {
display: grid;
grid-template-columns: 1fr auto;
align-items: baseline;
gap: 4px 16px;
padding: 22px 0;
border-top: 1px solid var(--line);
}
.gu-folio__title {
font-size: clamp(2rem, 7cqi, 4.4rem);
font-weight: 900;
line-height: 1;
letter-spacing: -0.05em;
transition:
transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
color 0.3s;
}
.gu-folio__kind {
grid-column: 1;
color: var(--muted);
}
.gu-folio__year {
grid-row: 1;
grid-column: 2;
color: var(--muted);
font-variant-numeric: tabular-nums;
}
.gu-folio__list:hover .gu-folio__title {
color: rgb(14 14 16 / 0.25);
}
.gu-folio__list li:hover .gu-folio__title,
.gu-folio__row:focus-visible .gu-folio__title {
color: var(--text);
transform: translateX(14px);
}
/* Covers + placeholder look */
.gu-folio__inline,
.gu-folio__float-cover {
position: relative;
overflow: hidden;
background:
repeating-linear-gradient(
-45deg,
rgb(255 255 255 / 0.12) 0 2px,
transparent 2px 16px
),
radial-gradient(
130% 100% at 0% 0%,
color-mix(in srgb, var(--tone) 65%, #fff),
var(--tone)
);
}
.gu-folio__inline img,
.gu-folio__float-cover img {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.gu-folio__ph-label {
position: absolute;
left: 14px;
bottom: 12px;
color: #fff;
font-weight: 900;
font-size: 1.1rem;
letter-spacing: -0.03em;
}
.gu-folio__inline {
grid-column: 1 / -1;
aspect-ratio: 16 / 10;
margin-top: 14px;
border-radius: 16px;
}
/* Floating preview (mouse devices only) */
.gu-folio__float {
display: none;
}
@media (hover: hover) and (pointer: fine) {
.gu-folio__inline {
display: none;
}
.gu-folio__float {
position: absolute;
top: 0;
left: 0;
z-index: 5;
display: block;
width: clamp(220px, 30cqi, 360px);
aspect-ratio: 4 / 3;
pointer-events: none;
opacity: 0;
scale: 0.6;
transition:
opacity 0.3s,
scale 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.gu-folio__float[data-show] {
opacity: 1;
scale: 1;
}
.gu-folio__float-item {
position: absolute;
inset: 0;
overflow: hidden;
border-radius: 18px;
clip-path: inset(100% 0 0 0);
transition: clip-path 0.55s cubic-bezier(0.16, 1, 0.3, 1);
box-shadow: 0 30px 60px -30px rgb(14 14 16 / 0.6);
}
.gu-folio__float-item[data-on] {
clip-path: inset(0 0 0 0);
}
.gu-folio__float-cover {
position: absolute;
inset: 0;
}
}
.gu-folio__footer {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
gap: 16px;
padding: 64px 0;
}
.gu-folio__footer p {
margin: 0;
font-size: 1.3rem;
font-weight: 700;
letter-spacing: -0.02em;
}
.gu-folio__footer a {
display: inline-flex;
align-items: center;
min-height: 48px;
padding: 0 24px;
border-radius: 999px;
background: var(--accent);
color: #0e0e10;
font-weight: 800;
}
/* Reduced motion: the preview rests on the right, no chasing or tilting. */
@media (prefers-reduced-motion: reduce) {
.gu-folio__float {
top: auto !important;
left: auto !important;
right: 20px;
bottom: 120px;
transform: none !important;
transition: opacity 0.2s !important;
scale: 1 !important;
}
.gu-folio__title {
transition: color 0.2s;
}
.gu-folio__list li:hover .gu-folio__title {
transform: none;
}
}
```
You might also want
Next piece: Developer portfolioFashion designer portfolio with a lookbook loupe
Portfolios, advanced
Filmmaker portfolio with a screening room
Portfolios, advanced
Interior designer portfolio with a floor plan
Portfolios, advanced



