aboutsummaryrefslogtreecommitdiff
path: root/views/script/core_notification.js
diff options
context:
space:
mode:
authorMinteck <46352972+Minteck@users.noreply.github.com>2021-07-09 00:37:48 +0200
committerMinteck <46352972+Minteck@users.noreply.github.com>2021-07-09 00:37:48 +0200
commit8886d5111aa4ae75f54f46c93f09fa7548979969 (patch)
tree51ca4a81263486f1298e1262537703b0470fa4e6 /views/script/core_notification.js
parenta69a90e2f5970efb23dba5ca900e9624b35cfa36 (diff)
downloadkartik-client-8886d5111aa4ae75f54f46c93f09fa7548979969.tar.gz
kartik-client-8886d5111aa4ae75f54f46c93f09fa7548979969.tar.bz2
kartik-client-8886d5111aa4ae75f54f46c93f09fa7548979969.zip
Fixes
Diffstat (limited to 'views/script/core_notification.js')
-rw-r--r--views/script/core_notification.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/views/script/core_notification.js b/views/script/core_notification.js
new file mode 100644
index 0000000..118d19d
--- /dev/null
+++ b/views/script/core_notification.js
@@ -0,0 +1,13 @@
+var ipcRenderer = require('electron').ipcRenderer;
+ipcRenderer.on('notification', function (event, data) {
+ document.getElementById("notification-title").innerText = data.title;
+ document.getElementById("notification-message").innerText = data.message;
+ document.getElementById("notification").style.right = "20px";
+ document.getElementById("notification").style.opacity = "1";
+ new Audio("./sfx/notification.mp3").play();
+
+ setTimeout(() => {
+ document.getElementById("notification").style.right = "-300px";
+ document.getElementById("notification").style.opacity = "0";
+ }, 5000)
+}); \ No newline at end of file