Skip to content

Bluehour

Scroll and the camera leaves the shore, follows the snowy track and passes through the lit glass into the lounge. Scroll back and it returns the same way. From the lounge, two buttons walk the camera to the bath and the kitchen, and Back plays each walk in reverse. The cabin, the place name and the room sizes are invented, and the footage is generated.

  • html5
  • css3
  • javascript
  • gsap
  • webcodecs
  • canvas
Format
Interactive experience
Platform
Desktop, with phone and tablet layouts
Engine
WebCodecs + Canvas 2D + GSAP ScrollTrigger
Type
Concept

How It Works

1
Before the first scroll

Load

The page fetches the first film as a stream and decodes every frame once with WebCodecs into a cache of compressed images, while the script word in the loader fills as the bytes arrive. Without WebCodecs, the page plays the file once and captures the frames the browser presents.
2
On scroll

Enter

A GSAP ScrollTrigger timeline maps the scroll position to a position in the film, and scrolling up runs the same timeline backward. The canvas draws the frame under the playhead. It then draws the next frame over it at an opacity equal to the fraction between the two, so a slow scroll blends from one frame to the next.
3
On click

Walk

A room button locks scrolling and plays a second film on the same canvas from a timer that eases in, and the room's card appears on the last frame. Back plays the same frames in reverse and returns the camera to the lounge.
4
When the setting is on

Reduced motion

The page loads no film and shows a still of the cabin, with the headline, the fact card and the navigation in place.

Engineering

  • 241
    frames in the fly-in

    A frame cache in place of video seeking

    Seeking a video element on every scroll event is asynchronous, so the page does not seek. It decodes each film once and keeps every frame as a compressed image, turns only the frames near the playhead into bitmaps, and releases the ones far from it, so a scroll position maps straight to a frame in either direction.
  • A headline behind the mountains

    The block word sits behind the ridge without a cut-out image. A clip-path polygon traces the ridge line of the first film frame. The page maps each point through the same cover-fit transform the canvas uses, so the clip follows the mountains at any window size, and it sets the word's vertical position from the ridge beneath it.
  • Two clocks, one canvas

    Scroll drives the first film, and a timer drives the room walks and the hotspot's fly-in. Both write to one view state, a film and a position in it, and the canvas redraws when that state changes or a frame it needs finishes loading. During a walk, wheel, touch and scroll keys are held and a style rule keeps the lounge card hidden, so the scroll timeline cannot bring it back before the camera returns.
  • 18 MB
    shipped, from 86 MB of source film

    Films sized to the frame cache

    The films are encoded at 1600 by 900, the size the frame cache draws at on desktop, without B-frames, so the frames decode in the order they play. The films, fonts and scripts all load from the portfolio site, and the page makes no request to another host.

More projects

Get in touch

I bring design judgment and hands-on engineering together, using AI-assisted workflows to move from creative intent to tested, maintainable digital experiences.

jeffkliu@gmail.com