← Case study

Detail 11 · Transitions

From thumbnail to page

The resume island's thumbnail carried whole to where the sheet sits, the page sketched in outline round it. 6 minutes, 1 demo.

Try it: open the résumé
/
Sujoy Kr. Haldar

My resume

01 · The idea

The thumbnail is the page

The résumé island shows the real résumé, small: the same component as the résumé page, not a picture of it. So opening it shouldn’t throw the thumbnail away and load a page from nothing. The thing you clicked becomes the page: it’s carried, whole, to its place, and the résumé page arrives beneath it.

It’s carried the way the case study’s book is out of the Crafts island: the same machine, the same curve, the same hand-over. A résumé is something you open to read, so it stays readable the whole way, from the click to the landing.

02 · Watch it

Take off, fly, frame, hand over

Below is a small site with the résumé island open. Click the thumbnail, then slow it down. Switch “carried whole” off to see the grow it replaced.

From thumbnail to page
/
Sujoy Kr. Haldar

My resume

  1. 1.Take off

    The thumbnail lifts out of the island as the island closes. The page you're on, frozen, sinks back and fades beneath it.

    carry
  2. 2.Fly

    Whole and readable, it flies to where the sheet will sit on the résumé page, which is only now loading beneath it.

    1.4s
  3. 3.Frame

    The résumé page is sketched round it in outline only: the paper and a plain box for each block, nothing more.

    outlinesOnly()
  4. 4.Hand over

    The real sheet builds in under it all at once, unseen. Once every block is there, the copy fades off it.

    fullyShown()
↺ The résumé, where the thumbnail landed

03 · How it flies

Landing on a page that doesn't exist yet

The thumbnail sets off at the click, before the résumé page has loaded. So the sheet’s place isn’t measured; it’s worked out from the same numbers the résumé page lays itself out with, shared between the two.

Where the sheet will be, before the page is there
/** The sheet's box on screen when /resume is scrolled to the top. */
export function resumeSheetRect() {
  const wide = window.matchMedia(WIDE_FROM).matches;
  const gutter = wide ? SHEET_GUTTER_WIDE : SHEET_GUTTER;
  const width = Math.min(SHEET_MAX_WIDTH, window.innerWidth - gutter * 2);
  // Centered in the page's content box (which excludes any scrollbar)
  const left = (document.documentElement.clientWidth - width) / 2;
  return { left, top: wide ? SHEET_TOP : SHEET_TOP_PHONE, width };
}

That guess is the carry’s early aim. The same option takes the book out of its island: the route changes at the click, the old page is frozen and sinks under the flight, and once the new page is in, the flight’s end moves from the guess to the measured sheet without a kink.

Carried whole, as the book is
const openFullResume = (thumbEl) => {
  const box = thumbEl.getBoundingClientRect();
  const sheet = resumeSheetRect();
  close();
  navigate("/resume", {
    carry: {
      from: { left: box.left, top: box.top, width: box.width, height: box.height },
      // In px on a phone: scaled, its line breaks would jump at take-off, so it reflows instead
      element: window.matchMedia(SCALED_SHEET).matches ? (
        <FittedSheet width={sheet.width}>
          <ResumeSheet show timing={THUMB_REVEAL} />
        </FittedSheet>
      ) : (
        <ResumeSheet show timing={THUMB_REVEAL} />
      ),
      find: findSheet,
      early: () => ({ ...sheet, height: (sheet.width * box.height) / box.width }),
      whole: true,
    },
  });
};

The copy flies by animating its real box, its left, top, width and height. The sheet inside is laid out at the page’s width and scaled to fit that box, so its lines break where the page’s will, at every size on the way. The scale is written from a resize observer, straight to its style: the box changes every frame, and React state would be a frame behind it. On a phone the sheet is set in pixels rather than container units, so scaling it made its lines jump at take-off; there it flies unscaled and reflows as it grows.

The page's own layout, scaled to the box
function FittedSheet({ width, children }) {
  const ref = useRef(null);
  const sheetRef = useRef(null);
  useLayoutEffect(() => {
    const box = ref.current;
    const sheet = sheetRef.current;
    const fit = () => {
      sheet.style.transform = `scale(${box.offsetWidth / width})`;
    };
    fit();
    const observer = new ResizeObserver(fit);
    observer.observe(box);
    return () => observer.disconnect();
  }, [width]);

04 · The sketch

A sketch that frames it

Every page on the site arrives as a pencil sketch first. Here the content is already on screen, flying in, so the sketch has nothing to promise about it. It’s drawn in outline only: the paper, a plain box where each block will be, no hatching, no scribbled lines of text, no tags. (Nor the navbar: it never leaves the screen, so only the change to the home page marks it out.) It frames where the sheet lands instead of drawing the sheet again.

Outlines only
export function outlinesOnly(layout) {
  return {
    ...layout,
    blocks: layout.blocks.map((block) => ({ ...block, lines: [], plain: true, image: false, space: false, label: undefined, measure: false })),
  };
}

Under the copy, the real sheet builds in all at once, since nobody can see it. The copy only fades once every block inside the sheet is fully in, not just the sheet itself, so the swap from copy to page is never seen.

Fully shown: the sheet, and every block inside it
function fullyShown(el) {
  const settled = (node) => {
    const { opacity, filter } = getComputedStyle(node);
    return Number(opacity) >= 1 && (filter === "none" || filter === "blur(0px)");
  };
  for (let node = el; node && node !== document.body; node = node.parentElement) {
    if (!settled(node)) return false;
  }
  return [...el.querySelectorAll('[data-wf="block"]')].every(settled);
}

05 · Before

The grow it replaced

The first version grew the thumbnail into the page. As it took off, it cleared to blank paper, its sketch drew on it in the air, and once it landed the résumé’s text built back in, block by block. It was a good-looking flight, and it made people wait for what they’d come for: the text was there at the click, gone a moment later, and back only after the sketch.

Carrying it whole keeps the text on screen the whole way, and makes the résumé one more thing carried, like the book, instead of a page change of its own kind. The demo above still plays the grow, for comparison.

06 · Decisions

Why it’s built this way

Keep what was clicked

The thumbnail turns into the page instead of disappearing, so there’s never a moment of looking for the résumé again.

Shared numbers, not a guess

The island and the résumé page read the sheet’s place from one file. Change the layout, and the flight still lands exactly.

Don't unwrite it

Content that’s already readable stays readable. The sketch frames it; it doesn’t erase it to draw it again.

One way to carry

The résumé flies on the book’s machine: one carry, one curve, one hand-over, everywhere something travels to its page.

07 · Takeaways

What to keep

  • When a page opens from a preview of itself, let the preview become the page, readable all the way.
  • Know where it lands before the page exists: share the layout’s numbers rather than measuring a page that isn’t there yet.
  • When the content is already on screen, sketch round it, not over it, and hand over only once what’s beneath is fully there.
Try the real one→

Open the résumé island at the top of the page, then click the thumbnail.