Button Animation with CSS Offset Paths

PHOTO EMBED

Thu Apr 29 2021 08:06:55 GMT+0000 (UTC)

Saved by @ycljcfer

var $btn = document.querySelector('.btn');

​

$btn.addEventListener('click', e => {

  window.requestAnimationFrame(() => {

    $btn.classList.remove('is-animating');

    

    window.requestAnimationFrame(() => {

      $btn.classList.add('is-animating');

    });

  });

});
content_copyCOPY

https://codepen.io/Chokcoco/pen/xxgMPzJ