{"version":3,"file":"Examples.l5Xct92B.mjs","names":[],"sources":["https:/framerusercontent.com/modules/TQuCYbo2LAx4vWpHxP7O/wBV0BkvGcL1ET8koZ4Ja/Examples.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useCallback}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */const fullHeight=\"var(--vh100)\";const scrollSnapType=\"y mandatory\";const snapStyle={scrollSnapAlign:\"start\",scrollSnapStop:\"always\",height:fullHeight};const flexCol={display:\"flex\",maxWidth:\"100%\",flexDirection:\"column\"};const flexRow={display:\"flex\",flexDirection:\"row\"};const fullSize={height:fullHeight,width:\"100vw\"};export const withScrollToNextButton=Component=>{return props=>{const handleClick=useCallback(()=>{// Get all elements that use scroll-snap-stop, accounting for variations in spacing\nconst snapElements=Array.from(document.querySelectorAll('[style*=\"scroll-snap-stop:always\"], [style*=\"scroll-snap-stop: always\"]'));// Define a safe margin (in pixels)\nconst safeMargin=-20;// Find the element currently in the viewport with a safe margin\nconst currentElement=snapElements.find(el=>{const rect=el.getBoundingClientRect();return rect.top>=safeMargin&&rect.bottom<=window.innerHeight-safeMargin;});if(currentElement){// Get the current element's index\nconst currentIndex=snapElements.indexOf(currentElement);// Find the next element, wrapping around if necessary\nconst nextIndex=(currentIndex+1)%snapElements.length;const nextElement=snapElements[nextIndex];// Scroll to the next element smoothly\nif(nextElement){nextElement.scrollIntoView({behavior:\"smooth\",block:\"center\",inline:\"center\"});}}},[]);return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick});};};export const withSnapScrollSite=Component=>{return props=>{useEffect(()=>{const htmlElement=document.documentElement;htmlElement.style.scrollSnapType=\"y mandatory\";htmlElement.style.overscrollBehavior=\"none\";htmlElement.style.overflow=\"auto\";htmlElement.style.scrollBehavior=\"smooth\";const setVh100=()=>{// Check if the browser supports 'lvh' (a workaround to detect support)\nconst testElement=document.createElement(\"div\");testElement.style.height=\"100lvh\";document.body.appendChild(testElement);// If the height doesn't parse correctly, fallback to 100vh\nconst supportsLvh=testElement.offsetHeight>0;document.body.removeChild(testElement);// Set the --vh100 CSS variable to 100lvh or 100vh\nconst vhValue=supportsLvh?\"100lvh\":\"100vh\";document.documentElement.style.setProperty(\"--vh100\",vhValue);};// Set --vh100 initially\nsetVh100();// Mobile scroll position fix\nconst resetScrollPosition=()=>{// Check if we're on mobile (viewport width check)\nconst isMobile=window.innerWidth<=768;if(isMobile){// Temporarily disable scroll snap to allow proper scroll to top\nhtmlElement.style.scrollSnapType=\"none\";// Force scroll to top immediately\nwindow.scrollTo({top:0,left:0,behavior:\"instant\"});// Re-enable scroll snap after a brief delay\nsetTimeout(()=>{htmlElement.style.scrollSnapType=\"y mandatory\";},150);}else{// On desktop, just scroll to top normally\nwindow.scrollTo(0,0);}};// Handle different page load scenarios\nconst handlePageLoad=()=>{// Small delay to ensure DOM is fully loaded\nsetTimeout(resetScrollPosition,50);};// Handle page show (back/forward navigation)\nconst handlePageShow=event=>{// Only reset scroll position for fresh page loads, not cached pages\nif(!event.persisted){resetScrollPosition();}};// Run immediately if page is already loaded\nif(document.readyState===\"complete\"){handlePageLoad();}else{// Wait for page to fully load\nwindow.addEventListener(\"load\",handlePageLoad);}// Handle navigation events\nwindow.addEventListener(\"pageshow\",handlePageShow);window.addEventListener(\"resize\",setVh100);return()=>{window.removeEventListener(\"load\",handlePageLoad);window.removeEventListener(\"resize\",setVh100);window.removeEventListener(\"pageshow\",handlePageShow);htmlElement.style.scrollSnapType=\"\";htmlElement.style.overscrollBehavior=\"\";htmlElement.style.overflow=\"\";htmlElement.style.scrollBehavior=\"\";htmlElement.style.scrollPaddingBottom=\"\";};},[]);return /*#__PURE__*/_jsx(Component,{...props});};};// Learn more: https://www.framer.com/developers/overrides/\nexport function with100dvh(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,height:\"var(--vh100, 100vh)\"}});};}export const withSnapScrollElement=Component=>{return props=>{return /*#__PURE__*/_jsx(Component,{...props,style:snapStyle});};};\nexport const __FramerMetadata__ = {\"exports\":{\"withScrollToNextButton\":{\"type\":\"reactHoc\",\"name\":\"withScrollToNextButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSnapScrollElement\":{\"type\":\"reactHoc\",\"name\":\"withSnapScrollElement\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSnapScrollSite\":{\"type\":\"reactHoc\",\"name\":\"withSnapScrollSite\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"with100dvh\":{\"type\":\"reactHoc\",\"name\":\"with100dvh\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"8NAA2C,IAAyC,CAGR,EAAU,CAAC,gBAAgB,QAAQ,eAAe,SAAS,OAAnH,eAAqI,CAMkC,EAAmB,GAAmB,IAAQ,MAAc,CAAC,IAAM,EAAY,SAAS,gBAAgB,EAAY,MAAM,eAAe,cAAc,EAAY,MAAM,mBAAmB,OAAO,EAAY,MAAM,SAAS,OAAO,EAAY,MAAM,eAAe,SAAS,IAAM,MAAa,CAC7d,IAAM,EAAY,SAAS,cAAc,MAAM,CAAC,EAAY,MAAM,OAAO,SAAS,SAAS,KAAK,YAAY,EAAY,CACxH,IAAM,EAAY,EAAY,aAAa,EAAE,SAAS,KAAK,YAAY,EAAY,CACnF,IAAM,EAAQ,EAAY,SAAS,QAAQ,SAAS,gBAAgB,MAAM,YAAY,UAAU,EAAQ,EACxG,GAAU,CACV,IAAM,MAAwB,CACf,EAAO,YAAY,KAClC,EAAY,MAAM,eAAe,OACjC,EAAO,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,UAAU,CAAC,CAClD,eAAe,CAAC,EAAY,MAAM,eAAe,eAAgB,IAAI,EACrE,EAAO,SAAS,EAAE,EAAE,EACd,MAAmB,CACzB,WAAW,EAAoB,GAAG,EAC5B,EAAe,GAAO,CACxB,EAAM,WAAW,GA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