Skip to content

Commit

Permalink
task: adding copied notice
Browse files Browse the repository at this point in the history
  • Loading branch information
paganotoni committed Jun 14, 2024
1 parent 3eed0c7 commit ae52bb4
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion internal/assets/doco.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let doco = {
bt.classList.add(
"material-symbols-outlined",
"absolute",
"top-4",
"top-3",
"right-2",
"p-1.5",
"bg-gray-50",
Expand All @@ -26,9 +26,28 @@ let doco = {

bt.addEventListener("click", () => {
navigator.clipboard.writeText(el.textContent);

let notice = document.createElement("div");
notice.appendChild(document.createTextNode("Copied!"));
notice.classList.add(
"absolute",
"top-3",
"right-2",
"p-2",
"bg-gray-50",
"rounded",
"text-sm",
)

el.appendChild(notice);
setTimeout(() => {
notice.remove()
}, 1500);
});

el.appendChild(bt);


el.classList.add("relative");
});
},
Expand Down

0 comments on commit ae52bb4

Please sign in to comment.