Component · Text animations

CSS text mask sunset headline

by Informeek Studio 11 November 2026
Live Move the pointer or drag across the letters to steer the sun

The prompt

Build a CSS text mask headline for a ferry company evening sailing. Deep plum page (#170b24). A small uppercase label "Saltmarsh Ferries" in #ffb38a between two short rules. The headline "Golden hour" sits on two lines, uppercase, weight 900, 232px on desktop and 20vw on phones, line height 0.86. The letters are filled with an illustrated sunset using background-clip text: a sky gradient from violet #7b3fb0 through pink #d24f86 and coral #ff7a59 to gold #ffc168 at the horizon, a warm sea below it in #ff9d6c, #e2577e and #9b4bc0, thin pale reflection stripes across the sea that drift sideways, and a glowing sun (cream #fffbe8 to #ffc168 radial gradient) that follows the pointer across both lines. Give every line the same background size as the whole heading and offset it by the line position with CSS variables, so the scene runs continuously through both words. Without a pointer, the sun drifts slowly left and right on its own. On load each line rises out of an overflow hidden mask over 1.1s with cubic-bezier(.16,1,.3,1), the second 150ms after the first then a short line about the 19:40 sailing and two buttons fade in: a coral to gold gradient "Book the 19:40" and an outlined "Replay" that restarts the reveal. Keep the full heading in an aria-label and turn off the drifting and reveal for reduced motion.

Written by Informeek Studio to recreate this design. Prompts are not deterministic, so running it again gives a similar result, not an identical one.

Use it in three steps

  1. Copy the prompt with the button above.
  2. Paste it into your AI site builder, or any AI chat that writes code.
  3. Make it yours by painting your own scene inside the letters, a city skyline or a forest.

About this CSS text mask

A CSS text mask lets a headline carry a picture instead of a colour. Here the words Golden hour are filled with a little sunset, a violet to gold sky, a warm sea striped with reflections and a glowing sun that follows the pointer from letter to letter. Nothing is an image file; the whole scene is a stack of CSS gradients clipped to the text.

The detail that makes it work across two lines is the background maths. Each line gets a background the size of the whole heading, shifted by that line position, so the horizon runs straight through both words instead of starting again on the second line. The lines also rise into view from behind a mask on load, which gives the reveal its crisp bottom edge.

Why the prompt works

  • It lists every layer. Sky, sea, stripes and sun are described in order with their colours.
  • It solves the two line problem. Shared background size and per line offsets keep the scene continuous.
  • It plans for touch. Dragging steers the sun, and it drifts on its own when nobody is touching it.

Where to use it

Travel and hospitality heroes, event posters, album launches and any brand with one big word that deserves a scene inside it.

The prompt is shared under CC BY 4.0. Reuse it freely, including commercially, with a credit linking back to this page.

Keep exploring

More prompts like this

See the collection →
Live
Component · Text animations

Split flap animation departure board

Live
Component · Text animations

Wavy text animation headline

Live
Component · Text animations

Outline text CSS index with colour fill