Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/program-classification-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,26 +89,30 @@ jobs:
// ------------------------------------
// Metadata - new template format
// ------------------------------------

const normalizedBody = body.replace(/\r\n/g, '\n');
const has = (re) => re.test(normalizedBody);

if (
body.includes('- [x] gssoc26') ||
body.includes('program: gssoc') ||
body.includes('- [x] gssoc')
has(/\bprogram\s*:\s*gssoc\b/i) ||
has(/^\s*[-*]\s*\[x\]\s*(gssoc26|gssoc|i am contributing under gssoc|i am participating via gssoc)\b/im) ||
has(/\bprogram\n\s*gssoc\b/i)
) {
actualPrograms.add('gssoc');
}

if (
body.includes('- [x] nsoc26') ||
body.includes('program: nsoc') ||
body.includes('- [x] nsoc')
has(/\bprogram\s*:\s*nsoc\b/i) ||
has(/^\s*[-*]\s*\[x\]\s*(nsoc26|nsoc|i am contributing under nsoc|i am participating via nsoc)\b/im) ||
has(/\bprogram\n\s*nsoc\b/i)
) {
actualPrograms.add('nsoc');
}

if (
body.includes('- [x] general contribution') ||
body.includes('program: general')
has(/\bprogram\s*:\s*general\b/i) ||
has(/^\s*[-*]\s*\[x\]\s*(general contribution|i am a general contributor)\b/im) ||
has(/\bprogram\n\s*general\b/i)
) {
hasGeneralContribution = true;
}
Expand Down
90 changes: 61 additions & 29 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,62 @@
}
</script>
<script src="https://cdn.tailwindcss.com?plugins=forms,container-queries"></script>
<script src="https://cdn.jsdelivr.net/npm/marked@9.1.6/marked.min.js" integrity="sha384-odPBjvtXVM/5hOYIr3A1dB+flh0c3wAT3bSesIOqEGmyUA4JoKf/YTWy0XKOYAY7" crossorigin="anonymous"></script>
<script>
if (typeof marked === 'undefined') {
const s = document.createElement('script');
s.src = "https://unpkg.com/marked@9.1.6/marked.min.js";
s.integrity = "sha384-odPBjvtXVM/5hOYIr3A1dB+flh0c3wAT3bSesIOqEGmyUA4JoKf/YTWy0XKOYAY7";
s.crossOrigin = "anonymous";
document.head.appendChild(s);
}
</script>
<script src="https://cdn.jsdelivr.net/npm/dompurify@3.4.0/dist/purify.min.js" integrity="sha384-lExbHoPFNjOW+xMze1tJWzpODN3bi/yx3zhbwRoZWaIYxjl89HxJcI2BxPTNa9M7" crossorigin="anonymous"></script>
<script>
if (typeof DOMPurify === 'undefined') {
const s = document.createElement('script');
s.src = "https://unpkg.com/dompurify@3.4.0/dist/purify.min.js";
s.integrity = "sha384-lExbHoPFNjOW+xMze1tJWzpODN3bi/yx3zhbwRoZWaIYxjl89HxJcI2BxPTNa9M7";
s.crossOrigin = "anonymous";
document.head.appendChild(s);
}
</script>
<script src="https://cdn.jsdelivr.net/npm/html2pdf.js@0.14.0/dist/html2pdf.bundle.min.js" integrity="sha384-EaWTV/aVUkLz3tfwg3+5ycX7Q/d9ET9ruOKUgUuFIRUCfzHO1eo2J62a844iWPmY" crossorigin="anonymous"></script>
<script>
if (typeof html2pdf === 'undefined') {
const s = document.createElement('script');
s.src = "https://unpkg.com/html2pdf.js@0.14.0/dist/html2pdf.bundle.min.js";
s.integrity = "sha384-EaWTV/aVUkLz3tfwg3+5ycX7Q/d9ET9ruOKUgUuFIRUCfzHO1eo2J62a844iWPmY";
s.crossOrigin = "anonymous";
document.head.appendChild(s);
}
// Utility to load third-party scripts with primary and fallback CDNs safely.
(function loadDependencies() {
const dependencies = [
{
name: 'marked',
primary: 'https://cdn.jsdelivr.net/npm/marked@9.1.6/marked.min.js',
fallback: 'https://unpkg.com/marked@9.1.6/marked.min.js',
integrity: 'sha384-odPBjvtXVM/5hOYIr3A1dB+flh0c3wAT3bSesIOqEGmyUA4JoKf/YTWy0XKOYAY7',
check: () => typeof marked !== 'undefined'
},
{
name: 'DOMPurify',
primary: 'https://cdn.jsdelivr.net/npm/dompurify@3.4.0/dist/purify.min.js',
fallback: 'https://unpkg.com/dompurify@3.4.0/dist/purify.min.js',
integrity: 'sha384-lExbHoPFNjOW+xMze1tJWzpODN3bi/yx3zhbwRoZWaIYxjl89HxJcI2BxPTNa9M7',
check: () => typeof DOMPurify !== 'undefined'
},
{
name: 'html2pdf',
primary: 'https://cdn.jsdelivr.net/npm/html2pdf.js@0.14.0/dist/html2pdf.bundle.min.js',
fallback: 'https://unpkg.com/html2pdf.js@0.14.0/dist/html2pdf.bundle.min.js',
integrity: 'sha384-EaWTV/aVUkLz3tfwg3+5ycX7Q/d9ET9ruOKUgUuFIRUCfzHO1eo2J62a844iWPmY',
check: () => typeof html2pdf !== 'undefined'
}
];

function injectScript(src, integrity, onload, onerror) {
const s = document.createElement('script');
s.src = src;
if (integrity) {
s.integrity = integrity;
s.crossOrigin = 'anonymous';
}
s.onload = onload;
s.onerror = onerror;
document.head.appendChild(s);
}

dependencies.forEach(dep => {
injectScript(
dep.primary,
dep.integrity,
() => {
if (!dep.check()) {
console.warn(`Primary CDN failed validation for ${dep.name}, trying fallback...`);
injectScript(dep.fallback, dep.integrity, null, () => console.error(`Fallback failed for ${dep.name}`));
}
},
() => {
console.warn(`Primary CDN failed to load for ${dep.name}, trying fallback...`);
injectScript(dep.fallback, dep.integrity, null, () => console.error(`Fallback failed for ${dep.name}`));
}
);
});
Comment thread
desireddymohithreddy0925 marked this conversation as resolved.
})();
</script>
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&family=Fira+Code:wght@400;500&display=swap" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap" rel="stylesheet" />
Expand All @@ -75,7 +102,12 @@
// Theme restoration - runs early to prevent FOUC
(function(){
try {
if (localStorage.getItem('theme') === 'dark') {
const savedTheme = localStorage.getItem('theme');
if (savedTheme === 'dark') {
document.documentElement.classList.add('dark');
} else if (savedTheme === 'light') {
document.documentElement.classList.remove('dark');
} else if (globalThis.matchMedia?.('(prefers-color-scheme: dark)').matches) {
Comment thread
desireddymohithreddy0925 marked this conversation as resolved.
document.documentElement.classList.add('dark');
}
} catch(e) {
Expand Down
21 changes: 19 additions & 2 deletions src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,26 @@ const CONTACT_TIPS = {
// ══════════════════════════════════════════════
(function initTheme() {
try {
const saved = localStorage.getItem('theme') || 'light';
document.documentElement.classList.toggle('dark', saved === 'dark');
const saved = localStorage.getItem('theme');
if (saved === 'dark') {
document.documentElement.classList.add('dark');
} else if (saved === 'light') {
document.documentElement.classList.remove('dark');
} else if (globalThis.matchMedia?.('(prefers-color-scheme: dark)').matches) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
updateThemeIcon();

if (globalThis.matchMedia) {
globalThis.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
if (!localStorage.getItem('theme')) {
document.documentElement.classList.toggle('dark', e.matches);
updateThemeIcon();
}
});
}
Comment thread
desireddymohithreddy0925 marked this conversation as resolved.
} catch (e) {
console.warn('Theme init failed:', e);
}
Expand Down