{"version":3,"file":"FloatingNotes.DdkDc45f.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/Mkn2VkBcVsxYUbd9wccY/a0oxRXGAQZh1fLYQ2lfN/FloatingNotes.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export default function FloatingNotes(){const containerRef=useRef(null);const mousePos=useRef({x:window.innerWidth/2,y:window.innerHeight/2});const smoothMouse=useRef({x:window.innerWidth/2,y:window.innerHeight/2});const raf=useRef(null);const notes=[\"♪\",\"♫\",\"♬\"];useEffect(()=>{const container=containerRef.current;// 平滑鼠标位置跟随\nconst smoothFollow=()=>{smoothMouse.current.x+=(mousePos.current.x-smoothMouse.current.x)*.1;smoothMouse.current.y+=(mousePos.current.y-smoothMouse.current.y)*.1;raf.current=requestAnimationFrame(smoothFollow);};raf.current=requestAnimationFrame(smoothFollow);// 创建音符\nconst createNote=(x,y)=>{const note=document.createElement(\"div\");note.innerText=notes[Math.floor(Math.random()*notes.length)];note.style.position=\"fixed\";note.style.left=`${x}px`;note.style.top=`${y-20}px`// 鼠标上方\n;note.style.pointerEvents=\"none\";note.style.color=\"#2d4970\";note.style.fontSize=`${22+Math.random()*10}px`;// 初始不透明度低一点且随机\nnote.style.opacity=(.3+Math.random()*.4).toString();// 初始 scale 小一点\nconst initialScale=.6+Math.random()*.4;note.style.transform=`scale(${initialScale}) rotate(${Math.random()*30-15}deg)`;note.style.transition=\"transform 3.5s ease-out, opacity 3.5s ease-out\";container.appendChild(note);// 随机偏移方向，更自然漂浮\nconst xOffset=(Math.random()-.5)*100// 左右漂动\n;const yOffset=-60-Math.random()*60// 总体向上漂浮\n;const finalScale=1+Math.random()*.3// 最终缩放\n;// 开始动画（小到大 + 漂浮 + 旋转 + 透明度消失）\nsetTimeout(()=>{note.style.transform=`translate(${xOffset}px, ${yOffset}px) scale(${finalScale}) rotate(${Math.random()*30-15}deg)`;note.style.opacity=\"0\";},50);// 删除元素\nsetTimeout(()=>{note.remove();},3500);};// 鼠标移动时生成音符\nlet lastMoveTime=Date.now();const handleMove=e=>{mousePos.current.x=e.clientX;mousePos.current.y=e.clientY;const now=Date.now();if(now-lastMoveTime>150){createNote(smoothMouse.current.x,smoothMouse.current.y);lastMoveTime=now;}};window.addEventListener(\"mousemove\",handleMove);// 即使不动鼠标，也会缓慢生成音符\nconst idleInterval=setInterval(()=>{createNote(smoothMouse.current.x,smoothMouse.current.y);},600);return()=>{window.removeEventListener(\"mousemove\",handleMove);cancelAnimationFrame(raf.current);clearInterval(idleInterval);};},[]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"fixed\",inset:0,pointerEvents:\"none\",zIndex:9999}});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FloatingNotes\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FloatingNotes.map"],"mappings":"uIAA+E,SAAwB,GAAe,CAAC,IAAM,EAAaA,EAAO,KAAK,CAAO,EAASA,EAAO,CAAC,EAAE,EAAO,WAAW,EAAE,EAAE,EAAO,YAAY,EAAE,CAAC,CAAO,EAAYA,EAAO,CAAC,EAAE,EAAO,WAAW,EAAE,EAAE,EAAO,YAAY,EAAE,CAAC,CAAO,EAAIA,EAAO,KAAK,CAAO,EAAM,CAAC,IAAI,IAAI,IAAI,CAa/G,OAbgH,MAAc,CAAC,IAAM,EAAU,EAAa,QAC7X,MAAiB,CAAC,EAAY,QAAQ,IAAI,EAAS,QAAQ,EAAE,EAAY,QAAQ,GAAG,GAAG,EAAY,QAAQ,IAAI,EAAS,QAAQ,EAAE,EAAY,QAAQ,GAAG,GAAG,EAAI,QAAQ,sBAAsB,EAAa,EAAG,EAAI,QAAQ,sBAAsB,EAAa,CACnQ,IAAM,GAAY,EAAE,IAAI,CAAC,IAAM,EAAK,SAAS,cAAc,MAAM,CAAC,EAAK,UAAU,EAAM,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