Fichiers
2026-10-11 01:57:33 +02:00

383 lignes
13 KiB
JavaScript

const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const SITE_DIR = path.resolve(__dirname, '..');
const ACTUAL_DIR = path.resolve(SITE_DIR, '../Actual_Website');
const INDEX_HTML_PATH = path.join(SITE_DIR, 'index.html');
console.log('[ACTION] Restauration immédiate du thème BLANC et propre pour #apps...');
let indexHtml = fs.readFileSync(INDEX_HTML_PATH, 'utf8');
// 1. Remplacement de tout le bloc CSS pour #apps par le thème BLANC propre
const cleanAppsCss = `
/* ==========================================================================
THÈME BLANC PUR ET ÉPURÉ : APPLICATIONS DÉVELOPPÉES (#apps)
========================================================================== */
#apps {
font-family: var(--font-sans, 'Inter', sans-serif);
color: #111111;
background: #ffffff;
line-height: 1.6;
}
#apps .apps-pad {
max-width: 1100px;
margin: 0 auto;
padding: 70px 24px 100px;
}
#apps .apps-header {
border-bottom: 1px solid #e8e8e8;
padding-bottom: 32px;
margin-bottom: 48px;
}
#apps .apps-header h1 {
font-family: 'Comfortaa', cursive, sans-serif;
font-size: clamp(2rem, 4vw, 2.8rem);
font-weight: 700;
letter-spacing: -.5px;
margin: 0 0 14px 0;
color: #111111;
}
#apps .apps-intro {
font-size: 1.02rem;
color: #555555;
max-width: 680px;
margin: 0 0 18px 0;
line-height: 1.65;
}
#apps .apps-note {
display: inline-block;
font-size: .72rem;
text-transform: uppercase;
letter-spacing: 1.5px;
font-weight: 700;
color: #1e4d8b;
border: 1px solid #d4e2f4;
border-radius: 4px;
padding: 5px 12px;
background: #eef3fa;
}
#apps .apps-category {
margin-bottom: 65px;
}
#apps .apps-category-header {
display: flex;
justify-content: space-between;
align-items: baseline;
border-bottom: 2px solid #1e4d8b;
padding-bottom: 12px;
margin-bottom: 20px;
}
#apps .apps-category-title {
font-size: 1.1rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 1.2px;
margin: 0;
color: #111111;
}
#apps .apps-category-count {
font-size: .78rem;
font-weight: 600;
color: #1e4d8b;
letter-spacing: .5px;
text-transform: uppercase;
}
#apps .apps-category-desc {
font-size: .92rem;
color: #666666;
margin: 0 0 28px 0;
line-height: 1.5;
}
#apps .apps-detailed-list {
display: flex;
flex-direction: column;
gap: 36px;
}
/* BANDEAU HÉROÏQUE GASTINEL WEATHER STUDIO (Design Lumineux & Propre) */
.app-card-featured-gws {
background: #f7faff;
border: 2px solid #c8daf0;
border-radius: 12px;
padding: 32px 30px;
box-shadow: 0 4px 16px rgba(18, 58, 107, 0.08);
margin-bottom: 30px;
position: relative;
overflow: hidden;
}
.app-card-featured-gws::before {
content: '';
position: absolute;
top: 0; left: 0; right: 0; height: 4px;
background: #1e4d8b;
}
.gws-featured-top {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 20px;
margin-bottom: 16px;
}
.gws-featured-brand {
display: flex;
align-items: center;
gap: 18px;
}
.gws-featured-icon {
width: 56px;
height: 56px;
border-radius: 10px;
border: 1px solid #d4e2f4;
background: #ffffff;
padding: 3px;
box-shadow: 0 2px 8px rgba(18, 58, 107, 0.1);
flex-shrink: 0;
}
.gws-featured-tag-row {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 4px;
}
.gws-badge-status.available {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 0.72rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.8px;
color: #1c6b45;
background: #e9f5ef;
border: 1px solid #b7dfcb;
padding: 3px 10px;
border-radius: 4px;
}
.gws-badge-status .badge-dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: #1c6b45;
}
.gws-badge-arch {
font-size: 0.74rem;
color: #666666;
font-weight: 600;
}
.gws-featured-title {
font-size: 1.6rem;
font-weight: 800;
color: #123a6b;
margin: 0;
letter-spacing: -0.3px;
}
.gws-featured-pitch {
font-size: 0.95rem;
color: #1e4d8b;
font-weight: 600;
margin-top: 2px;
}
.gws-featured-cta-main {
display: inline-flex;
align-items: center;
gap: 10px;
background: #1e4d8b;
color: #ffffff !important;
font-weight: 700;
font-size: 0.95rem;
padding: 13px 22px;
border-radius: 8px;
text-decoration: none;
box-shadow: 0 2px 8px rgba(30, 77, 139, 0.25);
transition: all 0.15s ease;
white-space: nowrap;
}
.gws-featured-cta-main:hover {
background: #123a6b;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(18, 58, 107, 0.35);
}
.gws-featured-desc {
font-size: 0.95rem;
color: #3f464f;
line-height: 1.65;
margin: 0 0 18px 0;
}
.gws-featured-pills-row {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 22px;
}
.gws-feature-pill {
font-size: 0.8rem;
font-weight: 600;
color: #1e4d8b;
background: #ffffff;
border: 1px solid #d4e2f4;
padding: 5px 12px;
border-radius: 20px;
}
.gws-featured-actions-row {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 16px;
padding-top: 18px;
border-top: 1px solid #e2ecf8;
}
.gws-featured-downloads-split {
display: flex;
gap: 14px;
flex-wrap: wrap;
}
.gws-btn-dl-box {
display: flex;
flex-direction: column;
padding: 10px 18px;
border-radius: 8px;
text-decoration: none;
transition: all 0.15s ease;
}
.gws-btn-dl-box.primary {
background: #ffffff;
border: 1px solid #1e4d8b;
color: #1e4d8b !important;
}
.gws-btn-dl-box.primary:hover {
background: #eef3fa;
}
.gws-btn-dl-box.secondary {
background: #ffffff;
border: 1px solid #1c6b45;
color: #1c6b45 !important;
}
.gws-btn-dl-box.secondary:hover {
background: #e9f5ef;
}
.gws-btn-dl-label {
display: flex;
align-items: center;
gap: 8px;
font-size: 0.9rem;
}
.gws-btn-dl-sub {
font-size: 0.72rem;
color: #666666;
margin-top: 2px;
padding-left: 26px;
}
.gws-btn-guide-link {
font-size: 0.86rem;
font-weight: 600;
color: #1e4d8b;
text-decoration: none;
}
.gws-btn-guide-link:hover {
text-decoration: underline;
color: #123a6b;
}
/* Cartes classiques d'applications */
#apps .app-card-detailed {
border: 1px solid #e8e8e8;
border-radius: 8px;
background: #ffffff;
padding: 34px;
box-shadow: 0 1px 4px rgba(0,0,0,0.02);
transition: border-color .2s ease;
}
#apps .app-card-detailed:hover { border-color: #d0d0d0; }
#apps .app-card-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
#apps .app-title-group { display: flex; align-items: center; gap: 16px; }
#apps .app-icon-img { width: 46px; height: 46px; border-radius: 8px; border: 1px solid #e8e8e8; background: #fafafa; padding: 2px; object-fit: contain; flex-shrink: 0; }
#apps .app-main-title { font-size: 1.4rem; font-weight: 700; color: #111111; margin: 0; letter-spacing: -.3px; }
#apps .app-status-tag { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; color: #555555; background: #f4f4f4; border: 1px solid #e0e0e0; border-radius: 4px; padding: 6px 12px; white-space: nowrap; }
#apps .app-pitch { font-size: 1.05rem; font-weight: 600; color: #222222; font-style: italic; border-left: 3px solid #111111; padding-left: 14px; margin: 0 0 22px 0; }
#apps .app-problem { background: #fcfcfc; border: 1px solid #eeeeee; border-radius: 6px; padding: 18px 20px; margin-bottom: 24px; }
#apps .app-problem h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: #888888; margin: 0 0 8px 0; }
#apps .app-problem p { font-size: .92rem; color: #444444; margin: 0; line-height: 1.65; }
#apps .app-hero-visual { border-radius: 6px; overflow: hidden; border: 1px solid #e6e6e6; margin: 22px 0 26px; background: #f7f7f7; }
#apps .app-hero-visual img { width: 100%; height: auto; display: block; }
#apps .app-visual-caption { font-size: .78rem; color: #777777; padding: 8px 14px; border-top: 1px solid #eeeeee; background: #fafafa; }
#apps .app-features-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 24px 0; }
#apps .app-feature-card { background: #fafafa; border: 1px solid #ececec; border-radius: 6px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; }
#apps .app-feature-card h4 { font-size: .88rem; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; color: #111111; margin: 0 0 8px 0; }
#apps .app-feature-card p { font-size: .88rem; color: #444444; line-height: 1.6; margin: 0; }
#apps .app-feature-media { margin-top: 14px; border-radius: 4px; overflow: hidden; border: 1px solid #e2e2e2; }
#apps .app-feature-media img { width: 100%; height: auto; display: block; }
#apps .app-meta-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-top: 26px; padding-top: 22px; border-top: 1px solid #eeeeee; }
#apps .app-meta-grid.two-cols { grid-template-columns: 1fr 1fr; }
#apps .app-meta-item { background: #fcfcfc; border: 1px solid #ececec; border-radius: 6px; padding: 16px 18px; }
#apps .app-meta-item h5 { font-size: .76rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: #888888; margin: 0 0 6px 0; }
#apps .app-meta-item p { font-size: .86rem; color: #444444; margin: 0; line-height: 1.55; }
/* Grille compacte des projets annoncés */
#apps .apps-compact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
#apps .app-card-compact { border: 1px solid #e8e8e8; border-radius: 6px; background: #fafafa; overflow: hidden; transition: border-color .2s ease, background .2s ease; }
#apps .app-card-compact:hover { border-color: #cccccc; background: #ffffff; }
#apps .app-card-compact[open] { background: #ffffff; border-color: #aaaaaa; }
#apps .app-compact-summary { list-style: none; padding: 18px 20px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; user-select: none; }
#apps .app-compact-summary::-webkit-details-marker { display: none; }
#apps .app-compact-info { display: flex; flex-direction: column; gap: 4px; }
#apps .app-compact-name { font-size: 1.05rem; font-weight: 700; margin: 0; color: #111111; letter-spacing: -.2px; }
#apps .app-compact-status { font-size: .72rem; font-weight: 600; color: #888888; text-transform: uppercase; letter-spacing: .8px; }
#apps .app-compact-arrow { width: 14px; height: 14px; fill: #888888; transition: transform .25s ease, fill .25s ease; flex-shrink: 0; }
#apps .app-card-compact[open] .app-compact-arrow { transform: rotate(180deg); fill: #111111; }
#apps .app-compact-body { padding: 0 20px 18px 20px; border-top: 1px solid #f0f0f0; margin-top: 2px; padding-top: 14px; }
#apps .app-keywords { font-size: .88rem; font-weight: 600; color: #222222; margin-bottom: 8px; letter-spacing: .2px; line-height: 1.4; }
#apps .app-timeline { font-size: .8rem; color: #777777; line-height: 1.4; }
@media (max-width: 850px) {
#apps .app-meta-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
#apps .apps-pad { padding: 45px 18px 60px; }
#apps .app-card-detailed { padding: 22px 18px; }
#apps .app-features-grid, #apps .app-meta-grid.two-cols { grid-template-columns: 1fr; }
#apps .apps-compact-grid { grid-template-columns: 1fr; }
#apps .app-card-top { flex-direction: column; align-items: flex-start; gap: 12px; }
}
`;
// Remplacer le bloc CSS de #apps dans index.html
const appsCssStart = indexHtml.indexOf('#apps {');
const appsCssEnd = indexHtml.indexOf('/* ==========================================================================\r\n CSS DU HUB DÉDIÉ WEATHER STUDIO (#gws)') !== -1
? indexHtml.indexOf('/* ==========================================================================\r\n CSS DU HUB DÉDIÉ WEATHER STUDIO (#gws)')
: indexHtml.indexOf('/* ==========================================================================\n CSS DU HUB DÉDIÉ WEATHER STUDIO (#gws)');
if (appsCssStart !== -1 && appsCssEnd !== -1) {
indexHtml = indexHtml.substring(0, appsCssStart) + cleanAppsCss + '\n' + indexHtml.substring(appsCssEnd);
console.log('✓ CSS de #apps restauré en BLANC et propre');
} else {
console.warn('Attention : bornes CSS de #apps non trouvées, application par regex');
}
fs.writeFileSync(INDEX_HTML_PATH, indexHtml, 'utf8');
// 2. Synchronisation Actual_Website
fs.copyFileSync(INDEX_HTML_PATH, path.join(ACTUAL_DIR, 'index.html'));
console.log('✓ Synchronisé avec Actual_Website/index.html');
// 3. Précompression
execSync('node ' + path.join(SITE_DIR, 'tools/precompress.js'), { stdio: 'inherit', cwd: SITE_DIR });
// 4. Test
execSync('node ' + path.join(SITE_DIR, 'tools/test-verify.js'), { stdio: 'inherit', cwd: SITE_DIR });
console.log('[ACTION] Prêt pour le déploiement serveur !');