toasts timer increased to 5s. Add animation to the toast Add toast for like and favorite actions fixed the deal card design added a opening animation to modal
18 lines
572 B
JavaScript
18 lines
572 B
JavaScript
const toast = document.querySelector('.toast');
|
|
const toastBtn = document.querySelector('#toast-btn');
|
|
let toastMessage = toast.querySelector('#toast-message');
|
|
export function showToast(message) {
|
|
toast.classList.remove('translate-x-[100vw]');
|
|
toast.classList.add('translate-x-0');
|
|
toastMessage.textContent = message;
|
|
setTimeout(() => {
|
|
hideToast();
|
|
}, 5000)
|
|
}
|
|
function hideToast() {
|
|
toast.classList.remove('translate-x-0');
|
|
toast.classList.add('translate-x-[100vw]');
|
|
}
|
|
document.hideToast = hideToast;
|
|
document.showToast = showToast;
|