Load GSAP, ScrollTrigger and three.js first
The script reads window.gsap, window.ScrollTrigger and window.THREE. Load all three before code.js. If three never arrives, the section still swaps the pictures at halfway.
Give it room to scroll
The section is --tpp-length tall (400vh by default) with a sticky stage inside, and the whole length minus one screen drives both tears. Don't put it inside a parent with overflow: hidden, or the stage stops sticking.
Keep plate B first in the markup
Plate B sits under plate A and stays hidden until the frame is fully papered (46%–54% of the scroll), when it fades in under the sheet. The order in code.html is what stacks them.
Shape the tear
data-au-jagged scales the big slanted swell, data-au-fibre the fray and hanging fibres, data-au-rim the width of the pulp rim. Bigger values need more margin, which the script adds above and below the frame for you.
Retheme with variables
--tpp-paper and --tpp-rim colour the sheet and its torn edge (read once at init). --tpp-fg and --tpp-muted colour the titles and any labels, --tpp-bg shows behind the pictures while they load.
Labels are optional
It ships with a title on each picture and no label. To add one, put <p class="tpp_label"> under a title (label on the slide in React).