GSAPScrollTriggerFlipSplitTextReactSVGCSS
Controls
- Scroll through the coffee chapters to pour each drink into the glass: espresso, macchiato, cortado, flat white, cappuccino and latte
- Pick a menu category (Coffee, Not coffee, Pastry, Brunch) to filter the cards; the rest glide to their new places
- Fill in the booking form (day, time, guests, name, email) and press Hold my table to get a printed ticket; nothing is sent
- Tab and Enter work everywhere; the guest count has its own minus and plus buttons
Works in current Chrome, Safari and Firefox. Respects the reduced-motion setting: the glass switches straight to each finished drink, nothing slides, spins or scrolls sideways, and the menu filter switches instantly.
Questions
Is Corvo a real café?
No. Corvo is a fictional coffee house and the address is invented; the site is a design concept. The photos are free stock from Pexels.
How does the glass fill as you scroll?
The glass is an SVG drawing. A ScrollTrigger maps the scroll position to a point between two drinks, and the espresso, milk and foam layers are set to the volumes of that blend.
Are the drink ratios real?
They follow common café definitions in a 240 ml glass, such as a cortado as equal parts double espresso and warm milk and a cappuccino in thirds. Cafés vary them.
How is the menu filter animated?
GSAP Flip records where every card is, the filter hides or shows cards, and Flip animates the remaining cards from their old places to the new ones.
Does the booking form send anything?
No. It validates the day, opening-hours time slot, party size, name and email in the browser and shows a ticket. A real site would post it to a booking service.
How it’s built
Corvo is a fictional coffee house, and this is a full website concept for it: hero, a scroll story about what is in each drink, a filterable menu, table booking, opening hours and a map. GSAP does the motion; there is no 3D engine.
- The glass. One hand-drawn SVG: a tapered tumbler on a saucer with a teaspoon, standing on a round wooden café table. Light comes from the upper left, so the highlights sit on the left wall and the shadow falls to the right. The liquid layers are paths clipped by the inside of the glass; each fills from its own top to the bottom and they are drawn top layer first, so every band shows only its own height. The top surface is an ellipse sized to the glass width at that height.
- Scroll pouring. A pure module (
drinks.ts, Vitest-tested) holds six drinks as millilitres of espresso, milk and foam in a 240 ml glass. A single ScrollTrigger maps the chapter list to a position from 0 (empty) to 6 (latte); between two drinks the layers hold, then blend over the middle 70 % of the step. A tapered pour stream in the colour of the rising layer (with a glint and ripple rings where it lands) shows only while something is filling; steam curls above the rim only when nothing is pouring, and these CSS loops run only while the story is on screen. Short landscape phones keep the two-column layout. Updates go straight to SVG attributes, never through React state. - Menu filter. Every card has the same footprint (an aspect ratio on wide screens, a fixed row height on phones). A press runs three beats: leaving cards fade out in place, the grid swaps while it keeps its old height, then Flip (no absolute positioning, no scaling) slides the remaining cards to their new slots while the new ones rise in and the grid height eases to its new value. A press during a run kills it and starts from what is on screen; the photos of the cards that come back are decoded before the swap (capped at 0.9 s), so nothing pops in after the slide. One ember rule slides between the tabs and the count tweens. The grid has align-content start and overflow-anchor none, otherwise the locked height stretches the rows.
- Booking. Client-side only (static export): half-hour slots come from the opening hours, the form validates day, time, party size, name and email, and success prints a ticket with a stamp and a reference. Nothing is sent.
- Hero. SplitText headline (foam, milk, crema layers), a photo in an arch with two outline arches that draw themselves and a photo that spreads from the apex (clip-path circle), a badge that spins faster with the scroll velocity, pointer parallax and a light that follows the cursor (fine pointers only), and a giant wordmark whose fill level (a CSS variable) rises with the scroll. The entrance waits for the loader to start leaving. On large screens the page scales as a whole:
SCALE_CSS in index.tsx sets the root font size to clamp(16px, min(100vw, 177.78vh) * 0.0094, 36px) while the example is mounted (16 px up to about 1700 px, 18 px at 1920 x 1080, 24 px at 2560 x 1440 and at 3440 x 1440, because the height limits it), every rem follows, and --cv-pad-x caps the content column at 104 rem so an ultrawide gets wide margins instead of a stretched layout. The arch is sized from the width and from the first screen height, the wordmark and its fill (--word) set the bottom padding, the glow is in percentages of the hero, and short desktop windows (up to 800 px high) get tighter copy. - Find us. One section: a flat, north-up street plan (MapArt.tsx; streets are the gaps between blocks, so they always connect; the pin stands on the café lot; the route follows street centre lines and draws itself), the opening hours with today marked and an open-now line, and the way into the booking form with the next bookable time. It shares one dark surface with the booking form and the footer.
- Reduced motion. The glass jumps straight to each finished drink, no stream, no steam, no marquee, badge spin or Flip; sections simply appear.
- Photos. Fifteen menu photos, one per item, plus the hero, from Pexels (Pexels licence: free to use, no attribution required; photographers and URLs are listed at the top of
data.ts). Menu photos are cropped square, warmed a little by one shared grade and exported to WebP at 1600 and 640 px (-sm); the hero photo is 2000 and 800 px. Each photo carries its average colour (tone, the card background while it loads) and a focal point (focus, used as object-position). Only the hero photo loads eagerly; the cards are lazy and fade in once decoded.