{"version":3,"file":"Loop.BW6ONtx4.mjs","names":["React.useRef","gsap","useRef","__legacyOverrideHOC_DataObserverContext","_jsx","ScrollTrigger"],"sources":["https:/framerusercontent.com/modules/2TJUwYuzwxvDgp6Fqtej/tI3vEpOtCaK3Fh4mVX6H/Loop.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import gsap from\"gsap\";import{ScrollTrigger}from\"gsap/ScrollTrigger\";gsap.registerPlugin(ScrollTrigger);/* =========================\n1. ROTATE 360 LOOP\n========================= */export function RotateLoop(){const ref=React.useRef(null);const tweenRef=React.useRef(null);React.useLayoutEffect(()=>{if(!ref.current)return;const ctx=gsap.context(()=>{// tạo tween 1 lần duy nhất\ntweenRef.current=gsap.to(ref.current,{rotation:360,duration:3,ease:\"none\",repeat:-1,delay:.5,paused:true});ScrollTrigger.create({trigger:ref.current,start:\"top bottom\",onEnter:()=>tweenRef.current?.resume(),onLeave:()=>tweenRef.current?.pause(),onEnterBack:()=>tweenRef.current?.resume(),onLeaveBack:()=>tweenRef.current?.pause()});},ref);return()=>ctx.revert();},[]);return{ref};}/* =========================\n2. ROTATE -360 LOOP\n========================= */export function RotateReverseLoop(){const ref=React.useRef(null);const tweenRef=React.useRef(null);React.useLayoutEffect(()=>{if(!ref.current)return;const ctx=gsap.context(()=>{tweenRef.current=gsap.to(ref.current,{rotation:-360,duration:3,ease:\"none\",repeat:-1,delay:.5,paused:true});ScrollTrigger.create({trigger:ref.current,start:\"top bottom\",onEnter:()=>tweenRef.current?.resume(),onLeave:()=>tweenRef.current?.pause(),onEnterBack:()=>tweenRef.current?.resume(),onLeaveBack:()=>tweenRef.current?.pause()});},ref);return()=>ctx.revert();},[]);return{ref};}/* =========================\n3. SCALE LOOP BASE\n========================= */function createScaleLoop(delay=0){const ref=React.useRef(null);const tweenRef=React.useRef(null);React.useLayoutEffect(()=>{if(!ref.current)return;const ctx=gsap.context(()=>{gsap.set(ref.current,{scale:0});tweenRef.current=gsap.to(ref.current,{scale:1,duration:1,delay,ease:\"power2.inOut\",repeat:-1,yoyo:true,paused:true});ScrollTrigger.create({trigger:ref.current,start:\"top bottom\",onEnter:()=>tweenRef.current?.resume(),onLeave:()=>tweenRef.current?.pause(),onEnterBack:()=>tweenRef.current?.resume(),onLeaveBack:()=>tweenRef.current?.pause()});},ref);return()=>ctx.revert();},[delay]);return{ref};}/* =========================\n4 VARIANTS\n========================= */export function ScaleLoop0(){return createScaleLoop(0);}export function ScaleLoop1(){return createScaleLoop(.1);}export function ScaleLoop2(){return createScaleLoop(.2);}export function ScaleLoop3(){return createScaleLoop(.3);}//CTA\nexport function IllusCTA(){const ref=React.useRef(null);const tweenRef=React.useRef(null);React.useLayoutEffect(()=>{if(!ref.current)return;const ctx=gsap.context(()=>{const tl=gsap.timeline({repeat:-1,paused:true});tl.to(ref.current,{rotation:-15,duration:.2,ease:\"power2.out\"}).to(ref.current,{rotation:360,duration:.7,ease:\"power2.in\"}).to(ref.current,{rotation:367,duration:.2,ease:\"power2.out\"}).to(ref.current,{rotation:360,duration:.2,ease:\"power2.out\"}).set(ref.current,{rotation:0}).to({},{duration:4});tweenRef.current=tl;ScrollTrigger.create({trigger:ref.current,start:\"top bottom\",onEnter:()=>tweenRef.current?.resume(),onLeave:()=>tweenRef.current?.pause(),onEnterBack:()=>tweenRef.current?.resume(),onLeaveBack:()=>tweenRef.current?.pause()});},ref);return()=>ctx.revert();},[]);return{ref};}// Eye\nimport{useRef}from\"react\";import{useEffect}from\"react\";import{useMotionValue,useSpring,animate,useInView}from\"framer-motion\";export function withMouseEye(Component){return props=>{const ref=useRef(null);const isInView=useInView(ref);const x=useMotionValue(0);const y=useMotionValue(0);const scaleY=useMotionValue(1);const sx=useSpring(x,{damping:40,stiffness:300});const sy=useSpring(y,{damping:40,stiffness:300});const sScaleY=useSpring(scaleY,{damping:20,stiffness:300});// detect touch device (mobile / tablet)\nconst isTouchDevice=typeof window!==\"undefined\"&&window.matchMedia(\"(pointer: coarse)\").matches;// mouse follow (DESKTOP ONLY)\nuseEffect(()=>{if(isTouchDevice)return;const move=e=>{if(!ref.current||!isInView)return;const r=ref.current.getBoundingClientRect();x.set((e.clientX-(r.left+r.width/2))*.04);y.set((e.clientY-(r.top+r.height/2))*.04);};document.addEventListener(\"mousemove\",move);return()=>document.removeEventListener(\"mousemove\",move);},[isInView,isTouchDevice]);// eye blink loop (ALL DEVICES)\nuseEffect(()=>{const blink=animate(scaleY,[1,.15,1],{duration:.3,repeat:Infinity,repeatDelay:2+Math.random()*2,ease:\"easeInOut\"});return()=>blink.stop();},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,style:{x:isTouchDevice?0:sx,y:isTouchDevice?0:sy,scaleY:sScaleY,transformOrigin:\"center\"}});};}export function withMailto(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,onClick:()=>window.open(\"mailto:noblenoir@icloud.com\")});};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withRotateLoop(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...RotateLoop(props)});};}withRotateLoop.displayName=\"RotateLoop\";export function withRotateReverseLoop(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...RotateReverseLoop(props)});};}withRotateReverseLoop.displayName=\"RotateReverseLoop\";export function withcreateScaleLoop(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...createScaleLoop(props)});};}withcreateScaleLoop.displayName=\"createScaleLoop\";export function withScaleLoop0(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ScaleLoop0(props)});};}withScaleLoop0.displayName=\"ScaleLoop0\";export function withScaleLoop1(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ScaleLoop1(props)});};}withScaleLoop1.displayName=\"ScaleLoop1\";export function withScaleLoop2(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ScaleLoop2(props)});};}withScaleLoop2.displayName=\"ScaleLoop2\";export function withScaleLoop3(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ScaleLoop3(props)});};}withScaleLoop3.displayName=\"ScaleLoop3\";export function withIllusCTA(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...IllusCTA(props)});};}withIllusCTA.displayName=\"IllusCTA\";\nexport const __FramerMetadata__ = {\"exports\":{\"withIllusCTA\":{\"type\":\"reactHoc\",\"name\":\"withIllusCTA\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScaleLoop3\":{\"type\":\"reactHoc\",\"name\":\"withScaleLoop3\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"RotateReverseLoop\":{\"type\":\"override\",\"name\":\"RotateReverseLoop\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScaleLoop0\":{\"type\":\"reactHoc\",\"name\":\"withScaleLoop0\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMouseEye\":{\"type\":\"reactHoc\",\"name\":\"withMouseEye\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScaleLoop1\":{\"type\":\"reactHoc\",\"name\":\"withScaleLoop1\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotateLoop\":{\"type\":\"reactHoc\",\"name\":\"withRotateLoop\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScaleLoop2\":{\"type\":\"reactHoc\",\"name\":\"withScaleLoop2\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"IllusCTA\":{\"type\":\"override\",\"name\":\"IllusCTA\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ScaleLoop1\":{\"type\":\"override\",\"name\":\"ScaleLoop1\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotateReverseLoop\":{\"type\":\"reactHoc\",\"name\":\"withRotateReverseLoop\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ScaleLoop0\":{\"type\":\"override\",\"name\":\"ScaleLoop0\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withcreateScaleLoop\":{\"type\":\"reactHoc\",\"name\":\"withcreateScaleLoop\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ScaleLoop2\":{\"type\":\"override\",\"name\":\"ScaleLoop2\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ScaleLoop3\":{\"type\":\"override\",\"name\":\"ScaleLoop3\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"RotateLoop\":{\"type\":\"override\",\"name\":\"RotateLoop\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMailto\":{\"type\":\"reactHoc\",\"name\":\"withMailto\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Loop.map"],"mappings":"+WAE4B,SAAgB,GAAY,CAAC,IAAM,EAAIA,EAAa,KAAK,CAAO,EAASA,EAAa,KAAK,CACyP,OADxP,MAA0B,CAAC,GAAG,CAAC,EAAI,QAAQ,OAAO,IAAM,EAAIC,EAAK,YAAY,CACrM,EAAS,QAAQA,EAAK,GAAG,EAAI,QAAQ,CAAC,SAAS,IAAI,SAAS,EAAE,KAAK,OAAO,OAAO,GAAG,MAAM,GAAG,OAAO,GAAK,CAAC,CAAC,EAAc,OAAO,CAAC,QAAQ,EAAI,QAAQ,MAAM,aAAa,YAAY,EAAS,SAAS,QAAQ,CAAC,YAAY,EAAS,SAAS,OAAO,CAAC,gBAAgB,EAAS,SAAS,QAAQ,CAAC,gBAAgB,EAAS,SAAS,OAAO,CAAC,CAAC,EAAG,EAAI,CAAC,UAAU,EAAI,QAAQ,EAAG,EAAE,CAAC,CAAO,CAAC,MAAI,CAE/V,SAAgB,GAAmB,CA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