{"version":3,"file":"SectionNavigation.BevqVch_.mjs","names":["useRef","useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","te","_e","p","c","init_jsx_runtime","ce","de","addPropertyControls","init_framer_D6uXRwWs","ControlType","SectionNavigation","props","navRef","scrollContainerRef","itemRefs","activeIndex","setActiveIndex","canScrollLeft","setCanScrollLeft","canScrollRight","setCanScrollRight","isScrollingToSection","indicatorStyle","setIndicatorStyle","checkScrollability","scrollLeft","scrollWidth","clientWidth","container","items","handleResize","updateIndicator","activeItem","navRect","itemRect","left","width","observerOptions","scrollOffset","observer","entries","entry","targetId","index","item","containerWidth","itemLeft","itemWidth","scrollTo","scrollBehavior","element","handleItemClick","targetElement","top","isFixedWidth","style","gap","padding","el","activeColor","inactiveColor","activeFont","inactiveFont","indicatorColor","showScrollIndicator","backgroundColor","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,SAAwBgB,EAAkB,EAAM,CAAC,GAAK,CAAC,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,EAAE,kBAAgB,UAAU,gBAAc,UAAU,cAAY,UAAU,eAAa,aAAW,UAAQ,GAAG,MAAI,GAAG,sBAAoB,GAAK,iBAAe,SAAS,iBAAe,UAAU,eAAa,EAAE,SAAOC,EAAYC,EAAOlB,EAAO,IAAI,EAAQmB,EAAmBnB,EAAO,IAAI,EA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