{"version":3,"file":"SectionNavigation.CyJCK3o-.mjs","names":["useRef","useState","startTransition","useEffect","_jsxs","_jsx","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","te","_e","p","c","init_jsx_runtime","ce","de","addPropertyControls","init_framer_ChujFWHC","ControlType","SectionNavigation","props","items","backgroundColor","inactiveColor","activeColor","inactiveFont","activeFont","padding","gap","showScrollIndicator","scrollBehavior","indicatorColor","scrollOffset","style","navRef","scrollContainerRef","itemRefs","activeIndex","setActiveIndex","canScrollLeft","setCanScrollLeft","canScrollRight","setCanScrollRight","isScrollingToSection","indicatorStyle","setIndicatorStyle","checkScrollability","scrollLeft","scrollWidth","clientWidth","container","handleResize","updateIndicator","activeItem","navRect","itemRect","left","width","observerOptions","observer","entries","entry","targetId","index","item","containerWidth","itemLeft","itemWidth","scrollTo","element","handleItemClick","targetElement","top","isFixedWidth","el","init_SectionNavigation"],"sources":["https:/framerusercontent.com/modules/w8rNanDIoJ1gy8mdQNT5/NBGAoFpCGCkHps7beTCf/SectionNavigation.js"],"sourcesContent":["// 상세페이지 내비게이션 - 좌우 스크롤 가능하며 각 텍스트는 섹션과 연결되어 클릭 시 해당 섹션으로 스크롤\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useRef,useState,useEffect,startTransition}from\"react\";/**\n * 상세페이지 섹션 네비게이션\n *\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 60\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function SectionNavigation(props){const{items=[{label:\"혜택\",targetId:\"section1\"},{label:\"브랜드 위크\",targetId:\"section2\"},{label:\"에센셜아이템\",targetId:\"section3\"},{label:\"포인트아이템\",targetId:\"section4\"}],backgroundColor=\"#FFFFFF\",inactiveColor=\"#666666\",activeColor=\"#000000\",inactiveFont,activeFont,padding=20,gap=40,showScrollIndicator=true,scrollBehavior=\"smooth\",indicatorColor=\"#000000\",scrollOffset=0,style}=props;const navRef=useRef(null);const scrollContainerRef=useRef(null);const itemRefs=useRef([]);const[activeIndex,setActiveIndex]=useState(0);const[canScrollLeft,setCanScrollLeft]=useState(false);const[canScrollRight,setCanScrollRight]=useState(false);const isScrollingToSection=useRef(false);const[indicatorStyle,setIndicatorStyle]=useState({left:0,width:0});const checkScrollability=()=>{if(!scrollContainerRef.current)return;const{scrollLeft,scrollWidth,clientWidth}=scrollContainerRef.current;startTransition(()=>{setCanScrollLeft(scrollLeft>0);setCanScrollRight(scrollLeft<scrollWidth-clientWidth-1);});};useEffect(()=>{checkScrollability();const container=scrollContainerRef.current;if(container){container.addEventListener(\"scroll\",checkScrollability);return()=>container.removeEventListener(\"scroll\",checkScrollability);}},[items]);useEffect(()=>{if(typeof window!==\"undefined\"){const handleResize=()=>checkScrollability();window.addEventListener(\"resize\",handleResize);return()=>window.removeEventListener(\"resize\",handleResize);}},[]);// Update indicator position when active index changes\nuseEffect(()=>{const updateIndicator=()=>{if(!itemRefs.current[activeIndex]||!scrollContainerRef.current||!navRef.current)return;const activeItem=itemRefs.current[activeIndex];const container=scrollContainerRef.current;const nav=navRef.current;const navRect=nav.getBoundingClientRect();const itemRect=activeItem.getBoundingClientRect();const left=itemRect.left-navRect.left;const width=itemRect.width;startTransition(()=>{setIndicatorStyle({left,width});});};updateIndicator();const container=scrollContainerRef.current;if(container){container.addEventListener(\"scroll\",updateIndicator);return()=>container.removeEventListener(\"scroll\",updateIndicator);}},[activeIndex]);// Observe sections\nuseEffect(()=>{if(typeof window===\"undefined\")return;const observerOptions={root:null,rootMargin:`-${scrollOffset+1}px 0px -80% 0px`,threshold:0};const observerCallback=entries=>{if(isScrollingToSection.current)return;entries.forEach(entry=>{if(entry.isIntersecting){const targetId=entry.target.id;const index=items.findIndex(item=>item.targetId===targetId);if(index!==-1){startTransition(()=>setActiveIndex(index));// Center the active item\nif(scrollContainerRef.current&&itemRefs.current[index]){const container=scrollContainerRef.current;const item=itemRefs.current[index];const containerWidth=container.clientWidth;const itemLeft=item.offsetLeft;const itemWidth=item.offsetWidth;const scrollTo=itemLeft-containerWidth/2+itemWidth/2;container.scrollTo({left:scrollTo,behavior:scrollBehavior});}}}});};const observer=new IntersectionObserver(observerCallback,observerOptions);items.forEach(item=>{const element=document.getElementById(item.targetId);if(element){observer.observe(element);}});return()=>{observer.disconnect();};},[items,scrollBehavior,scrollOffset]);const handleItemClick=(index,targetId)=>{isScrollingToSection.current=true;startTransition(()=>setActiveIndex(index));// Center the clicked item\nif(scrollContainerRef.current&&itemRefs.current[index]){const container=scrollContainerRef.current;const item=itemRefs.current[index];const containerWidth=container.clientWidth;const itemLeft=item.offsetLeft;const itemWidth=item.offsetWidth;const scrollTo=itemLeft-containerWidth/2+itemWidth/2;container.scrollTo({left:scrollTo,behavior:scrollBehavior});}if(typeof window!==\"undefined\"){const targetElement=document.getElementById(targetId);if(targetElement){const top=targetElement.getBoundingClientRect().top+window.pageYOffset-scrollOffset;window.scrollTo({top,behavior:scrollBehavior});setTimeout(()=>{isScrollingToSection.current=false;},1e3);}}};const isFixedWidth=style?.width===\"100%\";return /*#__PURE__*/_jsxs(\"div\",{ref:navRef,style:{...style,position:\"relative\",backgroundColor,overflow:\"hidden\",display:\"flex\",alignItems:\"center\",...isFixedWidth?{}:{minWidth:\"max-content\"}},children:[/*#__PURE__*/_jsxs(\"div\",{ref:scrollContainerRef,style:{display:\"flex\",gap:`${gap}px`,overflowX:\"auto\",overflowY:\"hidden\",scrollbarWidth:\"none\",msOverflowStyle:\"none\",WebkitOverflowScrolling:\"touch\",padding:`${padding}px`,paddingBottom:`${padding}px`,width:\"100%\"},onScroll:checkScrollability,children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                        div::-webkit-scrollbar {\n                            display: none;\n                        }\n                    `}),items.map((item,index)=>/*#__PURE__*/_jsx(\"button\",{ref:el=>{itemRefs.current[index]=el;},onClick:()=>handleItemClick(index,item.targetId),style:{background:\"none\",border:\"none\",cursor:\"pointer\",padding:0,whiteSpace:\"nowrap\",color:activeIndex===index?activeColor:inactiveColor,transition:\"color 0.2s ease\",position:\"relative\",...activeIndex===index?activeFont:inactiveFont},onMouseEnter:e=>{if(activeIndex!==index){e.currentTarget.style.color=activeColor;}},onMouseLeave:e=>{if(activeIndex!==index){e.currentTarget.style.color=inactiveColor;}},children:item.label},index))]}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:0,left:indicatorStyle.left,width:indicatorStyle.width,height:\"2px\",backgroundColor:indicatorColor,transition:\"left 0.6s cubic-bezier(0.16, 1, 0.3, 1), width 0.6s cubic-bezier(0.16, 1, 0.3, 1)\",pointerEvents:\"none\"}}),showScrollIndicator&&canScrollRight&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",right:0,top:0,bottom:0,width:\"60px\",background:`linear-gradient(to right, transparent, ${backgroundColor})`,pointerEvents:\"none\"}})]});}addPropertyControls(SectionNavigation,{items:{type:ControlType.Array,title:\"Navigation Items\",control:{type:ControlType.Object,controls:{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Section\"},targetId:{type:ControlType.String,title:\"Target Section ID\",defaultValue:\"section1\",description:\"섹션의 ID (예: section1)\"}}},defaultValue:[{label:\"혜택\",targetId:\"section1\"},{label:\"브랜드 위크\",targetId:\"section2\"},{label:\"에센셜아이템\",targetId:\"section3\"},{label:\"포인트아이템\",targetId:\"section4\"}]},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},inactiveColor:{type:ControlType.Color,title:\"Inactive Color\",defaultValue:\"#666666\"},activeColor:{type:ControlType.Color,title:\"Active Color\",defaultValue:\"#000000\"},indicatorColor:{type:ControlType.Color,title:\"Indicator Color\",defaultValue:\"#000000\"},inactiveFont:{type:ControlType.Font,title:\"Inactive Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Medium\",letterSpacing:\"-0.02em\",lineHeight:\"1em\"}},activeFont:{type:ControlType.Font,title:\"Active Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1em\"}},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:20,min:0,max:60,step:4,unit:\"px\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:40,min:10,max:100,step:5,unit:\"px\"},showScrollIndicator:{type:ControlType.Boolean,title:\"Scroll Indicator\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},scrollBehavior:{type:ControlType.Enum,title:\"Scroll Behavior\",options:[\"smooth\",\"auto\"],optionTitles:[\"Smooth\",\"Instant\"],defaultValue:\"smooth\",displaySegmentedControl:true},scrollOffset:{type:ControlType.Number,title:\"Scroll Offset\",defaultValue:0,min:0,max:300,step:4,unit:\"px\",description:\"상단 고정 헤더 높이만큼 설정 (예: 80px)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SectionNavigation\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"800\",\"framerIntrinsicHeight\":\"60\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SectionNavigation.map"],"mappings":"A,oNASG,SAAwBoB,EAAkBC,EAAM,CAAC,GAAK,CAACC,QAAM,CAAC,CAAC,MAAM,KAAK,SAAS,UAAU,EAAE,CAAC,MAAM,SAAS,SAAS,UAAU,EAAE,CAAC,MAAM,SAAS,SAAS,UAAU,EAAE,CAAC,MAAM,SAAS,SAAS,UAAU,CAAC,EAAEC,kBAAgB,UAAUC,gBAAc,UAAUC,cAAY,UAAUC,eAAaC,aAAWC,UAAQ,GAAGC,MAAI,GAAGC,sBAAoB,GAAKC,iBAAe,SAASC,iBAAe,UAAUC,eAAa,EAAEC,SAAOb,EAAYc,EAAOnC,EAA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