{"version":3,"file":"ScrollNextPage.D-RrjGJr.mjs","names":["useState","MOBILE_QUERY","useState","useRef"],"sources":["https:/framerusercontent.com/modules/yiSA7q5hhfibKUrTAWcu/AoqvIBbS9olW65bfFW1J/ScrollHint.js","https:/framerusercontent.com/modules/5Tw3mKIkYKuUO33nm4Pj/8nlp6uklBdCTfuRhxG7v/ScrollNextPage.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const MOBILE_QUERY=\"(max-width: 1199.98px)\";export default function ScrollHint(props){const{target=\"\",targetPath=\"\",direction=\"down\",accentColor=\"#EC008B\"}=props;const[isMobile,setIsMobile]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;const mq=window.matchMedia(MOBILE_QUERY);const update=()=>setIsMobile(mq.matches);update();mq.addEventListener?mq.addEventListener(\"change\",update):mq.addListener(update);return()=>{mq.removeEventListener?mq.removeEventListener(\"change\",update):mq.removeListener(update);};},[]);const arrow=direction===\"down\"?\"↓\":\"↑\";if(isMobile){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",display:\"flex\",justifyContent:\"center\",padding:\"18px 0\"},children:/*#__PURE__*/_jsxs(\"a\",{href:targetPath||undefined,style:{display:\"inline-flex\",alignItems:\"center\",gap:\"8px\",border:`1px solid ${accentColor}`,borderRadius:\"100px\",padding:\"10px 20px\",fontFamily:\"Space Grotesk, sans-serif\",fontWeight:600,fontSize:\"13px\",letterSpacing:\"0.02em\",color:accentColor,textDecoration:\"none\",cursor:\"pointer\",userSelect:\"none\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontSize:\"15px\",lineHeight:1},children:arrow}),/*#__PURE__*/_jsx(\"span\",{children:target})]})});}const label=`Scroll ${direction} for ${target}`;return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",display:\"flex\",flexDirection:direction===\"down\"?\"column\":\"column-reverse\",alignItems:\"center\",justifyContent:\"center\",gap:\"6px\",padding:\"22px 0\",fontFamily:\"Space Grotesk, sans-serif\",fontWeight:600,fontSize:\"12px\",letterSpacing:\"0.08em\",textTransform:\"uppercase\",color:accentColor,userSelect:\"none\"},children:[/*#__PURE__*/_jsx(\"span\",{children:label}),/*#__PURE__*/_jsx(\"span\",{style:{fontSize:\"18px\",lineHeight:1,display:\"inline-block\",animation:`scrollHintBounce-${direction} 1.6s ease-in-out infinite`},children:arrow}),/*#__PURE__*/_jsx(\"style\",{children:`\n                @keyframes scrollHintBounce-down {\n                    0%, 100% { transform: translateY(0); }\n                    50% { transform: translateY(6px); }\n                }\n                @keyframes scrollHintBounce-up {\n                    0%, 100% { transform: translateY(0); }\n                    50% { transform: translateY(-6px); }\n                }\n                `})]});}addPropertyControls(ScrollHint,{target:{type:ControlType.String,title:\"Target\",defaultValue:\"About\"},targetPath:{type:ControlType.String,title:\"Target Path\",defaultValue:\"/about\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"down\",\"up\"],optionTitles:[\"Down (next)\",\"Up (prev)\"],defaultValue:\"down\"},accentColor:{type:ControlType.Color,title:\"Accent Color\",defaultValue:\"#EC008B\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollHint\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollHint.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const BASE_FONT_PX=32;const MOBILE_QUERY=\"(max-width: 1199.98px)\";export default function ScrollNextPage(props){const{label=\"Keep scrolling\",nextPath=\"\",prevLabel=\"\",prevPath=\"\",accentColor=\"#EC008B\",threshold=900,mobileThreshold=420}=props;const[isMobile,setIsMobile]=useState(false);const[display,setDisplay]=useState(0)// smoothed 0..1, drives rendering\n;const[dir,setDir]=useState(\"next\");const targetRef=useRef(0)// signed, -activeThreshold..activeThreshold\n;const displayRef=useRef(0);const navigatingRef=useRef(false);const rafRef=useRef(null);const textRef=useRef(null);const[maxFontPx,setMaxFontPx]=useState(400);const activeThreshold=isMobile?mobileThreshold:threshold;const activeLabel=dir===\"next\"?label:prevLabel;useEffect(()=>{if(typeof window===\"undefined\")return;const mq=window.matchMedia(MOBILE_QUERY);const update=()=>setIsMobile(mq.matches);update();mq.addEventListener?mq.addEventListener(\"change\",update):mq.addListener(update);return()=>{mq.removeEventListener?mq.removeEventListener(\"change\",update):mq.removeListener(update);};},[]);// measure the label's natural width at the base font size so growth can\n// be capped to the viewport without ever needing a blur-prone transform\nuseEffect(()=>{if(typeof window===\"undefined\"||isMobile)return;function measure(){const w=textRef.current?.offsetWidth||0;if(w>0)setMaxFontPx(Math.max(BASE_FONT_PX,window.innerWidth*.9*BASE_FONT_PX/w));}measure();window.addEventListener(\"resize\",measure);return()=>window.removeEventListener(\"resize\",measure);},[activeLabel,isMobile]);useEffect(()=>{if(typeof window===\"undefined\")return;// on phone, navigation happens via the tap buttons (ScrollHint) - no\n// swipe-driven transition at all, so skip setting up any of this\nif(isMobile)return;// reset any in-flight progress when the active threshold changes\n// (e.g. rotating a tablet across the breakpoint) so it can't get\n// stuck partway using the wrong scale\ntargetRef.current=0;displayRef.current=0;navigatingRef.current=false;function atBottom(){const doc=document.documentElement;return window.innerHeight+window.scrollY>=doc.scrollHeight-4;}function atTop(){return window.scrollY<=4;}function setTarget(delta){if(navigatingRef.current)return;const next=Math.max(-activeThreshold,Math.min(activeThreshold,targetRef.current+delta));if(next===targetRef.current)return;targetRef.current=next;setDir(next>=0?\"next\":\"prev\");if(next>=activeThreshold&&nextPath){navigatingRef.current=true;window.setTimeout(()=>{window.location.href=nextPath;},550);}else if(next<=-activeThreshold&&prevPath){navigatingRef.current=true;window.setTimeout(()=>{window.location.href=prevPath;},550);}}function tryApply(delta){if(navigatingRef.current)return;if(targetRef.current!==0){setTarget(delta);return;}if(delta>0&&nextPath&&atBottom())setTarget(delta);else if(delta<0&&prevPath&&atTop())setTarget(delta);}function onWheel(e){tryApply(e.deltaY);}let touchY=null;function onTouchStart(e){touchY=e.touches[0].clientY;}function onTouchMove(e){if(touchY==null)return;const y=e.touches[0].clientY;const delta=touchY-y;touchY=y;tryApply(delta);}function onTouchEnd(){touchY=null;}window.addEventListener(\"wheel\",onWheel,{passive:true});window.addEventListener(\"touchstart\",onTouchStart,{passive:true});window.addEventListener(\"touchmove\",onTouchMove,{passive:true});window.addEventListener(\"touchend\",onTouchEnd,{passive:true});// smooth the displayed value toward the raw target every frame so the\n// motion trails gently instead of jumping with each scroll/swipe tick\nfunction tick(){const goal=Math.abs(targetRef.current)/activeThreshold;displayRef.current+=(goal-displayRef.current)*.12;if(Math.abs(goal-displayRef.current)<8e-4)displayRef.current=goal;setDisplay(displayRef.current);rafRef.current=requestAnimationFrame(tick);}rafRef.current=requestAnimationFrame(tick);return()=>{window.removeEventListener(\"wheel\",onWheel);window.removeEventListener(\"touchstart\",onTouchStart);window.removeEventListener(\"touchmove\",onTouchMove);window.removeEventListener(\"touchend\",onTouchEnd);if(rafRef.current!=null)cancelAnimationFrame(rafRef.current);};},[nextPath,prevPath,activeThreshold]);// on phone, ScrollHint's tap buttons handle navigation directly - nothing\n// for this component to render at all\nif(isMobile)return null;const eased=display*display*(3-2*display)// smoothstep\n;const inert=display<=.001;const desiredFontPx=BASE_FONT_PX+eased*(maxFontPx-BASE_FONT_PX)*.86;const fontPx=Math.min(desiredFontPx,maxFontPx);const backdropOpacity=Math.min(1,eased*1.15);const textOpacity=Math.min(1,eased*2.5);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:0},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",inset:0,width:\"100vw\",height:\"100vh\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",pointerEvents:\"none\",zIndex:9999,overflow:\"hidden\",visibility:inert?\"hidden\":\"visible\",background:`rgba(255,255,255,${backdropOpacity})`},children:/*#__PURE__*/_jsx(\"div\",{ref:textRef,style:{fontFamily:\"Space Grotesk, sans-serif\",fontWeight:700,fontSize:`${fontPx}px`,letterSpacing:\"-0.02em\",color:accentColor,textAlign:\"center\",whiteSpace:\"nowrap\",opacity:textOpacity},children:activeLabel})})});}addPropertyControls(ScrollNextPage,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Keep scrolling\"},nextPath:{type:ControlType.String,title:\"Next path\",defaultValue:\"\"},prevLabel:{type:ControlType.String,title:\"Prev label\",defaultValue:\"\"},prevPath:{type:ControlType.String,title:\"Prev path\",defaultValue:\"\"},accentColor:{type:ControlType.Color,title:\"Accent Color\",defaultValue:\"#EC008B\"},threshold:{type:ControlType.Number,title:\"Threshold\",defaultValue:900,min:150,max:2500,step:10},mobileThreshold:{type:ControlType.Number,title:\"Mobile threshold\",defaultValue:420,min:100,max:1500,step:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollNextPage\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollNextPage.map"],"mappings":"6MAA+L,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,SAAO,GAAG,aAAW,GAAG,YAAU,OAAO,cAAY,WAAW,EAAW,CAAC,EAAS,GAAaA,EAAS,EAAK,EAAE,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAG,EAAO,WAAWC,CAAY,EAAQ,MAAW,EAAY,EAAG,OAAO,EAA2F,OAAzF,EAAO,EAAE,EAAG,iBAAiB,EAAG,iBAAiB,SAAS,CAAM,EAAE,EAAG,YAAY,CAAM,MAAY,CAAC,EAAG,oBAAoB,EAAG,oBAAoB,SAAS,CAAM,EAAE,EAAG,eAAe,CAAM,CAAE,CAAE,EAAE,CAAC,CAAC,EAAE,IAAM,EAAM,IAAY,OAAO,IAAI,IAAI,GAAG,EAAU,OAAoB,EA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