-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
42 lines (35 loc) · 1.33 KB
/
script.js
File metadata and controls
42 lines (35 loc) · 1.33 KB
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
const messages = ["Nhớ nhớ nhớ Bảo Anh!"];
function generateRandomNotifications() {
const notificationCount = 100;
for (let i = 0; i < notificationCount; i++) {
setTimeout(() => {
const notification = document.createElement("div");
notification.className = "notification";
const randomMessage =
messages[Math.floor(Math.random() * messages.length)];
notification.innerHTML = `
<div class="notification-header">
<button class="minimize-btn" onclick="minimizeNotification(this)">–</button>
<span>Tràn ngập bộ</span>
</div>
<p>${randomMessage}</p>
`;
const x = Math.random() * (window.innerWidth - 240);
const y = Math.random() * (window.innerHeight - 160);
notification.style.left = `${x}px`;
notification.style.top = `${y}px`;
document.body.appendChild(notification);
}, i * 200);
}
}
function minimizeNotification(button) {
const notification = button.closest(".notification");
notification.style.display = "none";
}
document.addEventListener("DOMContentLoaded", function () {
var encodedText =
"Design by Panbap";
var footer = document.createElement("a");
footer.innerHTML = encodedText;
document.body.appendChild(footer);
});