better copy button styles

This commit is contained in:
Cory LaViska
2021-08-10 09:01:53 -04:00
parent a7d81993d5
commit 35d960c09f
2 changed files with 56 additions and 30 deletions

View File

@@ -194,4 +194,14 @@
event.target.setAttribute('aria-expanded', codeBlock.classList.contains('code-block--expanded'));
}
});
// Show pulse when copying
document.addEventListener('click', event => {
const button = event.target.closest('.docsify-copy-code-button');
if (button) {
button.classList.remove('copied');
requestAnimationFrame(() => button.classList.add('copied'));
}
});
})();