126

Grid Split Reveal

£10 or the whole Vault, £79.20

A preloader and page transition shaped by your layout: hairline rules draw down the cover along your page's own columns, then the cover splits along them and the panels slide apart to uncover the page.

intermediate
10 more details
load-sequencepage-transitionsoft-navigationstaggergrid-drawinterruptible-transitionsqueued-transitionsfocus-managementprogressive-enhancementreduced-motion

This demo reads better at your own screen size than in the frame below:

Released

About this effect

The page opens under a plain cover. Thin rules draw down it one after another, landing exactly on the columns of the layout underneath, and the last line, in your accent colour, finishes the moment the page has actually loaded. Then the cover splits along those lines and the panels slide apart, alternating up and down by column with a short stagger, to uncover the page and settle onto its own grid lines.

Read the full effect overview

The lines come from your site rather than from a setting: point the cover at any element laid out with CSS Grid and it reads the columns and gutters the browser has worked out, at every breakpoint. A twelve-column desktop layout splits into twelve panels; the same page on a phone splits into two.

Between pages of the same site it becomes the route transition. The panels close in along the same lines, the next page is swapped in underneath, and they open again. Back reverses the travel. Links stay ordinary links, and without JavaScript the cover never appears.

Grid Split Reveal - GSAP animation effect preview

What's included

8 items
  • Rules drawn along the page's own CSS Grid columns and gutters, so the reveal lands on the layout's hairlines at every breakpoint
  • An accent rule that doubles as honest progress: it waits for fonts, the window load and any hero image you mark, with a minimum hold and a hard cap
  • Panels slide apart alternating up and down by column, with a short stagger and an optional entrance for content you mark
  • The same panels close and open between pages: fetch-and-swap navigation with history, Back in reverse, prefetch on hover and focus
  • Clicks before the swap retarget the transition; clicks and Back after it queue the latest destination and hurry the opening
  • Returning visitors in the same session get a short split, or no cover at all with one attribute
  • Focus moves to the new heading and the page title is announced; reduced motion fades the preloader and swaps pages instantly
  • Colours and timings are CSS custom properties; GSAP core only, no plugins

Perfect for

4 use cases
  • Studio, architecture and portfolio sites whose column grid is part of the look
  • Editorial and magazine-style sites built as plain multi-page HTML that want one consistent load and page change
  • Agency and product sites that need a preloader that ends as soon as the page is ready rather than on a timer
  • Existing static sites that want soft navigation with proper history, focus and announcements without a framework

How it works

3 sections

A cover element sits first in the body and is painted before the page by a one-line head script, so nothing flashes underneath. When the script starts it measures the grid element you name, takes the line half a gutter outside each column, snaps every line to whole device pixels and builds one panel per column (and per row, if you ask for rows), each overlapping its neighbour by a pixel so no seam shows the page early.

A GSAP timeline draws the rules with a stagger, parks before the accent rule until the page reports ready, then slides the panels out with transforms only. Each panel carries its own copy of the rule on its edge, so the lines travel with the split.

For navigation, same-origin links are intercepted, the next page is fetched (usually already prefetched on hover) and its page container swapped in while the cover is closed. The title and description update, history entries carry an order so Back knows its direction, scroll is restored, focus moves to the new heading and a live region announces the page. If anything goes wrong the browser simply loads the page normally.

Difficulty Intermediate
Includes HTML + JS + CSS source, documentation, AI setup prompt, lifetime updates

Lighthouse, as measured

Google Lighthouse on this effect's demo (4 pages, lowest score shown), from the latest scan. A measurement of the demo as shipped, not a promise for your page.

Accessibility
100
Best practices
100

No performance score, on purpose. That figure depends on how you deploy: your server's compression and caching, your CDN, the connection and the device doing the test, none of which the code controls. The same page can score very differently on two consecutive runs, so measure it where it will live.

Paid effect

Purchase to unlock the code.

Buying Grid Split Reveal opens the HTML, CSS and JavaScript source, the full documentation, an AI setup prompt for your editor, and every update we ship to it. Standard license: unlimited personal and commercial projects. Every paid product is tested for desktop and mobile layouts, reduced-motion handling, animation cleanup and keyboard controls wherever there is something to operate.

£10 Standard license, unlimited projects

Browse free effects

Or the whole library: the Vault, £79.20, one payment.

Documentation

Quick Start

Every page of your site gets the same three things. Serve the site from a web server (http or https) for the page transition; opened straight from disk, the preloader still runs and links stay ordinary links.

1. In each page's <head>, before your stylesheet:

Code snippet omitted: it ships with the download.

has-js lets the cover paint before the page, so nothing flashes underneath. gs-seen is only used by data-gs-once.

2. The cover first in <body>, and one container around the part of each page that changes:

Code snippet omitted: it ships with the download.

3. Before the closing </body> tag:

Code snippet omitted: it ships with the download.

That is all. The preloader runs on every full page load, and links between your pages now close and open the cover.

Using It With Your Own Design

The lines come from your grid. data-gs-grid names any element laid out with display: grid. The script reads the column widths and gutter the browser has worked out at the current viewport and draws one line in the middle of each gutter, plus one half a gutter outside the first and last columns. So a twelve-column desktop grid gives twelve panels plus two narrow margin panels, and the same page on a phone, where your CSS drops to two columns, gives two. Without data-gs-grid (or if the element is not a grid), data-gs-cols splits the viewport into equal columns, dropping to data-gs-cols-mobile at 640px and below.

If you want the lines to be visible on the page afterwards, as in the demo, draw them in your own CSS at the same positions: the demo's .guides element is a copy of the grid with a 1px line half a gutter outside each column.

What the cover needs.

  • The [data-gs] element must be a direct child of <body>, outside the page container, so it survives page changes. The script builds the panels inside it. Anything you put inside it yourself (a name, a mark) shows above the panels during the preloader only and leaves just before the split; position it with CSS (it is position: absolute).
  • The first block of style.css (marked THE COVER) is the effect. Copy it as it is; everything after it is the demo site.
  • The cover is position: fixed at z-index: var(--gs-z) (100). Raise it if a fixed header of yours should be covered too.

What the transition needs from your pages. Only the [data-gs-page] container is swapped; the title, meta description and <html lang> are updated from the fetched page and the rest of <head> is kept. So every page must share the same stylesheets and scripts. Scripts inside the container do not run after a soft navigation: start per-page code from the grid-split:enter event. Pages in other folders work, as relative URLs inside the container are rewritten.

What is only the demo's design. The Rennick copy and photographs, Mona Sans, the faint column guides, the header, the Replay button and the name on the cover are all replaceable. The demo loads on an ink cover with light rules (set on [data-gs] in the demo block of style.css) and uses a light cover for page changes through the --gs-route-* properties.

Colours and timings, set on :root or on [data-gs]:

Property Default What it controls
--gs-cover #fdfdfc The cover and its panels
--gs-rule #141412 The hairline rules
--gs-accent #e0218a The last rule only
--gs-rule-width 1px Rule thickness
--gs-draw 0.6s Each rule's draw
--gs-split 0.8s Each panel's slide when the preloader opens
--gs-close 0.4s Each panel's slide when the cover closes for a new page
--gs-open 0.65s Each panel's slide when it opens on the new page
--gs-stagger 0.03s Delay between neighbouring columns
--gs-z 100 Stacking order of the cover
--gs-route-cover, --gs-route-rule, --gs-route-accent the values above Optional separate colours for page changes

Options

Data attributes on the [data-gs] cover:

Attribute Default Description
data-gs-grid none Selector for the grid element whose columns become the lines
data-gs-cols 4 Equal columns when there is no grid element
data-gs-cols-mobile 2 Equal columns at 640px and below, when there is no grid element
data-gs-rows 1 Rows: more than one adds horizontal rules, and the panels in each column leave one after another
data-gs-once false true: returning visitors in the same session see no cover at all (otherwise they get a short split)
data-gs-min 1.2 Seconds the first-visit sequence takes at least, so it reads
data-gs-max 4 Seconds after which the cover opens whether or not the page has finished loading
data-gs-timeout 8000 Milliseconds before a slow page fetch gives up and the browser loads the page normally
data-gs-transition true false: preloader only, links stay ordinary

Other hooks:

Attribute On Description
data-gs-page each page's container The part swapped between pages
data-gs-wait an <img> The preloader waits for this image (your hero) as well as fonts and the window load
data-gs-reveal any element in the page Rises and fades in as the panels part
data-gs-replay a button Plays the load sequence again
data-gs-ignore a link or its ancestor That link always does a normal page load

Accessibility

  • The cover is aria-hidden and never takes focus. Content is in the HTML from the start, so crawlers and screen readers get the full page.
  • After a page change, focus moves to the new page's h1 (or main), the document title updates and a polite live region announces it.
  • Scrolling is held only while the cover is closed or opening, so the page cannot slide under it.
  • Without JavaScript or GSAP the cover never appears and every link is an ordinary link. If the script fails to start, the cover clears itself after six seconds.

Reduced Motion Behavior

The preloader has no lines and no travel: the cover fades out in 0.3 seconds once the page is ready. Page changes swap instantly, with focus and announcement intact. Switching to reduced motion mid-sequence finishes it at once.

Interruptions

  • A click on another link before the page swap retargets the transition to the new page; a click on the current page's own link cancels and the panels open on the page you were on.
  • A click or Back after the swap queues: the latest destination wins and the opening runs three times faster to get to it.
  • A double click is one navigation. Back before the swap goes to the previous page, as the browser would.
  • A link clicked while the preloader is still showing takes the cover over: it closes from wherever it is and opens on the new page.
  • If the fetch fails, times out or the page has no [data-gs-page], the browser loads the page normally and the cover stays closed until its preloader takes over.

Dependencies

  • GSAP 3.12+ (core only, no plugins). The demo is pinned to 3.15.0.
  • No build step and no framework. The page transition needs fetch, DOMParser and the History API, which every current browser has; without them, links stay ordinary.

Worked examples, the events and programmatic API, and the class reference ship with the download, alongside the full source.