blog-hexo/themes/hexo-theme-cosy/source/js/9f1cd854.js

1 line
397 B
JavaScript
Raw Normal View History

2023-10-31 13:15:48 +08:00
(()=>{"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`)}})})()}))})();