Skip to the content

Zoom through

A transition between two sections, driven by the scroll.

Become a member to unlock the full effect today.

Join now

Already a member? Sign in

Documentation

  1. Copy to Webflow

    Add Geist and Geist Mono to your site's fonts (Site settings, Fonts, Google Fonts) before pasting: Webflow removes any font your site has not installed.

  2. Add custom CSS

    Three things belong to the page rather than to the component: the next section needs an opaque background, since the word opens on it; the section takes no height of its own, its height being the next section plus the scroll the zoom takes; and no parent of the section may cut its overflow with overflow: hidden, which stops the panel from pinning. Use overflow-x: clip where a parent has to cut.
  3. Add custom JS

  4. Tune it

    Custom attributes
    Select the section on the canvas and open the Settings panel. Under Custom attributes, add a pair: the name on the left, the value on the right.
    Custom attributeWhat it does
    data-zoom-through Marks the section that holds the panel and the next section, its two blocks. It takes no value: leave the value field empty. That section is what the stylesheet makes taller by the scroll the zoom takes, and what carries the settings. Without it on any element of the page, the embed marks the block holding the panel.
    data-zoom-through-panel Marks the panel, the block that holds the screen with the word on it, a child of the section. It takes no value. Without it the engine takes the first block of the section. [ Optional ]
    data-zoom-through-word Marks the word that grows, a heading in real text inside the panel. It takes no value. Without it the engine takes the first heading of the panel, and mounts nothing when the panel has none. [ Optional ]
    data-zoom-through-next Marks the section the word opens on, the block after the panel, a child of the section too. It takes no value, and it needs an opaque background. Without it the engine takes the block after the panel. [ Optional ]
    data-zoom-through-fade Marks what leaves the panel as the zoom starts, a strip of labels for instance: it fades out over the first eighth of the scroll. Without it everything on the panel stays until the letters cover it. [ Optional ]
    data-zoom-through-state Written by the engine on the section: idle before the zoom, live while it runs, done once through, still under reduced motion. Never written by hand; it is what the stylesheet reads to pin the panel and to blend it. [ Optional ]
    Settings
    Every setting is a custom attribute too, added the same way and on the same section. An attribute always wins over the defaults written in the code.
    AttributeDefaultWhat it is
    data-zoom-through-background #f4ece0 Colour of the panel, the ground the word sits on. Options: any plain CSS colour. It is what stays around the letters until the last stroke covers the screen.
    data-zoom-through-color #15100c Colour of the word at rest, before its ink turns into the window. Options: any plain CSS colour. Give it the background colour of the next section and the word opens without a seam.
    data-zoom-through-distance clamp(600px, 160vh, 1800px) Scroll the zoom takes, any CSS length: how long the panel holds the screen.
    data-zoom-through-origin-x auto Zoom point across the word, 0 at its left edge and 1 at its right, or auto.
    data-zoom-through-origin-y auto Zoom point down the word, 0 at the top of its box and 1 at the bottom, or auto.
    data-zoom-through-scale auto Size of the word when the scroll ends, as a factor, or auto.
    data-zoom-through-ease inOut Shape of the zoom along the scroll: linear, in, out, inOut or a cubic-bezier(x1, y1, x2, y2). Options: linear follows the wheel evenly, in holds the word before it leaves, out leaves at once and lands softly, inOut does both.
    data-zoom-through-reveal 0.3 Share of the scroll over which the ink of the word turns into the window, 0 to 1.
    data-zoom-through-smooth 0.12 Time the zoom takes to catch the scroll, in seconds.

What it does

Zoom through is a scroll animation for Webflow and vanilla JavaScript, with no library. Also called text zoom on scroll, zoom through text or text mask scroll transition.

A transition between two sections, driven by the scroll. A panel holds the screen with one huge word on it; as the page scrolls, the word grows on an eased curve, its zoom point travelling to the middle of the screen, until the stroke of one letter fills the window. The ink of the word is the window: over the first part of the scroll it turns from its colour into a cut out, the next section shows through the letters, and once a single stroke covers the screen the next section has taken over and scrolls on as any section does. The word is real text, a heading of the page, selectable and read by search engines; nothing is drawn to a canvas and there is no picture. The zoom point and the final scale can be left to the engine, which reads the ink of the word and aims at its thickest stroke, so the window is fully open exactly as the scroll ends, on every screen. No library: the hold is sticky positioning, the position is read from the layout, so it follows the browser's own scroll and a smooth scroll library alike. Under reduced motion there is no pin and no zoom: the panel, then the next section. Pattern type zoom through text, text mask transition, scroll driven reveal.

Updated

Questions

Mark one section data-zoom-through and give it two children: the panel, data-zoom-through-panel, holding a heading marked data-zoom-through-word, then the next section, data-zoom-through-next. Settings are custom attributes on the section, for instance data-zoom-through-color="#1f3a2e". The next section needs an opaque background, and the section itself takes no height of its own.

No. The hold is CSS sticky positioning and the progress is read from the layout, with no library, so nothing is inserted when the pin starts and nothing is given back when it ends. It follows the browser's own scroll and a smooth scroll library such as Lenis alike; set smooth to 0 if the two glides add up.

Real text. The word is a heading of the page, selectable and read by search engines, and there is no picture. The window is made of two copies of the panel blended with a multiply and a screen, which only know solid colours: a transparent or gradient panel does not blend right.

Set data-zoom-through-distance, the scroll the zoom takes, in any CSS length; the default is clamp(600px, 160vh, 1800px). Lower gives a quick punch through, higher a slow travel into the letter with more wheel to turn before the next section.

Left on auto, the engine reads the ink of the word and aims at the thickest stroke nearest the middle. To open on a given letter, set data-zoom-through-origin-x and data-zoom-through-origin-y, shares of the word's box from 0 to 1: 0.12 and 0.5 is usually the stem of the first letter. Aim at ink, never at the hole of a letter, and give both of them and scale yourself when the word wraps on two lines.