add code blocks + copy

This commit is contained in:
yagich committed 2025-05-24 05:12:46 +03:00
1 parent 66318698e5
commit 69bfaa8db0
5 files changed
+90 -3

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
for (let button of document.querySelectorAll(".copy-code")) {
button.addEventListener("click", async () => {
await navigator.clipboard.writeText(button.value)
button.textContent = "Copied!"
setTimeout(() => {button.textContent = "Copy"}, 1000.0)
})
}