-
Notifications
You must be signed in to change notification settings - Fork 0
/
website.js
42 lines (36 loc) · 1.37 KB
/
website.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
document.getElementById('new').click();
function openCity(evt, cityName, doSomthing) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}
window.addEventListener("load", () => {
const loader = document.querySelector(".loader");
loader.classList.add("loader--hidden");
loader.addEventListener("transitionend", () => {
document.body.removeChild(loader);
});
});
function notifyMe(body, title, link) {
if (Notification.permission !== 'granted') {
Notification.requestPermission();
}
else {
var notification = new Notification(title, {
icon: 'img/favicon.jpg',
body: body,
});
notification.onclick = function() {
window.open(link)
}
}
};
notifyMe("Hello!👋 Did you know we have an AWSOME game, perfect for YOU!? It's called: Slither Snake! Click this notification to play it!", "Hello👋!", "https://theprogrammer5.github.io/Slither-Snake-Offical-Website/");