# Nightlife photo field hero

> An events app hero where night-out photos fly out from the headline into a floating field, drift at different depths and reveal the venue on hover.

- Kind: Plan
- Page: https://ownlyplans.com/bhaskar/nightlife-photo-field-hero/
- Licence: All rights reserved (view and build only)

## Steps

### 1. Set the dark stage, top bar and centre copy

Build the night background, the top bar with a pill nav and city button, and the centred pill, headline, search bar and filter chips.

Prompt:

```text
Create a single-file HTML hero for a nightlife app called "Nightlist", plain HTML, CSS and JavaScript only. Full-screen near-black page (#0b0a10) with three soft colour glows (warm coral in the middle, violet bottom left, blue top right), a dark vignette and a light SVG grain. Top bar: on the left a logo (a coral-to-pink crescent moon with a small white spark) and the wordmark in Bricolage Grotesque 700; in the middle a glass pill nav with Tonight (current), Cities, Venues and For hosts; on the right a glass city button with a pin icon and "Mumbai" plus a white "Get the app" pill. In the centre: a small glass pill with a pulsing green dot reading "214 plans tonight in Mumbai" and an arrow; a two-line headline "Find the night / you'll talk about tomorrow." in Bricolage Grotesque 600 with "night" in Instrument Serif italic filled with a coral-to-pink gradient; a 600px glass search bar with a search icon, a "/" key hint and a coral-to-pink "Find plans →" button; and a row of filter chips (Tonight, Live music, Rooftops, Supper clubs, Comedy, Techno) where one is selected at a time.
```

Done when: The page shows the top bar and the centred pill, headline, search bar and chips on a dark glowing background.

### 2. Lay out the photo field by depth

Place photo cards from a layout table, and use each card's depth to set its size, blur, brightness and stacking.

Prompt:

```text
Keep a PHOTOS list of [Unsplash id, orientation L/P/S, caption such as "Sax & Smoke · Fri 9 PM"] and a LAYOUTS object with three hand-placed tables: desktop (26 cards), tablet or any portrait window (18) and phone (10). Each entry is [photo index, x %, y %, depth 0 to 1, rotation]. Keep the middle clear for the copy, and put only small far cards near it. Pick the layout from the window size (phone under 768px; tablet under 1100px or when taller than wide). Base card width follows the window (desktop min(11.8% of width, 21% of height) clamped to 110 to 200px; tablet 17% of width; phone 27%). Multiply it by 0.55 + 0.6 × depth; landscape cards are 0.7 as tall as wide, portrait cards 0.78 as wide and 1.32 times taller, square cards nearly square. Give each card 14px corners and a deep shadow, set z-index from depth, and use a static filter: blur((0.5 - depth) × 7px) for far cards, lower brightness and saturation the further back they are, and opacity 0.4 to 1. Load photos from images.unsplash.com at 520px wide. Recalculate on resize.
```

Done when: Photo cards fill the edges of the screen around the copy, with small blurry cards at the back and big sharp ones at the front.

### 3. Fly-in, drift, parallax and hover

Animate everything from one requestAnimationFrame loop: cards fly out from the centre, drift slowly, follow the pointer by depth and lift on hover.

Prompt:

```text
Start the clock when the photos have loaded (or after 5 s). Sort the cards nearest first and give each a delay of 0.12 s + 0.038 s × rank. Over 1.35 s with an ease-out-quart curve, move each card from the screen centre to its slot while scaling from 0.3 to 1, turning to its rotation and fading in. After that, add a slow drift: sine and cosine offsets of 5 to 14px with periods that differ per card, and a rotation wobble of about 1.4 degrees. Ease the pointer position and shift each card by depth (up to 54px across and 36px down) so near cards travel furthest. Near cards (depth 0.55 and up) take the pointer: on hover, ease a value to 1 that lifts the card 6px, scales it 7%, straightens it a little, brings it to the front at full opacity and fades in a glass caption pill under it with the venue and time. Make the centre copy ignore the pointer except for its pill, search and chips, so cards under it can still be hovered.
```

Done when: The photos burst out from the headline, settle and keep drifting, follow the mouse with depth, and a near card shows its venue when hovered.

### 4. Headline intro, live search and the phone version

Reveal the copy, make the search suggestion type itself out, wire the chips and city button, and fold the nav into a sheet on phones.

Uses: nightlist-photo-field-hero.html

Prompt:

```text
Copy intro: the top bar fades down; the pill fades and lifts in at 0.25 s; each headline word slides up from behind its line mask (translateY 110% to 0, 0.07 s apart, while the full sentence stays as the h1 aria-label); the search bar at 1.05 s and the chips at 1.3 s fade in with a slight blur. Search: keep a real labelled input and an aria-hidden "Try …" overlay that types each of six suggestions at 50ms per letter, holds 1.7 s, deletes and moves on, with a blinking coral caret; hide it while the user types; "/" focuses the input; submit announces the search in a polite status. Chips use aria-pressed with one selected. The city button cycles six cities and updates the city and count in the pill. Pulse the live dot from a CSS variable set in the loop. Under 900px hide the pill nav; under 768px hide the city and app buttons, show a Menu button that opens a full-screen blurred sheet (aria-expanded, Escape or a press outside closes it), shrink the search button to an arrow and show four chips. With prefers-reduced-motion, show everything in place with no fly-in, drift, parallax or typing.
```

Done when: The headline reveals word by word, the search suggestion types and deletes on a loop, the city button changes the count, and on a phone the menu sheet opens and closes.

## Files

- nightlist-photo-field-hero.html: https://ownlyplans.com/bhaskar/nightlife-photo-field-hero/nightlist-photo-field-hero/ (The finished file. Open it in a browser. Swap photos and captions in PHOTOS, move cards in LAYOUTS, and edit cities and search suggestions at the top of the script.)

## About

A single-file hero for a nightlife and events product, written in plain HTML, CSS and JavaScript with no libraries. Twenty-six night-out photos fly outward from the headline into a hand-placed field, nearest first. Each card sits at its own depth: far ones are small, soft and dim, near ones are large and sharp. They drift on slow loops and move with the pointer by depth, and hovering a near card lifts it and shows the venue and time. In the centre are a live "plans tonight" pill, a two-line headline with a serif accent, a search bar whose suggestion types itself out ("/" focuses it), and quick filter chips. The city button cycles cities and counts. There are separate layouts for desktop, tablet and phone, a phone menu sheet and a reduced-motion mode. The demo brand is Nightlist with free Unsplash photos; swap your own into PHOTOS and move cards in LAYOUTS.

---
Also available as JSON: https://ownlyplans.com/bhaskar/nightlife-photo-field-hero/?format=json
MCP server: https://ownlyplans.com/mcp
