Files
AudioBookRequest/templates/scripts/toast.html
T
2025-02-19 18:53:01 +01:00

31 lines
685 B
HTML

<link
rel="stylesheet"
type="text/css"
href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css"
/>
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/toastify-js"
></script>
<script>
const toast = (message, type = "success") => {
const classNames = {
success: "success-alert",
error: "error-alert",
info: "info-alert",
};
Toastify({
text: message,
duration: type === "error" ? 10000 : 3000,
close: true,
gravity: "top",
position: "right",
stopOnFocus: true,
className: classNames[type],
style: {
background: "unset",
},
}).showToast();
};
</script>