-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalendar.html
More file actions
160 lines (142 loc) · 5.28 KB
/
calendar.html
File metadata and controls
160 lines (142 loc) · 5.28 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Calendar – Commit Intranet Hub</title>
<link rel="stylesheet" href="css/styles.css"/>
<link rel="stylesheet" href="css/ai-assistant.css"/>
</head>
<body>
<div class="layout">
<!-- Sidebar -->
<aside class="sidebar" aria-label="Department Navigation">
<div class="sidebar-header">
<img src="assets/commit-logo-white.svg" alt="Commit Logo" class="sidebar-logo" />
</div>
<nav>
<ul>
<h2>Departments</h2>
<li><a href="departments/hr.html">👥 HR</a></li>
<li><a href="departments/it.html">💻 IT Support</a></li>
<li><a href="departments/operations.html">📦 Operations</a></li>
<li><a href="departments/policy.html">📜 Policy</a></li>
<li><a href="departments/development.html">💡 Development</a></li>
</ul>
</nav>
</aside>
<!-- Main Content -->
<div class="main-content">
<header class="site-header">
<h1>Calendar</h1>
<nav class="topnav">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="news.html">News</a></li>
<li><a href="calendar.html" class="active">Calendar</a></li>
<li><a href="documents.html">Documents</a></li>
<li><a href="shoutouts.html">Shoutouts</a></li>
<li><a href="wiki.html">Wiki</a></li>
<li><a href="ai.html">Ask AI</a></li>
</ul>
</nav>
</header>
<main>
<div class="calendar-container">
<div class="calendar-header">
<h2 id="month-year"></h2>
<div>
<button onclick="prevMonth()">←</button>
<button onclick="nextMonth()">→</button>
</div>
</div>
<div class="calendar-grid" id="calendar-grid"></div>
</div>
</main>
<footer class="site-footer">
<p>© 2025 The Commit Partnership | Built for demonstration purposes</p>
<p style="font-size: 0.8rem; color: #aaa;">All content and interactions are simulated.</p>
</footer>
</div>
</div>
<!-- AI Assistant Bubble -->
<div id="ai-chat-widget">
<button id="ai-toggle" aria-label="Open AI Assistant">🤖</button>
<div id="ai-chat-window" style="display: none;">
<div class="ai-chat-header">
<span>Commit AI Assistant</span>
<button id="ai-close">×</button>
</div>
<div class="ai-chat-body" id="ai-messages"></div>
<textarea id="ai-user-input" placeholder="Ask a question..."></textarea>
<button id="ai-send">Send</button>
</div>
</div>
<script src="js/ai-assistant.js" defer></script>
<!-- JavaScript Calendar Logic -->
<script>
document.addEventListener("DOMContentLoaded", () => {
const calendarGrid = document.getElementById("calendar-grid");
const monthYear = document.getElementById("month-year");
let currentDate = new Date();
const events = {
"2025-08-05": "All-Staff Meeting",
"2025-08-12": "Summer PTO Deadline",
"2025-08-20": "Birthday Bash 🎉",
"2025-08-30": "Labor Day PTO"
};
function renderCalendar(date) {
const year = date.getFullYear();
const month = date.getMonth();
const firstDay = new Date(year, month, 1).getDay();
const daysInMonth = new Date(year, month + 1, 0).getDate();
calendarGrid.innerHTML = "";
monthYear.textContent = `${date.toLocaleString("default", { month: "long" })} ${year}`;
["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"].forEach(day => {
const div = document.createElement("div");
div.className = "day";
div.style.fontWeight = "bold";
div.textContent = day;
calendarGrid.appendChild(div);
});
for (let i = 0; i < firstDay; i++) {
const empty = document.createElement("div");
empty.className = "day";
calendarGrid.appendChild(empty);
}
for (let d = 1; d <= daysInMonth; d++) {
const dayDiv = document.createElement("div");
const current = new Date();
const cellDate = new Date(year, month, d);
const iso = cellDate.toISOString().split("T")[0];
dayDiv.className = "day";
if (
cellDate.getDate() === current.getDate() &&
cellDate.getMonth() === current.getMonth() &&
cellDate.getFullYear() === current.getFullYear()
) {
dayDiv.classList.add("today");
}
dayDiv.innerHTML = `<strong>${d}</strong>`;
if (events[iso]) {
const event = document.createElement("div");
event.className = "event";
event.textContent = events[iso];
dayDiv.appendChild(event);
}
calendarGrid.appendChild(dayDiv);
}
}
window.prevMonth = () => {
currentDate.setMonth(currentDate.getMonth() - 1);
renderCalendar(currentDate);
};
window.nextMonth = () => {
currentDate.setMonth(currentDate.getMonth() + 1);
renderCalendar(currentDate);
};
renderCalendar(currentDate);
});
</script>
</body>
</html>