Some examples
The logo and polaroid animate when they scroll into view, or you can
hit the replay button to view again. The motion tracking footage is a normal video, with graphics added.
The globe is code, you can drag it around, zoom in on it.
All Animations
Here's an example of video scroll animation. Keep scrolling and the clip below moves along with the page,
a frame at a time. Scroll back up and it runs backwards.
Same original video clip, two ways of doing it
The scroll clip above is the quick version. It's one video file with its
playhead synced to your scroll position, which takes barely any code. The issue is that the
browser has to go hunting around inside a compressed video every time you scroll a few
pixels, which is not efficient. On a phone it can judder. Everyone who lands on the page
also downloads the whole file, whether they scroll that far or not. Not great for SEO
Below is the better version, which is similar to what Apple does on its
product pages. We export the clip out as a run of still images and paint them onto a
<canvas> one at a time as you scroll. Browsers are very good at drawing
still images, so it stays smooth going up as well as down, and the page only loads the
frame sizes your screen actually needs.
Quick version · video scrub
7.8 MB
You download the entire MP4 to watch it once, and
it may stutter, because the browser is seeking around inside compressed
video.
Better version · frame sequence
2.0–3.3 MB
You only load the frames your screen needs, about 2.0 MB normally in WebP. Still images are cheap to
draw, so it stays smooth.
The third way. Scrub a real 3D model
Both versions above are, in the end, pictures of a thing. A third option is to put the
actual object on the page and move it by scrolling. The model below is a 3D
laptop built in 3D modelling software, lit in the browser and moved by your
scroll position.
It is the lightest of the three at around 1MB. The reflections move because the object moves. The lighting is built rather than filmed.
Scroll to view