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