BREAKING

What's your job's AI risk?

Type your job title and get your risk score, transferable skills, and a clear path forward — in seconds.

🔍

out of 10

It's not your job title that matters — it's what you can do.

These skills unlock paths you might not have considered.

Realistic careers you could move into

Start learning — no cost, no commitment

📰 Latest Career Compass Articles
{"id":"google-data-analytics","title":"Google Data Analytics Certificate","field":"Data & Analytics","description":"Learn data analysis, spreadsheets, SQL, R, and Tableau from Google — one of the most job-relevant free certificates available.","skill_tags":["numbers","data-entry","critical-thinking","spreadsheets","coding"],"time_to_complete":"3-6 months","cost_tier":"free","cost_detail":"Free to audit on Coursera (no certificate); ~$59/month for certificate","url":"https://www.coursera.org/professional-certificates/google-data-analytics","provider":"Google / Coursera","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"Audit for free — you get all the content, just no certificate. Widely recognised by NZ employers."}, {"id":"google-project-management","title":"Google Project Management Certificate","field":"Project Management","description":"Covers Agile, Scrum, stakeholder management, and project planning — directly applicable to PM and coordinator roles.","skill_tags":["organisation","communication","scheduling","leadership","problem-solving"],"time_to_complete":"3-6 months","cost_tier":"free","cost_detail":"Free to audit on Coursera; ~$59/month for certificate","url":"https://www.coursera.org/professional-certificates/google-project-management","provider":"Google / Coursera","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"Great transition for admin assistants, coordinators, and operations staff."}, {"id":"google-ux-design","title":"Google UX Design Certificate","field":"UX Design","description":"Comprehensive intro to UX research, wireframing, prototyping in Figma, and usability testing.","skill_tags":["visual-design","empathy","research","problem-solving","software"],"time_to_complete":"6 months","cost_tier":"free","cost_detail":"Free to audit on Coursera; ~$59/month for certificate","url":"https://www.coursera.org/professional-certificates/google-ux-design","provider":"Google / Coursera","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"Good transition for graphic designers moving into digital product work."}, {"id":"google-digital-marketing","title":"Google Digital Marketing & E-commerce Certificate","field":"Marketing","description":"Covers SEO, email marketing, social media, Shopify, and analytics — a complete digital marketing foundation.","skill_tags":["communication","seo","social-media","creativity","data-entry"],"time_to_complete":"3-6 months","cost_tier":"free","cost_detail":"Free to audit on Coursera; ~$59/month for certificate","url":"https://www.coursera.org/professional-certificates/google-digital-marketing-ecommerce","provider":"Google / Coursera","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"Excellent for retail workers, admin staff, and anyone wanting to move into marketing."}, {"id":"freecodecamp-web-dev","title":"freeCodeCamp – Web Development","field":"Web Development","description":"Completely free, browser-based coding curriculum covering HTML, CSS, JavaScript, React, Node.js, and databases.","skill_tags":["coding","logical-thinking","problem-solving","software","visual-design"],"time_to_complete":"6-12 months","cost_tier":"free","cost_detail":"100% free, always — no paywall","url":"https://www.freecodecamp.org","provider":"freeCodeCamp","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"6 certifications included. Millions of developers globally started here. No excuses not to start."}, {"id":"harvard-cs50","title":"Harvard CS50 – Introduction to Computer Science","field":"Computer Science","description":"Harvard's legendary intro to CS — teaches C, Python, SQL, and web development with exceptional quality, totally free.","skill_tags":["coding","logical-thinking","problem-solving","critical-thinking"],"time_to_complete":"3-6 months","cost_tier":"free","cost_detail":"100% free to audit on edX — certificate costs ~$149","url":"https://cs50.harvard.edu/x/","provider":"Harvard / edX","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"One of the best computer science courses ever made. Free certificate if you verify through edX for free tier."}, {"id":"salesforce-trailhead","title":"Salesforce Trailhead","field":"CRM & Sales Technology","description":"Gamified learning platform teaching Salesforce CRM — one of the highest-ROI free credentials for admin-to-tech career changes.","skill_tags":["customer-service","data-entry","organisation","software","communication"],"time_to_complete":"1-3 months","cost_tier":"free","cost_detail":"100% free — Salesforce funds it as a pipeline for their ecosystem","url":"https://trailhead.salesforce.com","provider":"Salesforce","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"Salesforce Admin certification (paid exam ~$200) pairs perfectly with free Trailhead learning. High demand in NZ."}, {"id":"hubspot-academy","title":"HubSpot Academy","field":"Marketing & Sales","description":"Free certifications in inbound marketing, content marketing, email marketing, sales, and CRM from HubSpot.","skill_tags":["communication","seo","social-media","writing","customer-service"],"time_to_complete":"1-4 weeks","cost_tier":"free","cost_detail":"100% free including certificates","url":"https://academy.hubspot.com","provider":"HubSpot","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"HubSpot certifications are well-recognised by NZ marketing agencies. Quick wins for career changers."}, {"id":"khan-academy-finance","title":"Khan Academy – Personal Finance & Accounting","field":"Finance","description":"Free, well-structured courses in personal finance, accounting basics, and economics — ideal foundations for finance career changers.","skill_tags":["numbers","critical-thinking","attention-to-detail","compliance"],"time_to_complete":"1-3 months","cost_tier":"free","cost_detail":"100% free, always","url":"https://www.khanacademy.org/economics-finance-domain","provider":"Khan Academy","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"Great foundation before moving to formal NZ accounting qualifications."}, {"id":"youtube-data-science","title":"YouTube – Data Science & Python (freeCodeCamp channel)","field":"Data Science","description":"Comprehensive free data science tutorials on Python, Pandas, Machine Learning — freeCodeCamp YouTube is world-class.","skill_tags":["numbers","coding","critical-thinking","logical-thinking","data-entry"],"time_to_complete":"3-6 months","cost_tier":"free","cost_detail":"Free — just need a YouTube account","url":"https://www.youtube.com/@freecodecamp","provider":"freeCodeCamp (YouTube)","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"Combine with freeCodeCamp.org for a complete self-taught data science path."}, {"id":"youtube-ux-design","title":"YouTube – UX Design (AJ&Smart channel)","field":"UX Design","description":"Practical UX design tutorials, design sprints, and career advice from one of the best UX channels on YouTube.","skill_tags":["visual-design","empathy","research","creativity","communication"],"time_to_complete":"Ongoing","cost_tier":"free","cost_detail":"Free","url":"https://www.youtube.com/@AJandSmart","provider":"AJ&Smart (YouTube)","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"Great supplement to the Google UX certificate — real-world, practical perspective."}, {"id":"te-wananga-business","title":"Te Wānanga o Aotearoa – Business Administration","field":"Business & Administration","description":"NZ-focused business admin qualification with a te ao Māori lens — accessible, affordable, and NZQA-recognised.","skill_tags":["organisation","communication","numbers","customer-service","compliance"],"time_to_complete":"6-12 months","cost_tier":"free","cost_detail":"Fees-free for eligible NZ learners under Fees Free scheme","url":"https://www.twoa.ac.nz/programmes/business","provider":"Te Wānanga o Aotearoa","nz_relevant":true,"can_do_while_working":true,"location_type":"nz-only","tier":"free","notes":"NZ-specific, NZQA-credited, fees-free for many. Face-to-face support available across NZ marae and centres."}, {"id":"te-wananga-digital","title":"Te Wānanga o Aotearoa – Digital Skills","field":"Digital Literacy","description":"Practical digital skills training covering Office tools, basic coding, and digital communication — NZ community-focused delivery.","skill_tags":["data-entry","software","communication","organisation"],"time_to_complete":"1-3 months","cost_tier":"free","cost_detail":"Fees-free for eligible NZ learners","url":"https://www.twoa.ac.nz/programmes","provider":"Te Wānanga o Aotearoa","nz_relevant":true,"can_do_while_working":true,"location_type":"nz-only","tier":"free","notes":"Face-to-face support across NZ — great for learners who struggle with fully online study."}, {"id":"nzqa-career-guidance","title":"Careers NZ – Career Planning Resources","field":"Career Planning","description":"Free career guidance, skills assessment, and retraining pathway mapping from the NZ government.","skill_tags":["assessment","research","communication","organisation"],"time_to_complete":"Self-paced","cost_tier":"free","cost_detail":"Completely free NZ government service","url":"https://www.careers.govt.nz","provider":"Tertiary Education Commission (TEC)","nz_relevant":true,"can_do_while_working":true,"location_type":"nz-only","tier":"free","notes":"Also offers free one-on-one career guidance sessions in person across NZ."}, {"id":"msd-training-support","title":"MSD Training Incentive Allowance","field":"Financial Support","description":"NZ government financial support for solo parents and people on benefits to retrain — covers course costs and childcare.","skill_tags":["organisation","compliance"],"time_to_complete":"Varies","cost_tier":"free","cost_detail":"Financial assistance — covers training costs up to certain thresholds","url":"https://www.workandincome.govt.nz/eligibility/training-for-work/training-incentive-allowance.html","provider":"Work and Income NZ (MSD)","nz_relevant":true,"can_do_while_working":false,"location_type":"nz-only","tier":"free","notes":"Check eligibility — many career changers qualify. Free money for retraining."}, {"id":"linkedin-learning-free","title":"LinkedIn Learning – Free Month Trial","field":"Professional Development","description":"LinkedIn Learning's full library free for 1 month — thousands of courses on tech, business, creativity, and leadership.","skill_tags":["communication","organisation","software","leadership","critical-thinking"],"time_to_complete":"1 month (free period)","cost_tier":"free","cost_detail":"1 month free, then ~$40/month NZD","url":"https://www.linkedin.com/learning/","provider":"LinkedIn","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"Free through many NZ public libraries — check your local council library for free access."}, {"id":"nz-library-linkedin","title":"LinkedIn Learning via NZ Public Libraries","field":"Professional Development","description":"Many NZ public libraries provide completely free LinkedIn Learning access with a library card.","skill_tags":["communication","software","organisation","creativity","problem-solving"],"time_to_complete":"Ongoing","cost_tier":"free","cost_detail":"Free with NZ public library membership","url":"https://www.aucklandlibraries.govt.nz/pages/linkedin-learning.aspx","provider":"Auckland Libraries / LinkedIn","nz_relevant":true,"can_do_while_working":true,"location_type":"nz-only","tier":"free","notes":"Auckland, Wellington, and many regional libraries offer this. Check your local library website."}, {"id":"aws-cloud-practitioner","title":"AWS Cloud Practitioner Essentials","field":"Cloud Computing","description":"AWS's free foundational cloud computing course — entry point to the highest-demand tech skills of the decade.","skill_tags":["technical-support","logical-thinking","coding","systems-thinking","problem-solving"],"time_to_complete":"1-2 months","cost_tier":"free","cost_detail":"Free training; exam costs ~$150 USD","url":"https://explore.skillbuilder.aws/learn/course/134/aws-cloud-practitioner-essentials","provider":"Amazon Web Services","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"AWS Cloud Practitioner cert is a strong CV addition for anyone moving into IT or tech support."}, {"id":"mit-opencourseware","title":"MIT OpenCourseWare – Computer Science","field":"Computer Science","description":"MIT's actual course materials — lectures, problem sets, and exams — free online for anyone to use.","skill_tags":["coding","logical-thinking","critical-thinking","problem-solving"],"time_to_complete":"6-18 months","cost_tier":"free","cost_detail":"Completely free — MIT publishes all materials openly","url":"https://ocw.mit.edu/","provider":"MIT","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"Challenging but highly credible. Perfect for career changers who want rigorous self-study."}, {"id":"openai-prompt-engineering","title":"DeepLearning.AI – Prompt Engineering for Developers","field":"AI Skills","description":"Free short course teaching how to work effectively with AI models — a critical skill for future-proofing any role.","skill_tags":["critical-thinking","communication","software","logical-thinking"],"time_to_complete":"1-2 weeks","cost_tier":"free","cost_detail":"Free on DeepLearning.AI","url":"https://www.deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/","provider":"DeepLearning.AI / OpenAI","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"Even non-technical workers benefit from understanding how to use AI tools effectively."}, {"id":"nz-certificate-business","title":"NZ Certificate in Business (Level 4)","field":"Business","description":"NZQA-accredited qualification in business fundamentals — recognised across NZ employers, delivered by polytechs.","skill_tags":["communication","organisation","numbers","compliance","critical-thinking"],"time_to_complete":"6-12 months","cost_tier":"low","cost_detail":"Fees-free if eligible; otherwise $1,000-$3,000 at NZ polytechs","url":"https://www.nzqa.govt.nz/qualifications-standards/qualifications/nzqf/","provider":"Various NZ Polytechs (Unitec, Ara, NMIT, etc.)","nz_relevant":true,"can_do_while_working":true,"location_type":"nz-only","tier":"paid","notes":"Available part-time at most NZ polytechs. Check Fees Free eligibility first."}, {"id":"coursera-ibm-data-science","title":"IBM Data Science Professional Certificate","field":"Data Science","description":"Comprehensive data science training including Python, machine learning, and data visualisation from IBM.","skill_tags":["numbers","coding","critical-thinking","logical-thinking","data-entry"],"time_to_complete":"6-12 months","cost_tier":"medium","cost_detail":"~$59/month on Coursera (audit free)","url":"https://www.coursera.org/professional-certificates/ibm-data-science","provider":"IBM / Coursera","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"paid","notes":"Pair with free audit of Google Data Analytics first to test if you enjoy it."}, {"id":"udemy-python-bootcamp","title":"Udemy – 100 Days of Code Python Bootcamp","field":"Python Programming","description":"The most popular Python course on Udemy — 60+ hours of video covering Python from zero to portfolio projects.","skill_tags":["coding","logical-thinking","problem-solving","data-entry","numbers"],"time_to_complete":"3-6 months","cost_tier":"low","cost_detail":"~$20-30 NZD on Udemy sale (runs constantly)","url":"https://www.udemy.com/course/100-days-of-code/","provider":"Udemy / Dr. Angela Yu","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"paid","notes":"Udemy runs sales constantly — never pay full price. Watch for $15-30 NZD deals."}, {"id":"udemy-web-dev-bootcamp","title":"Udemy – The Web Developer Bootcamp","field":"Web Development","description":"Comprehensive web dev course covering HTML, CSS, JavaScript, Node.js, MongoDB, and React.","skill_tags":["coding","visual-design","logical-thinking","problem-solving","software"],"time_to_complete":"6-12 months","cost_tier":"low","cost_detail":"~$20-30 NZD on Udemy sale","url":"https://www.udemy.com/course/the-web-developer-bootcamp/","provider":"Udemy / Colt Steele","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"paid","notes":"Supplement with freeCodeCamp for the best bang for buck."}, {"id":"unitec-it","title":"Bachelor of Computing Systems – Unitec","field":"Information Technology","description":"Three-year NZ degree in IT covering software development, networks, cybersecurity, and data management.","skill_tags":["coding","problem-solving","logical-thinking","systems-thinking","technical-support"],"time_to_complete":"3 years","cost_tier":"high","cost_detail":"~$7,000-$8,000 per year domestic fees","url":"https://www.unitec.ac.nz/study/information-technology","provider":"Unitec NZ","nz_relevant":true,"can_do_while_working":false,"location_type":"nz-only","tier":"paid","notes":"Full degree for those wanting deep expertise. Student loans available. Available in Auckland."}, {"id":"whitireia-nursing","title":"Bachelor of Nursing – Whitireia / WelTec","field":"Healthcare / Nursing","description":"NZQA-accredited three-year nursing degree leading to NZ nursing registration — one of the most job-secure career changes possible.","skill_tags":["empathy","physical-care","communication","clinical-knowledge","assessment"],"time_to_complete":"3 years","cost_tier":"high","cost_detail":"~$7,000/year domestic; student loan available","url":"https://www.whitireia.ac.nz/study/nursing","provider":"Whitireia / WelTec","nz_relevant":true,"can_do_while_working":false,"location_type":"nz-only","tier":"paid","notes":"NZ nursing shortage means virtually guaranteed employment. Best career change for empathetic people."}, {"id":"sitxhrm-health-social","title":"NZ Certificate in Health & Wellbeing (Level 4)","field":"Healthcare Support","description":"Entry pathway to healthcare support roles — covers personal care, health literacy, and working in NZ health settings.","skill_tags":["empathy","physical-care","communication","patience","assessment"],"time_to_complete":"6-12 months","cost_tier":"low","cost_detail":"Fees-free for eligible learners; otherwise $1,000-$2,500","url":"https://www.nzqa.govt.nz/qualifications-standards/qualifications/nzqf/","provider":"Various NZ polytechs and PTEs","nz_relevant":true,"can_do_while_working":true,"location_type":"nz-only","tier":"paid","notes":"First step into aged care, disability support, or community health roles."}, {"id":"trademe-jobs-upskill","title":"Trade Me Jobs – Skills Assessment","field":"Career Navigation","description":"Use Trade Me Jobs to research what skills NZ employers actually want — free market intelligence for career changers.","skill_tags":["research","organisation","communication"],"time_to_complete":"Self-paced","cost_tier":"free","cost_detail":"Free","url":"https://www.trademe.co.nz/a/jobs","provider":"Trade Me","nz_relevant":true,"can_do_while_working":true,"location_type":"nz-only","tier":"free","notes":"Most accurate picture of actual NZ job market. Search your target role and count what skills appear."}, {"id":"excel-power-bi","title":"Microsoft Excel & Power BI – Microsoft Learn","field":"Data & Analytics","description":"Free official Microsoft training on Excel, Power BI, and data analysis tools — immediately valuable for office workers.","skill_tags":["numbers","data-entry","spreadsheets","critical-thinking","organisation"],"time_to_complete":"1-3 months","cost_tier":"free","cost_detail":"Free on Microsoft Learn","url":"https://learn.microsoft.com/en-us/training/","provider":"Microsoft Learn","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"Free and directly applicable to most office jobs. Power BI certification is valuable for data roles."}, {"id":"figma-design","title":"Figma – Free Design Education","field":"UI/UX Design","description":"Figma's official free tutorials teaching UI/UX design using the industry-standard design tool.","skill_tags":["visual-design","software","creativity","attention-to-detail"],"time_to_complete":"1-2 months","cost_tier":"free","cost_detail":"Free — Figma provides education materials free","url":"https://help.figma.com/hc/en-us/categories/360002042553-Figma-design","provider":"Figma","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"Figma is the industry standard for UI/UX design. Learning it is essential for any design career pivot."}, {"id":"youtube-woodworking","title":"YouTube – Trades Skills (various channels)","field":"Trades","description":"Thousands of free tutorials on electrical basics, plumbing, carpentry, and HVAC — hands-on supplementary learning.","skill_tags":["physical-work","technical-knowledge","problem-solving","safety"],"time_to_complete":"Ongoing","cost_tier":"free","cost_detail":"Free","url":"https://www.youtube.com/results?search_query=electrical+basics+tutorial","provider":"YouTube","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"free","notes":"YouTube is excellent supplement to formal apprenticeships. Not a replacement for NZQA credentials."}, {"id":"nz-apprenticeship","title":"NZ Apprenticeship – Trades","field":"Trades","description":"Earn while you learn — NZ apprenticeships in electrical, plumbing, building, and automotive with NZQA credentials.","skill_tags":["physical-work","technical-knowledge","problem-solving","safety","attention-to-detail"],"time_to_complete":"3-4 years","cost_tier":"free","cost_detail":"Employer-funded — you are paid while learning","url":"https://www.nzapprenticeships.nz","provider":"BCITO / Competenz / NZ Government","nz_relevant":true,"can_do_while_working":true,"location_type":"nz-only","tier":"free","notes":"Best pathway for trades. You get paid while qualifying. NZ has a massive trades shortage."}, {"id":"linkedin-learning-paid","title":"LinkedIn Learning – Full Subscription","field":"Professional Development","description":"Access to 21,000+ courses in tech, business, and creative skills with LinkedIn profile integration and certificates.","skill_tags":["communication","leadership","software","organisation","creativity"],"time_to_complete":"Ongoing","cost_tier":"medium","cost_detail":"~$40/month NZD or ~$350/year","url":"https://www.linkedin.com/learning/","provider":"LinkedIn","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"paid","notes":"Check your local NZ public library first — may be free with library card."}, {"id":"coursera-plus","title":"Coursera Plus","field":"Multiple Fields","description":"Unlimited access to 7,000+ courses from top universities — Google, IBM, Meta, Johns Hopkins certificates included.","skill_tags":["coding","numbers","communication","critical-thinking","research"],"time_to_complete":"Ongoing","cost_tier":"medium","cost_detail":"~$70/month or ~$550/year USD","url":"https://www.coursera.org/courseraplus","provider":"Coursera","nz_relevant":true,"can_do_while_working":true,"location_type":"online","tier":"paid","notes":"Best value if doing multiple certificates. Remember you can audit most individual courses free."} ]; // ── State ── const state = { selectedJob: null, activeFilter: 'all' }; // ── DOM refs ── const input = document.getElementById('cc-input'); const dropdown = document.getElementById('cc-dropdown'); const results = document.getElementById('cc-results'); const resetBtn = document.getElementById('cc-reset'); const catsEl = document.getElementById('cc-categories'); // ── Helpers ── function capitalise(s) { return s.replace(/-/g,' ').replace(/\b\w/g, c => c.toUpperCase()); } function skillMatch(jobSkills, pathwaySkills) { if (!pathwaySkills || pathwaySkills.length === 0) return 0; const matches = jobSkills.filter(s => pathwaySkills.includes(s)).length; return Math.round((matches / pathwaySkills.length) * 100); } function fastCourse(p) { const t = (p.time_to_complete || '').toLowerCase(); const n = parseInt(t); if (isNaN(n)) return false; if (t.includes('week')) return n <= 12; if (t.includes('month')) return n < 3; return false; } function riskColors() { return { critical:'#ff4444', high:'#ff8800', medium:'#ffcc00', low:'#00e676' }; } // ── Build category buttons ── function buildCategories() { const cats = [...new Set(CC_JOBS.map(j => j.category))].sort(); catsEl.innerHTML = cats.map(c => `` ).join(''); catsEl.querySelectorAll('.cc-cat-btn').forEach(btn => { btn.addEventListener('click', () => { const cat = btn.dataset.cat; const jobs = CC_JOBS.filter(j => j.category === cat); showDropdownItems(jobs, true); input.value = ''; input.focus(); catsEl.querySelectorAll('.cc-cat-btn').forEach(b => b.classList.remove('active')); btn.classList.add('active'); }); }); } // ── Dropdown ── let focusedIdx = -1; function showDropdownItems(jobs, forceOpen) { dropdown.innerHTML = ''; focusedIdx = -1; if (!jobs.length) { dropdown.innerHTML = '
No matches found
'; dropdown.classList.add('open'); return; } jobs.slice(0, 12).forEach((job, i) => { const item = document.createElement('div'); item.className = 'cc-dropdown-item'; item.setAttribute('role','option'); item.dataset.idx = i; item.innerHTML = `${job.title}${job.category}`; item.addEventListener('click', () => selectJob(job)); dropdown.appendChild(item); }); dropdown.classList.add('open'); } function closeDropdown() { dropdown.classList.remove('open'); focusedIdx = -1; } // ── Debounce ── let debTimer; input.addEventListener('input', () => { clearTimeout(debTimer); debTimer = setTimeout(() => { const q = input.value.trim().toLowerCase(); if (q.length < 1) { closeDropdown(); return; } const matches = CC_JOBS.filter(j => j.title.toLowerCase().includes(q) || j.category.toLowerCase().includes(q) || (j.skill_clusters || []).some(s => s.includes(q)) ); showDropdownItems(matches); }, 280); }); input.addEventListener('focus', () => { if (input.value.trim().length > 0) { const q = input.value.trim().toLowerCase(); const matches = CC_JOBS.filter(j => j.title.toLowerCase().includes(q)); if (matches.length) showDropdownItems(matches); } }); // Keyboard nav input.addEventListener('keydown', (e) => { const items = dropdown.querySelectorAll('.cc-dropdown-item'); if (!items.length) return; if (e.key === 'ArrowDown') { e.preventDefault(); focusedIdx = Math.min(focusedIdx + 1, items.length - 1); items.forEach((el,i) => el.classList.toggle('focused', i === focusedIdx)); } else if (e.key === 'ArrowUp') { e.preventDefault(); focusedIdx = Math.max(focusedIdx - 1, 0); items.forEach((el,i) => el.classList.toggle('focused', i === focusedIdx)); } else if (e.key === 'Enter' && focusedIdx >= 0) { e.preventDefault(); const q = input.value.trim().toLowerCase(); const matches = CC_JOBS.filter(j => j.title.toLowerCase().includes(q)); if (matches[focusedIdx]) selectJob(matches[focusedIdx]); } else if (e.key === 'Escape') { closeDropdown(); } }); document.addEventListener('click', (e) => { if (!e.target.closest('.cc-search-input-wrap')) closeDropdown(); }); // ── Select a job ── function selectJob(job) { state.selectedJob = job; state.activeFilter = 'all'; input.value = job.title; closeDropdown(); catsEl.querySelectorAll('.cc-cat-btn').forEach(b => b.classList.remove('active')); resetBtn.style.display = 'inline-flex'; renderResults(job); } // ── Render all results ── function renderResults(job) { renderRisk(job); renderSkills(job); renderPathways(job); renderResources(job); results.style.display = 'block'; requestAnimationFrame(() => { results.classList.add('visible'); results.scrollIntoView({ behavior:'smooth', block:'start' }); }); } // ── Section B: Risk ── function renderRisk(job) { document.getElementById('cc-job-title').textContent = job.title; document.getElementById('cc-job-category').textContent = '📁 ' + job.category; document.getElementById('cc-risk-reason').textContent = job.risk_reason || ''; const colors = riskColors(); const risk = job.ai_risk || 'medium'; const score = job.ai_risk_score || 5; const col = colors[risk] || '#ffcc00'; const labels = { critical:'⚠️ Critical Risk', high:'🔶 High Risk', medium:'🟡 Medium Risk', low:'🟢 Low Risk' }; const badge = document.getElementById('cc-risk-badge'); badge.className = 'cc-risk-badge ' + risk; badge.textContent = labels[risk] || risk; document.getElementById('cc-score-label').textContent = score + '/10'; document.getElementById('cc-score-label').style.color = col; // Needle: score 1 = left (−90°), score 10 = right (+90°) const angle = -90 + ((score - 1) / 9) * 180; document.getElementById('cc-needle').style.transform = `translateX(-50%) rotate(${angle}deg)`; document.getElementById('cc-needle').style.background = col; } // ── Section C: Skills ── function renderSkills(job) { const tags = document.getElementById('cc-skills-tags'); const skills = job.skill_clusters || []; tags.innerHTML = skills.map(s => `${capitalise(s)}` ).join(''); const note = document.getElementById('cc-region-note'); if (job.region_notes && job.region_notes.trim()) { note.innerHTML = '🇳🇿 ' + job.region_notes; note.style.display = 'block'; } else { note.style.display = 'none'; } } // ── Section D: Pathways ── function renderPathways(job) { const grid = document.getElementById('cc-pathways-grid'); const skills = job.skill_clusters || []; // Score each pathway const scored = CC_PATHWAYS.map(p => ({ ...p, match: skillMatch(skills, p.skill_tags || []) })) .filter(p => p.match > 0) .sort((a,b) => { if (b.match !== a.match) return b.match - a.match; // Secondary: free first if (a.tier === 'free' && b.tier !== 'free') return -1; if (b.tier === 'free' && a.tier !== 'free') return 1; return 0; }) .slice(0, 6); if (!scored.length) { grid.innerHTML = '

No direct pathway matches — try exploring the resources below.

'; return; } // Get paid pathways for "go deeper" const allPaid = CC_PATHWAYS.filter(p => p.tier === 'paid' || p.cost_tier !== 'free'); grid.innerHTML = scored.map(p => { const nzBadge = p.nz_relevant ? '🇳🇿 NZ' : ''; const paidMatches = allPaid .filter(pp => skillMatch(skills, pp.skill_tags || []) > 0) .slice(0, 3); const deeperHTML = paidMatches.length ? `

🤝 Some links below are affiliate links — we may earn a small commission if you enroll, at no extra cost to you. Free options are always shown first.

` + paidMatches.map(pp => { const linkUrl = pp.url_affiliate || pp.url || '#'; return `
${pp.title}
${pp.cost_detail || ''}
View course →
`; }).join('') : '

No paid alternatives found for this pathway.

'; return `

${p.title}

${p.match}% match
⏱ ${p.time_to_complete || 'Varies'} ${nzBadge} ${p.can_do_while_working ? '✅ While working' : ''}
🆓 Free start
${p.title}
${p.cost_detail || ''} · ${p.provider || ''}
Start for free →
${deeperHTML}
`; }).join(''); } // ── Section E: Resources ── function renderResources(job) { const grid = document.getElementById('cc-resources-grid'); const skills = job.skill_clusters || []; const matched = CC_PATHWAYS .filter(p => skillMatch(skills, p.skill_tags || []) > 0) .sort((a,b) => { // Free first if (a.tier === 'free' && b.tier !== 'free') return -1; if (b.tier === 'free' && a.tier !== 'free') return 1; return 0; }); if (!matched.length) { grid.innerHTML = '
No matching resources — explore the pathways above.
'; return; } grid.innerHTML = matched.map(p => { const isFree = p.tier === 'free' || p.cost_tier === 'free'; const isNZ = p.nz_relevant && (p.location_type === 'nz-only' || p.nz_relevant); const isFast = fastCourse(p); return `
${p.title} ${isFree ? 'Free' : 'Paid'}
${p.provider || ''}
⏱ ${p.time_to_complete || 'Varies'} ${p.nz_relevant ? '🇳🇿' : ''} ${p.can_do_while_working ? '✅ While working' : ''}
${p.notes ? `
${p.notes}
` : ''} Start learning →
`; }).join(''); applyFilter('all'); } // ── Filter tabs ── function applyFilter(filter) { state.activeFilter = filter; document.querySelectorAll('#cc-filter-tabs .cc-filter-tab').forEach(t => { t.classList.toggle('active', t.dataset.filter === filter); }); document.querySelectorAll('#cc-resources-grid .cc-resource-card').forEach(card => { let show = true; if (filter === 'free') show = card.dataset.free === 'true'; else if (filter === 'nz') show = card.dataset.nz === 'true'; else if (filter === 'fast') show = card.dataset.fast === 'true'; card.dataset.hidden = !show; card.style.display = show ? '' : 'none'; }); const visible = document.querySelectorAll('#cc-resources-grid .cc-resource-card:not([data-hidden="true"])'); const noRes = document.querySelector('#cc-resources-grid .cc-no-results'); if (!visible.length && !noRes) { const d = document.createElement('div'); d.className = 'cc-no-results'; d.id = 'cc-no-filter-results'; d.textContent = 'No resources match this filter. Try "All".'; document.getElementById('cc-resources-grid').appendChild(d); } else { const old = document.getElementById('cc-no-filter-results'); if (old) old.remove(); } } document.getElementById('cc-filter-tabs').addEventListener('click', (e) => { const btn = e.target.closest('.cc-filter-tab'); if (btn) applyFilter(btn.dataset.filter); }); // ── Reset ── resetBtn.addEventListener('click', () => { state.selectedJob = null; input.value = ''; results.classList.remove('visible'); setTimeout(() => { results.style.display = 'none'; }, 300); resetBtn.style.display = 'none'; catsEl.querySelectorAll('.cc-cat-btn').forEach(b => b.classList.remove('active')); input.focus(); }); // ── Init ── buildCategories(); })();