Code copied to clipboard
<div><div class="code-box notranslate" translate="no"><pre><code>parsed code here</code></pre><button class="copy-btn" aria-label="Copy code">Copy</button></div></div>
<!-- ====== CSS ====== -->
<style>.code-box {position: relative;border-radius: 8px;margin: 20px 0;overflow-x: auto;border: 2px solid #bcbcbc;background: #f9f9f9;font-family: monospace;}.code-box pre {margin: 0;white-space: pre-wrap;word-wrap: break-word;}.copy-btn {position: absolute;top: 10px;right: 10px;padding: 6px 12px;font-size: 12px;border: none;border-radius: 5px;background: #007bff;color: #fff;cursor: pointer;transition: background 0.3s;}.copy-btn:hover,.copy-btn:focus {background: #0056b3;}</style>
<!-- ====== JavaScript ====== -->
<script>/*<![CDATA[*/ document.addEventListener("DOMContentLoaded", function () {document.querySelectorAll(".copy-btn").forEach(button => {button.addEventListener("click", function () {let code = this.previousElementSibling.querySelector("code").innerText;navigator.clipboard.writeText(code).then(() => {this.textContent = "Copied!";setTimeout(() => {this.textContent = "Copy";}, 2000);});});});});/*]]>*/</script>