blog-hexo/public/js/9f1cd854.js
2023-10-31 13:15:48 +08:00

1 line
397 B
JavaScript

(()=>{"use strict";document.addEventListener("DOMContentLoaded",(()=>{(()=>{const e=document.querySelector(".magic-cards");e&&(e.onmousemove=e=>{const t=document.getElementsByClassName("card");for(let o=0;o<t.length;o++){const n=t[o],s=n.getBoundingClientRect(),c=e.clientX-s.left,l=e.clientY-s.top;n.style.setProperty("--mouse-x",`${c}px`),n.style.setProperty("--mouse-y",`${l}px`)}})})()}))})();