{"version":3,"file":"Button_Sound.DkSPdaYN.mjs","names":["__esmMin","init_ssg_sandbox_shims","window","init_jsx_runtime","J","c","init_npm_react_18_3_1","motion","init_framer_motion_DhsWWWsN","init_framer_BpuvUAiZ","ControlType","addPropertyControls","Button_Sound","tint","withClickSound","playSound","ctx","oscillator","gain","Component","props","event","init_Button_Sound"],"sources":["https:/framerusercontent.com/modules/gm6IIwnzmUMijm6TgoNB/CLvYJ00mdgObgkcrvI1s/Button_Sound.js"],"sourcesContent":["// Get Started: https://www.framer.com/developers\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Button_Sound({tint}){return /*#__PURE__*/_jsx(motion.div,{style:{margin:50,width:100,height:100,borderRadius:5,backgroundColor:tint},animate:{scale:1.5},whileHover:{rotate:90}});}addPropertyControls(Button_Sound,{tint:{title:\"Tint\",type:ControlType.Color,defaultValue:\"rgba(150,150,150,0.15)\"}});import{forwardRef}from\"react\";export function withClickSound(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const playSound=()=>{const AudioContext=window.AudioContext||window.webkitAudioContext;const ctx=new AudioContext;const oscillator=ctx.createOscillator();const gain=ctx.createGain();oscillator.type=\"sine\";oscillator.frequency.setValueAtTime(650,ctx.currentTime);oscillator.frequency.exponentialRampToValueAtTime(950,ctx.currentTime+.12);gain.gain.setValueAtTime(.04,ctx.currentTime);gain.gain.exponentialRampToValueAtTime(.001,ctx.currentTime+.15);oscillator.connect(gain);gain.connect(ctx.destination);oscillator.start();oscillator.stop(ctx.currentTime+.15);oscillator.onended=()=>{void ctx.close();};};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:event=>{playSound();props.onClick?.(event);}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withClickSound\":{\"type\":\"reactHoc\",\"name\":\"withClickSound\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"Button_Sound\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Button_Sound.map"],"mappings":"A,yOAIG,SAAwBY,EAAa,CAAC,QAAM,CAAC,MAAoB,gBAAKL,EAAO,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,MAAM,IAAI,OAAO,IAAI,aAAa,EAAE,gBAAgBM,CAAI,EAAE,QAAQ,CAAC,MAAM,GAAG,EAAE,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,CAAE,CAAoJ,SAAgBC,EAAe,EAAU,CAAC,MAAoB,iBAAY,EAAM,IAAM,CAAC,IAAMC,MAAc,CAAmE,IAAMC,EAAI,IAAzDd,EAAO,cAAcA,EAAO,oBAAoDe,EAAWD,EAAI,iBAAiB,EAAQE,EAAKF,EAAI,WAAW,EAAE,EAAW,KAAK,OAAOC,EAAW,UAAU,eAAe,IAAID,EAAI,WAAW,EAAEC,EAAW,UAAU,6BAA6B,IAAID,EAAI,YAAY,GAAG,EAAEE,EAAK,KAAK,eAAe,IAAIF,EAAI,WAAW,EAAEE,EAAK,KAAK,6BAA6B,KAAKF,EAAI,YAAY,GAAG,EAAEC,EAAW,QAAQC,CAAI,EAAEA,EAAK,QAAQF,EAAI,WAAW,EAAEC,EAAW,MAAM,EAAEA,EAAW,KAAKD,EAAI,YAAY,GAAG,EAAE,EAAW,YAAY,CAACA,EAAS,MAAM,CAAE,CAAE,EAAE,MAAoB,gBAAKG,EAAU,CAAK,MAAI,GAAGC,EAAM,QAAQ,GAAO,CAACL,EAAU,EAAEK,EAAM,UAAUC,CAAK,CAAE,CAAC,CAAC,CAAE,CAAC,CAAE,C,kDAAr7BV,EAAoBC,EAAa,CAAC,KAAK,CAAC,MAAM,OAAO,KAAKF,EAAY,MAAM,aAAa,wBAAwB,CAAC,CAAC,C"}