{"version":3,"file":"Scroll.FF_iHCkk.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/6Sa9itD2nPhK6us2z8vu/fNIRIa07ui8ZPUM6miMe/Scroll.js"],"sourcesContent":["/* Original Code *//* import type { ComponentType } from \"react\"\nimport { useState, useEffect, useRef } from \"react\"\n\nexport function withVerticalProgress(Component): ComponentType {\n    return (props) => {\n        const [progress, setProgress] = useState(0)\n        const [isScrolling, setIsScrolling] = useState(false)\n        const prevScrollY = useRef(0)\n\n        useEffect(() => {\n            const calculateProgress = () => {\n                const startEl = document.getElementById(\"start\")\n                const endEl = document.getElementById(\"end\")\n                if (startEl && endEl) {\n                    const sectionHeight = endEl.offsetTop - startEl.offsetTop\n                    const scrollDistance =\n                        window.pageYOffset || document.documentElement.scrollTop\n                    const sectionScrollDistance =\n                        scrollDistance - startEl.offsetTop\n                    const sectionProgress =\n                        (sectionScrollDistance / sectionHeight) * 100\n                    setProgress(sectionProgress)\n                }\n            }\n\n            const handleScroll = () => {\n                const scrollY =\n                    window.pageYOffset || document.documentElement.scrollTop\n                if (scrollY !== prevScrollY.current) {\n                    prevScrollY.current = scrollY\n                    calculateProgress()\n                    setIsScrolling(true)\n                }\n            }\n\n            const handleScrollEnd = () => {\n                setIsScrolling(false)\n            }\n\n            calculateProgress()\n\n            window.addEventListener(\"scroll\", handleScroll)\n            window.addEventListener(\"scrollend\", handleScrollEnd)\n\n            return () => {\n                window.removeEventListener(\"scroll\", handleScroll)\n                window.removeEventListener(\"scrollend\", handleScrollEnd)\n            }\n        }, [])\n\n        return (\n            <Component\n                {...props}\n                style={{\n                    height: `${progress}%`,\n                    transition: isScrolling\n                        ? \"none\"\n                        : \"height 0.5s ease-in-out\",\n                }}\n            />\n        )\n    }\n}\n*//* Modified by Yaya *//*import type { ComponentType } from \"react\"\nimport { useState, useEffect, useRef } from \"react\"\n\nexport function withVerticalProgress(Component): ComponentType {\n    return (props) => {\n        const [progress, setProgress] = useState(0)\n        const [isScrolling, setIsScrolling] = useState(false)\n        const prevScrollY = useRef(0)\n\n        useEffect(() => {\n            const calculateProgress = () => {\n                const startEl = document.getElementById(\"start\")\n                const endEl = document.getElementById(\"end\")\n                if (startEl && endEl) {\n                    const sectionHeight = endEl.offsetTop - startEl.offsetTop\n                    const scrollDistance =\n                        window.pageYOffset || document.documentElement.scrollTop\n                    const viewportHeight = window.innerHeight\n                    const bottomOfViewport = scrollDistance + viewportHeight\n\n                    let sectionScrollDistance =\n                        bottomOfViewport - startEl.offsetTop\n\n                    // Ensure sectionScrollDistance does not exceed sectionHeight\n                    sectionScrollDistance = Math.min(\n                        sectionScrollDistance,\n                        sectionHeight\n                    )\n\n                    const sectionProgress =\n                        (sectionScrollDistance / sectionHeight) * 100\n                    setProgress(sectionProgress)\n                }\n            }\n\n            const handleScroll = () => {\n                const scrollY =\n                    window.pageYOffset || document.documentElement.scrollTop\n                if (scrollY !== prevScrollY.current) {\n                    prevScrollY.current = scrollY\n                    calculateProgress()\n                    setIsScrolling(true)\n                }\n            }\n\n            const handleScrollEnd = () => {\n                setIsScrolling(false)\n            }\n\n            window.addEventListener(\"scroll\", handleScroll)\n            window.addEventListener(\"scrollend\", handleScrollEnd)\n\n            return () => {\n                window.removeEventListener(\"scroll\", handleScroll)\n                window.removeEventListener(\"scrollend\", handleScrollEnd)\n            }\n        }, [])\n\n        useEffect(() => {\n            const cruiseIcon = document.getElementById(\"cruise-icon\")\n            if (cruiseIcon) {\n                cruiseIcon.style.transform = `translate(0px, ${-1 * progress}%)`\n            }\n        }, [progress])\n\n        return (\n            <Component\n                {...props}\n                style={{\n                    height: `${progress}%`,\n                    transition: isScrolling\n                        ? \"none\"\n                        : \"height 0.5s ease-in-out\",\n                }}\n            />\n        )\n    }\n}*//* With Rotation */import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";export function withVerticalProgress(Component){return props=>{const[progress,setProgress]=useState(0);const[isScrolling,setIsScrolling]=useState(false);const[isScrollingUp,setIsScrollingUp]=useState(false);const prevScrollY=useRef(0);useEffect(()=>{const calculateProgress=()=>{const startEl=document.getElementById(\"start\");const endEl=document.getElementById(\"end\");if(startEl&&endEl){const sectionHeight=endEl.offsetTop-startEl.offsetTop;const scrollDistance=window.pageYOffset||document.documentElement.scrollTop;const viewportHeight=window.innerHeight;const bottomOfViewport=scrollDistance+viewportHeight;let sectionScrollDistance=bottomOfViewport-startEl.offsetTop;// Ensure sectionScrollDistance does not exceed sectionHeight\nsectionScrollDistance=Math.min(sectionScrollDistance,sectionHeight);const sectionProgress=sectionScrollDistance/sectionHeight*100;setProgress(sectionProgress);}};const handleScroll=()=>{const scrollY=window.pageYOffset||document.documentElement.scrollTop;if(scrollY!==prevScrollY.current){setIsScrollingUp(scrollY<prevScrollY.current);prevScrollY.current=scrollY;calculateProgress();setIsScrolling(true);}};const handleScrollEnd=()=>{setIsScrolling(false);};window.addEventListener(\"scroll\",handleScroll);window.addEventListener(\"scrollend\",handleScrollEnd);return()=>{window.removeEventListener(\"scroll\",handleScroll);window.removeEventListener(\"scrollend\",handleScrollEnd);};},[]);useEffect(()=>{const cruiseIcon=document.getElementById(\"cruise-icon\");if(cruiseIcon){cruiseIcon.style.transform=`translate(0px, ${-1*progress}%) rotate(${isScrollingUp?180:0}deg)`;}},[progress,isScrollingUp]);return /*#__PURE__*/_jsx(Component,{...props,style:{height:`${progress}%`,transition:isScrolling?\"none\":\"height 0.5s ease-in-out\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withVerticalProgress\":{\"type\":\"reactHoc\",\"name\":\"withVerticalProgress\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Scroll.map"],"mappings":"mNA4I8G,SAAgB,EAAqB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAS,EAAE,CAAM,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAM,CAAC,EAAc,GAAkBA,EAAS,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