-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
153 lines (138 loc) · 6.15 KB
/
Copy pathscript.js
File metadata and controls
153 lines (138 loc) · 6.15 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
document.addEventListener('DOMContentLoaded', () => {
// Mobile Menu Toggle
const mobileMenuBtn = document.querySelector('.mobile-menu-btn');
const navLinks = document.querySelector('.nav-links');
if (mobileMenuBtn && navLinks) {
mobileMenuBtn.addEventListener('click', () => {
const isDisplayed = window.getComputedStyle(navLinks).display !== 'none';
if (isDisplayed && window.innerWidth <= 768) {
navLinks.style.display = 'none';
} else {
navLinks.style.display = 'flex';
navLinks.style.flexDirection = 'column';
navLinks.style.position = 'absolute';
navLinks.style.top = '100%';
navLinks.style.left = '0';
navLinks.style.width = '100%';
navLinks.style.background = 'rgba(10, 10, 15, 0.95)';
navLinks.style.padding = '1rem 0';
navLinks.style.backdropFilter = 'blur(10px)';
navLinks.style.borderBottom = '1px solid var(--border-color)';
}
});
}
// Smooth Scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const targetId = this.getAttribute('href');
if (targetId === '#') return;
const target = document.querySelector(targetId);
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
if (window.innerWidth <= 768 && navLinks) {
navLinks.style.display = 'none';
}
}
});
});
// Load Data from courseData globally defined in data.js
const teamsContainer = document.getElementById('teams-container');
const deliverablesContainer = document.getElementById('deliverables-container');
if (teamsContainer && typeof courseData !== 'undefined' && courseData.teams) {
// Render Teams
courseData.teams.forEach(team => {
const card = document.createElement('div');
card.className = 'team-card';
let statusClass = 'status-pending';
if (team.status.includes('Approved') || team.status.includes('Progress')) {
statusClass = 'status-active';
}
const membersList = team.members.join(', ');
card.innerHTML = `
<h3 class="team-name">${team.name}</h3>
<h4 class="project-title">${team.project || 'TBD'}</h4>
<p class="members"><strong>Members:</strong> ${membersList}</p>
<div class="team-badges">
<span class="badge ${statusClass}">${team.status}</span>
</div>
`;
teamsContainer.appendChild(card);
});
}
if (deliverablesContainer && typeof courseData !== 'undefined' && courseData.deliverables) {
// Render Deliverables
courseData.deliverables.forEach(item => {
const timelineItem = document.createElement('div');
timelineItem.className = 'timeline-item';
timelineItem.innerHTML = `
<div class="timeline-dot"></div>
<div class="timeline-content card interactive">
<h3>${item.title || 'Submission Due'}</h3>
<p class="date">Due: ${item.date || 'TBD'}</p>
</div>
`;
deliverablesContainer.appendChild(timelineItem);
});
}
const proposalsContainer = document.getElementById('proposals-container');
if (proposalsContainer && typeof courseData !== 'undefined' && courseData.proposals) {
// Render Proposals
courseData.proposals.forEach(prop => {
const propLink = document.createElement('a');
propLink.href = 'ProjectProposalDocuments/' + prop.file;
propLink.target = '_blank';
propLink.className = 'resource-card';
// Determine if PDF or DOCX
const isPdf = prop.file.toLowerCase().endsWith('.pdf');
const icon = isPdf ? '📄' : '📝';
const fileType = isPdf ? 'PDF' : 'DOCX';
propLink.innerHTML = `
<div class="resource-icon">${icon}</div>
<div class="resource-info">
<h3>${prop.team} Proposal (${fileType})</h3>
<p>Download</p>
</div>
`;
proposalsContainer.appendChild(propLink);
});
}
// Render Delayed Submissions
const delayedContainer = document.getElementById('delayed-submissions-container');
if (delayedContainer && typeof courseData !== 'undefined' && courseData.delayedSubmissions) {
courseData.delayedSubmissions.forEach(sub => {
const subCard = document.createElement('div');
subCard.className = 'resource-card';
subCard.innerHTML = `
<div class="resource-info">
<h3>${sub.Name} (${sub.SRN})</h3>
<p>${sub["Submitted On"]} - Due: ${sub["Due Date"]}</p>
</div>`;
delayedContainer.appendChild(subCard);
});
}
// Simple intersection observer for scroll animations
const observerOptions = {
threshold: 0.1,
rootMargin: "0px 0px -50px 0px"
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.opacity = '1';
entry.target.style.transform = 'translateY(0)';
observer.unobserve(entry.target);
}
});
}, observerOptions);
const sections = document.querySelectorAll('.section-title, .card, .timeline-content, .team-card');
sections.forEach(section => {
section.style.opacity = '0';
section.style.transform = 'translateY(20px)';
section.style.transition = 'opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1)';
observer.observe(section);
});
});