aboutsummaryrefslogtreecommitdiff
path: root/views/script/core_notification.js
blob: 118d19d1e081642efee256bbf473a2869fee46a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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)
});