import { profile, projects, processes, source } from './content.js'; const main = document.querySelector('main'); let lang = new URLSearchParams(location.search).get('lang') === 'en' ? 'en' : 'nl'; const t = pair => pair[lang === 'nl' ? 0 : 1]; const esc = value => String(value).replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); const tx = pair => esc(t(pair)); const ext = (url, label, cls = '') => `${label}`; const badge = text => `${esc(text)}`; const route = () => location.hash.slice(1) || 'home'; document.querySelector('.skip').addEventListener('click', event => { event.preventDefault(); main.focus(); main.scrollIntoView(); }); const go = (id, label, cls = '') => `${label}`; function header() { const current = route(); document.querySelector('#header').innerHTML = `
${go('home', 'az_Alvin Zilverstand', 'brand')}
${['nl','en'].map(l => ``).join('')}
`; document.querySelectorAll('[data-lang]').forEach(button => button.addEventListener('click', () => { lang = button.dataset.lang; const url = new URL(location.href); url.searchParams.set('lang', lang); history.replaceState(null, '', url); render(false); document.querySelector(`[data-lang="${lang}"]`).focus(); })); } function footer() { document.querySelector('footer').innerHTML = `
AZ / PORTFOLIO

Alvin Zilverstand · VISTA college, Heerlen

${tx(['In ontwikkeling','Work in progress'])} / 2026`; } function system(p, large = false) { return ``; } function projectRow(p) { return `
/${esc(p.number)}

${p.challenge === '—' ? tx(['PERSOONLIJK PROJECT','PERSONAL PROJECT']) : `CHALLENGE ${esc(p.challenge)}`} · ${tx(p.kind)}

${go(`project/${p.id}`,tx(p.name))}

${tx(p.intro)}

${p.stack.map(badge).join('')}
${go(`project/${p.id}`,`${tx(['Bekijk project','Explore project'])}`,'row-link')}
`; } function home() { const p = projects[0]; return `

${tx(['Van idee','From idea'])}
${tx(['naar iets','to something'])}
${tx(['dat werkt.','that works.'])}

${tx(['Ik ben Alvin. Derdejaars Software Developer bij VISTA college in Heerlen. Hier laat ik zien wat ik bouw, hoe het in elkaar zit en wat ik nog leer.','I’m Alvin, a third-year Software Developer student at VISTA college in Heerlen. This is what I build, how it fits together, and what I’m still learning.'])}

${go('work',`${tx(['Ontdek mijn werk','Explore my work'])} `,'button primary')}${go('evidence',tx(['Naar de bewijsindex','View the evidence index']),'text-link')}
FIELDNOTES / 0012024—2026
${p ? system(p,true) : ''}${p ? `
${esc(p.number)} /
${tx(p.name)}

${tx(p.kind)}

${go(`project/${p.id}`, '' + tx(p.name) + '↗','circle-link')}
` : ''}
${tx(['NU','NOW'])}VISTA college · Heerlen${tx(['Leerjaar 3','Year 3'])}

01 / ${tx(['SELECTIE','SELECTED'])}

${tx(['Werk met een verhaal.','Work with a story.'])}

${String(projects.length).padStart(2, '0')} ${tx(['PROJECTEN','PROJECTS'])}
${projects.length ? projects.map(projectRow).join('') : emptyProjects()}

02 / ${tx(['VAN PROJECT NAAR BEWIJS','FROM PROJECT TO EVIDENCE'])}

${tx(['De code is het begin.','The code is the starting point.'])}

${tx(['Een project vertelt meer met de keuzes, documenten en tests ernaast. De bewijsindex verbindt die onderdelen met de acht beroepsspecifieke SBB-werkprocessen.','A project says more with its decisions, documents, and tests alongside it. The evidence index connects those artifacts to the eight vocational SBB work processes.'])}

${go('evidence',`${tx(['Open bewijsindex','Open evidence index'])} ↗`,'text-link')}
`; } function emptyProjects() { return `

${tx(['Nog geen projecten toegevoegd.','No projects added yet.'])}

`; } function work() { return `

01 / ${tx(['PROJECTARCHIEF','PROJECT ARCHIVE'])}

${tx(['Gebouwd. Onderzocht.','Built. Explored.'])}
${tx(['Verder geleerd.','Still learning.'])}

${tx(['Schoolprojecten en persoonlijke experimenten, bekeken vanuit het probleem, de uitvoering en de beschikbare bronnen. De broncode blijft één klik verder.','School projects and personal experiments, through their problems, implementation, and available sources. The source code is always one click away.'])}

${projects.length ? projects.map(p=>`
${system(p)}${projectRow(p)}
`).join('') : emptyProjects()}
`; } function detail(p) { return `
${go('work',`← ${tx(['Alle projecten','All projects'])}`,'back-link')}

PROJECT ${esc(p.number)} / ${p.challenge === '—' ? tx(['PERSOONLIJK PROJECT','PERSONAL PROJECT']) : `CHALLENGE ${esc(p.challenge)}`}

${tx(p.name)}.

${tx(p.intro)}

${p.stack.map(badge).join('')}
${system(p,true)}
${[[['De opdracht','The assignment'],p.context],[['Hoe het is opgebouwd','How it is built'],p.implementation],[['Keuzes & aandachtspunten','Decisions & considerations'],p.decisions]].map(([title,body],i)=>`

0${i+1}

${tx(title)}

${tx(body)}

`).join('')}

04

${tx(['Bronnen & bewijs','Sources & evidence'])}

${tx(['Dit zijn gevonden bronnen, geen goedgekeurde examenbewijzen. Documentinhoud en testresultaten moeten nog worden gecontroleerd.','These are located sources, not approved exam evidence. Document contents and test results still need review.'])}

05 / ${tx(['PERSOONLIJKE REFLECTIE','PERSONAL REFLECTION'])}

${tx(['Het verhaal achter mijn bijdrage.','The story behind my contribution.'])}

${tx(['Nog aan te vullen door Alvin: welke onderdelen heb ik zelf gemaakt, met wie werkte ik samen, welke feedback kreeg ik en wat zou ik anders doen?','To be completed by Alvin: which parts did I build myself, who did I work with, what feedback did I receive, and what would I do differently?'])}

${p.codes.map(c=>go(`evidence/${c}`,esc(c),'tag')).join('')}
`; } function evidence(filter = '') { const selected = processes.some(p=>p.code === filter) ? filter : ''; return `

02 / ${tx(['EXAMENPORTFOLIO','EXAM PORTFOLIO'])}

${tx(['Van werk','From work'])}
${tx(['naar bewijs.','to evidence.'])}

${tx(['Bronnen per werkproces. Een navigeerbare voorbereiding op mijn examen, met zichtbaar onderscheid tussen gevonden materiaal en wat nog ontbreekt.','Sources by work process. A navigable preparation for my exam, making the distinction between located material and missing evidence visible.'])}

${tx(['In opbouw. Koppelingen zijn voorlopig; aanwezigheid van code of een document bewijst nog geen beheersing. Persoonlijke bijdrage, resultaten en beoordeling moeten worden toegevoegd. Stem de definitieve bewijslast af met de examinator.','In progress. Mappings are provisional; code or a document alone does not demonstrate competence. Personal contributions, results, and assessment need to be added. Agree the final evidence requirements with the examiner.'])}

${processes.filter(p=>!selected||p.code===selected).map(processRow).join('')}

SBB / 25998 / 2024

${tx(['Deze index volgt de acht beroepsspecifieke werkprocessen uit het gekoppelde dossier. Generieke vakken, keuzedelen en VISTA-examenafspraken vallen buiten deze index. Engelse labels zijn eigen vertalingen.','This index follows the eight vocational work processes in the linked qualification. General subjects, electives, and VISTA exam arrangements are outside this index. English labels are informal translations.'])}

${ext(profile.qualification,tx(['Lees het officiële kwalificatiedossier','Read the official qualification document']),'text-link')}
`; } function processRow(p) { const found = projects.flatMap(project=>project.evidence.filter(e=>e.codes.includes(p.code)).map(e=>({project,e}))); return `
${esc(p.code)}${tx(p.title)}${found.length ? `${found.length} ${tx(found.length === 1 ? ['bron','source'] : ['bronnen','sources'])}` : tx(['Aanvullen','To add'])}

${tx(p.description)}

${found.length?`

${tx(['Te controleren: inhoud, eigen bijdrage en geschiktheid voor het examen.','To verify: contents, personal contribution, and suitability for the exam.'])}

`:`
${tx(['Nog geen bewijs geselecteerd. Voeg een eigen document, feedback of een concreet projectvoorbeeld toe.','No evidence selected yet. Add your own document, feedback, or a specific project example.'])}
`}
`; } function about() { return `

03 / ${tx(['OVER MIJ','ABOUT ME'])}

Alvin
Zilverstand.

${tx(['Software Developer in opleiding. Derdejaars bij VISTA college in Heerlen.','Software Developer in training. Third-year student at VISTA college in Heerlen.'])}

${tx(['Leren door te bouwen.','Learning by building.'])}

${tx(['Mijn projecten lopen uiteen van websites en PHP-applicaties tot narrowcasting, een muziekgame, desktopsoftware en beheerscripts. Dit portfolio brengt de projecten en de bijbehorende bronnen bij elkaar.','My projects range from websites and PHP applications to narrowcasting, a music game, desktop software, and administration scripts. This portfolio brings those projects and their sources together.'])}

${tx(['Ik bouw dit portfolio voor mijn eindexamen. Daarna wil ik het verder gebruiken om mijn werk aan toekomstige werkgevers te laten zien.','I’m building this portfolio for my final exam. After that, I want to keep using it to show my work to future employers.'])}

${tx(['Opleiding','Course'])}Software Developer
CampusVISTA · Heerlen
${tx(['Studiefase','Study stage'])}${tx(['Leerjaar 3','Year 3'])}
${tx(['Werk & broncode','Work & source'])}GitHub + Gitea

${tx(['VERDER KIJKEN','TAKE A CLOSER LOOK'])}

${tx(['De rest staat in de repositories.','There’s more in the repositories.'])}

${ext(profile.github,'GitHub','button primary')}${ext(profile.gitea,'Gitea','button')}

${tx(['Een rechtstreeks contactadres en cv worden later toegevoegd.','A direct contact address and CV will be added later.'])}

`; } function render(focus = false) { document.documentElement.lang = lang; header(); footer(); const r = route(); let title = t(['Portfolio','Portfolio']); if (r === 'home') main.innerHTML = home(); else if (r === 'work') { main.innerHTML = work(); title = t(['Werk','Work']); } else if (r === 'about') { main.innerHTML = about(); title = t(['Over mij','About']); } else if (r === 'evidence' || r.startsWith('evidence/')) { main.innerHTML = evidence(r.split('/')[1]); title = t(['Bewijsindex','Evidence index']); document.querySelector('#process-filter').addEventListener('change', e => { location.hash = e.target.value ? `evidence/${e.target.value}` : 'evidence'; }); document.querySelector('#print').addEventListener('click', () => { document.querySelectorAll('.process').forEach(d=>d.open=true); window.print(); }); } else { const p = projects.find(p=>r === `project/${p.id}`); if (p) { main.innerHTML = detail(p); title = t(p.name); } else main.innerHTML = `

404

${tx(['Deze pagina bestaat niet.','This page does not exist.'])}

${go('home',tx(['Terug naar het begin','Back to home']),'button')}
`; } document.title = `${title} — Alvin Zilverstand`; if (focus) { main.focus({preventScroll:true}); window.scrollTo(0,0); } } window.addEventListener('hashchange',()=>render(true)); render();