-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
264 lines (215 loc) Β· 9.19 KB
/
Copy pathscript.js
File metadata and controls
264 lines (215 loc) Β· 9.19 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
//INTRO EFFECTS
window.addEventListener("scroll", () => {
const yOffset = window.scrollY;
document.querySelector(".sky").style.backgroundPosition =
`center ${0 - yOffset * 0.1}px`;
});
window.addEventListener('load', () => {
const intro = document.getElementById('intro');
if (!intro) return;
intro.classList.add('show');
const startWords = () => intro.classList.add('animate');
if (getComputedStyle(intro).transitionDuration !== '0s') {
intro.addEventListener('transitionend', startWords, { once: true });
} else {
startWords();
}
const BOB_MS = 2600;
const EXIT_MS = 900;
const startExit = () => {
intro.classList.add('fly');
setTimeout(() => intro.remove(), EXIT_MS + 250);
};
const t = setTimeout(startExit, BOB_MS);
['click', 'keydown', 'scroll', 'touchstart'].forEach(ev =>
window.addEventListener(ev, () => { clearTimeout(t); startExit(); }, { once: true })
);
});
// Kean title effect
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.title-effect .wrd-effect').forEach(span => {
span.addEventListener('animationend', (e) => {
// ensure we're reacting only to the 'drop' animation ending
if (e.animationName === 'drop') {
span.classList.add('landed');
}
});
});
});
// Set the date/time of the hackathon
const eventDate = new Date("April 25, 2026 08:00:00").getTime();
const countdown = setInterval(function () {
const now = new Date().getTime();
const distance = eventDate - now;
// Time calculations
const days = Math.floor(distance / (1000 * 60 * 60 * 24));
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Output to HTML
document.getElementById("days").innerText = days.toString().padStart(2, "0");
document.getElementById("hours").innerText = hours.toString().padStart(2, "0");
document.getElementById("minutes").innerText = minutes.toString().padStart(2, "0");
document.getElementById("seconds").innerText = seconds.toString().padStart(2, "0");
// When event passes
if (distance < 0) {
clearInterval(countdown);
document.getElementById("countdown").innerHTML = "The hackathon has started!";
}
}, 1000);
// --- SCHEDULE TIMELINE LOGIC ---
// --- SCHEDULE TIMELINE LOGIC ---
const scheduleData = {
1: [
{ title: "Welcome & Check-In πΎ", time: "8:00 AM", loc: "STEM Building", desc: "Arrival, breakfast, and get settled in. Pick up your badges and swag!" },
{ title: "Opening Ceremony ποΈ", time: "9:00 AM", loc: "Auditorium", desc: "Intro, rules, and announcements to kick off the event." },
{ title: "Team Formation π€", time: "9:30 AM", loc: "Lobby", desc: "Form teams and brainstorm ideas." },
{ title: "Hacking Begins π»", time: "10:00 AM", loc: "Hacking Area", desc: "Coding, planning, and prototyping starts NOW!" },
{ title: "Sponsor Expo (Group A) πΌ", time: "11:00 AM", loc: "Expo Hall", desc: "Group A meets with companies in rotating time blocks." },
{ title: "Sponsor Expo (Group B) πΌ", time: "12:00 PM", loc: "Expo Hall", desc: "Group B meets with companies in rotating time blocks." },
{ title: "Lunch & Workshop 1 π", time: "12:30 PM", loc: "Cafeteria / Room 101", desc: "Fuel up! 1-hour workshop blocks running alongside lunch." },
{ title: "Workshop 2 π οΈ", time: "1:30 PM", loc: "Room 102", desc: "Learn new skills to level up your project." },
{ title: "Workshop 3 π¨", time: "2:30 PM", loc: "Room 103", desc: "Another opportunity to learn something cool." },
{ title: "Career Expo Ends π", time: "3:00 PM", loc: "Expo Hall", desc: "Say thank you to our amazing sponsors!" },
{ title: "Social Break π¦", time: "4:00 PM", loc: "Lounge", desc: "Light refreshments, snacks, and fun activities to de-stress." },
{ title: "Pizza Dinner π", time: "7:00 PM", loc: "Cafeteria", desc: "1 pie per team! Regroup, refuel, and prepare for the long night." },
{ title: "Workshops & Hacking π", time: "8:00 PM", loc: "Hacking Area", desc: "Optional technical workshops + strong hacking focus." },
{ title: "Overnight Hacking π¦", time: "10:00 PM", loc: "Everywhere", desc: "Hacking continues! Snacks, coffee, and mentors available for debugging." },
],
2: [
{ title: "Final Stretch β", time: "5:00 AM", loc: "Hacking Area", desc: "Teams polish presentations, finalize demos, and submit projects." },
{ title: "Judging & Closing π", time: "7:00 AM", loc: "Auditorium", desc: "Team pitches to judges, winners announced, and group photos!" },
{ title: "Event Ends π", time: "8:00 AM", loc: "STEM Building", desc: "Head home, sleep, and celebrate an amazing 24 hours!" },
]
};
let currentDay = 1;
let activeEventIndex = 0;
function renderTimeline() {
const events = scheduleData[currentDay];
const dotsContainer = document.getElementById('timeline-dots');
if (!dotsContainer) return; // Safety check
dotsContainer.innerHTML = ''; // Clear existing
events.forEach((event, index) => {
const wrapper = document.createElement('div');
wrapper.classList.add('timeline-dot-wrapper');
if (index === activeEventIndex) wrapper.classList.add('active');
wrapper.innerHTML = `<div class="timeline-dot"></div>
<div class="dot-time">${event.time}</div>`;
wrapper.addEventListener('click', () => {
setActiveEvent(index);
});
dotsContainer.appendChild(wrapper);
});
}
function setActiveEvent(index) {
const events = scheduleData[currentDay];
if (index < 0 || index >= events.length) return;
activeEventIndex = index;
// Update Card
const event = events[index];
const titleEl = document.getElementById('event-title');
const timeEl = document.getElementById('event-time');
const locEl = document.getElementById('event-loc');
const descEl = document.getElementById('event-desc');
if (titleEl && timeEl && locEl && descEl) {
// Simple fade transition
const card = document.querySelector('.event-card');
if (card) {
card.style.opacity = 0;
card.style.transform = "translateY(10px)";
setTimeout(() => {
titleEl.textContent = event.title;
timeEl.textContent = event.time;
locEl.textContent = event.loc;
descEl.textContent = event.desc;
card.style.opacity = 1;
card.style.transform = "translateY(0)";
}, 300);
} else {
// Fallback if card class missing
titleEl.textContent = event.title;
timeEl.textContent = event.time;
locEl.textContent = event.loc;
descEl.textContent = event.desc;
}
}
// Update Dots
document.querySelectorAll('.timeline-dot-wrapper').forEach((dot, idx) => {
if (idx === index) dot.classList.add('active');
else dot.classList.remove('active');
});
}
// Initialize everything on DOMContentLoaded
document.addEventListener('DOMContentLoaded', () => {
// Initial Render
renderTimeline();
setActiveEvent(0);
// Event Listeners for Nav Arrows
const prevBtn = document.querySelector('.nav-arrow.prev');
const nextBtn = document.querySelector('.nav-arrow.next');
if (prevBtn) {
prevBtn.addEventListener('click', () => {
if (activeEventIndex > 0) setActiveEvent(activeEventIndex - 1);
});
}
if (nextBtn) {
nextBtn.addEventListener('click', () => {
const max = scheduleData[currentDay].length - 1;
if (activeEventIndex < max) setActiveEvent(activeEventIndex + 1);
});
}
// Day Switching
document.querySelectorAll('.day-btn').forEach(btn => {
btn.addEventListener('click', (e) => {
const day = parseInt(e.target.dataset.day);
if (day === currentDay) return;
currentDay = day;
activeEventIndex = 0; // Reset to first event of the day
// Update active button
document.querySelectorAll('.day-btn').forEach(b => b.classList.remove('active'));
e.target.classList.add('active');
// Update Date Text
const dateEl = document.getElementById('schedule-date');
if (dateEl) {
if (currentDay === 1) {
dateEl.textContent = "Saturday, April 25, 2026";
} else {
dateEl.textContent = "Sunday, April 26, 2026";
}
}
renderTimeline();
setActiveEvent(0);
});
});
// FAQ Accordion Logic
const faqItems = document.querySelectorAll('.faq-item');
console.log("FAQ Items found:", faqItems.length);
faqItems.forEach((item, idx) => {
item.addEventListener('click', () => {
console.log("FAQ item clicked:", idx);
// Close other open items
faqItems.forEach(otherItem => {
if (otherItem !== item) {
otherItem.classList.remove('active');
}
});
// Toggle current item
const isActive = item.classList.toggle('active');
console.log("Item active state:", isActive);
});
});
// TRACKS Card Logic
const trackCards = document.querySelectorAll('.card-container');
trackCards.forEach(card => {
card.addEventListener('click', () => {
// Close others
trackCards.forEach(c => {
if (c !== card) {
c.classList.remove('active');
}
});
// Toggle current
card.classList.toggle('active');
});
});
});