G
GEMI CAE™
Controlled Application Engine · v5
🇬🇧
0%
Readiness
Personal Information
Your core identity details
Professional Summary
3–5 lines that open every door
Quick-fill by match:
Work Experience
Most recent first. Action verbs. Quantify.
Education
Degrees, diplomas, qualifications
Skills
Technical and professional competencies
Certifications
Professional qualifications & licences
Projects
Key achievements & independent work
Cover Letter
Country-tuned narrative to the employer
Application Readiness0%
Complete all sections to unlock export
📄 CV / Résumé
✉️ Cover Letter
Your Full Name
Professional Title
📧 email@example.com📞 +000 000 0000📍 City, Country
${name}
${val('inp-title')||''}
${[val('inp-email'),val('inp-phone'),val('inp-city'),val('inp-linkedin')].filter(Boolean).join(' | ')}
${val('inp-summary')?`Professional Summary
${val('inp-summary')}
`:''} ${STATE.experience.length?`Work Experience
${expSec}`:''} ${STATE.education.length?`Education
${eduSec}`:''} ${STATE.skills.length?`Skills
${skillsTxt}
`:''} ${STATE.certifications.length?`Certifications
${certSec}`:''} ${STATE.projects.length?`Projects
${projSec}`:''} ${clSection} `; const blob=new Blob([html],{type:'application/msword'}); const url=URL.createObjectURL(blob); const a=document.createElement('a'); a.href=url; a.download=(name.replace(/\s+/g,'_')||'CV')+'_GEMI_v5.doc'; a.click(); URL.revokeObjectURL(url); notify('Word document downloaded ✓','success'); } /* ════════════════════════════════════════ MODAL CONTROL ════════════════════════════════════════ */ function openModal(id){ document.getElementById(id).classList.add('open'); } function closeModal(id){ document.getElementById(id).classList.remove('open'); } function initModals(){ $$('[data-close]').forEach(btn=>btn.addEventListener('click',()=>closeModal(btn.dataset.close))); $$('.modal-overlay').forEach(o=>o.addEventListener('click',e=>{ if(e.target===o) o.classList.remove('open'); })); } /* ════════════════════════════════════════ WIRE ALL BUTTONS ════════════════════════════════════════ */ function initButtons(){ // Nav document.getElementById('btn-audit').addEventListener('click', openAuditModal); document.getElementById('audit-trigger').addEventListener('click', openAuditModal); document.getElementById('audit-autofix').addEventListener('click', ()=>{ autoFixAll(); closeModal('modal-audit'); }); document.getElementById('btn-autofix').addEventListener('click', autoFixAll); document.getElementById('btn-export-word').addEventListener('click', exportWord); document.getElementById('btn-export-pdf').addEventListener('click', ()=>{ setPreviewMode('cv'); setTimeout(()=>window.print(),300); }); document.getElementById('btn-grammar-header').addEventListener('click', ()=>openGrammarChecker(null)); // Entry add buttons ['exp','edu','cert','proj'].forEach(type=>{ document.getElementById('add-'+type+'-btn').addEventListener('click', ()=>({exp:addExpEntry,edu:addEduEntry,cert:addCertEntry,proj:addProjEntry})[type]()); document.getElementById('add-'+type+'-alt').addEventListener('click', ()=>({exp:addExpEntry,edu:addEduEntry,cert:addCertEntry,proj:addProjEntry})[type]()); }); // Humanizer $$('.mode-btn').forEach(btn=>btn.addEventListener('click',()=>{ $$('.mode-btn').forEach(b=>b.classList.remove('active')); btn.classList.add('active'); STATE.humanMode=btn.dataset.mode; const orig=document.getElementById('human-original').value; if(orig) runHumanize(orig,STATE.humanMode); })); document.getElementById('humanize-regen').addEventListener('click',()=>{ runHumanize(document.getElementById('human-original').value, STATE.humanMode); }); document.getElementById('humanize-apply').addEventListener('click',()=>{ const enhanced=document.getElementById('human-enhanced').value; if(STATE.currentHumanField){ const el=document.getElementById(STATE.currentHumanField); if(el){ el.value=enhanced; el.dispatchEvent(new Event('input')); } } closeModal('modal-humanizer'); notify('Humanized text applied ✓','success'); }); // Grammar tabs $$('.grammar-tab').forEach(tab=>tab.addEventListener('click',()=>{ $$('.grammar-tab').forEach(t=>t.classList.remove('active')); tab.classList.add('active'); ['gtab-checker','gtab-preview','gtab-rewrite'].forEach(id=>document.getElementById(id).style.display='none'); document.getElementById('gtab-'+tab.dataset.gtab).style.display=''; })); document.getElementById('grammar-run-btn').addEventListener('click', runGrammarCheck); document.getElementById('grammar-clear-btn').addEventListener('click',()=>{ document.getElementById('grammar-input').value=''; document.getElementById('grammar-issues-container').innerHTML='Paste text above and click Analyse.
';
document.getElementById('grammar-stats-row').style.display='none';
});
document.getElementById('grammar-fix-errors').addEventListener('click',()=>{
const ta=document.getElementById('grammar-input');
ta.value=GRAMMAR.autoCorrect(ta.value,['error']);
runGrammarCheck(); notify('Errors fixed ✓','success');
});
document.getElementById('grammar-fix-all').addEventListener('click',()=>{
const ta=document.getElementById('grammar-input');
ta.value=GRAMMAR.autoCorrect(ta.value,['error','warning']);
runGrammarCheck(); notify('Errors & warnings fixed ✓','success');
});
document.getElementById('grammar-apply-rewrite').addEventListener('click',()=>{
const rewritten=document.getElementById('rewrite-output').value;
if(STATE.currentGrammarField){
const el=document.getElementById(STATE.currentGrammarField);
if(el){ el.value=rewritten; el.dispatchEvent(new Event('input')); }
}
closeModal('modal-grammar'); notify('Smart rewrite applied ✓','success');
});
// Delegated: humanize / pick / grammar buttons
document.addEventListener('click', e=>{
const hb=e.target.closest('[data-humanize]');
if(hb) openHumanizer(hb.dataset.humanize);
const pb=e.target.closest('[data-pick]');
if(pb){ const type=pb.dataset.pick; openPromptPicker(type, document.getElementById(type==='summary'?'inp-summary':type)); }
const gb=e.target.closest('[data-grammar]');
if(gb) openGrammarChecker(gb.dataset.grammar);
const pt=e.target.closest('#pick-title');
if(pt) openPromptPicker('titles', document.getElementById('inp-title'));
});
}
/* ════════════════════════════════════════
LIVE INPUT BINDINGS
════════════════════════════════════════ */
function initLiveInputs(){
['inp-firstname','inp-lastname','inp-title','inp-email','inp-phone','inp-city','inp-linkedin','inp-summary','inp-target-role','inp-target-company','cl-manager','cl-company','cl-position','cl-opening','cl-body','cl-closing'].forEach(id=>{
const el=document.getElementById(id);
if(el) el.addEventListener('input',()=>{ updatePreview(); updateReadiness(); });
});
document.getElementById('inp-industry').addEventListener('change',()=>{
STATE.prof=val('inp-industry');
refreshAllPills(); updateContextBadges(); updateCLContextBar(); updatePreview();
});
document.getElementById('inp-level').addEventListener('change',()=>{ loadSummaryPills(); });
}
/* ════════════════════════════════════════
INIT
════════════════════════════════════════ */
function init(){
initNav(); initCountry(); initSkills();
initLiveInputs(); initModals(); initButtons();
refreshAllPills(); updateContextBadges(); updateCLContextBar();
renderSkillsetButtons(); updatePreview(); updateReadiness();
setTimeout(()=>notify('GEMI CAE v5 ready — Select country + industry to align all templates',''),700);
}
document.addEventListener('DOMContentLoaded', init);
