Loading effect…
Loading preview…
scroll · react · free
A pinned image strip splits into three cards that flip over to reveal copy as you scroll.
npx znverse add split-flip-scrollInstalls gsap, @gsap/react, lenis.
export const CARD_IMAGES = [
"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22600%22%20height%3D%22900%22%20viewBox%3D%220%200%20600%20900%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22g%22%20x1%3D%220%22%20y1%3D%221%22%20x2%3D%221%22%20y2%3D%220%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%232b2d42%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238d5a97%22%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%22b0%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23bfc0c0%22%20stop-opacity%3D%220.9%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23bfc0c0%22%20stop-opacity%3D%220%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22b1%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%234f5d75%22%20stop-opacity%3D%220.7%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%234f5d75%22%20stop-opacity%3D%220%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22b2%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23f7c59f%22%20stop-opacity%3D%220.7%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23f7c59f%22%20stop-opacity%3D%220%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22b3%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23bfc0c0%22%20stop-opacity%3D%220.8%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23bfc0c0%22%20stop-opacity%3D%220%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22b4%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23bfc0c0%22%20stop-opacity%3D%220.8%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23bfc0c0%22%20stop-opacity%3D%220%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22b5%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23f7c59f%22%20stop-opacity%3D%220.7%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23f7c59f%22%20stop-opacity%3D%220%22%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%22600%22%20height%3D%22900%22%20fill%3D%22url(%23g)%22%2F%3E%3Cellipse%20cx%3D%22624.3%22%20cy%3D%22943.5%22%20rx%3D%22487.7%22%20ry%3D%22317%22%20fill%3D%22url(%23b0)%22%20transform%3D%22rotate(162%20624%20943)%22%2F%3E%3Cellipse%20cx%3D%22294.6%22%20cy%3D%22744.8%22%20rx%3D%22351.8%22%20ry%3D%22210%22%20fill%3D%22url(%23b1)%22%20transform%3D%22rotate(64%20295%20745)%22%2F%3E%3Cellipse%20cx%3D%22657.7%22%20cy%3D%22659.9%22%20rx%3D%22470.9%22%20ry%3D%22470.3%22%20fill%3D%22url(%23b2)%22%20transform%3D%22rotate(66%20658%20660)%22%2F%3E%3Cellipse%20cx%3D%22-15.3%22%20cy%3D%22330.8%22%20rx%3D%22479.3%22%20ry%3D%22308.2%22%20fill%3D%22url(%23b3)%22%20transform%3D%22rotate(122%20-15%20331)%22%2F%3E%3Cellipse%20cx%3D%22388.1%22%20cy%3D%22576.6%22%20rx%3D%22353%22%20ry%3D%22335.3%22%20fill%3D%22url(%23b4)%22%20transform%3D%22rotate(142%20388%20577)%22%2F%3E%3Cellipse%20cx%3D%22400.3%22%20cy%3D%22792.8%22%20rx%3D%22402.4%22%20ry%3D%22350.5%22%20fill%3D%22url(%23b5)%22%20transform%3D%22rotate(162%20400%20793)%22%2F%3E%3C%2Fsvg%3E",
"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22600%22%20height%3D%22900%22%20viewBox%3D%220%200%20600%20900%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22s%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%220%22%20y2%3D%221%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%2384a59d%22%2F%3E%3Cstop%20offset%3D%220.7%22%20stop-color%3D%22%23d8e2dc%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23f28482%22%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%22h%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%2352796f%22%20stop-opacity%3D%220.6%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2352796f%22%20stop-opacity%3D%220%22%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%22600%22%20height%3D%22900%22%20fill%3D%22url(%23s)%22%2F%3E%3Ccircle%20cx%3D%22449.8%22%20cy%3D%22211.4%22%20r%3D%22188.9%22%20fill%3D%22url(%23h)%22%2F%3E%3Ccircle%20cx%3D%22449.8%22%20cy%3D%22211.4%22%20r%3D%2259%22%20fill%3D%22%2352796f%22%2F%3E%3Cpath%20d%3D%22M0%20901L0%20416.2L85.7%20376.5L171.4%20360.8L257.1%20450.3L342.9%20408.8L428.6%20371L514.3%20426.6L600%20387.8L600%20901Z%22%20fill%3D%22%23a2b8b0%22%2F%3E%3Cpath%20d%3D%22M0%20901L0%20506.9Q0%20506.9%2075%20503.7Q150%20500.6%20225%20529.3Q300%20558.1%20375%20536.2Q450%20514.3%20525%20498.1L600%20481.8L600%20901Z%22%20fill%3D%22%23627473%22%2F%3E%3Cpath%20d%3D%22M0%20901L0%20711.1Q0%20711.1%2060%20711.4Q120%20711.7%20180%20720.5Q240%20729.4%20300%20723.8Q360%20718.2%20420%20721.7Q480%20725.1%20540%20703.6L600%20682L600%20901Z%22%20fill%3D%22%23213036%22%2F%3E%3C%2Fsvg%3E",
"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22600%22%20height%3D%22900%22%20viewBox%3D%220%200%20600%20900%22%3E%3Crect%20width%3D%22600%22%20height%3D%22900%22%20fill%3D%22%23fbefe3%22%2F%3E%3Ccircle%20cx%3D%220%22%20cy%3D%22900%22%20r%3D%221027.6%22%20fill%3D%22%23ff7b54%22%2F%3E%3Ccircle%20cx%3D%220%22%20cy%3D%22900%22%20r%3D%22913.4%22%20fill%3D%22%23f3e8d8%22%2F%3E%3Ccircle%20cx%3D%220%22%20cy%3D%22900%22%20r%3D%22799.2%22%20fill%3D%22%23f6ae2d%22%2F%3E%3Ccircle%20cx%3D%220%22%20cy%3D%22900%22%20r%3D%22685.1%22%20fill%3D%22%233d1e3a%22%2F%3E%3Ccircle%20cx%3D%220%22%20cy%3D%22900%22%20r%3D%22570.9%22%20fill%3D%22%23e94f37%22%2F%3E%3Ccircle%20cx%3D%220%22%20cy%3D%22900%22%20r%3D%22456.7%22%20fill%3D%22%230d0a11%22%2F%3E%3Ccircle%20cx%3D%220%22%20cy%3D%22900%22%20r%3D%22342.5%22%20fill%3D%22%23ff7b54%22%2F%3E%3Ccircle%20cx%3D%220%22%20cy%3D%22900%22%20r%3D%22228.4%22%20fill%3D%22%23f3e8d8%22%2F%3E%3Ccircle%20cx%3D%220%22%20cy%3D%22900%22%20r%3D%22114.2%22%20fill%3D%22%23f6ae2d%22%2F%3E%3Ccircle%20cx%3D%22270.8%22%20cy%3D%22158.7%22%20r%3D%2236%22%20fill%3D%22%230d0a11%22%2F%3E%3C%2Fsvg%3E",
] as const;
A pinned image strip splits into three cards that flip over to reveal copy as you scroll.
Copy src/ into a React project and render <SplitFlipScroll />.
Originally published at https://github.com/Hank-D-Tank/nextjs-split-flip.