Accueil : bloc « Pour votre métier » (vraies cartes Wallet, tampons et points) à la place de « Pour qui ? »
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9a38adda7d
commit
54c1af0231
3 changed files with 73 additions and 9 deletions
|
|
@ -330,6 +330,32 @@ ${m.faq.map(([q, a], i) => `<details${i === 0 ? ' open' : ''}><summary>${q}${ico
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Tuile d'un métier : vraie carte, format, accroche, lien. */
|
||||||
|
function tile(m, tag = 'h2') {
|
||||||
|
return `<a href="${HUB}${m.slug}/" class="cd mt-tile"><div class="mt-tv">${apple(m.card)}</div><span class="mt-fmtag">${m.card.mode === 'STAMP' ? 'Tampons' : 'Points'}</span><${tag} class="mt-tt">${m.label}</${tag}><p class="mu">${m.pains[0][1]}.</p><span class="mt-more">Découvrir ${ico('i-back', 's mt-arrow')}</span></a>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Accueil : bloc « Pour votre métier » (trois exemples, les deux formats, accès à tous les métiers). */
|
||||||
|
const HOME_START = '<!-- metiers:debut -->';
|
||||||
|
const HOME_END = '<!-- metiers:fin -->';
|
||||||
|
function homeBlock() {
|
||||||
|
const pick = ['boulangerie', 'restaurant', 'coiffeur-barbier'].map((slug) => METIERS.find((m) => m.slug === slug));
|
||||||
|
return `${HOME_START}
|
||||||
|
<section class="sec alt">
|
||||||
|
<div class="w">
|
||||||
|
<p class="eb">Pour votre métier</p>
|
||||||
|
<h2 style="max-width:24ch">Une carte adaptée à votre commerce.</h2>
|
||||||
|
<p class="lead">Tampons à chaque passage ou points au montant dépensé : choisissez le format qui colle à votre métier. Voici à quoi ressemble la carte dans le Wallet de vos clients.</p>
|
||||||
|
<div class="g3" style="margin-top:40px">
|
||||||
|
${pick.map((m) => tile(m, 'h3')).join('\n')}
|
||||||
|
</div>
|
||||||
|
<div class="mt-chips mt-chips-l"><span class="mu">Tous les métiers :</span>${METIERS.map((m) => `<a href="${HUB}${m.slug}/" class="mt-chip">${m.short}</a>`).join('')}</div>
|
||||||
|
<div class="btnrow" style="margin-top:28px"><a href="${HUB}" class="btn2">Voir la carte de votre métier</a></div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
${HOME_END}`;
|
||||||
|
}
|
||||||
|
|
||||||
function hubBody() {
|
function hubBody() {
|
||||||
return `
|
return `
|
||||||
<section class="sec" style="padding-bottom:40px">
|
<section class="sec" style="padding-bottom:40px">
|
||||||
|
|
@ -342,7 +368,7 @@ function hubBody() {
|
||||||
<section class="sec" style="padding-top:24px">
|
<section class="sec" style="padding-top:24px">
|
||||||
<div class="w">
|
<div class="w">
|
||||||
<div class="g3">
|
<div class="g3">
|
||||||
${METIERS.map((m) => `<a href="${HUB}${m.slug}/" class="cd mt-tile"><div class="mt-tv">${apple(m.card)}</div><span class="mt-fmtag">${m.card.mode === 'STAMP' ? 'Tampons' : 'Points'}</span><h2 class="mt-tt">${m.label}</h2><p class="mu">${m.pains[0][1]}.</p><span class="mt-more">Découvrir ${ico('i-back', 's mt-arrow')}</span></a>`).join('\n')}
|
${METIERS.map((m) => tile(m)).join('\n')}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -402,6 +428,7 @@ const CSS = [
|
||||||
'.mep .mt-a{color:var(--grt);text-decoration:underline;text-underline-offset:3px}',
|
'.mep .mt-a{color:var(--grt);text-decoration:underline;text-underline-offset:3px}',
|
||||||
'.mep .mt-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:14px}',
|
'.mep .mt-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:14px}',
|
||||||
'.mep .mt-chip{display:inline-flex;align-items:center;min-height:44px;padding:0 18px;border-radius:999px;border:1.5px solid var(--bd);background:var(--sf);font-weight:600;font-size:15px}',
|
'.mep .mt-chip{display:inline-flex;align-items:center;min-height:44px;padding:0 18px;border-radius:999px;border:1.5px solid var(--bd);background:var(--sf);font-weight:600;font-size:15px}',
|
||||||
|
'.mep .mt-chips-l{justify-content:flex-start;align-items:center;margin-top:28px}',
|
||||||
'.mep .mt-chip:hover{border-color:var(--grt);color:var(--grt)}',
|
'.mep .mt-chip:hover{border-color:var(--grt);color:var(--grt)}',
|
||||||
'.mep .mt-tile{display:flex;flex-direction:column;gap:12px;color:inherit;text-decoration:none;transition:border-color .2s,transform .2s}',
|
'.mep .mt-tile{display:flex;flex-direction:column;gap:12px;color:inherit;text-decoration:none;transition:border-color .2s,transform .2s}',
|
||||||
'.mep .mt-tile:hover{border-color:var(--grt);transform:translateY(-2px)}',
|
'.mep .mt-tile:hover{border-color:var(--grt);transform:translateY(-2px)}',
|
||||||
|
|
@ -470,6 +497,21 @@ function build(OUT) {
|
||||||
if (s >= 0) css = css.slice(0, s).trimEnd() + '\n';
|
if (s >= 0) css = css.slice(0, s).trimEnd() + '\n';
|
||||||
fs.writeFileSync(cssFile, `${css.trimEnd()}\n${CSS_START}\n${CSS}\n${CSS_END}\n`);
|
fs.writeFileSync(cssFile, `${css.trimEnd()}\n${CSS_START}\n${CSS}\n${CSS_END}\n`);
|
||||||
|
|
||||||
|
// Accueil : bloc « Pour votre métier » à la place de la section « Pour qui ? » de la maquette.
|
||||||
|
{
|
||||||
|
const file = path.join(OUT, 'index.html');
|
||||||
|
let home = fs.readFileSync(file, 'utf8');
|
||||||
|
const a = home.indexOf(HOME_START);
|
||||||
|
if (a >= 0) home = home.slice(0, a) + homeBlock() + home.slice(home.indexOf(HOME_END) + HOME_END.length);
|
||||||
|
else {
|
||||||
|
const m = home.match(/<section class="sec alt">\s*<div class="w">\s*<p class="eb">Pour qui \?<\/p>[\s\S]*?<\/section>/);
|
||||||
|
if (!m) throw new Error('Accueil : section « Pour qui ? » introuvable');
|
||||||
|
home = home.replace(m[0], homeBlock());
|
||||||
|
}
|
||||||
|
fs.writeFileSync(file, home);
|
||||||
|
console.log('✓ / (bloc « Pour votre métier »)');
|
||||||
|
}
|
||||||
|
|
||||||
// Lien « Par métier » dans le pied de page de toutes les pages.
|
// Lien « Par métier » dans le pied de page de toutes les pages.
|
||||||
const pages = [];
|
const pages = [];
|
||||||
(function walk(dir) {
|
(function walk(dir) {
|
||||||
|
|
|
||||||
|
|
@ -276,6 +276,7 @@ textarea.in{padding:14px 16px;min-height:140px;resize:vertical}
|
||||||
.mep .mt-a{color:var(--grt);text-decoration:underline;text-underline-offset:3px}
|
.mep .mt-a{color:var(--grt);text-decoration:underline;text-underline-offset:3px}
|
||||||
.mep .mt-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:14px}
|
.mep .mt-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:14px}
|
||||||
.mep .mt-chip{display:inline-flex;align-items:center;min-height:44px;padding:0 18px;border-radius:999px;border:1.5px solid var(--bd);background:var(--sf);font-weight:600;font-size:15px}
|
.mep .mt-chip{display:inline-flex;align-items:center;min-height:44px;padding:0 18px;border-radius:999px;border:1.5px solid var(--bd);background:var(--sf);font-weight:600;font-size:15px}
|
||||||
|
.mep .mt-chips-l{justify-content:flex-start;align-items:center;margin-top:28px}
|
||||||
.mep .mt-chip:hover{border-color:var(--grt);color:var(--grt)}
|
.mep .mt-chip:hover{border-color:var(--grt);color:var(--grt)}
|
||||||
.mep .mt-tile{display:flex;flex-direction:column;gap:12px;color:inherit;text-decoration:none;transition:border-color .2s,transform .2s}
|
.mep .mt-tile{display:flex;flex-direction:column;gap:12px;color:inherit;text-decoration:none;transition:border-color .2s,transform .2s}
|
||||||
.mep .mt-tile:hover{border-color:var(--grt);transform:translateY(-2px)}
|
.mep .mt-tile:hover{border-color:var(--grt);transform:translateY(-2px)}
|
||||||
|
|
|
||||||
|
|
@ -180,19 +180,40 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- metiers:debut -->
|
||||||
<section class="sec alt">
|
<section class="sec alt">
|
||||||
<div class="w">
|
<div class="w">
|
||||||
<p class="eb">Pour qui ?</p>
|
<p class="eb">Pour votre métier</p>
|
||||||
<h2>Pour tous les commerces où l’on revient.</h2>
|
<h2 style="max-width:24ch">Une carte adaptée à votre commerce.</h2>
|
||||||
<p class="lead" style="margin-bottom:48px">Chaque commerce a sa carte, à ses couleurs. Voici quatre exemples fictifs.</p>
|
<p class="lead">Tampons à chaque passage ou points au montant dépensé : choisissez le format qui colle à votre métier. Voici à quoi ressemble la carte dans le Wallet de vos clients.</p>
|
||||||
<div class="g4">
|
<div class="g3" style="margin-top:40px">
|
||||||
<div><div class="wk" style="--cb:#A64B17;--cf:#FFF4E4;--ca:#F7D58B"><div class="wk-h"><span class="wk-l"></span>Boulangerie Kerlann</div><div class="wk-d"><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i><i></i><i></i><i></i></div><div class="wk-f"><div><small>Tampons</small><b>7 / 10</b></div><div class="q"><svg style="width:100%;height:100%" aria-hidden="true"><use href="#qr"/></svg></div></div></div><p style="margin-top:16px;font-weight:700">Boulangerie</p></div>
|
<a href="/carte-de-fidelite/boulangerie/" class="cd mt-tile"><div class="mt-tv"><div class="wa" style="background:#A64B17;color:#FFF4E4" aria-hidden="true">
|
||||||
<div><div class="wk" style="--cb:#3B261B;--cf:#F6EBDD;--ca:#E1B382"><div class="wk-h"><span class="wk-l"></span>Café Lann</div><div class="wk-d"><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i><i></i><i></i><i></i><i></i><i></i><i></i></div><div class="wk-f"><div><small>Tampons</small><b>4 / 10</b></div><div class="q"><svg style="width:100%;height:100%" aria-hidden="true"><use href="#qr"/></svg></div></div></div><p style="margin-top:16px;font-weight:700">Café</p></div>
|
<div class="wa-h"><b>Boulangerie Kerlann</b><div class="wa-r"><small style="color:#F7D58B">TAMPONS</small><span>7</span></div></div>
|
||||||
<div><div class="wk" style="--cb:#121212;--cf:#E9D8A6;--ca:#C9A24B"><div class="wk-h"><span class="wk-l"></span>Barbier Hermine</div><div class="wk-d"><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i><i></i></div><div class="wk-f"><div><small>Passages</small><b>9 / 10</b></div><div class="q"><svg style="width:100%;height:100%" aria-hidden="true"><use href="#qr"/></svg></div></div></div><p style="margin-top:16px;font-weight:700">Barbier</p></div>
|
<div class="wa-s"><small style="color:#F7D58B">SOLDE</small><span>7</span></div>
|
||||||
<div><div class="wk" style="--cb:#F2D3D6;--cf:#3B2A30;--ca:#2F6B57"><div class="wk-h"><span class="wk-l"></span>Fleuriste Lilas</div><div class="wk-d"><i class="on"></i><i class="on"></i><i class="on"></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div><div class="wk-f"><div><small>Tampons</small><b>3 / 10</b></div><div class="q"><svg style="width:100%;height:100%" aria-hidden="true"><use href="#qr"/></svg></div></div></div><p style="margin-top:16px;font-weight:700">Fleuriste</p></div>
|
<div class="wa-2"><div><small style="color:#F7D58B">PROGRAMME</small><span>Carte fidélité</span></div><div class="wa-r"><small style="color:#F7D58B">MEMBRE</small><span>Camille</span></div></div>
|
||||||
|
<div class="wa-n"><small style="color:#F7D58B">PROCHAINE RÉCOMPENSE</small><span>Viennoiserie offerte : encore 3 tampons</span></div>
|
||||||
|
<div class="wa-q"><i><svg viewBox="0 0 21 21" shape-rendering="crispEdges"><rect width="21" height="21" fill="#fff"/><path d="M0 0h7v7h-7zM1 1v5h5v-5zM2 2h3v3h-3zM14 0h7v7h-7zM15 1v5h5v-5zM16 2h3v3h-3zM0 14h7v7h-7zM1 15v5h5v-5zM2 16h3v3h-3zM9 0h1v1h-1zM12 0h1v1h-1zM10 1h1v1h-1zM9 3h1v1h-1zM12 3h1v1h-1zM10 4h1v1h-1zM9 6h1v1h-1zM12 6h1v1h-1zM10 7h1v1h-1zM0 9h1v1h-1zM3 9h1v1h-1zM6 9h1v1h-1zM9 9h1v1h-1zM12 9h1v1h-1zM15 9h1v1h-1zM18 9h1v1h-1zM1 10h1v1h-1zM4 10h1v1h-1zM7 10h1v1h-1zM10 10h1v1h-1zM13 10h1v1h-1zM16 10h1v1h-1zM19 10h1v1h-1zM0 12h1v1h-1zM3 12h1v1h-1zM6 12h1v1h-1zM9 12h1v1h-1zM12 12h1v1h-1zM15 12h1v1h-1zM18 12h1v1h-1zM10 13h1v1h-1zM13 13h1v1h-1zM16 13h1v1h-1zM19 13h1v1h-1zM9 15h1v1h-1zM12 15h1v1h-1zM15 15h1v1h-1zM18 15h1v1h-1zM10 16h1v1h-1zM13 16h1v1h-1zM16 16h1v1h-1zM19 16h1v1h-1zM9 18h1v1h-1zM12 18h1v1h-1zM15 18h1v1h-1zM18 18h1v1h-1zM10 19h1v1h-1zM13 19h1v1h-1zM16 19h1v1h-1zM19 19h1v1h-1z" fill="#000" fill-rule="evenodd"/></svg></i></div>
|
||||||
|
</div></div><span class="mt-fmtag">Tampons</span><h3 class="mt-tt">Boulangerie, pâtisserie</h3><p class="mu">Une carte toujours sur soi.</p><span class="mt-more">Découvrir <svg class="ico s mt-arrow"><use href="#i-back"/></svg></span></a>
|
||||||
|
<a href="/carte-de-fidelite/restaurant/" class="cd mt-tile"><div class="mt-tv"><div class="wa" style="background:#7A1F2B;color:#FFF4E4" aria-hidden="true">
|
||||||
|
<div class="wa-h"><b>Bistrot des Halles</b><div class="wa-r"><small style="color:#E9C46A">POINTS</small><span>84</span></div></div>
|
||||||
|
<div class="wa-s"><small style="color:#E9C46A">SOLDE</small><span>84</span></div>
|
||||||
|
<div class="wa-2"><div><small style="color:#E9C46A">PROGRAMME</small><span>Les fidèles du Bistrot</span></div><div class="wa-r"><small style="color:#E9C46A">MEMBRE</small><span>Sophie</span></div></div>
|
||||||
|
<div class="wa-n"><small style="color:#E9C46A">PROCHAINE RÉCOMPENSE</small><span>Dessert offert : encore 66 points</span></div>
|
||||||
|
<div class="wa-q"><i><svg viewBox="0 0 21 21" shape-rendering="crispEdges"><rect width="21" height="21" fill="#fff"/><path d="M0 0h7v7h-7zM1 1v5h5v-5zM2 2h3v3h-3zM14 0h7v7h-7zM15 1v5h5v-5zM16 2h3v3h-3zM0 14h7v7h-7zM1 15v5h5v-5zM2 16h3v3h-3zM9 0h1v1h-1zM12 0h1v1h-1zM10 1h1v1h-1zM9 3h1v1h-1zM12 3h1v1h-1zM10 4h1v1h-1zM9 6h1v1h-1zM12 6h1v1h-1zM10 7h1v1h-1zM0 9h1v1h-1zM3 9h1v1h-1zM6 9h1v1h-1zM9 9h1v1h-1zM12 9h1v1h-1zM15 9h1v1h-1zM18 9h1v1h-1zM1 10h1v1h-1zM4 10h1v1h-1zM7 10h1v1h-1zM10 10h1v1h-1zM13 10h1v1h-1zM16 10h1v1h-1zM19 10h1v1h-1zM0 12h1v1h-1zM3 12h1v1h-1zM6 12h1v1h-1zM9 12h1v1h-1zM12 12h1v1h-1zM15 12h1v1h-1zM18 12h1v1h-1zM10 13h1v1h-1zM13 13h1v1h-1zM16 13h1v1h-1zM19 13h1v1h-1zM9 15h1v1h-1zM12 15h1v1h-1zM15 15h1v1h-1zM18 15h1v1h-1zM10 16h1v1h-1zM13 16h1v1h-1zM16 16h1v1h-1zM19 16h1v1h-1zM9 18h1v1h-1zM12 18h1v1h-1zM15 18h1v1h-1zM18 18h1v1h-1zM10 19h1v1h-1zM13 19h1v1h-1zM16 19h1v1h-1zM19 19h1v1h-1z" fill="#000" fill-rule="evenodd"/></svg></i></div>
|
||||||
|
</div></div><span class="mt-fmtag">Points</span><h3 class="mt-tt">Restaurant, bistrot</h3><p class="mu">Récompenser au montant.</p><span class="mt-more">Découvrir <svg class="ico s mt-arrow"><use href="#i-back"/></svg></span></a>
|
||||||
|
<a href="/carte-de-fidelite/coiffeur-barbier/" class="cd mt-tile"><div class="mt-tv"><div class="wa" style="background:#1C1C19;color:#FFFFFF" aria-hidden="true">
|
||||||
|
<div class="wa-h"><b>Atelier Coupe</b><div class="wa-r"><small style="color:#D9B48F">TAMPONS</small><span>4</span></div></div>
|
||||||
|
<div class="wa-s"><small style="color:#D9B48F">SOLDE</small><span>4</span></div>
|
||||||
|
<div class="wa-2"><div><small style="color:#D9B48F">PROGRAMME</small><span>Carte fidélité</span></div><div class="wa-r"><small style="color:#D9B48F">MEMBRE</small><span>Thomas</span></div></div>
|
||||||
|
<div class="wa-n"><small style="color:#D9B48F">PROCHAINE RÉCOMPENSE</small><span>Soin offert : encore 2 tampons</span></div>
|
||||||
|
<div class="wa-q"><i><svg viewBox="0 0 21 21" shape-rendering="crispEdges"><rect width="21" height="21" fill="#fff"/><path d="M0 0h7v7h-7zM1 1v5h5v-5zM2 2h3v3h-3zM14 0h7v7h-7zM15 1v5h5v-5zM16 2h3v3h-3zM0 14h7v7h-7zM1 15v5h5v-5zM2 16h3v3h-3zM9 0h1v1h-1zM12 0h1v1h-1zM10 1h1v1h-1zM9 3h1v1h-1zM12 3h1v1h-1zM10 4h1v1h-1zM9 6h1v1h-1zM12 6h1v1h-1zM10 7h1v1h-1zM0 9h1v1h-1zM3 9h1v1h-1zM6 9h1v1h-1zM9 9h1v1h-1zM12 9h1v1h-1zM15 9h1v1h-1zM18 9h1v1h-1zM1 10h1v1h-1zM4 10h1v1h-1zM7 10h1v1h-1zM10 10h1v1h-1zM13 10h1v1h-1zM16 10h1v1h-1zM19 10h1v1h-1zM0 12h1v1h-1zM3 12h1v1h-1zM6 12h1v1h-1zM9 12h1v1h-1zM12 12h1v1h-1zM15 12h1v1h-1zM18 12h1v1h-1zM10 13h1v1h-1zM13 13h1v1h-1zM16 13h1v1h-1zM19 13h1v1h-1zM9 15h1v1h-1zM12 15h1v1h-1zM15 15h1v1h-1zM18 15h1v1h-1zM10 16h1v1h-1zM13 16h1v1h-1zM16 16h1v1h-1zM19 16h1v1h-1zM9 18h1v1h-1zM12 18h1v1h-1zM15 18h1v1h-1zM18 18h1v1h-1zM10 19h1v1h-1zM13 19h1v1h-1zM16 19h1v1h-1zM19 19h1v1h-1z" fill="#000" fill-rule="evenodd"/></svg></i></div>
|
||||||
|
</div></div><span class="mt-fmtag">Tampons</span><h3 class="mt-tt">Coiffeur, barbier</h3><p class="mu">Le bon rappel, au bon moment.</p><span class="mt-more">Découvrir <svg class="ico s mt-arrow"><use href="#i-back"/></svg></span></a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mt-chips mt-chips-l"><span class="mu">Tous les métiers :</span><a href="/carte-de-fidelite/boulangerie/" class="mt-chip">Boulangerie</a><a href="/carte-de-fidelite/cafe-bar/" class="mt-chip">Café, bar</a><a href="/carte-de-fidelite/restaurant/" class="mt-chip">Restaurant</a><a href="/carte-de-fidelite/coiffeur-barbier/" class="mt-chip">Coiffeur, barbier</a><a href="/carte-de-fidelite/fleuriste/" class="mt-chip">Fleuriste</a><a href="/carte-de-fidelite/boutique/" class="mt-chip">Boutique</a></div>
|
||||||
|
<div class="btnrow" style="margin-top:28px"><a href="/carte-de-fidelite/" class="btn2">Voir la carte de votre métier</a></div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
<!-- metiers:fin -->
|
||||||
|
|
||||||
<section class="sec">
|
<section class="sec">
|
||||||
<div class="w">
|
<div class="w">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue