document.addEventListener('DOMContentLoaded',()=>{
  document.querySelectorAll('button,.btn,input[type=submit],input[type=button],a.btn')
    .forEach(btn=>{
      btn.addEventListener('click',e=>{
        const rect=btn.getBoundingClientRect();
        btn.style.setProperty('--x',(e.clientX-rect.left)+'px');
        btn.style.setProperty('--y',(e.clientY-rect.top)+'px');
        btn.classList.add('ripple');
        setTimeout(()=>btn.classList.remove('ripple'),450);
      });
    });
});