-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbulletinboard.html
More file actions
90 lines (68 loc) · 2.41 KB
/
Copy pathbulletinboard.html
File metadata and controls
90 lines (68 loc) · 2.41 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>bulletin board</title>
<!--Favicon-->
<link rel="icon" type="image/gif" href="./images/Untitled.gif">
<link rel="stylesheet" href="bullboard.css">
</head>
<body>
<img class="board" src="./images/bulletinboard.png" width="55%">
<!-- UPDATES -->
<div id="sidebar">
<div style="height:150px;width:250px;overflow:auto;border:1px solid black;background-color:transparent;color:black;padding:15px;">
<h3>Website Updates</h3>
10/oct/25: Updated about page<br>
08/oct/25: Added functioning guestbook!<br>
06/oct/25: Updated recipies<br>
05/oct/25: Light housekeeping<br>
04/oct/25: all pages created<br>
03/oct/25: Website created<br><br>
</div>
</div>
<div class="calendar">
<div class="month-year" id="monthYear"></div>
<div class="weekdays">
<div>Sun</div><div>Mon</div><div>Tue</div><div>Wed</div>
<div>Thu</div><div>Fri</div><div>Sat</div>
</div>
<div class="days" id="calendarDays"></div>
</div>
<script>
const monthYear = document.getElementById("monthYear");
const calendarDays = document.getElementById("calendarDays");
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth();
const months = [
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
];
// Display month and year
monthYear.textContent = `${months[month]} ${year}`;
// Get first and last day of the month
const firstDay = new Date(year, month, 1).getDay();
const lastDate = new Date(year, month + 1, 0).getDate();
// Add empty boxes for days before month starts
for (let i = 0; i < firstDay; i++) {
const emptyDiv = document.createElement("div");
calendarDays.appendChild(emptyDiv);
}
// Fill in the days
for (let day = 1; day <= lastDate; day++) {
const dayDiv = document.createElement("div");
dayDiv.textContent = day;
if (
day === date.getDate() &&
month === new Date().getMonth() &&
year === new Date().getFullYear()
) {
dayDiv.classList.add("today");
}
calendarDays.appendChild(dayDiv);
}
</script>
</body>
</html>