refactor: trying copilot edits

This commit is contained in:
ayo 2026-06-02 14:01:36 +02:00
parent fd1d015a18
commit e77351e5dd

View file

@ -49,21 +49,29 @@ AP0YLC768PFTBm9CM5T1BE0xjJ7s4dZSrVoI4n8RSe1nCA==
<script> <script>
/* Clipboard copy logic */ /* Clipboard copy logic */
document.querySelector('.copy-btn').addEventListener('click', async () => { const copyBtn = document.querySelector('.copy-btn')
const keyText = document.querySelector('#public-key code').innerText.trim() if (copyBtn) {
copyBtn.addEventListener('click', async () => {
const keyText = (
document.querySelector('#public-key code') as HTMLElement
)?.innerText.trim()
if (!keyText) return
try { try {
await navigator.clipboard.writeText(keyText) await navigator.clipboard.writeText(keyText)
const btn = document.querySelector('.copy-btn') const btn = document.querySelector('.copy-btn')
if (btn) {
const original = btn.textContent const original = btn.textContent
btn.textContent = 'Copied!' btn.textContent = 'Copied!'
setTimeout(() => { setTimeout(() => {
btn.textContent = original btn.textContent = original
}, 2000) }, 2000)
}
} catch (err) { } catch (err) {
console.error('Copy failed', err) console.error('Copy failed', err)
alert('Unable to copy the key. Please copy it manually.') alert('Unable to copy the key. Please copy it manually.')
} }
}) })
}
</script> </script>
<style> <style>