Patti Supply
/
Image Trail

Image Trail

Preview

Installation

Copy the element to Webflow

Copy to Webflow
Copied to clipboard!
{"type":"@webflow/XscpData","payload":{"nodes":[{"_id":"a3cc5c45-8e11-2357-3c34-7ffcc8fe42da","type":"Block","tag":"div","classes":["375a6ab4-d6d4-4b0f-8b30-b480eed9abe6"],"children":["55f0d251-bd6a-1dfd-fc1a-09db0cab8649","493d0ea4-9fc8-9385-8f41-f6013345e709"],"data":{"tag":"div","text":false,"xattr":[{"name":"data-trail","value":"true"}],"devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"search":{"exclude":false},"visibility":{"conditions":[],"keepInHtml":{"tag":"False","val":{}}}}},{"_id":"55f0d251-bd6a-1dfd-fc1a-09db0cab8649","type":"Block","tag":"div","classes":["88f6b9f9-4af6-76c2-87b0-14f52ecee051"],"children":["4541c16a-796e-d777-d33a-52ae1138bbf2"],"data":{"tag":"div","text":false,"devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[],"keepInHtml":{"tag":"False","val":{}}}}},{"_id":"4541c16a-796e-d777-d33a-52ae1138bbf2","type":"Heading","tag":"h1","classes":["dcede6a5-e4de-ed4f-9b9b-328080fe3341"],"children":["67e3392b-5587-1b87-6931-076ffc34a6da"],"data":{"tag":"h1","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[],"keepInHtml":{"tag":"False","val":{}}}}},{"_id":"67e3392b-5587-1b87-6931-076ffc34a6da","text":true,"v":"WELCOME"},{"_id":"493d0ea4-9fc8-9385-8f41-f6013345e709","type":"Block","tag":"div","classes":["05f1937a-14be-a291-5aac-ddbd1c8fbbe9"],"children":["f6d3e5e0-9e28-0697-ffdd-cc9f747ebf40","6c1f6608-98c9-83db-e8f2-586c2adfd1e5","7b757393-0dac-53bf-a689-6a2ec61f14a0","f9109631-4a3f-bc11-cf93-21edd77fdc7a","55347a6c-e0d9-f984-e8cf-8e48d528f060","27edefa2-a1bb-f236-0bad-a6f39ad129a5"],"data":{"tag":"div","text":false,"devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[{"name":"aria-hidden","value":"true"}],"search":{"exclude":false},"visibility":{"conditions":[],"keepInHtml":{"tag":"False","val":{}}}}},{"_id":"f6d3e5e0-9e28-0697-ffdd-cc9f747ebf40","type":"Image","tag":"img","classes":["866966c6-51fa-8644-f777-cd52b178c630"],"children":[],"data":{"attr":{"src":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c34e7904f7119de49ed_dim-gunger-Am9Se-CMNvM-unsplash.webp","loading":"eager","width":"auto","height":"auto","alt":"__wf_reserved_decorative","id":""},"img":{"id":"6b0e7c34e7904f7119de49ed"},"srcsetDisabled":false,"sizes":[{"max":640,"size":"100vw"},{"max":10000,"size":"640px"}],"xattr":[{"name":"data-trail-image","value":"true"}],"devlink":{"runtimeProps":{},"slot":""},"displayName":"","search":{"exclude":false},"visibility":{"conditions":[],"keepInHtml":{"tag":"False","val":{}}}}},{"_id":"6c1f6608-98c9-83db-e8f2-586c2adfd1e5","type":"Image","tag":"img","classes":["866966c6-51fa-8644-f777-cd52b178c630"],"children":[],"data":{"attr":{"src":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c349accec6805d81718_scott-webb-mV9-1XjnM4Y-unsplash.webp","loading":"eager","width":"auto","height":"auto","alt":"__wf_reserved_decorative","id":""},"img":{"id":"6b0e7c349accec6805d81718"},"srcsetDisabled":false,"sizes":[{"max":640,"size":"100vw"},{"max":10000,"size":"640px"}],"xattr":[{"name":"data-trail-image","value":"true"}],"devlink":{"runtimeProps":{},"slot":""},"displayName":"","search":{"exclude":false},"visibility":{"conditions":[],"keepInHtml":{"tag":"False","val":{}}}}},{"_id":"7b757393-0dac-53bf-a689-6a2ec61f14a0","type":"Image","tag":"img","classes":["866966c6-51fa-8644-f777-cd52b178c630"],"children":[],"data":{"attr":{"src":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c342be233dffd060926_mymind-tZCrFpSNiIQ-unsplash.webp","loading":"eager","width":"auto","height":"auto","alt":"__wf_reserved_decorative","id":""},"img":{"id":"6b0e7c342be233dffd060926"},"srcsetDisabled":false,"sizes":[{"max":640,"size":"100vw"},{"max":10000,"size":"640px"}],"xattr":[{"name":"data-trail-image","value":"true"}],"devlink":{"runtimeProps":{},"slot":""},"displayName":"","search":{"exclude":false},"visibility":{"conditions":[],"keepInHtml":{"tag":"False","val":{}}}}},{"_id":"f9109631-4a3f-bc11-cf93-21edd77fdc7a","type":"Image","tag":"img","classes":["866966c6-51fa-8644-f777-cd52b178c630"],"children":[],"data":{"attr":{"src":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c343aef82c936580302_andrei-castanha-qTZr2TEUNBo-unsplash.webp","loading":"eager","width":"auto","height":"auto","alt":"__wf_reserved_decorative","id":""},"img":{"id":"6b0e7c343aef82c936580302"},"srcsetDisabled":false,"sizes":[{"max":640,"size":"100vw"},{"max":10000,"size":"640px"}],"xattr":[{"name":"data-trail-image","value":"true"}],"devlink":{"runtimeProps":{},"slot":""},"displayName":"","search":{"exclude":false},"visibility":{"conditions":[],"keepInHtml":{"tag":"False","val":{}}}}},{"_id":"55347a6c-e0d9-f984-e8cf-8e48d528f060","type":"Image","tag":"img","classes":["866966c6-51fa-8644-f777-cd52b178c630"],"children":[],"data":{"attr":{"src":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c3456970dfed3c3cad1_simon-lee-zft-W1kVEhg-unsplash.webp","loading":"eager","width":"auto","height":"auto","alt":"__wf_reserved_decorative","id":""},"img":{"id":"6b0e7c3456970dfed3c3cad1"},"srcsetDisabled":false,"sizes":[{"max":640,"size":"100vw"},{"max":10000,"size":"640px"}],"xattr":[{"name":"data-trail-image","value":"true"}],"devlink":{"runtimeProps":{},"slot":""},"displayName":"","search":{"exclude":false},"visibility":{"conditions":[],"keepInHtml":{"tag":"False","val":{}}}}},{"_id":"27edefa2-a1bb-f236-0bad-a6f39ad129a5","type":"Image","tag":"img","classes":["866966c6-51fa-8644-f777-cd52b178c630"],"children":[],"data":{"attr":{"src":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c348ff6422ed2cac519_jean-philippe-delberghe-75xPHEQBmvA-unsplash.webp","loading":"eager","width":"auto","height":"auto","alt":"__wf_reserved_decorative","id":""},"img":{"id":"6b0e7c348ff6422ed2cac519"},"srcsetDisabled":false,"sizes":[{"max":640,"size":"100vw"},{"max":10000,"size":"640px"}],"xattr":[{"name":"data-trail-image","value":"true"}],"devlink":{"runtimeProps":{},"slot":""},"displayName":"","search":{"exclude":false},"visibility":{"conditions":[],"keepInHtml":{"tag":"False","val":{}}}}}],"styles":[{"_id":"375a6ab4-d6d4-4b0f-8b30-b480eed9abe6","fake":false,"type":"class","name":"p003-image-trail","namespace":"","comb":"","styleLess":"position: relative; display: flex; overflow: hidden; min-height: 100svh; flex-direction: column; justify-content: center; flex-wrap: nowrap; align-items: center; background-color: hsla(0, 0.00%, 0.00%, 1.00);","variants":{},"children":[],"createdBy":"6a524a3cbc0fac0d25bf4b97","origin":null,"selector":null},{"_id":"88f6b9f9-4af6-76c2-87b0-14f52ecee051","fake":false,"type":"class","name":"p003-image-trail_content","namespace":"","comb":"","styleLess":"position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; flex-wrap: nowrap; align-items: center; text-align: center;","variants":{},"children":[],"createdBy":"6a524a3cbc0fac0d25bf4b97","origin":null,"selector":null},{"_id":"dcede6a5-e4de-ed4f-9b9b-328080fe3341","fake":false,"type":"class","name":"p003-image-trail_heading","namespace":"","comb":"","styleLess":"color: hsla(0, 0.00%, 94.00%, 1.00); font-size: 10rem; line-height: 8rem; font-weight: 700; letter-spacing: -0.6rem; text-transform: uppercase;","variants":{"small":{"styleLess":"font-size: 8rem;"},"tiny":{"styleLess":"font-size: 4rem; letter-spacing: -0.2rem;"}},"children":[],"createdBy":"6a524a3cbc0fac0d25bf4b97","origin":null,"selector":null},{"_id":"05f1937a-14be-a291-5aac-ddbd1c8fbbe9","fake":false,"type":"class","name":"p003-image-trail_images","namespace":"","comb":"","styleLess":"position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; z-index: 2; pointer-events: none;","variants":{},"children":[],"createdBy":"6a524a3cbc0fac0d25bf4b97","origin":null,"selector":null},{"_id":"866966c6-51fa-8644-f777-cd52b178c630","fake":false,"type":"class","name":"p003-image-trail_image","namespace":"","comb":"","styleLess":"position: absolute; left: 0px; top: 0px; width: 16rem; aspect-ratio: 3/4; opacity: 0; object-fit: cover;","variants":{},"children":[],"createdBy":"6a524a3cbc0fac0d25bf4b97","origin":null,"selector":null}],"assets":[{"cdnUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c34e7904f7119de49ed_dim-gunger-Am9Se-CMNvM-unsplash.webp","siteId":"6b0e7602eb8c1fb2c1c45ef1","width":640,"isHD":false,"height":944,"fileName":"6b0e7c34e7904f7119de49ed_dim-gunger-Am9Se-CMNvM-unsplash.webp","createdOn":"2026-12-01T07:50:12.916Z","origFileName":"dim-gunger-Am9Se-CMNvM-unsplash.webp","fileHash":"0977e59e752d121616820047edfbdc0d","translationLoading":false,"variants":[{"s3Url":"https://s3.amazonaws.com/webflow-prod-assets/6b0e7602eb8c1fb2c1c45ef1/6b0e7c34e7904f7119de49ed_dim-gunger-Am9Se-CMNvM-unsplash-p-500.webp","origFileName":"dim-gunger-Am9Se-CMNvM-unsplash-p-500.webp","fileName":"6b0e7c34e7904f7119de49ed_dim-gunger-Am9Se-CMNvM-unsplash-p-500.webp","format":"webp","width":500,"size":92216,"quality":100,"cdnUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c34e7904f7119de49ed_dim-gunger-Am9Se-CMNvM-unsplash-p-500.webp","_id":"6b0e7c37660283af8b7bd9ea"}],"mimeType":"image/webp","isFromWellKnownFolder":false,"s3Url":"https://s3.amazonaws.com/webflow-prod-assets/6b0e7602eb8c1fb2c1c45ef1/6b0e7c34e7904f7119de49ed_dim-gunger-Am9Se-CMNvM-unsplash.webp","thumbUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c34e7904f7119de49ed_dim-gunger-Am9Se-CMNvM-unsplash.webp","_id":"6b0e7c34e7904f7119de49ed","updatedOn":"2026-12-01T07:50:15.286Z","fileSize":145912,"localizedSettings":{}},{"cdnUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c349accec6805d81718_scott-webb-mV9-1XjnM4Y-unsplash.webp","siteId":"6b0e7602eb8c1fb2c1c45ef1","width":640,"isHD":false,"height":960,"fileName":"6b0e7c349accec6805d81718_scott-webb-mV9-1XjnM4Y-unsplash.webp","createdOn":"2026-12-01T07:50:12.902Z","origFileName":"scott-webb-mV9-1XjnM4Y-unsplash.webp","fileHash":"08bae01a4000b1816882403af2afa3c5","translationLoading":false,"variants":[{"s3Url":"https://s3.amazonaws.com/webflow-prod-assets/6b0e7602eb8c1fb2c1c45ef1/6b0e7c349accec6805d81718_scott-webb-mV9-1XjnM4Y-unsplash-p-500.webp","origFileName":"scott-webb-mV9-1XjnM4Y-unsplash-p-500.webp","fileName":"6b0e7c349accec6805d81718_scott-webb-mV9-1XjnM4Y-unsplash-p-500.webp","format":"webp","width":500,"size":73040,"quality":100,"cdnUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c349accec6805d81718_scott-webb-mV9-1XjnM4Y-unsplash-p-500.webp","_id":"6b0e7c3659164ec3a2fee91d"}],"mimeType":"image/webp","isFromWellKnownFolder":false,"s3Url":"https://s3.amazonaws.com/webflow-prod-assets/6b0e7602eb8c1fb2c1c45ef1/6b0e7c349accec6805d81718_scott-webb-mV9-1XjnM4Y-unsplash.webp","thumbUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c349accec6805d81718_scott-webb-mV9-1XjnM4Y-unsplash.webp","_id":"6b0e7c349accec6805d81718","updatedOn":"2026-12-01T07:50:14.574Z","fileSize":130942,"localizedSettings":{}},{"cdnUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c342be233dffd060926_mymind-tZCrFpSNiIQ-unsplash.webp","siteId":"6b0e7602eb8c1fb2c1c45ef1","width":640,"isHD":false,"height":960,"fileName":"6b0e7c342be233dffd060926_mymind-tZCrFpSNiIQ-unsplash.webp","createdOn":"2026-12-01T07:50:12.860Z","origFileName":"mymind-tZCrFpSNiIQ-unsplash.webp","fileHash":"9b12a8a6d3e774ea144adbb506d0d5a5","translationLoading":false,"variants":[{"s3Url":"https://s3.amazonaws.com/webflow-prod-assets/6b0e7602eb8c1fb2c1c45ef1/6b0e7c342be233dffd060926_mymind-tZCrFpSNiIQ-unsplash-p-500.webp","origFileName":"mymind-tZCrFpSNiIQ-unsplash-p-500.webp","fileName":"6b0e7c342be233dffd060926_mymind-tZCrFpSNiIQ-unsplash-p-500.webp","format":"webp","width":500,"size":7192,"quality":100,"cdnUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c342be233dffd060926_mymind-tZCrFpSNiIQ-unsplash-p-500.webp","_id":"6b0e7c3668f44c51e5175903"}],"mimeType":"image/webp","isFromWellKnownFolder":false,"s3Url":"https://s3.amazonaws.com/webflow-prod-assets/6b0e7602eb8c1fb2c1c45ef1/6b0e7c342be233dffd060926_mymind-tZCrFpSNiIQ-unsplash.webp","thumbUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c342be233dffd060926_mymind-tZCrFpSNiIQ-unsplash.webp","_id":"6b0e7c342be233dffd060926","updatedOn":"2026-12-01T07:50:14.290Z","fileSize":7670,"localizedSettings":{}},{"cdnUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c343aef82c936580302_andrei-castanha-qTZr2TEUNBo-unsplash.webp","siteId":"6b0e7602eb8c1fb2c1c45ef1","width":640,"isHD":false,"height":905,"fileName":"6b0e7c343aef82c936580302_andrei-castanha-qTZr2TEUNBo-unsplash.webp","createdOn":"2026-12-01T07:50:12.855Z","origFileName":"andrei-castanha-qTZr2TEUNBo-unsplash.webp","fileHash":"11376c69aea0746672bead9f53a6fbb3","translationLoading":false,"variants":[{"s3Url":"https://s3.amazonaws.com/webflow-prod-assets/6b0e7602eb8c1fb2c1c45ef1/6b0e7c343aef82c936580302_andrei-castanha-qTZr2TEUNBo-unsplash-p-500.webp","origFileName":"andrei-castanha-qTZr2TEUNBo-unsplash-p-500.webp","fileName":"6b0e7c343aef82c936580302_andrei-castanha-qTZr2TEUNBo-unsplash-p-500.webp","format":"webp","width":500,"size":19682,"quality":100,"cdnUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c343aef82c936580302_andrei-castanha-qTZr2TEUNBo-unsplash-p-500.webp","_id":"6b0e7c362faae9f9874d735a"}],"mimeType":"image/webp","isFromWellKnownFolder":false,"s3Url":"https://s3.amazonaws.com/webflow-prod-assets/6b0e7602eb8c1fb2c1c45ef1/6b0e7c343aef82c936580302_andrei-castanha-qTZr2TEUNBo-unsplash.webp","thumbUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c343aef82c936580302_andrei-castanha-qTZr2TEUNBo-unsplash.webp","_id":"6b0e7c343aef82c936580302","updatedOn":"2026-12-01T07:50:14.144Z","fileSize":24248,"localizedSettings":{}},{"cdnUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c3456970dfed3c3cad1_simon-lee-zft-W1kVEhg-unsplash.webp","siteId":"6b0e7602eb8c1fb2c1c45ef1","width":640,"isHD":false,"height":853,"fileName":"6b0e7c3456970dfed3c3cad1_simon-lee-zft-W1kVEhg-unsplash.webp","createdOn":"2026-12-01T07:50:12.855Z","origFileName":"simon-lee-zft-W1kVEhg-unsplash.webp","fileHash":"46064cb0deae0e5a1a9855fe2dbfef75","translationLoading":false,"variants":[{"s3Url":"https://s3.amazonaws.com/webflow-prod-assets/6b0e7602eb8c1fb2c1c45ef1/6b0e7c3456970dfed3c3cad1_simon-lee-zft-W1kVEhg-unsplash-p-500.webp","origFileName":"simon-lee-zft-W1kVEhg-unsplash-p-500.webp","fileName":"6b0e7c3456970dfed3c3cad1_simon-lee-zft-W1kVEhg-unsplash-p-500.webp","format":"webp","width":500,"size":23268,"quality":100,"cdnUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c3456970dfed3c3cad1_simon-lee-zft-W1kVEhg-unsplash-p-500.webp","_id":"6b0e7c3662d58f175ffa1fcb"}],"mimeType":"image/webp","isFromWellKnownFolder":false,"s3Url":"https://s3.amazonaws.com/webflow-prod-assets/6b0e7602eb8c1fb2c1c45ef1/6b0e7c3456970dfed3c3cad1_simon-lee-zft-W1kVEhg-unsplash.webp","thumbUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c3456970dfed3c3cad1_simon-lee-zft-W1kVEhg-unsplash.webp","_id":"6b0e7c3456970dfed3c3cad1","updatedOn":"2026-12-01T07:50:14.085Z","fileSize":31732,"localizedSettings":{}},{"cdnUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c348ff6422ed2cac519_jean-philippe-delberghe-75xPHEQBmvA-unsplash.webp","siteId":"6b0e7602eb8c1fb2c1c45ef1","width":640,"isHD":false,"height":960,"fileName":"6b0e7c348ff6422ed2cac519_jean-philippe-delberghe-75xPHEQBmvA-unsplash.webp","createdOn":"2026-12-01T07:50:12.853Z","origFileName":"jean-philippe-delberghe-75xPHEQBmvA-unsplash.webp","fileHash":"972eabd4368307930bf9ab1411480df3","translationLoading":false,"variants":[{"s3Url":"https://s3.amazonaws.com/webflow-prod-assets/6b0e7602eb8c1fb2c1c45ef1/6b0e7c348ff6422ed2cac519_jean-philippe-delberghe-75xPHEQBmvA-unsplash-p-500.webp","origFileName":"jean-philippe-delberghe-75xPHEQBmvA-unsplash-p-500.webp","fileName":"6b0e7c348ff6422ed2cac519_jean-philippe-delberghe-75xPHEQBmvA-unsplash-p-500.webp","format":"webp","width":500,"size":7628,"quality":100,"cdnUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c348ff6422ed2cac519_jean-philippe-delberghe-75xPHEQBmvA-unsplash-p-500.webp","_id":"6b0e7c36b9cf282920cf5d92"}],"mimeType":"image/webp","isFromWellKnownFolder":false,"s3Url":"https://s3.amazonaws.com/webflow-prod-assets/6b0e7602eb8c1fb2c1c45ef1/6b0e7c348ff6422ed2cac519_jean-philippe-delberghe-75xPHEQBmvA-unsplash.webp","thumbUrl":"https://cdn.prod.website-files.com/6b0e7602eb8c1fb2c1c45ef1/6b0e7c348ff6422ed2cac519_jean-philippe-delberghe-75xPHEQBmvA-unsplash.webp","_id":"6b0e7c348ff6422ed2cac519","updatedOn":"2026-12-01T07:50:14.099Z","fileSize":10084,"localizedSettings":{}}],"ix1":[],"ix2":{"interactions":[],"events":[],"actionLists":[]},"expandUserComponents":false},"meta":{"droppedLinks":0,"dynBindRemovedCount":0,"dynListBindRemovedCount":0,"paginationRemovedCount":0,"universalBindingsRemovedCount":0,"unlinkedSymbolCount":0,"codeComponentsRemovedCount":0,"richTextComponentsStripped":false,"sourceSiteId":"6b0e7602eb8c1fb2c1c45ef1"}}

Add custom JavaScript

JavaScript
(() => {
  const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
  // Animation settings
  const distance = 65;
  const duration = 1500;
  const drift = 0.5;
  const rotation = 5;
  document.querySelectorAll('[data-trail="true"]').forEach((trail) => {
    if (trail.dataset.trailInitialized) return;
    const images = [...trail.querySelectorAll('[data-trail-image="true"]')];
    if (!images.length) return;
    trail.dataset.trailInitialized = 'true';
    const animations = new Map();
    let index = 0;
    let last = null;
    let pointer = null;
    let frame = null;
    images.forEach((image) => {
      image.style.opacity = '0';
    });
    function reset() {
      last = null;
      pointer = null;
      if (frame !== null) {
        cancelAnimationFrame(frame);
        frame = null;
      }
    }
    function render() {
      frame = null;
      if (!pointer || reducedMotion.matches) return;
      const rect = trail.getBoundingClientRect();
      const x = pointer.x - rect.left;
      const y = pointer.y - rect.top;
      const dx = last ? x - last.x : 0;
      const dy = last ? y - last.y : 0;
      const movement = Math.hypot(dx, dy);
      if (last && movement < distance) return;
      let image;
      // Skip unloaded or unavailable images
      for (let i = 0; i < images.length; i++) {
        const candidate = images[index];
        index = (index + 1) % images.length;
        if (candidate.complete && candidate.naturalWidth > 0) {
          image = candidate;
          break;
        }
      }
      if (!image) return;
      last = { x, y };
      // Reuse the existing image pool
      animations.get(image)?.cancel();
      // Keep stacking order within the image pool
      images.forEach((item) => {
        item.style.zIndex = Math.max(0, (Number(item.style.zIndex) || 0) - 1);
      });
      image.style.zIndex = images.length;
      const angle = Math.max(-rotation, Math.min(rotation, dx * 0.1));
      const offsetX = movement ? (dx / movement) * distance * drift : 0;
      const offsetY = movement ? (dy / movement) * distance * drift : 0;
      const transform = (px, py, scale, rotate) =>
        `translate3d(${px}px, ${py}px, 0)
       translate(-50%, -50%)
       rotate(${rotate}deg)
       scale(${scale})`;
      const animation = image.animate(
        [
          {
            opacity: 0,
            transform: transform(x, y, 0.85, angle),
          },
          {
            opacity: 1,
            transform: transform(x, y, 1, angle),
            offset: 0.15,
          },
          {
            opacity: 1,
            transform: transform(x + offsetX * 0.5, y + offsetY * 0.5, 1, angle),
            offset: 0.4,
          },
          {
            opacity: 0,
            transform: transform(x + offsetX, y + offsetY + 25, 0.9, angle * 1.5),
          },
        ],
        {
          duration,
          easing: 'cubic-bezier(0.22, 1, 0.36, 1)',
        },
      );
      animations.set(image, animation);
      animation.onfinish = () => {
        if (animations.get(image) === animation) {
          animations.delete(image);
        }
      };
    }
    function move(event) {
      if (reducedMotion.matches || event.pointerType !== 'mouse') return;
      pointer = {
        x: event.clientX,
        y: event.clientY,
      };
      if (frame === null) {
        frame = requestAnimationFrame(render);
      }
    }
    trail.addEventListener('pointermove', move, { passive: true });
    trail.addEventListener('pointerleave', reset);
    trail.addEventListener('pointercancel', reset);
    reducedMotion.addEventListener('change', () => {
      reset();
      if (reducedMotion.matches) {
        animations.forEach((animation) => animation.cancel());
        animations.clear();
      }
    });
  });
})();

Add HTML structure

<div class="p003-image-trail" data-trail="true">
  <div class="p003-image-trail_content">
    <h1 class="p003-image-trail_heading">WELCOME</h1>
  </div>
  <div aria-hidden="true" class="p003-image-trail_images">
    <img alt="" class="p003-image-trail_image" data-trail-image="true" loading="eager" src="assets/<trail-></<trail-></trail->01.webp" />
    <img alt="" class="p003-image-trail_image" data-trail-image="true" loading="eager" src="assets/trail-02.webp" />
    <img alt="" class="p003-image-trail_image" data-trail-image="true" loading="eager" src="assets/trail-03.webp" />
    <img alt="" class="p003-image-trail_image" data-trail-image="true" loading="eager" src="assets/trail-04.webp" />
    <img alt="" class="p003-image-trail_image" data-trail-image="true" loading="eager" src="assets/trail-05.webp" />
    <img alt="" class="p003-image-trail_image" data-trail-image="true" loading="eager" src="assets/trail-06.webp" />
  </div>
</div>

Add custom CSS

.p003-image-trail,
.p003-image-trail * {
  box-sizing: border-box;
}

.p003-image-trail {
  /* Demo appearance */
  font-family: Arial, sans-serif;
  background-color: #000;
  width: 100%;
  min-height: 100vh;
  flex-flow: column;
  justify-content: center;
  align-items: center;
  min-height: 100svh;
  display: flex;
  position: relative;
  overflow: hidden;
}

.p003-image-trail_content {
  z-index: 1;
  text-align: center;
  flex-flow: column;
  justify-content: center;
  align-items: center;
  display: flex;
  position: relative;
}

.p003-image-trail_heading {
  margin: 20px 0 10px;
  color: #f0f0f0;
  letter-spacing: -0.6rem;
  text-transform: uppercase;
  font-size: 10rem;
  font-weight: 700;
  line-height: 8rem;
}

.p003-image-trail_images {
  z-index: 2;
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.p003-image-trail_image {
  /* Required: hidden until animated */
  aspect-ratio: 3 / 4;
  height: auto;
  max-width: 100%;
  display: inline-block;
  vertical-align: middle;
  opacity: 0;
  object-fit: cover;
  width: 16rem;
  position: absolute;
  top: 0;
  left: 0;
}

@media screen and (max-width: 767px) {
  .p003-image-trail_heading {
    font-size: 8rem;
  }
}

@media screen and (max-width: 479px) {
  .p003-image-trail_heading {
    letter-spacing: -0.2rem;
    font-size: 4rem;
  }
}

Add custom JavaScript

JavaScript
(() => {
  const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
  // Animation settings
  const distance = 65;
  const duration = 1500;
  const drift = 0.5;
  const rotation = 5;
  document.querySelectorAll('[data-trail="true"]').forEach((trail) => {
    if (trail.dataset.trailInitialized) return;
    const images = [...trail.querySelectorAll('[data-trail-image="true"]')];
    if (!images.length) return;
    trail.dataset.trailInitialized = 'true';
    const animations = new Map();
    let index = 0;
    let last = null;
    let pointer = null;
    let frame = null;
    images.forEach((image) => {
      image.style.opacity = '0';
    });
    function reset() {
      last = null;
      pointer = null;
      if (frame !== null) {
        cancelAnimationFrame(frame);
        frame = null;
      }
    }
    function render() {
      frame = null;
      if (!pointer || reducedMotion.matches) return;
      const rect = trail.getBoundingClientRect();
      const x = pointer.x - rect.left;
      const y = pointer.y - rect.top;
      const dx = last ? x - last.x : 0;
      const dy = last ? y - last.y : 0;
      const movement = Math.hypot(dx, dy);
      if (last && movement < distance) return;
      let image;
      // Skip unloaded or unavailable images
      for (let i = 0; i < images.length; i++) {
        const candidate = images[index];
        index = (index + 1) % images.length;
        if (candidate.complete && candidate.naturalWidth > 0) {
          image = candidate;
          break;
        }
      }
      if (!image) return;
      last = { x, y };
      // Reuse the existing image pool
      animations.get(image)?.cancel();
      // Keep stacking order within the image pool
      images.forEach((item) => {
        item.style.zIndex = Math.max(0, (Number(item.style.zIndex) || 0) - 1);
      });
      image.style.zIndex = images.length;
      const angle = Math.max(-rotation, Math.min(rotation, dx * 0.1));
      const offsetX = movement ? (dx / movement) * distance * drift : 0;
      const offsetY = movement ? (dy / movement) * distance * drift : 0;
      const transform = (px, py, scale, rotate) =>
        `translate3d(${px}px, ${py}px, 0)
       translate(-50%, -50%)
       rotate(${rotate}deg)
       scale(${scale})`;
      const animation = image.animate(
        [
          {
            opacity: 0,
            transform: transform(x, y, 0.85, angle),
          },
          {
            opacity: 1,
            transform: transform(x, y, 1, angle),
            offset: 0.15,
          },
          {
            opacity: 1,
            transform: transform(x + offsetX * 0.5, y + offsetY * 0.5, 1, angle),
            offset: 0.4,
          },
          {
            opacity: 0,
            transform: transform(x + offsetX, y + offsetY + 25, 0.9, angle * 1.5),
          },
        ],
        {
          duration,
          easing: 'cubic-bezier(0.22, 1, 0.36, 1)',
        },
      );
      animations.set(image, animation);
      animation.onfinish = () => {
        if (animations.get(image) === animation) {
          animations.delete(image);
        }
      };
    }
    function move(event) {
      if (reducedMotion.matches || event.pointerType !== 'mouse') return;
      pointer = {
        x: event.clientX,
        y: event.clientY,
      };
      if (frame === null) {
        frame = requestAnimationFrame(render);
      }
    }
    trail.addEventListener('pointermove', move, { passive: true });
    trail.addEventListener('pointerleave', reset);
    trail.addEventListener('pointercancel', reset);
    reducedMotion.addEventListener('change', () => {
      reset();
      if (reducedMotion.matches) {
        animations.forEach((animation) => animation.cancel());
        animations.clear();
      }
    });
  });
})();

Documentation

How to use in Webflow

‍

Copy the component into your Webflow project. Paste the JavaScript into "Page Settings → Before </body>" tag.

Publish your page to test the menu and replace the placeholder links with your own destinations.

‍

‍

‍

How it works

‍

The Mouse Image Trail displays a sequence of images as the cursor moves across the component. Each image appears at the cursor position, follows its movement with a subtle drift and rotation, and smoothly fades out. The effect is built with vanilla JavaScript and the native Web Animations API. Existing image elements are reused to keep the animation lightweight and performant, without external dependencies or continuous animation loops. The animation only responds to mouse input. Touch and pen input are ignored, and the effect is automatically disabled when the user has enabled reduced motion in their system settings.

‍

‍

Animation settings

‍

Adjust the following four values at the beginning of the JavaScript to customize the animation:

‍

‍

Images

‍

Replace, add, or remove images to create your own visual experience. The script automatically detects the number of images. Make sure each image retains the "data-trail-image=true" attribute.

For optimal performance, use compressed WebP images. Images are loaded eagerly to minimize delays during the animation, including on touch devices.

‍

‍

Styling

‍

Customize the image size, aspect ratio, border radius, typography, background color, and container height directly in the Webflow Designer or through the provided CSS. You can also adjust the stacking order to display the image trail in front of or behind the content. Keep the required data attributes and functional positioning styles intact to ensure the animation works correctly.

‍

‍

Multiple instances

‍

The component supports multiple independent instances on the same page. Simply duplicate the component while keeping its data attributes intact. The JavaScript only needs to be included once.

‍