{"version":3,"file":"sectionTransition01.D5maX_R6.mjs","names":["React.useRef","p"],"sources":["https:/framerusercontent.com/modules/oZ6PVOzlJTBUbxXw3mNV/0il8i15jfLTuFe1xQZ9y/sectionTransition01.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{motion,useScroll,useTransform,useSpring,useVelocity,useReducedMotion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 1200\n * @framerIntrinsicHeight 150\n *//**\n * SCROLL MORPH SECTION\n * --------------------\n * An interactive section edge that morphs between curved and straight states\n * based on scroll position and velocity, simulating physical elasticity.\n * @framerDisableUnlink\n */export default function ScrollMorphSection(props){const{topEdgeEnabled,topEdgeType,bottomEdgeEnabled,bottomEdgeType,intensity,color,stiffness,damping,mass,velocityInfluence}=props;const containerRef=React.useRef(null);const shouldReduceMotion=useReducedMotion();// 1. Scroll Tracking\nconst{scrollYProgress}=useScroll({target:containerRef,offset:[\"start end\",\"end start\"]});// 2. Velocity Tracking for Physics\n// We track how fast the user is scrolling to influence the 'bulge'\nconst scrollVelocity=useVelocity(scrollYProgress);const smoothVelocity=useSpring(scrollVelocity,{stiffness:100,damping:30});// 3. Smooth Progress for Animation\nconst smoothProgress=useSpring(scrollYProgress,{stiffness:shouldReduceMotion?1e3:stiffness,damping:shouldReduceMotion?100:damping,mass:mass});// 4. Transform Logic\n// Combined bulge value: Base intensity + Velocity influence\n// We use useTransform to blend these values dynamically\n// velocityInfluence is in percentage (0-100), convert to multiplier (0-1)\nconst velocityMultiplier=velocityInfluence/100;const dynamicBulge=useTransform(smoothVelocity,[-1,0,1],[intensity*(1+velocityMultiplier),intensity,intensity*(1+velocityMultiplier)]);// Path calculation function to keep code clean\nconst getPath=(prog,currentBulge,isTop,morphType)=>{// Base coordinates for 100x100 ViewBox\nconst baseLine=isTop?0:100;const fillTo=isTop?100:0;// Intensity scaling based on scroll progress and morphType\nlet multiplier=0;switch(morphType){case\"straight-to-curve\":// Starts straight (0), becomes curved (1)\nmultiplier=prog;break;case\"curve-to-straight\":// Starts curved (1), becomes straight (0)\nmultiplier=1-prog;break;default:multiplier=prog;break;}const currentIntensity=currentBulge*multiplier;// Control point calculation\n// Q 50 {baseLine - intensity}\nconst cpY=isTop?baseLine-currentIntensity:baseLine+currentIntensity;return`M 0 ${fillTo} V ${baseLine} Q 50 ${cpY} 100 ${baseLine} V ${fillTo} Z`;};// Generate path for top edge (always calculate, render conditionally)\nconst topD=useTransform([smoothProgress,dynamicBulge],([p,b])=>getPath(p,b,true,topEdgeType));// Generate path for bottom edge (always calculate, render conditionally)\nconst bottomD=useTransform([smoothProgress,dynamicBulge],([p,b])=>getPath(p,b,false,bottomEdgeType));return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"visible\",zIndex:1,pointerEvents:\"none\"},children:/*#__PURE__*/_jsxs(\"svg\",{viewBox:\"0 0 100 100\",preserveAspectRatio:\"none\",style:{width:\"100%\",height:\"100%\",display:\"block\",overflow:\"visible\"},children:[topEdgeEnabled&&/*#__PURE__*/_jsx(motion.path,{d:topD,fill:color}),bottomEdgeEnabled&&/*#__PURE__*/_jsx(motion.path,{d:bottomD,fill:color})]})});}/**\n * PROPERTY CONTROLS\n */ScrollMorphSection.defaultProps={topEdgeEnabled:false,topEdgeType:\"straight-to-curve\",bottomEdgeEnabled:false,bottomEdgeType:\"curve-to-straight\",intensity:50,color:\"#000000\",stiffness:180,damping:50,mass:1.2,velocityInfluence:100};addPropertyControls(ScrollMorphSection,{color:{type:ControlType.Color,title:\"Fill Color\"},intensity:{type:ControlType.Number,title:\"Curve Depth\",min:1,max:50,step:1,unit:\"px\",defaultValue:50},topEdgeEnabled:{type:ControlType.Boolean,title:\"Top Edge\",defaultValue:true,enabledTitle:\"Enabled\",disabledTitle:\"Disabled\"},topEdgeType:{type:ControlType.Enum,title:\"Top Edge Type\",options:[\"straight-to-curve\",\"curve-to-straight\"],optionTitles:[\"Straight to Curve\",\"Curve to Straight\"],hidden:props=>!props.topEdgeEnabled},bottomEdgeEnabled:{type:ControlType.Boolean,title:\"Bottom Edge\",defaultValue:true,enabledTitle:\"Enabled\",disabledTitle:\"Disabled\"},bottomEdgeType:{type:ControlType.Enum,title:\"Bottom Edge Type\",options:[\"straight-to-curve\",\"curve-to-straight\"],optionTitles:[\"Straight to Curve\",\"Curve to Straight\"],defaultValue:\"curve-to-straight\",hidden:props=>!props.bottomEdgeEnabled},velocityInfluence:{type:ControlType.Number,title:\"Velocity Effect\",min:0,max:100,step:1,unit:\"%\",defaultValue:100,description:\"Scroll speed effect on curve. 0% = off, 100% = max.\"},stiffness:{type:ControlType.Number,title:\"Stiffness\",min:50,max:300,step:10,group:\"Physics\",defaultValue:180,description:\"Animation responsiveness. Higher = snappier.\"},damping:{type:ControlType.Number,title:\"Damping\",min:10,max:50,step:1,group:\"Physics\",defaultValue:50,description:\"Motion smoothness. Higher = less oscillation.\"},mass:{type:ControlType.Number,title:\"Mass\",min:.5,max:2,step:.1,group:\"Physics\",defaultValue:1.2,description:\"Animation weight. Higher = slower, heavier. Explore more components at [THE DESIGN FUTURIST](https://thedesignfuturist.zip)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollMorphSection\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicHeight\":\"150\",\"framerIntrinsicWidth\":\"1200\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./sectionTransition01.map"],"mappings":"qQAWG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,iBAAe,cAAY,oBAAkB,iBAAe,YAAU,QAAM,YAAU,UAAQ,OAAK,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