Add pantry and shopping lists
This commit is contained in:
13
stacks/recipe/js/ui/toast.js
Normal file
13
stacks/recipe/js/ui/toast.js
Normal file
@@ -0,0 +1,13 @@
|
||||
export function showAppToast(message) {
|
||||
const wrap = document.getElementById('app-toast');
|
||||
const text = document.getElementById('app-toast-text');
|
||||
if (!wrap || !text) return;
|
||||
text.textContent = message;
|
||||
wrap.classList.remove('opacity-0', 'translate-y-2');
|
||||
wrap.classList.add('opacity-100', 'translate-y-0');
|
||||
clearTimeout(showAppToast._t);
|
||||
showAppToast._t = setTimeout(() => {
|
||||
wrap.classList.add('opacity-0', 'translate-y-2');
|
||||
wrap.classList.remove('opacity-100', 'translate-y-0');
|
||||
}, 2600);
|
||||
}
|
||||
Reference in New Issue
Block a user