Refactor toast notifications and improve LoraCard interactions

This commit is contained in:
Will Miao
2025-02-05 16:41:12 +08:00
parent 0bbecd7197
commit e2793a71be
4 changed files with 90 additions and 126 deletions

View File

@@ -66,18 +66,7 @@ export function toggleFolder(tag) {
export function copyTriggerWord(word) {
navigator.clipboard.writeText(word).then(() => {
const toast = document.createElement('div');
toast.className = 'toast toast-copy';
toast.textContent = 'Copied!';
document.body.appendChild(toast);
requestAnimationFrame(() => {
toast.classList.add('show');
setTimeout(() => {
toast.classList.remove('show');
setTimeout(() => toast.remove(), 300);
}, 1000);
});
showToast('Trigger word copied', 'success');
});
}