diff --git a/assets/js/quest.js b/assets/js/quest.js index f8e4ac7..89065ee 100644 --- a/assets/js/quest.js +++ b/assets/js/quest.js @@ -15,27 +15,42 @@ const quests = [ {id:"T3",sphere:"T",dir:"T3 - Dashboards, Interfaces & Open Infrastructure",label:"🖥️ T3 Dashboards & Infra"} ]; +// Research quests from RESEARCH-QUESTS folder +const researchQuests = [ + {id:"R1",sphere:"R",dir:"research-quest-01-ai-data-pipeline",label:"🔬 R1 AI & Data Pipeline Investigation"}, + {id:"R2",sphere:"R",dir:"research-quest-02-reproducibility-check",label:"🔬 R2 Reproducibility Check"}, + {id:"R3",sphere:"R",dir:"research-quest-03-method-validation",label:"🔬 R3 Method Validation"} +]; + const REPO_MAP = { S:"K-RnD-Lab/SPHERE-I-SCIENCE", E:"K-RnD-Lab/SPHERE-II-ENTREPRENEURSHIP", - T:"K-RnD-Lab/SPHERE-III-TECHNOLOGY" + T:"K-RnD-Lab/SPHERE-III-TECHNOLOGY", + R:"K-RnD-Lab/SPHERE-FRONTIER" }; + const nav = document.getElementById("questNav"); const content = document.getElementById("mdContent"); function buildNav(){ - const groups = {S:[],E:[],T:[]}; + const groups = {S:[],E:[],T:[],R:[]}; quests.forEach(q => groups[q.sphere].push(q)); - const labels = {S:"Science",E:"Entrepreneurship",T:"Technology"}; + researchQuests.forEach(q => groups[q.sphere].push(q)); + + const labels = {S:"Science",E:"Entrepreneurship",T:"Technology",R:"Research Quests"}; let html = `← K R&D Lab
Loading quest...
"; + try { const res = await fetch(url); if(!res.ok) throw new Error(res.status); const md = await res.text(); content.innerHTML = marked.parse(md); } catch(err) { - const ghUrl = `https://github.com/${repo}/tree/main/${dir}`; + let ghUrl; + if(sphere === "R"){ + ghUrl = `https://github.com/K-RnD-Lab/SPHERE-FRONTIER/tree/TEZv-research/RESEARCH-QUESTS`; + } else { + const repo = REPO_MAP[sphere]; + ghUrl = `https://github.com/${repo}/tree/main/${dir}`; + } content.innerHTML = `Could not load quest. Open on GitHub →
`; } } @@ -65,7 +94,8 @@ buildNav(); const hash = location.hash.slice(1); if(hash){ - const q = quests.find(q => q.id === hash); + const allQuests = [...quests, ...researchQuests]; + const q = allQuests.find(q => q.id === hash); if(q){ const a = nav.querySelector(`a[href="#${q.id}"]`); if(a){ a.classList.add("active"); loadQuest(q.dir, q.sphere); }