{"version":3,"file":"Random_project.CcUlyKvA.mjs","names":[],"sources":["https:/framerusercontent.com/modules/8visRMLLmPaIl7AeY9rZ/EwOuybt02d2JoonSixDG/Random_project.js"],"sourcesContent":["// Apply this code override to the \"Collection List\" and it will randomly re-order your \"Post\" containers\n// Modified from the following override:\n// https://gist.github.com/tswic-highdesert/23e82bdc9f1bc7fa5ef48c1cac0656e2\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export const withShuffledItems=Component=>{const ShuffledComponent=props=>{const componentRef=useRef(null);const shuffleAndDisplayItems=()=>{const container=componentRef.current;if(!container)return;// get child nodes of our collection\nlet items=Array.from(container.children);// Shuffle the array\nfor(let i=items.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[items[i],items[j]]=[items[j],items[i]];}// Ne garde que les 3 premiers items après le mélange\nconst firstThreeItems=items.slice(0,3);// Vide le container pour insérer les éléments réordonnés\ncontainer.innerHTML=\"\";// Réinsère uniquement les 3 premiers items mélangés\nfirstThreeItems.forEach(item=>{container.appendChild(item);});};useEffect(()=>{shuffleAndDisplayItems()// Shuffle and display items on component mount\n;},[])// Empty dependency array ensures this runs once after the initial render\n;return /*#__PURE__*/_jsx(Component,{ref:componentRef,...props});};return ShuffledComponent;};\nexport const __FramerMetadata__ = {\"exports\":{\"withShuffledItems\":{\"type\":\"reactHoc\",\"name\":\"withShuffledItems\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Random_project.map"],"mappings":"kLAG4F,AAA5F,GAA2C,IAAoC,CAAa,EAAkB,GAAW,CAAC,IAAM,EAAkB,GAAO,CAAC,IAAM,EAAa,EAAO,KAAK,CAAO,EAAuB,IAAI,CAAC,IAAM,EAAU,EAAa,QAAQ,IAAI,EAAU,OAC/Q,IAAI,EAAM,MAAM,KAAK,EAAU,SAAS,CACxC,IAAI,IAAI,EAAE,EAAM,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,IAAM,EAAE,KAAK,MAAM,KAAK,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAC,EAAM,GAAG,EAAM,GAAG,CAAC,CAAC,EAAM,GAAG,EAAM,EAAG,CAAE,CACnH,IAAM,EAAgB,EAAM,MAAM,EAAE,EAAE,CAEtC,AADA,EAAU,UAAU,GACpB,EAAgB,QAAQ,GAAM,CAAC,EAAU,YAAY,EAAK,AAAE,EAAC,AAAE,EAE9D,MAF+D,GAAU,IAAI,CAAC,GAAwB,AACrG,EAAC,CAAE,EAAC,CACe,EAAK,EAAU,CAAC,IAAI,EAAa,GAAG,CAAM,EAAC,AAAE,EAAC,OAAO,CAAmB"}