|
@@ -55,6 +55,7 @@ const state = {
|
|
|
optional: {},
|
|
optional: {},
|
|
|
result: null,
|
|
result: null,
|
|
|
emailUnlocked: false,
|
|
emailUnlocked: false,
|
|
|
|
|
+ unlockExiting: false,
|
|
|
captureEmail: '',
|
|
captureEmail: '',
|
|
|
notifyTool: '',
|
|
notifyTool: '',
|
|
|
roiInputs: { volume: '', tempsActuel: '', tempsCible: '', coutHoraire: '', tauxErreurs: '', tempsErreur: '', delaiActuel: '', delaiCible: '' },
|
|
roiInputs: { volume: '', tempsActuel: '', tempsCible: '', coutHoraire: '', tauxErreurs: '', tempsErreur: '', delaiActuel: '', delaiCible: '' },
|
|
@@ -118,7 +119,7 @@ async function apiJson(path, { method = 'GET', body } = {}) {
|
|
|
function setView(v) { state.view = v; render(); }
|
|
function setView(v) { state.view = v; render(); }
|
|
|
|
|
|
|
|
function goStart() {
|
|
function goStart() {
|
|
|
- Object.assign(state, { packId: null, pack: null, idx: 0, answers: {}, optional: {}, result: null, emailUnlocked: false, captureEmail: '' });
|
|
|
|
|
|
|
+ Object.assign(state, { packId: null, pack: null, idx: 0, answers: {}, optional: {}, result: null, emailUnlocked: false, unlockExiting: false, captureEmail: '' });
|
|
|
setView('landing');
|
|
setView('landing');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -178,7 +179,6 @@ function renderNotifyDialog() {
|
|
|
if (body) {
|
|
if (body) {
|
|
|
body.innerHTML = '';
|
|
body.innerHTML = '';
|
|
|
body.appendChild(h('div', { style: 'text-align:center;padding:20px 0' }, [
|
|
body.appendChild(h('div', { style: 'text-align:center;padding:20px 0' }, [
|
|
|
- h('div', { style: 'font-size:36px;margin-bottom:12px;color:var(--good)' }, ['✓']),
|
|
|
|
|
h('div', { class: 'h2', style: 'color:var(--good);margin-bottom:8px' }, ['C\'est noté !']),
|
|
h('div', { class: 'h2', style: 'color:var(--good);margin-bottom:8px' }, ['C\'est noté !']),
|
|
|
h('p', { class: 'lead' }, [`Vous serez parmi les premiers informés du lancement de ${toolName}.`]),
|
|
h('p', { class: 'lead' }, [`Vous serez parmi les premiers informés du lancement de ${toolName}.`]),
|
|
|
h('button', {
|
|
h('button', {
|
|
@@ -325,6 +325,7 @@ function renderIntro() {
|
|
|
state.optional = {};
|
|
state.optional = {};
|
|
|
state.idx = 0;
|
|
state.idx = 0;
|
|
|
state.emailUnlocked = false;
|
|
state.emailUnlocked = false;
|
|
|
|
|
+ state.unlockExiting = false;
|
|
|
state.captureEmail = '';
|
|
state.captureEmail = '';
|
|
|
saveProgress();
|
|
saveProgress();
|
|
|
setView('quiz');
|
|
setView('quiz');
|
|
@@ -606,13 +607,19 @@ function renderResults() {
|
|
|
const email = e.target.querySelector('input[type="email"]').value.trim();
|
|
const email = e.target.querySelector('input[type="email"]').value.trim();
|
|
|
if (!email.includes('@') || email.length < 5) return;
|
|
if (!email.includes('@') || email.length < 5) return;
|
|
|
state.captureEmail = email;
|
|
state.captureEmail = email;
|
|
|
- state.emailUnlocked = true;
|
|
|
|
|
- saveProgress();
|
|
|
|
|
|
|
+ state.unlockExiting = true;
|
|
|
render();
|
|
render();
|
|
|
- setTimeout(() => document.getElementById('pdfDialog')?.showModal(), 80);
|
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ state.emailUnlocked = true;
|
|
|
|
|
+ state.unlockExiting = false;
|
|
|
|
|
+ saveProgress();
|
|
|
|
|
+ render();
|
|
|
|
|
+ setTimeout(() => document.getElementById('pdfDialog')?.showModal(), 50);
|
|
|
|
|
+ }, 320);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- return h('div', { class: 'unlock-gate' }, [
|
|
|
|
|
|
|
+ const exiting = state.unlockExiting;
|
|
|
|
|
+ return h('div', { class: 'unlock-gate' + (exiting ? ' unlock-gate--exiting' : '') }, [
|
|
|
h('div', { class: 'unlock-gate__inner' }, [
|
|
h('div', { class: 'unlock-gate__inner' }, [
|
|
|
h('div', { class: 'unlock-gate__icon' }, ['↓']),
|
|
h('div', { class: 'unlock-gate__icon' }, ['↓']),
|
|
|
h('div', { class: 'h2', style: 'margin-bottom:6px' }, ['Débloquez vos axes d\'amélioration']),
|
|
h('div', { class: 'h2', style: 'margin-bottom:6px' }, ['Débloquez vos axes d\'amélioration']),
|
|
@@ -638,26 +645,29 @@ function renderResults() {
|
|
|
|
|
|
|
|
/* ── CTAs débloqués ── */
|
|
/* ── CTAs débloqués ── */
|
|
|
const renderUnlockedCtas = () =>
|
|
const renderUnlockedCtas = () =>
|
|
|
- h('div', { class: 'unlocked-ctas' }, [
|
|
|
|
|
|
|
+ h('div', { class: 'unlocked-ctas unlocked-ctas--entering' }, [
|
|
|
h('div', { class: 'unlocked-ctas__inner' }, [
|
|
h('div', { class: 'unlocked-ctas__inner' }, [
|
|
|
|
|
|
|
|
/* En-tête */
|
|
/* En-tête */
|
|
|
h('div', { class: 'h2', style: 'margin-bottom:6px' }, ['Et maintenant ?']),
|
|
h('div', { class: 'h2', style: 'margin-bottom:6px' }, ['Et maintenant ?']),
|
|
|
h('p', { class: 'lead', style: 'margin-bottom:24px' }, [
|
|
h('p', { class: 'lead', style: 'margin-bottom:24px' }, [
|
|
|
- 'Votre diagnostic révèle des opportunités concrètes. Nous pouvons vous aider à les transformer en plan d\'action avec les bons outils digitaux.',
|
|
|
|
|
|
|
+ 'Votre diagnostic révèle des opportunités concrètes. Réservez un entretien offert avec un consultant pour les prioriser et définir votre plan d\'action.',
|
|
|
]),
|
|
]),
|
|
|
|
|
|
|
|
/* CTAs commerciaux */
|
|
/* CTAs commerciaux */
|
|
|
h('div', { class: 'cta-block' }, [
|
|
h('div', { class: 'cta-block' }, [
|
|
|
- BOOKING_URL ? h('a', {
|
|
|
|
|
- class: 'btn btn--primary btn--cta-main',
|
|
|
|
|
- href: BOOKING_URL, target: '_blank', rel: 'noreferrer',
|
|
|
|
|
- }, ['📅\u00a0 Réserver un appel découverte gratuit — 30 min']) : null,
|
|
|
|
|
|
|
+ BOOKING_URL ? h('div', { style: 'display:flex;flex-direction:column;align-items:center;width:100%' }, [
|
|
|
|
|
+ h('span', { class: 'cta-offert' }, ['30 min offert']),
|
|
|
|
|
+ h('a', {
|
|
|
|
|
+ class: 'btn btn--primary btn--cta-main',
|
|
|
|
|
+ href: BOOKING_URL, target: '_blank', rel: 'noreferrer',
|
|
|
|
|
+ }, ['Découvrir les opportunités suite à mon audit — Entretien de 30 min offert avec un consultant']),
|
|
|
|
|
+ ]) : null,
|
|
|
|
|
|
|
|
DEVIS_URL ? h('a', {
|
|
DEVIS_URL ? h('a', {
|
|
|
class: 'btn btn--outline btn--cta-secondary',
|
|
class: 'btn btn--outline btn--cta-secondary',
|
|
|
href: DEVIS_URL,
|
|
href: DEVIS_URL,
|
|
|
- }, ['✉\u00a0 Demander un devis']) : null,
|
|
|
|
|
|
|
+ }, ['Demander un devis']) : null,
|
|
|
]),
|
|
]),
|
|
|
|
|
|
|
|
h('p', { class: 'hint', style: 'text-align:center;margin-top:10px' }, [
|
|
h('p', { class: 'hint', style: 'text-align:center;margin-top:10px' }, [
|
|
@@ -672,7 +682,7 @@ function renderResults() {
|
|
|
h('button', {
|
|
h('button', {
|
|
|
class: 'btn btn--outline',
|
|
class: 'btn btn--outline',
|
|
|
onClick: () => document.getElementById('pdfDialog')?.showModal(),
|
|
onClick: () => document.getElementById('pdfDialog')?.showModal(),
|
|
|
- }, ['⬇\u00a0 Télécharger mon PDF']),
|
|
|
|
|
|
|
+ }, ['Télécharger mon PDF']),
|
|
|
h('button', {
|
|
h('button', {
|
|
|
class: 'btn btn--outline',
|
|
class: 'btn btn--outline',
|
|
|
style: 'font-size:13px',
|
|
style: 'font-size:13px',
|
|
@@ -707,7 +717,7 @@ function renderResults() {
|
|
|
v2 ? renderV2Diagnostic() : null,
|
|
v2 ? renderV2Diagnostic() : null,
|
|
|
|
|
|
|
|
/* Non-V2 : risques (visibles uniquement après déblocage) */
|
|
/* Non-V2 : risques (visibles uniquement après déblocage) */
|
|
|
- !v2 && unlocked ? h('div', { class: 'card' }, [
|
|
|
|
|
|
|
+ !v2 && unlocked && !state.unlockExiting ? h('div', { class: 'card' }, [
|
|
|
h('div', { class: 'h2' }, ['3 risques probables']),
|
|
h('div', { class: 'h2' }, ['3 risques probables']),
|
|
|
riskItems.length
|
|
riskItems.length
|
|
|
? h('ol', { class: 'list' }, riskItems)
|
|
? h('ol', { class: 'list' }, riskItems)
|
|
@@ -715,7 +725,7 @@ function renderResults() {
|
|
|
]) : null,
|
|
]) : null,
|
|
|
|
|
|
|
|
/* Non-V2 : coût caché (visible uniquement après déblocage) */
|
|
/* Non-V2 : coût caché (visible uniquement après déblocage) */
|
|
|
- !v2 && unlocked && cost ? h('div', { class: 'cost-block' }, [
|
|
|
|
|
|
|
+ !v2 && unlocked && !state.unlockExiting && cost ? h('div', { class: 'cost-block' }, [
|
|
|
h('div', { class: 'h2' }, ['Coût caché estimé']),
|
|
h('div', { class: 'h2' }, ['Coût caché estimé']),
|
|
|
h('div', { class: 'cost-figures' }, [
|
|
h('div', { class: 'cost-figures' }, [
|
|
|
h('div', { class: 'cost-fig' }, [
|
|
h('div', { class: 'cost-fig' }, [
|
|
@@ -730,14 +740,14 @@ function renderResults() {
|
|
|
h('p', { class: 'hint' }, ['Estimation indicative, à valider par mesure réelle.']),
|
|
h('p', { class: 'hint' }, ['Estimation indicative, à valider par mesure réelle.']),
|
|
|
]) : null,
|
|
]) : null,
|
|
|
|
|
|
|
|
- /* Gate (formulaire déblocage) ou contenu débloqué — gate visible uniquement si non débloqué */
|
|
|
|
|
- unlocked ? null : renderUnlockGate(),
|
|
|
|
|
|
|
+ /* Gate (formulaire déblocage) ou contenu débloqué — gate visible pendant animation de sortie */
|
|
|
|
|
+ !unlocked || state.unlockExiting ? renderUnlockGate() : null,
|
|
|
|
|
|
|
|
/* V2 : mini plan (débloqué) */
|
|
/* V2 : mini plan (débloqué) */
|
|
|
v2 ? renderMiniPlan() : null,
|
|
v2 ? renderMiniPlan() : null,
|
|
|
|
|
|
|
|
/* Non-V2 : quick wins (débloqués) */
|
|
/* Non-V2 : quick wins (débloqués) */
|
|
|
- !v2 && unlocked ? h('div', { class: 'card' }, [
|
|
|
|
|
|
|
+ !v2 && unlocked && !state.unlockExiting ? h('div', { class: 'card' }, [
|
|
|
h('div', { class: 'h2' }, ['5 quick wins prioritaires']),
|
|
h('div', { class: 'h2' }, ['5 quick wins prioritaires']),
|
|
|
winItems.length
|
|
winItems.length
|
|
|
? h('ol', { class: 'list' }, winItems)
|
|
? h('ol', { class: 'list' }, winItems)
|
|
@@ -746,7 +756,7 @@ function renderResults() {
|
|
|
]) : null,
|
|
]) : null,
|
|
|
|
|
|
|
|
/* CTA débloqué */
|
|
/* CTA débloqué */
|
|
|
- unlocked ? renderUnlockedCtas() : null,
|
|
|
|
|
|
|
+ unlocked && !state.unlockExiting ? renderUnlockedCtas() : null,
|
|
|
|
|
|
|
|
renderPdfDialog(),
|
|
renderPdfDialog(),
|
|
|
]);
|
|
]);
|
|
@@ -966,7 +976,7 @@ function renderRoiResults() {
|
|
|
]),
|
|
]),
|
|
|
h('div', { class: 'btnrow' }, [
|
|
h('div', { class: 'btnrow' }, [
|
|
|
h('button', { class: 'btn btn--primary', onClick: () => setView('qwf') }, ['Trouver mes 3 quick wins →']),
|
|
h('button', { class: 'btn btn--primary', onClick: () => setView('qwf') }, ['Trouver mes 3 quick wins →']),
|
|
|
- BOOKING_URL ? h('a', { class: 'btn btn--outline', href: BOOKING_URL, target: '_blank', rel: 'noreferrer' }, ['Réserver un appel découverte']) : null,
|
|
|
|
|
|
|
+ BOOKING_URL ? h('a', { class: 'btn btn--outline', href: BOOKING_URL, target: '_blank', rel: 'noreferrer' }, ['Entretien 30 min offert avec un consultant']) : null,
|
|
|
]),
|
|
]),
|
|
|
h('div', { class: 'btnrow', style: 'margin-top:6px' }, [
|
|
h('div', { class: 'btnrow', style: 'margin-top:6px' }, [
|
|
|
h('button', { class: 'btn btn--outline', style: 'font-size:13px', onClick: () => setView('roi') }, ['← Modifier mes données']),
|
|
h('button', { class: 'btn btn--outline', style: 'font-size:13px', onClick: () => setView('roi') }, ['← Modifier mes données']),
|
|
@@ -1125,7 +1135,7 @@ function renderQwfResults() {
|
|
|
h('div', { class: 'qw-card__head-title' }, [qw.title]),
|
|
h('div', { class: 'qw-card__head-title' }, [qw.title]),
|
|
|
]),
|
|
]),
|
|
|
h('div', { class: 'qw-card__body' }, [
|
|
h('div', { class: 'qw-card__body' }, [
|
|
|
- h('div', { class: 'qw-card__result' }, [`✓ ${qw.result}`]),
|
|
|
|
|
|
|
+ h('div', { class: 'qw-card__result' }, [qw.result]),
|
|
|
h('div', { class: 'qw-section' }, [
|
|
h('div', { class: 'qw-section' }, [
|
|
|
h('div', { class: 'qw-section__lbl' }, ['Ce qu\'on met en place']),
|
|
h('div', { class: 'qw-section__lbl' }, ['Ce qu\'on met en place']),
|
|
|
h('div', { class: 'qw-section__val' }, [qw.setup]),
|
|
h('div', { class: 'qw-section__val' }, [qw.setup]),
|
|
@@ -1156,12 +1166,12 @@ function renderQwfResults() {
|
|
|
h('div', { class: 'card' }, [
|
|
h('div', { class: 'card' }, [
|
|
|
h('div', { class: 'h2' }, ['Et maintenant ?']),
|
|
h('div', { class: 'h2' }, ['Et maintenant ?']),
|
|
|
h('p', { class: 'lead', style: 'margin-bottom:16px' }, [
|
|
h('p', { class: 'lead', style: 'margin-bottom:16px' }, [
|
|
|
- 'Ces 3 quick wins sont un point de départ solide. Un appel découverte permet de valider les priorités et de cadrer le quick win n°1 en plan d\'action.',
|
|
|
|
|
|
|
+ 'Ces 3 quick wins sont un point de départ solide. Un entretien offert avec un consultant permet de découvrir les opportunités et de cadrer le quick win n°1 en plan d\'action.',
|
|
|
]),
|
|
]),
|
|
|
h('div', { class: 'btnrow' }, [
|
|
h('div', { class: 'btnrow' }, [
|
|
|
BOOKING_URL ? h('a', {
|
|
BOOKING_URL ? h('a', {
|
|
|
class: 'btn btn--primary', href: BOOKING_URL, target: '_blank', rel: 'noreferrer',
|
|
class: 'btn btn--primary', href: BOOKING_URL, target: '_blank', rel: 'noreferrer',
|
|
|
- }, ['📅\u00a0 Réserver un appel découverte — 30 min']) : null,
|
|
|
|
|
|
|
+ }, ['Découvrir les opportunités — Entretien 30 min offert']) : null,
|
|
|
h('button', { class: 'btn btn--outline', onClick: () => setView('roi') }, ['Calculer le ROI →']),
|
|
h('button', { class: 'btn btn--outline', onClick: () => setView('roi') }, ['Calculer le ROI →']),
|
|
|
]),
|
|
]),
|
|
|
h('div', { class: 'btnrow', style: 'margin-top:6px' }, [
|
|
h('div', { class: 'btnrow', style: 'margin-top:6px' }, [
|