The two icons are stacked, and toggling one class swaps them with a springy scale. The check "draws" itself by animating stroke-dashoffset from its full length to zero.
If the Clipboard API is blocked (insecure origin, sandboxed iframe, older browser), the fallback selects the text so a keyboard copy still works. A hidden role="status" element tells screen-reader users what happened.
Reuse it: point data-copy-target at any element with a CSS selector.