From 3f3e773d3d9470e71f231dce51240fa9e8a12b4f Mon Sep 17 00:00:00 2001
From: Rajyadav999
- 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.
+
+ A global program focused on bringing new contributors into open
+ source software development.
+
- π 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 = "" + programData.skills.map(item => `
";
- prepare.innerHTML = "" + programData.prepare.map(item => `
";
- tips.innerHTML = "" + programData.tips.map(item => `
";
-
- modal.style.display = "flex";
-}
-
-function closeModal() {
- document.getElementById("programModal").style.display = "none";
-}
-
-/* Accordion Toggle */
-document.addEventListener("click", function (e) {
- if (e.target.classList.contains("accordion-header")) {
- const body = e.target.nextElementSibling;
- body.style.display = body.style.display === "block" ? "none" : "block";
- }
});
\ No newline at end of file
diff --git a/frontend/js/pr-generator.js b/frontend/js/pr-generator.js
index 8e4d7f3a..a162ccda 100644
--- a/frontend/js/pr-generator.js
+++ b/frontend/js/pr-generator.js
@@ -6,6 +6,18 @@
* Includes AI Assist Controls for fine-grained PR generation.
*/
+// FIX: Declare aiAssistState on window to avoid re-declaration SyntaxError
+// if this script is loaded more than once across pages
+if (typeof window.aiAssistState === 'undefined') {
+ window.aiAssistState = {
+ creativity: 50,
+ strictness: 'best-practice',
+ autoSummarize: true,
+ autoDetectType: true,
+ rewriteInput: false,
+ };
+}
+
document.addEventListener('DOMContentLoaded', () => {
const existingForm = document.getElementById('prGeneratorForm');
@@ -111,17 +123,6 @@ function getStructureSettings() {
};
}
-// ==========================================
-// AI Assist State
-// ==========================================
-const aiAssistState = {
- creativity: 50,
- strictness: 'best-practice',
- autoSummarize: true,
- autoDetectType: true,
- rewriteInput: false,
-};
-
function getCreativityLabel(value) {
if (value <= 20) return 'Low';
if (value <= 40) return 'Medium-Low';
@@ -151,7 +152,7 @@ function setupAIAssistControls() {
if (slider && valueLabel) {
const updateSlider = () => {
const val = parseInt(slider.value);
- aiAssistState.creativity = val;
+ window.aiAssistState.creativity = val;
valueLabel.textContent = getCreativityLabel(val);
// Update slider track gradient
@@ -170,7 +171,7 @@ function setupAIAssistControls() {
btn.addEventListener('click', () => {
btns.forEach(b => b.classList.remove('active'));
btn.classList.add('active');
- aiAssistState.strictness = btn.dataset.value;
+ window.aiAssistState.strictness = btn.dataset.value;
});
});
}
@@ -180,9 +181,9 @@ function setupAIAssistControls() {
const autoDetect = document.getElementById('autoDetectTypeToggle');
const rewriteInput = document.getElementById('rewriteInputToggle');
- if (autoSummarize) autoSummarize.addEventListener('change', () => { aiAssistState.autoSummarize = autoSummarize.checked; });
- if (autoDetect) autoDetect.addEventListener('change', () => { aiAssistState.autoDetectType = autoDetect.checked; });
- if (rewriteInput) rewriteInput.addEventListener('change', () => { aiAssistState.rewriteInput = rewriteInput.checked; });
+ if (autoSummarize) autoSummarize.addEventListener('change', () => { window.aiAssistState.autoSummarize = autoSummarize.checked; });
+ if (autoDetect) autoDetect.addEventListener('change', () => { window.aiAssistState.autoDetectType = autoDetect.checked; });
+ if (rewriteInput) rewriteInput.addEventListener('change', () => { window.aiAssistState.rewriteInput = rewriteInput.checked; });
// Per-field AI assist buttons
const assistBtns = document.querySelectorAll('.ai-field-assist-btn');
@@ -219,8 +220,8 @@ async function handleFieldImprove(btn) {
body: JSON.stringify({
text,
fieldName: targetId,
- creativity: aiAssistState.creativity,
- strictness: aiAssistState.strictness,
+ creativity: window.aiAssistState.creativity,
+ strictness: window.aiAssistState.strictness,
}),
});
@@ -353,11 +354,11 @@ async function handlePRGeneration(submitBtn, previewSection, textarea) {
structureSettings,
// AI Assist parameters
aiAssist: {
- creativity: aiAssistState.creativity,
- strictness: aiAssistState.strictness,
- autoSummarize: aiAssistState.autoSummarize,
- autoDetectType: aiAssistState.autoDetectType,
- rewriteInput: aiAssistState.rewriteInput,
+ creativity: window.aiAssistState.creativity,
+ strictness: window.aiAssistState.strictness,
+ autoSummarize: window.aiAssistState.autoSummarize,
+ autoDetectType: window.aiAssistState.autoDetectType,
+ rewriteInput: window.aiAssistState.rewriteInput,
},
}),
});
@@ -661,15 +662,15 @@ async function analyzePRStatus() {
if (data.merged) {
statusBadge = `Merged`;
statusText = "This Pull Request has been successfully merged.";
- }
+ }
else if (data.state === "open" && data.draft) {
statusBadge = `Draft`;
statusText = "This PR is currently in draft state.";
- }
+ }
else if (data.state === "open") {
statusBadge = `Open`;
statusText = "This PR is open and under review.";
- }
+ }
else {
statusBadge = `Closed`;
statusText = "This PR is closed without merge.";
diff --git a/frontend/js/pwa.js b/frontend/js/pwa.js
index 22307ff8..98950a41 100644
--- a/frontend/js/pwa.js
+++ b/frontend/js/pwa.js
@@ -48,11 +48,15 @@ if ('serviceWorker' in navigator) {
});
}
-let deferredPrompt;
+// FIX: Use window.deferredPrompt to avoid re-declaration errors
+// if this script is ever executed more than once
+if (typeof window.deferredPrompt === 'undefined') {
+ window.deferredPrompt = null;
+}
window.addEventListener('beforeinstallprompt', (e) => {
e.preventDefault();
- deferredPrompt = e;
+ window.deferredPrompt = e;
const showButton = () => {
const btn = document.getElementById('pwa-install-btn');
@@ -60,14 +64,14 @@ window.addEventListener('beforeinstallprompt', (e) => {
btn.style.display = 'inline-flex';
btn.addEventListener('click', () => {
btn.style.display = 'none';
- deferredPrompt.prompt();
- deferredPrompt.userChoice.then((choiceResult) => {
+ window.deferredPrompt.prompt();
+ window.deferredPrompt.userChoice.then((choiceResult) => {
if (choiceResult.outcome === 'accepted') {
console.log('User accepted the install prompt');
} else {
console.log('User dismissed the install prompt');
}
- deferredPrompt = null;
+ window.deferredPrompt = null;
});
});
} else {
@@ -78,6 +82,6 @@ window.addEventListener('beforeinstallprompt', (e) => {
});
window.addEventListener('appinstalled', () => {
- deferredPrompt = null;
+ window.deferredPrompt = null;
console.log('PWA was installed');
-});
+});
\ No newline at end of file
diff --git a/frontend/js/theme.js b/frontend/js/theme.js
index 539c68a3..76619216 100644
--- a/frontend/js/theme.js
+++ b/frontend/js/theme.js
@@ -77,17 +77,19 @@ function updateThemeIcon(isDark) {
/* ===============================
CURSOR HIGHLIGHT
+ FIX: Renamed variable from 'cursor' to 'themeCursor' to avoid
+ conflict with the 'cursor' variable declared in home.js
================================ */
-const cursor = document.getElementById('cursor-highlight');
+const themeCursor = document.getElementById('cursor-highlight');
-if (cursor) {
+if (themeCursor) {
document.addEventListener('mousemove', (e) => {
- cursor.style.transform = `translate(${e.clientX}px, ${e.clientY}px)`;
- cursor.style.opacity = '1';
+ themeCursor.style.transform = `translate(${e.clientX}px, ${e.clientY}px)`;
+ themeCursor.style.opacity = '1';
});
document.addEventListener('mouseleave', () => {
- cursor.style.opacity = '0';
+ themeCursor.style.opacity = '0';
});
-}
+}
\ No newline at end of file
diff --git a/index.html b/index.html
index 4c0fb979..08e37a3a 100644
--- a/index.html
+++ b/index.html
@@ -110,8 +110,6 @@
-
-
@@ -169,229 +167,34 @@
π₯ Video for Beginners
">
-
- Open Source Programs
- Google Summer of Code
- GSSoC
- Hacktoberfest
- Linux Foundation
- Outreachy
- MLH Fellowship
- Season of KDE
- Hyperledger Mentorship
- Open Source Programs
+ Google Summer of Code
+ GSSoC
GirlScript Summer of Code is a three-month-long Open Source program
by GirlScript Foundation.
-
-
- Hacktoberfest
A month-long celebration of open-source software run by
DigitalOcean.
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.