diff --git a/frontend/js/chatbot.js b/frontend/js/chatbot.js
index 5d73c32b..1b01c653 100644
--- a/frontend/js/chatbot.js
+++ b/frontend/js/chatbot.js
@@ -129,7 +129,10 @@ restoreChatHistory();
// Load data
// Note: This path assumes index.html is in /pages/ and data is in /data/
- fetch('../data/chatbot_data.json')
+ // Resolve path relative to root regardless of current page depth
+ const isPagesDir = window.location.pathname.includes('/pages/');
+ const chatbotDataPath = isPagesDir ? '../../frontend/data/chatbot_data.json' : './frontend/data/chatbot_data.json';
+ fetch(chatbotDataPath)
.then(response => response.json())
.then(data => {
intents = data.intents;
@@ -342,4 +345,4 @@ function parseMarkdown(text) {
return "I'm not sure about that. Try asking about open source programs or guides.";
}
-});
+});
\ No newline at end of file
diff --git a/frontend/js/home.js b/frontend/js/home.js
index c896e5b8..711de401 100644
--- a/frontend/js/home.js
+++ b/frontend/js/home.js
@@ -123,10 +123,12 @@ document.addEventListener('DOMContentLoaded', () => {
// ===============================
// Scroll Progress Indicator (Top)
+// FIX: Renamed variable from 'scrollProgressBar' to 'homeScrollProgressBar'
+// to avoid conflict with the same variable name declared in theme.js
// ===============================
-const scrollProgressBar = document.getElementById('scrollProgress');
+const homeScrollProgressBar = document.getElementById('scrollProgress');
-if (scrollProgressBar) {
+if (homeScrollProgressBar) {
window.addEventListener(
'scroll',
() => {
@@ -136,12 +138,12 @@ if (scrollProgressBar) {
document.documentElement.clientHeight;
if (docHeight <= 0) {
- scrollProgressBar.style.width = '0%';
+ homeScrollProgressBar.style.width = '0%';
return;
}
const scrollPercent = (scrollTop / docHeight) * 100;
- scrollProgressBar.style.width = `${scrollPercent}%`;
+ homeScrollProgressBar.style.width = `${scrollPercent}%`;
},
{ passive: true }
);
@@ -190,6 +192,7 @@ if (scrollProgressBar) {
cursor.style.opacity = '';
});
})();
+
// ===============================
// Back to Top Button
// ===============================
@@ -285,6 +288,9 @@ document.addEventListener("DOMContentLoaded", () => {
const counters = document.querySelectorAll(".counter");
const statsSection = document.querySelector(".stats");
+ // FIX: Guard against null statsSection
+ if (!statsSection) return;
+
let hasAnimated = false;
const animateCounter = (counter) => {
@@ -334,65 +340,4 @@ document.addEventListener("DOMContentLoaded", () => {
});
observer.observe(statsSection);
-});
-
-function openModal(program) {
- const modal = document.getElementById("programModal");
- const title = document.getElementById("modalTitle");
- const basicInfo = document.getElementById("modalBasicInfo");
- const skills = document.getElementById("modalSkills");
- const prepare = document.getElementById("modalPrepare");
- const tips = document.getElementById("modalTips");
-
- const data = {
- gsoc: {
- title: "Google Summer of Code",
- basic: `
- π
Duration: 12 Weeks
- π Eligibility: Students worldwide
- π° Stipend: Paid
- β³ Timeline: MayβAug
- `,
- skills: [
- "Strong problem solving",
- "Git & GitHub workflow",
- "Open source contribution experience"
- ],
- prepare: [
- "Start contributing early",
- "Fix good first issues",
- "Interact with mentors",
- "Understand project roadmap"
- ],
- tips: [
- "Write strong proposal",
- "Be active in discussions",
- "Submit quality PRs",
- "Show consistency"
- ]
- }
- };
-
- const programData = data[program];
-
- title.innerHTML = programData.title;
- basicInfo.innerHTML = programData.basic;
-
- skills.innerHTML = "
- Explore ongoing and upcoming open-source programs with timelines, - prerequisites, and official resources. -
- -- A global program focused on bringing new contributors into open - source software development. -
-- GirlScript Summer of Code is a three-month-long Open Source program - by GirlScript Foundation. -
-- A month-long celebration of open-source software run by - DigitalOcean. -
- -- Explore various mentorship opportunities within the massive Linux - ecosystem. -
-- Provides internships to people subject to systemic bias and - underrepresented in tech. -
-- A remote internship-like open source program where you collaborate in pods - on real-world projects with mentorship. -
-- A mentorship program by KDE that allows contributors to work on open - source desktop and Qt-based projects. -
-- A blockchain-focused mentorship program under the Hyperledger open source - ecosystem with guided project contributions. -
-+ Explore ongoing and upcoming open-source programs with timelines, + prerequisites, and official resources. +
- - Explore - -+ A global program focused on bringing new contributors into open + source software development. +
+Beginner-focused winter open-source program.
-- Learn alongside maintainers and contributors whoβve already - walked the path youβre starting today. + Learn alongside maintainers and contributors who've already + walked the path you're starting today.