Spaces:
Build error
Build error
| (text) => { | |
| navigator.clipboard.writeText(text); | |
| const toast = document.createElement('div') | |
| toast.textContent = "The content has been copied to the clipboard." | |
| toast.style.cssText = ` | |
| position: fixed; | |
| top: 20px; | |
| right: 20px; | |
| background-color: #ff8945; | |
| color: white; | |
| padding: 16px; | |
| border-radius: 4px; | |
| box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); | |
| z-index: 10000; | |
| font-size: 14px; | |
| opacity: 0; | |
| transition: opacity 0.3s ease-in-out; | |
| `; | |
| document.body.appendChild(toast); | |
| setTimeout(() => { | |
| toast.style.opacity = "1"; | |
| }, 10); | |
| setTimeout(() => { | |
| toast.style.opacity = "0"; | |
| setTimeout(() => { | |
| document.body.removeChild(toast); | |
| }, 300); | |
| }, 3000); | |
| return null; | |
| } |