-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainFrame.js
More file actions
38 lines (32 loc) · 769 Bytes
/
mainFrame.js
File metadata and controls
38 lines (32 loc) · 769 Bytes
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
class MainFrame {
constructor(type, title, text) {
this.type = type;
this.title = title;
this.text = text;
}
static id = 0;
getId() {
return MainFrame.id;
}
incrementId() {
MainFrame.id++;
}
getTemplate() {
return ``;
}
renderPopup() {
const popupContainer = document.querySelector(`.popup_container`);
if (popupContainer) {
popupContainer.innerHTML += this.getTemplate();
}
}
removePopup(id) {
const popupContainer = document.getElementById(`${id}`);
if (popupContainer) {
if (popupContainer.classList.contains("visible")) {
popupContainer.classList.add("animated");
setTimeout(() => popupContainer.remove(), 1000);
} else popupContainer.remove();
}
}
}