ascensiumconsultation.com

'); printWin.document.close(); setTimeout(function(){ printWin.print(); }, 600); } function generatePDF() { state.generating = true; render(); loadJsPDF(function(success) { if (!success) { // Fallback: open print-friendly page printResults(); state.generating = false; render(); return; } setTimeout(function() { try { var jsPDF = window.jspdf.jsPDF; var doc = new jsPDF({ orientation: "portrait", unit: "mm", format: "a4" }); var pageW = 210, margin = 20, contentW = pageW - margin * 2; var y = 0; var charcoal = [45,52,54], gold = [184,134,11], olive = [74,82,64]; var cream = [250,248,245], white = [255,255,255]; var red = [192,57,43], orange = [230,126,34], green = [74,82,64]; function scoreColor(s) { if(s<=40) return red; if(s<=70) return orange; return green; } function wrap(text, maxW, fs) { doc.setFontSize(fs); return doc.splitTextToSize(text, maxW); } function checkPage(needed) { if(y+needed>275){doc.addPage();y=20;} } var totalScore = getTotalScore(); var level = getLevel(totalScore); var config = levelConfig[level]; // PAGE 1 - COVER doc.setFillColor(...cream); doc.rect(0,0,210,297,"F"); doc.setFillColor(...gold); doc.rect(0,0,210,3,"F"); y = 45; doc.setFont("helvetica","bold"); doc.setFontSize(28); doc.setTextColor(...charcoal); doc.text("ASCENSIUM", pageW/2, y, {align:"center"}); y += 8; doc.setFont("helvetica","normal"); doc.setFontSize(9); doc.setTextColor(...olive); doc.text("CONSULTATION", pageW/2, y, {align:"center", charSpace:3}); y += 16; doc.setFillColor(...gold); doc.rect(pageW/2-15, y, 30, 0.8, "F"); y += 20; doc.setFont("helvetica","bold"); doc.setFontSize(26); doc.setTextColor(...charcoal); doc.text("Diagnostic de maturité", pageW/2, y, {align:"center"}); y += 10; doc.text("opérationnelle", pageW/2, y, {align:"center"}); y += 12; doc.setFont("helvetica","normal"); doc.setFontSize(11); doc.setTextColor(...olive); doc.text("Du chaos à l'harmonie", pageW/2, y, {align:"center", charSpace:2}); y += 25; doc.setFillColor(...white); doc.roundedRect(margin+20, y, contentW-40, 36, 3, 3, "F"); y += 14; doc.setFont("helvetica","bold"); doc.setFontSize(14); doc.setTextColor(...charcoal); doc.text(state.userName || "Participant", pageW/2, y, {align:"center"}); if (state.userCompany) { y += 8; doc.setFont("helvetica","normal"); doc.setFontSize(11); doc.setTextColor(...olive); doc.text(state.userCompany, pageW/2, y, {align:"center"}); } y += 10; doc.setFontSize(9); doc.setTextColor(150,150,150); var today = new Date().toLocaleDateString("fr-CA", {year:"numeric",month:"long",day:"numeric"}); doc.text(today, pageW/2, y, {align:"center"}); y += 30; var sc = scoreColor(totalScore); doc.setFillColor(...white); doc.circle(pageW/2, y+22, 28, "F"); doc.setDrawColor(...sc); doc.setLineWidth(1.5); doc.circle(pageW/2, y+22, 28, "S"); doc.setFont("helvetica","bold"); doc.setFontSize(36); doc.setTextColor(...sc); doc.text(""+totalScore, pageW/2, y+20, {align:"center"}); doc.setFontSize(11); doc.setTextColor(150,150,150); doc.text("/ 100", pageW/2, y+30, {align:"center"}); y += 60; doc.setFont("helvetica","bold"); doc.setFontSize(13); doc.setTextColor(...sc); doc.text(config.label.toUpperCase(), pageW/2, y, {align:"center", charSpace:2}); y += 12; doc.setFont("helvetica","normal"); doc.setFontSize(10); doc.setTextColor(...charcoal); var descL = wrap(config.description, contentW-30, 10); descL.forEach(function(l) { doc.text(l, pageW/2, y, {align:"center"}); y+=5; }); doc.setFillColor(...charcoal); doc.rect(0,285,210,12,"F"); doc.setFont("helvetica","normal"); doc.setFontSize(8); doc.setTextColor(200,200,200); doc.text("ascensiumconsultation.com", pageW/2, 292, {align:"center", charSpace:1}); // PAGE 2 - RADAR doc.addPage(); doc.setFillColor(...cream); doc.rect(0,0,210,297,"F"); doc.setFillColor(...gold); doc.rect(0,0,210,1.5,"F"); y = 22; doc.setFont("helvetica","bold"); doc.setFontSize(18); doc.setTextColor(...charcoal); doc.text("Votre portrait par dimension", pageW/2, y, {align:"center"}); y += 5; doc.setFillColor(...gold); doc.rect(pageW/2-12, y, 24, 0.6, "F"); y += 8; var radarData = categories.map(function(c,i){ return {dimension:c.shortName, score:getCategoryScore(i)}; }); var cvs = document.createElement("canvas"); cvs.width=500; cvs.height=500; drawRadar(cvs, radarData, 500); var img = cvs.toDataURL("image/png"); doc.addImage(img, "PNG", margin+20, y, contentW-40, contentW-40); y += contentW-40+10; doc.setFont("helvetica","bold"); doc.setFontSize(12); doc.setTextColor(...charcoal); doc.text("SCORES INDIVIDUELS", pageW/2, y, {align:"center", charSpace:1}); y += 10; var cardW = (contentW-8)/2; categories.forEach(function(cat, i) { var col = i%2, row = Math.floor(i/2); var cx = margin + col*(cardW+8), cy = y + row*20; var s = getCategoryScore(i), c = scoreColor(s); doc.setFillColor(...white); doc.roundedRect(cx, cy, cardW, 16, 2, 2, "F"); doc.setDrawColor(...c); doc.setLineWidth(0.8); doc.line(cx+1,cy+3,cx+1,cy+13); doc.setFont("helvetica","normal"); doc.setFontSize(10); doc.setTextColor(...charcoal); doc.text(cat.shortName, cx+6, cy+10.5); doc.setFont("helvetica","bold"); doc.setFontSize(14); doc.setTextColor(...c); doc.text(""+s, cx+cardW-8, cy+11, {align:"right"}); }); doc.setFillColor(...charcoal); doc.rect(0,285,210,12,"F"); doc.setFont("helvetica","normal"); doc.setFontSize(8); doc.setTextColor(200,200,200); doc.text("ascensiumconsultation.com", pageW/2, 292, {align:"center", charSpace:1}); // PAGE 3 - RECOMMENDATIONS doc.addPage(); doc.setFillColor(...cream); doc.rect(0,0,210,297,"F"); doc.setFillColor(...gold); doc.rect(0,0,210,1.5,"F"); y = 22; doc.setFont("helvetica","bold"); doc.setFontSize(18); doc.setTextColor(...charcoal); doc.text("Recommandations par dimension", pageW/2, y, {align:"center"}); y += 5; doc.setFillColor(...gold); doc.rect(pageW/2-12, y, 24, 0.6, "F"); y += 12; var sorted = categories.map(function(c,i){return{id:c.id,name:c.name,score:getCategoryScore(i)};}).sort(function(a,b){return a.score-b.score;}); sorted.forEach(function(cat) { var cl = getCategoryLevel(cat.score); var rec = categoryRecommendations[cat.id][cl]; var c = scoreColor(cat.score); checkPage(40); doc.setFillColor(...white); doc.roundedRect(margin, y, contentW, 10, 2, 2, "F"); doc.setDrawColor(...c); doc.setLineWidth(1); doc.line(margin+1,y+2,margin+1,y+8); doc.setFont("helvetica","bold"); doc.setFontSize(11); doc.setTextColor(...charcoal); doc.text(cat.name, margin+6, y+7); doc.setFont("helvetica","bold"); doc.setFontSize(12); doc.setTextColor(...c); doc.text(cat.score+"/100", margin+contentW-4, y+7, {align:"right"}); y += 14; doc.setFont("helvetica","normal"); doc.setFontSize(10); doc.setTextColor(85,85,85); var rl = wrap(rec, contentW-4, 10); rl.forEach(function(l){ checkPage(6); doc.text(l, margin+2, y); y+=5; }); y += 8; }); checkPage(60); y += 4; doc.setFillColor(...charcoal); doc.roundedRect(margin, y, contentW, 50, 3, 3, "F"); doc.setFont("helvetica","bold"); doc.setFontSize(14); doc.setTextColor(...gold); doc.text("Notre recommandation", margin+10, y+12); doc.setFont("helvetica","normal"); doc.setFontSize(10); doc.setTextColor(220,220,220); var rg = wrap(config.recommendation, contentW-20, 10); var ry = y+20; rg.forEach(function(l){ doc.text(l, margin+10, ry); ry+=5; }); y += 58; checkPage(45); doc.setFillColor(...white); doc.roundedRect(margin, y, contentW, 40, 3, 3, "F"); doc.setFont("helvetica","bold"); doc.setFontSize(14); doc.setTextColor(...charcoal); doc.text("Passez a l'action", pageW/2, y+12, {align:"center"}); doc.setFont("helvetica","normal"); doc.setFontSize(10); doc.setTextColor(100,100,100); var ct = wrap("Reservez un appel diagnostic de 30 minutes avec Isa pour interpreter vos resultats et creer votre feuille de route des 90 prochains jours.", contentW-20, 10); var cty = y+20; ct.forEach(function(l){ doc.text(l, pageW/2, cty, {align:"center"}); cty+=5; }); doc.setFont("helvetica","bold"); doc.setFontSize(9); doc.setTextColor(...gold); doc.text("ascensiumconsultation.com", pageW/2, cty+4, {align:"center"}); doc.setFillColor(...charcoal); doc.rect(0,285,210,12,"F"); doc.setFont("helvetica","normal"); doc.setFontSize(8); doc.setTextColor(200,200,200); doc.text("ascensiumconsultation.com", pageW/2, 292, {align:"center", charSpace:1}); var safeName = (state.userName||"diagnostic").replace(/[^a-zA-Z0-9]/g, "_"); doc.save("Diagnostic_Ascensium_"+safeName+".pdf"); } catch(e) { console.error("PDF error:", e); alert("Erreur lors de la génération du PDF. Veuillez réessayer."); } state.generating = false; render(); }, 100); }); // end loadJsPDF } // ─── RENDER ─── function render() { if (state.screen === "intro") renderIntro(); else if (state.screen === "questions") renderQuestions(); else if (state.screen === "results") renderResults(); } function renderIntro() { root.innerHTML = '
' + '
' + '
ASCENSIUM
' + '
Consultation
' + '
' + '
' + '

Diagnostic de maturité
opérationnelle

' + '

Du chaos à l\'harmonie

' + '
' + '

80 % du chaos en entreprise provient de 5 lacunes opérationnelles prévisibles. Ce diagnostic vous permet d\'identifier exactement où se situent vos zones de fragilité.

' + '

En moins de 5 minutes, évaluez votre maturité opérationnelle à travers 25 questions couvrant 5 dimensions essentielles :

' + categories.map(function(c) { return '
' + c.icon + '' + c.name + '
'; }).join("") + '
' + '
' + '

Vos coordonnées

' + '
' + '' + '' + '
' + '
' + '' + '' + '
' + '
' + '' + '' + '
' + '
' + '' + '

Temps estimé : 5 minutes ◇ 25 questions ◇ Résultats instantanés

' + '
'; var nameInput = document.getElementById("diagName"); var emailInput = document.getElementById("diagEmail"); var companyInput = document.getElementById("diagCompany"); var startBtn = document.getElementById("diagStart"); function updateBtn() { state.userName = nameInput.value; state.userEmail = emailInput.value; state.userCompany = companyInput.value; startBtn.disabled = !state.userName.trim(); } nameInput.addEventListener("input", updateBtn); emailInput.addEventListener("input", updateBtn); companyInput.addEventListener("input", updateBtn); updateBtn(); startBtn.addEventListener("click", function() { if (state.userName.trim()) { state.screen = "questions"; state.currentCategory = 0; render(); window.scrollTo(0, 0); } }); } function renderQuestions() { var ci = state.currentCategory; var cat = categories[ci]; var prog = progressPercent(); var tabsHtml = categories.map(function(c, i) { var cls = "diag-tab"; if (i === ci) cls += " active"; if (allCategoryAnswered(i)) cls += " completed"; return ''; }).join(""); var questionsHtml = cat.questions.map(function(q, qi) { var key = ci + "-" + qi; var val = state.answers[key]; var yesClass = "diag-answer-btn" + (val === true ? " selected-yes" : ""); var noClass = "diag-answer-btn" + (val === false ? " selected-no" : ""); return '
' + '
' + '

' + (qi+1) + '.' + q + '

' + '
' + '' + '' + '
' + '
' + '
'; }).join(""); var nextDisabled = !allCategoryAnswered(ci); var isLast = ci === 4; root.innerHTML = '
' + '
' + '
' + 'Progression' + '' + prog + ' %' + '
' + '
' + '
' + '
' + tabsHtml + '
' + '
' + '
Dimension ' + (ci+1) + ' sur 5
' + '

' + cat.name + '

' + '
' + '
' + questionsHtml + '
' + '
' + '' + (isLast ? '' : '' ) + '
' + '
'; // Events document.querySelectorAll(".diag-tab").forEach(function(tab) { tab.addEventListener("click", function() { state.currentCategory = parseInt(this.dataset.tab); render(); window.scrollTo(0, 0); }); }); document.querySelectorAll(".diag-answer-btn").forEach(function(btn) { btn.addEventListener("click", function() { var key = this.dataset.cat + "-" + this.dataset.q; state.answers[key] = this.dataset.val === "true"; render(); }); }); document.getElementById("diagPrev").addEventListener("click", function() { if (ci > 0) { state.currentCategory = ci - 1; } else { state.screen = "intro"; } render(); window.scrollTo(0, 0); }); document.getElementById("diagNext").addEventListener("click", function() { if (isLast && allAnswered()) { state.screen = "results"; } else if (!isLast && allCategoryAnswered(ci)) { state.currentCategory = ci + 1; } render(); window.scrollTo(0, 0); }); } function renderResults() { var totalScore = getTotalScore(); var level = getLevel(totalScore); var config = levelConfig[level]; var radarData = categories.map(function(c,i){ return {dimension:c.shortName, score:getCategoryScore(i)}; }); var scoresHtml = categories.map(function(cat, i) { var s = getCategoryScore(i); var c = getScoreColor(s); return '
' + '' + cat.shortName + '' + '' + s + '' + '
'; }).join(""); var sorted = categories.map(function(c,i){return{id:c.id,name:c.name,icon:c.icon,score:getCategoryScore(i)};}).sort(function(a,b){return a.score-b.score;}); var recsHtml = sorted.map(function(cat) { var cl = getCategoryLevel(cat.score); var rec = categoryRecommendations[cat.id][cl]; var c = getScoreColor(cat.score); return '
' + '
' + '

' + cat.icon + ' ' + cat.name + '

' + '' + cat.score + '/100' + '
' + '

' + rec + '

' + '
'; }).join(""); root.innerHTML = '
' + '
' + '
Résultats du diagnostic
' + '

' + (state.userName ? escHtml(state.userName) + ', voici' : 'Voici') + ' votre portrait opérationnel

' + (state.userCompany ? '

' + escHtml(state.userCompany) + '

' : '') + '
' + '
' + '
' + totalScore + '/100
' + '
' + config.label + '
' + '

' + config.description + '

' + '
' + '
' + '

Votre portrait par dimension

' + '' + '
' + scoresHtml + '
' + '
' + '
' + '

Recommandations par dimension

' + recsHtml + '
' + '
' + '

Notre recommandation

' + '

' + config.recommendation + '

' + '
' + '

« Les solutions qui fonctionnent ne viennent pas des livres de gestion, mais de la réalité entrepreneuriale. »
— Isa Hohn, fondatrice d\'Ascensium Consultation

' + '
' + '
' + '

Prêt·e à passer à l\'action ?

' + '

Réservez un appel diagnostic de 30 minutes avec Isa pour interpréter vos résultats et créer votre feuille de route des 90 prochains jours.

' + 'Réserver mon appel stratégique' + '

Sans engagement ◇ 30 minutes ◇ 100 % personnalisé

' + '
' + '
' + '' + '' + '
' + '' + '
'; // Draw radar var canvas = document.getElementById("diagRadar"); if (canvas) drawRadar(canvas, radarData, 440); document.getElementById("diagPDF").addEventListener("click", function() { if (!state.generating) generatePDF(); }); document.getElementById("diagRestart").addEventListener("click", function() { state.screen = "intro"; state.answers = {}; state.currentCategory = 0; render(); window.scrollTo(0, 0); }); } function escHtml(s) { return s.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""); } // ─── INIT ─── render(); })();
Scroll to Top