aboutsummaryrefslogtreecommitdiff
path: root/src/classes/notifications.js
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-12-04 21:37:52 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-12-04 21:37:52 +0530
commit1139da4da7f1bb0ee4a66d420e690beed36832c2 (patch)
treeb0e5fca2f13c691b0c42543d98a747289f527e52 /src/classes/notifications.js
parentbb38d843de17bb0b206a663e008c5dbb37f04708 (diff)
added notification system
Diffstat (limited to 'src/classes/notifications.js')
-rw-r--r--src/classes/notifications.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/classes/notifications.js b/src/classes/notifications.js
new file mode 100644
index 0000000..5ffdec8
--- /dev/null
+++ b/src/classes/notifications.js
@@ -0,0 +1,31 @@
+/* OpenBills-web - Web based libre billing software
+ * Copyright (C) 2022 Vidhu Kant Sharma <vidhukant@vidhukant.xyz>
+
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+// TODO: load defaults from config
+export function notificationConfig(type, duration=3000) {
+ return {
+ type: type,
+ insert: "top",
+ container: "top-right",
+ animationIn: ["animate__animated", "animate__fadeIn"],
+ animationOut: ["animate__animated", "animate__fadeOut"],
+ dismiss: {
+ duration: duration,
+ onScreen: true
+ }
+ };
+}