-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
43 lines (37 loc) · 1.2 KB
/
script.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
43
function filterArticles(tag) {
const articles = document.querySelectorAll(".article");
articles.forEach((article) => {
const articleTags = article.dataset.tags.split(",");
if (articleTags[0].includes(tag)) {
article.style.display = "block";
} else {
article.style.display = "none";
}
});
}
document.addEventListener("DOMContentLoaded", function () {
document
.getElementById("about-me-button")
.addEventListener("click", function () {
var aboutMeSection = document.getElementById("about-me-popup");
if (aboutMeSection.style.display !== "block") {
aboutMeSection.style.display = "block";
} else {
aboutMeSection.style.display = "none";
}
});
document
.getElementById("close-popup-btn")
.addEventListener("click", function () {
var aboutMeSection = document.getElementById("about-me-popup");
aboutMeSection.style.display = "none";
});
document.getElementById("menu-btn").addEventListener("click", function () {
var menu = document.getElementsByClassName("menu")[0];
if (menu.style.display !== "block") {
menu.style.display = "block";
} else {
menu.style.display = "none";
}
});
});