Agency page with stacking cases
A dark agency site where case studies pin and stack on top of each other as you scroll, each with one big result.
"use client";
import { useEffect, useRef, useState, type CSSProperties } from "react";
import "./agency-page.css";
/**
* AgencyPage: a dark one-page site for a digital agency ("Fieldwork").
* Its signature: case studies are cards that stack on top of each other as you scroll.
* Edit CASES below and drop the photos into /public/images.
*/
type Case = {
client: string;
title: string;
what: string;
result: string;
resultLabel: string;
image: string;
alt: string;
tone: string;
};
const CASES: Case[] = [
{
client: "Jadran Lines",
title: "Ferry tickets in three taps",
what: "Booking app, iOS and Android",
result: "64%",
resultLabel: "of tickets now sold in the app",
image: "/images/landing-agency-case-01.jpg",
alt: "A white passenger ferry docked in a stone harbor in the early morning",
tone: "#2b35ff",
},
{
client: "Moka Roasters",
title: "A coffee brand you can spot across a shop",
what: "Brand identity and packaging",
result: "3×",
resultLabel: "wholesale accounts in a year",
image: "/images/landing-agency-case-02.jpg",
alt: "Rows of coffee bags with bold orange labels on a wooden roastery shelf",
tone: "#ff5a1f",
},
{
client: "Museum of Small Things",
title: "An exhibition that keeps going online",
what: "Website and digital guide",
result: "410k",
resultLabel: "visits in the first month",
image: "/images/landing-agency-case-03.jpg",
alt: "A quiet museum gallery with small objects in lit glass cases",
tone: "#57534b",
},
{
client: "Lumo Bikes",
title: "Launching an e-bike in six cities",
what: "Launch campaign and online store",
result: "€2.1M",
resultLabel: "in pre-orders before launch day",
image: "/images/landing-agency-case-04.jpg",
alt: "A dark green commuter e-bike leaning against an old brick wall",
tone: "#d7ff3a",
},
];
const SERVICES = [
"Product design",
"Brand identity",
"Websites",
"Mobile apps",
"Launch campaigns",
];
/** Photo with a toned placeholder underneath until the file exists. */
function Shot({ src, alt, tone }: { src: string; alt: string; tone: string }) {
const img = useRef<HTMLImageElement>(null);
const [missing, setMissing] = useState(false);
useEffect(() => {
const el = img.current;
if (el && el.complete && el.naturalWidth === 0) setMissing(true);
}, []);
return (
<div
className="gu-agency__shot"
style={{ "--tone": tone } as CSSProperties}
>
{!missing && (
<img
ref={img}
src={src}
alt={alt}
loading="lazy"
onError={() => setMissing(true)}
/>
)}
</div>
);
}
export function AgencyPage() {
return (
<div className="gu-agency">
<nav className="gu-agency__nav" aria-label="Main">
<a href="#" className="gu-agency__logo">
Fieldwork
</a>
<a href="#agency-work">Work</a>
<a href="#agency-contact" className="gu-agency__cta">
Start a project
</a>
</nav>
<header className="gu-agency__hero">
<p className="gu-agency__now">
<span className="gu-agency__live" aria-hidden="true" />
Right now: building a booking app for a ferry company in Split.
</p>
<h1>
We design and build the digital side of companies that make real
things.
</h1>
<dl className="gu-agency__facts">
<div>
<dt>Projects shipped</dt>
<dd>140</dd>
</div>
<div>
<dt>People</dt>
<dd>22</dd>
</div>
<div>
<dt>Clients who came back</dt>
<dd>71%</dd>
</div>
</dl>
</header>
<section
id="agency-work"
className="gu-agency__work"
aria-labelledby="gu-agency-work"
>
<h2 id="gu-agency-work">Selected work</h2>
<ol className="gu-agency__stack">
{CASES.map((c, i) => (
<li
key={c.client}
className="gu-agency__case"
style={{ "--i": i } as CSSProperties}
>
<article>
<Shot src={c.image} alt={c.alt} tone={c.tone} />
<div className="gu-agency__case-body">
<p className="gu-agency__client">
{c.client}
<span>{c.what}</span>
</p>
<h3>{c.title}</h3>
<p className="gu-agency__result">
<strong>{c.result}</strong>
{c.resultLabel}
</p>
<a href="#" className="gu-agency__read">
Read the case study
<span className="gu-agency__sr">: {c.title}</span>
</a>
</div>
</article>
</li>
))}
</ol>
</section>
<section
className="gu-agency__services"
aria-labelledby="gu-agency-services"
>
<h2 id="gu-agency-services">What we do</h2>
<ul>
{SERVICES.map((s) => (
<li key={s}>{s}</li>
))}
</ul>
</section>
<section className="gu-agency__quote" aria-label="Client quote">
<blockquote>
<p>
“They asked better questions in the first week than our last
agency did in a year.”
</p>
<footer>Ana Kovač, COO, Jadran Lines</footer>
</blockquote>
</section>
<section id="agency-contact" className="gu-agency__contact">
<h2>Got a hard problem and a real deadline?</h2>
<a href="mailto:hello@example.com" className="gu-agency__mail">
hello@example.com
</a>
<p>We reply within one working day, usually with questions.</p>
</section>
<footer className="gu-agency__foot">
<span>© 2026 Fieldwork, Rotterdam</span>
<a href="#">Careers</a>
<a href="#">Privacy</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: Agency page with stacking cases
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 dark one-page site for a digital agency ("Fieldwork") that works for companies making physical things. Its signature: the case studies are big cards that pin and stack on top of each other as you scroll, each one a few pixels lower than the last. Sections: nav, hero (a live "Right now" status pill, a big statement, three facts), stacking case studies with photo, client, title and one large result number, a giant services list, a serif quote, an orange contact block with a huge email and a footer.
## Palette
Background #0e0e10, cards #18181b, text #f3eee3, muted #aea89c, lines rgba(243,238,227,0.14), accent #ff5a1f (result numbers, contact block, service hover), lime #d7ff3a only for the live dot and the focus ring. Image placeholder tones per case: #2b35ff, #ff5a1f, #57534b, #d7ff3a.
## Layout
- Root uses container queries (container-type: inline-size) and overflow-x: clip (not hidden, so sticky works). Side padding 5%.
- Hero: a pill with a pulsing lime dot and the current project; a headline max 17ch up to 6.4rem, weight 900, line-height 0.92; a row of three facts (big number above, label below) after a hairline.
- Case studies: an ordered list; each item is `position: sticky; top: calc(20px + index × 18px)`, so each new card slides over the last and the earlier edges stay visible like a stack.
- Card: 28px radius, 1px line border, card background, a shadow above it. At ≥720px two columns (photo 1.25fr, text 1fr) with a 420px minimum height; on phones the photo sits on top at 16:10.
- Text: client in bold with the service below, a title up to 2.8rem, a large orange result with its label, and a "Read the case study" link with an underline that shrinks on hover.
- Services: each service on its own line up to 5rem, weight 900, separated by hairlines; on hover it indents 18px and turns orange.
- Quote: italic serif up to 3.4rem, max 24ch.
- Contact: orange block, ink text, a short question, then the email up to 7rem.
## Images
Four photos, 1600×1000 (16:10), object-fit: cover. Until a file exists, its frame shows the case's tone as a radial gradient with faint diagonal stripes.
## Motion
- The live dot pulses every 2s.
- Case photos zoom to 1.04 over 1s on hover. Stacking comes from sticky positioning alone, with no JavaScript.
## Accessibility
- Cases are a real ordered list of articles. Each "Read the case study" link includes the case title in visually hidden text.
- Facts use a definition list. Photos have descriptive alt text.
- Focus ring: 2px lime outline.
- prefers-reduced-motion: no pulse, no zoom, no indents. The stacking stays, because it is ordinary scrolling.
## 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.
### AgencyPage.tsx
```tsx
"use client";
import { useEffect, useRef, useState, type CSSProperties } from "react";
import "./agency-page.css";
/**
* AgencyPage: a dark one-page site for a digital agency ("Fieldwork").
* Its signature: case studies are cards that stack on top of each other as you scroll.
* Edit CASES below and drop the photos into /public/images.
*/
type Case = {
client: string;
title: string;
what: string;
result: string;
resultLabel: string;
image: string;
alt: string;
tone: string;
};
const CASES: Case[] = [
{
client: "Jadran Lines",
title: "Ferry tickets in three taps",
what: "Booking app, iOS and Android",
result: "64%",
resultLabel: "of tickets now sold in the app",
image: "/images/landing-agency-case-01.jpg",
alt: "A white passenger ferry docked in a stone harbor in the early morning",
tone: "#2b35ff",
},
{
client: "Moka Roasters",
title: "A coffee brand you can spot across a shop",
what: "Brand identity and packaging",
result: "3×",
resultLabel: "wholesale accounts in a year",
image: "/images/landing-agency-case-02.jpg",
alt: "Rows of coffee bags with bold orange labels on a wooden roastery shelf",
tone: "#ff5a1f",
},
{
client: "Museum of Small Things",
title: "An exhibition that keeps going online",
what: "Website and digital guide",
result: "410k",
resultLabel: "visits in the first month",
image: "/images/landing-agency-case-03.jpg",
alt: "A quiet museum gallery with small objects in lit glass cases",
tone: "#57534b",
},
{
client: "Lumo Bikes",
title: "Launching an e-bike in six cities",
what: "Launch campaign and online store",
result: "€2.1M",
resultLabel: "in pre-orders before launch day",
image: "/images/landing-agency-case-04.jpg",
alt: "A dark green commuter e-bike leaning against an old brick wall",
tone: "#d7ff3a",
},
];
const SERVICES = [
"Product design",
"Brand identity",
"Websites",
"Mobile apps",
"Launch campaigns",
];
/** Photo with a toned placeholder underneath until the file exists. */
function Shot({ src, alt, tone }: { src: string; alt: string; tone: string }) {
const img = useRef<HTMLImageElement>(null);
const [missing, setMissing] = useState(false);
useEffect(() => {
const el = img.current;
if (el && el.complete && el.naturalWidth === 0) setMissing(true);
}, []);
return (
<div
className="gu-agency__shot"
style={{ "--tone": tone } as CSSProperties}
>
{!missing && (
<img
ref={img}
src={src}
alt={alt}
loading="lazy"
onError={() => setMissing(true)}
/>
)}
</div>
);
}
export function AgencyPage() {
return (
<div className="gu-agency">
<nav className="gu-agency__nav" aria-label="Main">
<a href="#" className="gu-agency__logo">
Fieldwork
</a>
<a href="#agency-work">Work</a>
<a href="#agency-contact" className="gu-agency__cta">
Start a project
</a>
</nav>
<header className="gu-agency__hero">
<p className="gu-agency__now">
<span className="gu-agency__live" aria-hidden="true" />
Right now: building a booking app for a ferry company in Split.
</p>
<h1>
We design and build the digital side of companies that make real
things.
</h1>
<dl className="gu-agency__facts">
<div>
<dt>Projects shipped</dt>
<dd>140</dd>
</div>
<div>
<dt>People</dt>
<dd>22</dd>
</div>
<div>
<dt>Clients who came back</dt>
<dd>71%</dd>
</div>
</dl>
</header>
<section
id="agency-work"
className="gu-agency__work"
aria-labelledby="gu-agency-work"
>
<h2 id="gu-agency-work">Selected work</h2>
<ol className="gu-agency__stack">
{CASES.map((c, i) => (
<li
key={c.client}
className="gu-agency__case"
style={{ "--i": i } as CSSProperties}
>
<article>
<Shot src={c.image} alt={c.alt} tone={c.tone} />
<div className="gu-agency__case-body">
<p className="gu-agency__client">
{c.client}
<span>{c.what}</span>
</p>
<h3>{c.title}</h3>
<p className="gu-agency__result">
<strong>{c.result}</strong>
{c.resultLabel}
</p>
<a href="#" className="gu-agency__read">
Read the case study
<span className="gu-agency__sr">: {c.title}</span>
</a>
</div>
</article>
</li>
))}
</ol>
</section>
<section
className="gu-agency__services"
aria-labelledby="gu-agency-services"
>
<h2 id="gu-agency-services">What we do</h2>
<ul>
{SERVICES.map((s) => (
<li key={s}>{s}</li>
))}
</ul>
</section>
<section className="gu-agency__quote" aria-label="Client quote">
<blockquote>
<p>
“They asked better questions in the first week than our last
agency did in a year.”
</p>
<footer>Ana Kovač, COO, Jadran Lines</footer>
</blockquote>
</section>
<section id="agency-contact" className="gu-agency__contact">
<h2>Got a hard problem and a real deadline?</h2>
<a href="mailto:hello@example.com" className="gu-agency__mail">
hello@example.com
</a>
<p>We reply within one working day, usually with questions.</p>
</section>
<footer className="gu-agency__foot">
<span>© 2026 Fieldwork, Rotterdam</span>
<a href="#">Careers</a>
<a href="#">Privacy</a>
</footer>
</div>
);
}
```
### agency-page.css
```css
/* AgencyPage: change these colors to match your brand. */
.gu-agency {
--bg: #0e0e10;
--card: #18181b;
--text: #f3eee3;
--muted: #aea89c;
--line: rgb(243 238 227 / 0.14);
--accent: #ff5a1f;
--volt: #d7ff3a;
--ease: cubic-bezier(0.16, 1, 0.3, 1);
container-type: inline-size;
/* clip (not hidden) so the case cards can stick */
overflow-x: clip;
background: var(--bg);
color: var(--text);
font-family: system-ui, sans-serif;
}
.gu-agency a {
color: inherit;
text-decoration: none;
}
.gu-agency :focus-visible {
outline: 2px solid var(--volt);
outline-offset: 3px;
}
.gu-agency h1,
.gu-agency h2,
.gu-agency h3,
.gu-agency p,
.gu-agency dl,
.gu-agency dd {
margin: 0;
}
.gu-agency__sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.gu-agency__nav {
display: flex;
align-items: center;
gap: 24px;
padding: 18px 5%;
font-weight: 700;
}
.gu-agency__logo {
margin-right: auto;
font-size: 1.2rem;
font-weight: 900;
letter-spacing: -0.04em;
}
.gu-agency__cta {
display: inline-flex;
align-items: center;
min-height: 44px;
padding: 0 18px;
border-radius: 999px;
background: var(--text);
color: var(--bg) !important;
transition: background-color 0.25s;
}
.gu-agency__cta:hover {
background: var(--accent);
}
/* Hero */
.gu-agency__hero {
padding: 56px 5% 72px;
}
.gu-agency__now {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 8px 14px;
border: 1px solid var(--line);
border-radius: 999px;
font-size: 0.9rem;
color: var(--muted);
}
.gu-agency__live {
flex: none;
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--volt);
animation: gu-agency-pulse 2s ease-in-out infinite;
}
@keyframes gu-agency-pulse {
50% {
box-shadow: 0 0 0 6px rgb(215 255 58 / 0);
opacity: 0.5;
}
}
.gu-agency__hero h1 {
max-width: 17ch;
margin-top: 28px;
font-size: clamp(2.4rem, 7.2cqi, 6.4rem);
font-weight: 900;
line-height: 0.92;
letter-spacing: -0.05em;
text-wrap: balance;
}
.gu-agency__facts {
display: flex;
flex-wrap: wrap;
gap: 24px 48px;
margin-top: 48px;
padding-top: 24px;
border-top: 1px solid var(--line);
}
.gu-agency__facts div {
display: flex;
flex-direction: column-reverse;
gap: 4px;
}
.gu-agency__facts dt {
color: var(--muted);
font-size: 0.9rem;
}
.gu-agency__facts dd {
font-size: 2.6rem;
font-weight: 900;
letter-spacing: -0.05em;
line-height: 1;
}
/* Stacking case studies */
.gu-agency__work {
padding: 0 5% 64px;
}
.gu-agency__work > h2,
.gu-agency__services > h2 {
margin-bottom: 24px;
font-size: 1rem;
color: var(--muted);
}
.gu-agency__stack {
display: grid;
gap: 24px;
margin: 0;
padding: 0;
list-style: none;
}
.gu-agency__case {
position: sticky;
top: calc(20px + var(--i) * 18px);
}
.gu-agency__case article {
display: grid;
overflow: hidden;
border: 1px solid var(--line);
border-radius: 28px;
background: var(--card);
box-shadow: 0 -20px 40px -20px rgb(0 0 0 / 0.6);
}
@container (min-width: 720px) {
.gu-agency__case article {
grid-template-columns: 1.25fr 1fr;
min-height: 420px;
}
}
.gu-agency__shot {
position: relative;
aspect-ratio: 16 / 10;
background:
repeating-linear-gradient(
135deg,
rgb(255 255 255 / 0.08) 0 2px,
transparent 2px 18px
),
radial-gradient(
120% 90% at 20% 10%,
color-mix(in srgb, var(--tone) 70%, #fff),
var(--tone)
);
}
@container (min-width: 720px) {
.gu-agency__shot {
min-height: 240px;
aspect-ratio: auto;
}
}
.gu-agency__shot img {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 1s var(--ease);
}
.gu-agency__case article:hover .gu-agency__shot img {
transform: scale(1.04);
}
.gu-agency__case-body {
display: grid;
align-content: start;
gap: 16px;
padding: 28px;
}
.gu-agency__client {
display: grid;
gap: 2px;
font-weight: 800;
}
.gu-agency__client span {
font-weight: 500;
color: var(--muted);
}
.gu-agency__case h3 {
font-size: clamp(1.8rem, 3.6cqi, 2.8rem);
font-weight: 900;
line-height: 0.98;
letter-spacing: -0.04em;
text-wrap: balance;
}
.gu-agency__result {
display: grid;
color: var(--muted);
}
.gu-agency__result strong {
font-size: clamp(2.8rem, 6cqi, 4.6rem);
font-weight: 900;
line-height: 1;
letter-spacing: -0.055em;
color: var(--accent);
}
.gu-agency__read {
justify-self: start;
display: inline-flex;
align-items: center;
min-height: 44px;
font-weight: 800;
background: linear-gradient(currentColor, currentColor) left 80% / 100% 2px
no-repeat;
transition: background-size 0.4s var(--ease);
}
.gu-agency__read:hover {
background-size: 30% 2px;
}
/* Services */
.gu-agency__services {
padding: 64px 5%;
border-top: 1px solid var(--line);
}
.gu-agency__services ul {
margin: 0;
padding: 0;
list-style: none;
}
.gu-agency__services li {
padding: 10px 0;
border-bottom: 1px solid var(--line);
font-size: clamp(2rem, 7cqi, 5rem);
font-weight: 900;
line-height: 1;
letter-spacing: -0.05em;
transition:
color 0.3s,
padding 0.5s var(--ease);
}
@media (hover: hover) {
.gu-agency__services li:hover {
padding-left: 18px;
color: var(--accent);
}
}
/* Quote */
.gu-agency__quote {
padding: 72px 5%;
}
.gu-agency__quote p {
max-width: 24ch;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(1.8rem, 4.8cqi, 3.4rem);
font-style: italic;
line-height: 1.1;
text-wrap: balance;
}
.gu-agency__quote footer {
margin-top: 20px;
color: var(--muted);
}
/* Contact */
.gu-agency__contact {
padding: 80px 5%;
background: var(--accent);
color: var(--bg);
}
.gu-agency__contact h2 {
max-width: 18ch;
font-size: clamp(1.6rem, 3.6cqi, 2.6rem);
font-weight: 800;
line-height: 1.05;
letter-spacing: -0.03em;
}
.gu-agency__mail {
display: inline-block;
margin: 18px 0 16px;
font-size: clamp(2rem, 8.6cqi, 7rem);
font-weight: 900;
line-height: 1;
letter-spacing: -0.055em;
word-break: break-all;
}
.gu-agency__mail:hover {
text-decoration: underline;
text-decoration-thickness: 0.06em;
text-underline-offset: 0.12em;
}
.gu-agency__contact p {
font-weight: 600;
}
.gu-agency__foot {
display: flex;
gap: 20px;
padding: 20px 5%;
font-size: 0.85rem;
color: var(--muted);
}
.gu-agency__foot span {
margin-right: auto;
}
@media (prefers-reduced-motion: reduce) {
.gu-agency__live {
animation: none;
}
.gu-agency__shot img,
.gu-agency__read,
.gu-agency__services li {
transition: none;
}
.gu-agency__case article:hover .gu-agency__shot img {
transform: none;
}
}
```
You might also want
Next piece: Announcement barHabit app landing page
Landing pages, advanced
E-bike launch page with colour wipe
Landing pages, advanced
App launch page
Landing pages, advanced



