forked from opsecfail/opsecfail.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathannouncements.html
62 lines (56 loc) · 2.32 KB
/
announcements.html
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="images/icons/favicon.png">
<title>announcements</title>
<meta name="description" content="this is the announcements page where I shall send anything relevant to the reader">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/announcements.css">
</head>
<body>
<div class="container">
<div class="header">
<span>A</span>
<span>N</span>
<span>N</span>
<span>O</span>
<span>U</span>
<span>N</span>
<span>C</span>
<span>E</span>
<span>M</span>
<span>E</span>
<span>N</span>
<span>T</span>
<span>S</span>
</div>
<div class="chain"></div>
<div class="announcements">
</div>
<script>
// Function to fetch and display announcements from JSON
function displayAnnouncements() {
fetch('storage/other/announcements.json')
.then(response => response.json())
.then(data => {
const announcementsDiv = document.querySelector('.announcements');
announcementsDiv.innerHTML = ''; // Clear previous announcements
data.forEach((announcement, index) => {
const announcementDiv = document.createElement('div');
announcementDiv.classList.add('announcement');
announcementDiv.textContent = announcement.announcement;
announcementsDiv.appendChild(announcementDiv);
});
})
.catch(error => console.error('Error fetching announcements:', error));
}
// Display announcements initially
displayAnnouncements();
// Update announcements every 60 seconds (if new ones are added)
setInterval(displayAnnouncements, 60000); // Adjust interval as needed
</script>
</div>
</body>
</html>