Chargement de la vitrine...

Site en construction

Notre école

Le site de cet établissement est en cours de préparation. Revenez bientôt !

1995
Fondée en
0
Élèves
0
Classes
100%
Engagement

Notre établissement

À Propos de Nous

Notre mission est de fournir une éducation d'excellence...

Excellence Éducative

Former les esprits, bâtir l'avenir.

Établissement d'excellence

Parcours scolaire

Nos Classes & Programmes

Un cursus complet, de la petite enfance jusqu'au baccalauréat.

Notre cadre de vie

Galerie Photo

Découvrez notre établissement, nos infrastructures et nos activités.

Rejoignez-nous

Inscrivez votre enfant pour l'année prochaine

Les inscriptions sont ouvertes. Ne manquez pas cette opportunité d'offrir à votre enfant une éducation d'excellence.

Pré-inscription

Informations de l'élève
Informations du tuteur
Documents à joindre
Cliquez ou glissez le fichier
Cliquez ou glissez le fichier
Cliquez ou glissez le fichier
Cliquez ou glissez le fichier

Parlons ensemble

Contactez-Nous

Notre équipe est disponible pour répondre à toutes vos questions.

Réseaux sociaux

Envoyer un message

'; const w = window.open('', '_blank'); w.document.write(content); w.document.close(); w.onload = () => { w.print(); }; } function printSingleMatiere(matiereNom, niveauTitre) { const modal = document.getElementById('chapitre-modal'); if (!modal) return; const body = modal.querySelector('.chapitre-modal-body').innerHTML; const content = `${matiereNom} - Programme

${matiereNom}

${niveauTitre}

${body} `; const w = window.open('', '_blank'); w.document.write(content); w.document.close(); w.onload = () => { w.print(); }; } // ── Galerie ─────────────────────────────────────────────────────────── function renderGalerie(photos) { const grid = document.getElementById('galerie-grid'); if (!photos.length) { // Masquer la section et ses liens nav si aucune photo grid.closest('section').style.display = 'none'; document.querySelectorAll('a[href="#galerie"]').forEach(function(el) { el.style.display = 'none'; }); return; } // Sauvegarder les photos pour la navigation lightbox lightboxPhotos = photos.map(function(p, i) { return { src: p.imageUrl || '', alt: p.alt || 'Photo ' + (i+1) }; }); grid.innerHTML = photos.map((p, i) => `
${escHtml(p.alt || 'Photo ' + (i+1))}
`).join(''); } // ── Contact ─────────────────────────────────────────────────────────── function renderContact(d) { if (d.adresse) { document.getElementById('contact-adresse').style.display = 'flex'; setText('contact-adresse-val', d.adresse); } if (d.tel) { document.getElementById('contact-tel-card').style.display = 'flex'; setText('contact-tel-val', d.tel); } if (d.email) { document.getElementById('contact-email-card').style.display = 'flex'; setText('contact-email-val', d.email); } } // ── Localisation ────────────────────────────────────────────────────── var locData = {}; function renderLocalisation(d) { var lat = d.latitudeVitrine; var lng = d.longitudeVitrine; var instructions = d.instructionsLocalisation; var adresse = d.adresse; // Stocker pour les fonctions copyAddress et openDirections locData = { lat: lat, lng: lng, adresse: adresse }; // Si pas de coordonnées, masquer toute la section if (!lat || !lng) { document.getElementById('localisation').style.display = 'none'; document.querySelectorAll('a[href="#localisation"]').forEach(function(el) { el.style.display = 'none'; }); return; } // Afficher la section document.getElementById('localisation').style.display = 'block'; // Charger la carte Google Maps avec marqueur var mapUrl = 'https://maps.google.com/maps?q=' + lat + ',' + lng + '&z=15&output=embed'; document.getElementById('map-iframe-vitrine').src = mapUrl; // Afficher l'adresse si disponible if (adresse) { document.getElementById('loc-adresse-card').style.display = 'flex'; setText('loc-adresse-text', adresse); } // Afficher les instructions si disponibles if (instructions) { document.getElementById('loc-instructions-card').style.display = 'flex'; setText('loc-instructions-text', instructions); } } function copyAddress() { var adresse = locData.adresse; if (!adresse) return; if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(adresse).then(function() { alert('Adresse copiée !'); }); } else { // Fallback pour navigateurs anciens var textarea = document.createElement('textarea'); textarea.value = adresse; textarea.style.position = 'fixed'; textarea.style.opacity = '0'; document.body.appendChild(textarea); textarea.select(); document.execCommand('copy'); document.body.removeChild(textarea); alert('Adresse copiée !'); } } function openDirections() { var lat = locData.lat; var lng = locData.lng; if (!lat || !lng) return; // Ouvrir Google Maps avec directions depuis la position actuelle var url = 'https://www.google.com/maps/dir/?api=1&destination=' + lat + ',' + lng; window.open(url, '_blank'); } // ── Réseaux sociaux ─────────────────────────────────────────────────── const SOCIAL_DEFS = [ { key: 'whatsapp', icon: 'fab fa-whatsapp', color: '#25D366' }, { key: 'telegram', icon: 'fab fa-telegram-plane', color: '#229ED9' }, { key: 'facebook', icon: 'fab fa-facebook-f', color: '#1877F2' }, { key: 'instagram', icon: 'fab fa-instagram', color: '#E1306C' }, ]; function renderSociaux(d) { const row = document.getElementById('social-row'); row.innerHTML = SOCIAL_DEFS .filter(s => d[s.key]) .map(s => ``) .join('') || ''; } function renderSociauxFooter(d) { const row = document.getElementById('footer-social'); row.innerHTML = SOCIAL_DEFS .filter(s => d[s.key]) .map(s => ``) .join(''); } function renderFlottants(d) { const wrap = document.getElementById('floating-btns'); const wa = document.getElementById('float-wa'); const tg = document.getElementById('float-tg'); let visible = false; if (d.whatsapp) { wa.href = d.whatsapp; wa.style.display = 'flex'; visible = true; } else { wa.style.display = 'none'; } if (d.telegram) { tg.href = d.telegram; tg.style.display = 'flex'; visible = true; } else { tg.style.display = 'none'; } if (visible) wrap.style.display = 'flex'; } // ── Page en construction ────────────────────────────────────────────── function showEnConstruction(d) { hideLoader(); document.getElementById('en-construction').classList.add('visible'); setText('ec-nom', d.nom || 'Notre école'); if (d.logo) { const img = document.getElementById('ec-logo'); img.src = d.logo; img.style.display = 'block'; } applyTheme(d); } // ── Erreur 404 ──────────────────────────────────────────────────────── function showErreur() { hideLoader(); document.body.innerHTML = `

École introuvable

Ce domaine n'est associé à aucun établissement dans notre système.

`; // Recharger Font Awesome si nécessaire const fa = document.createElement('link'); fa.rel = 'stylesheet'; fa.href = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css'; document.head.appendChild(fa); } // ── Loader ──────────────────────────────────────────────────────────── function hideLoader() { const content = document.getElementById('vitrine-content'); const loader = document.getElementById('loader'); if (content) content.classList.add('visible'); if (loader) setTimeout(() => loader.classList.add('hidden'), 300); } // ── Navbar scroll ───────────────────────────────────────────────────── function initNav() { const navbar = document.getElementById('navbar'); window.addEventListener('scroll', () => { navbar.classList.toggle('scrolled', window.scrollY > 20); }, { passive: true }); document.getElementById('nav-toggle').addEventListener('click', () => { document.getElementById('nav-mobile').classList.toggle('open'); }); } function closeMobile() { document.getElementById('nav-mobile').classList.remove('open'); } // ── Animations reveal ───────────────────────────────────────────────── function initScrollEffects() { const observer = new IntersectionObserver(entries => { entries.forEach(e => { if (e.isIntersecting) e.target.classList.add('visible'); }); }, { threshold: 0.1, rootMargin: '0px 0px -40px 0px' }); document.querySelectorAll('.reveal').forEach(el => observer.observe(el)); } // ── Lightbox ────────────────────────────────────────────────────────── var lightboxPhotos = []; var lightboxIndex = 0; function openLightbox(src, alt) { if (!src) return; // Trouver l'index de la photo cliquée for (var i = 0; i < lightboxPhotos.length; i++) { if (lightboxPhotos[i].src === src) { lightboxIndex = i; break; } } showLightboxImage(); document.getElementById('lightbox').classList.add('open'); document.body.style.overflow = 'hidden'; } function showLightboxImage() { var p = lightboxPhotos[lightboxIndex]; if (!p) return; document.getElementById('lightbox-img').src = p.src; document.getElementById('lightbox-img').alt = p.alt; document.getElementById('lightbox-counter').textContent = (lightboxIndex + 1) + ' / ' + lightboxPhotos.length; } function lightboxNav(dir) { lightboxIndex += dir; if (lightboxIndex < 0) lightboxIndex = lightboxPhotos.length - 1; if (lightboxIndex >= lightboxPhotos.length) lightboxIndex = 0; showLightboxImage(); } function closeLightbox(e) { if (e && e.target !== e.currentTarget && !e.target.closest('.lightbox-close')) return; document.getElementById('lightbox').classList.remove('open'); document.body.style.overflow = ''; } // Navigation clavier + swipe document.addEventListener('keydown', function(e) { var lb = document.getElementById('lightbox'); if (!lb || !lb.classList.contains('open')) return; if (e.key === 'ArrowRight' || e.key === 'ArrowDown') lightboxNav(1); else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') lightboxNav(-1); else if (e.key === 'Escape') closeLightbox(); }); // Swipe tactile (function() { var startX = 0; var lb = document.getElementById('lightbox'); if (!lb) return; lb.addEventListener('touchstart', function(e) { startX = e.touches[0].clientX; }, {passive: true}); lb.addEventListener('touchend', function(e) { var diff = startX - e.changedTouches[0].clientX; if (Math.abs(diff) > 50) lightboxNav(diff > 0 ? 1 : -1); }, {passive: true}); })(); // ── Formulaire contact ──────────────────────────────────────────────── /* ═══════════════════════════════════════════════════════════ PRÉ-INSCRIPTION MODAL ═══════════════════════════════════════════════════════════ */ function openPreinscr() { document.getElementById('preinscr-overlay').classList.add('open'); document.body.style.overflow = 'hidden'; } function vitrineQueryString() { const params = new URLSearchParams(window.location.search); const qp = []; if (params.get('ecoleId')) qp.push('ecoleId=' + params.get('ecoleId')); if (params.get('domain')) qp.push('domain=' + params.get('domain')); if (!qp.length) qp.push('domain=' + window.location.hostname); return '?' + qp.join('&'); } function closePreinscr() { document.getElementById('preinscr-overlay').classList.remove('open'); document.body.style.overflow = ''; } function handleFileSelect(input, docType) { const zone = document.getElementById('zone-' + docType); const fname = document.getElementById('fname-' + docType); if (input.files && input.files[0]) { const file = input.files[0]; // Limiter à 5 Mo if (file.size > 5 * 1024 * 1024) { alert('Le fichier est trop volumineux (max 5 Mo).'); input.value = ''; return; } zone.classList.add('has-file'); fname.textContent = file.name; } else { zone.classList.remove('has-file'); fname.textContent = ''; } } async function submitPreinscription() { const btn = document.getElementById('pi-submit'); const status = document.getElementById('pi-status'); status.style.display = 'none'; // Validation const nom = document.getElementById('pi-nom').value.trim(); const prenom = document.getElementById('pi-prenom').value.trim(); const dateNaissance = document.getElementById('pi-date-naissance').value; const sexe = document.getElementById('pi-sexe').value; const tuteurNom = document.getElementById('pi-tuteur-nom').value.trim(); const tuteurPrenom = document.getElementById('pi-tuteur-prenom').value.trim(); const tuteurTel = document.getElementById('pi-tuteur-tel').value.trim(); const acteInput = document.querySelector('#zone-acte input[type="file"]'); const carteInput = document.querySelector('#zone-carte input[type="file"]'); if (!nom || !prenom || !dateNaissance || !sexe || !tuteurNom || !tuteurPrenom || !tuteurTel) { showPiStatus('Veuillez remplir tous les champs obligatoires (*).', false); return; } if (!acteInput.files[0]) { showPiStatus("L'acte de naissance est obligatoire.", false); return; } if (!carteInput.files[0]) { showPiStatus("La carte d'identité du tuteur est obligatoire.", false); return; } // FormData const fd = new FormData(); fd.append('nom', nom); fd.append('prenom', prenom); fd.append('dateNaissance', dateNaissance); fd.append('lieuNaissance', document.getElementById('pi-lieu-naissance').value.trim()); fd.append('sexe', sexe); fd.append('classeSouhaitee', document.getElementById('pi-classe').value.trim()); fd.append('tuteurNom', tuteurNom); fd.append('tuteurPrenom', tuteurPrenom); fd.append('tuteurTel', tuteurTel); fd.append('tuteurEmail', document.getElementById('pi-tuteur-email').value.trim()); fd.append('observations', document.getElementById('pi-observations').value.trim()); fd.append('acteNaissance', acteInput.files[0]); const bulletinInput = document.querySelector('#zone-bulletin input[type="file"]'); if (bulletinInput.files[0]) fd.append('bulletin', bulletinInput.files[0]); const diplomeInput = document.querySelector('#zone-diplome input[type="file"]'); if (diplomeInput.files[0]) fd.append('diplome', diplomeInput.files[0]); fd.append('carteTuteur', carteInput.files[0]); btn.disabled = true; btn.innerHTML = ' Envoi en cours...'; try { const resp = await fetch(`${API_BASE}/public/vitrine/preinscription${vitrineQueryString()}`, { method: 'POST', body: fd }); // Gérer les réponses non-JSON (ex: page 404 HTML, erreur Nginx 413) let data; const contentType = resp.headers.get('content-type') || ''; if (contentType.includes('application/json')) { data = await resp.json(); } else { const text = await resp.text(); console.error('Réponse non-JSON:', resp.status, text.substring(0, 300)); if (resp.status === 413) { showPiStatus('Les fichiers sont trop volumineux. Réduisez la taille des images (max 5 Mo chacune).', false); } else if (resp.status === 404) { showPiStatus('Le service de pré-inscription n\'est pas encore disponible. Contactez l\'établissement.', false); } else { showPiStatus('Erreur serveur (HTTP ' + resp.status + '). Veuillez réessayer.', false); } btn.disabled = false; btn.innerHTML = ' Envoyer la pré-inscription'; return; } if (resp.ok && data.success) { showPiStatus('Pré-inscription envoyée avec succès ! L\'établissement vous contactera prochainement.', true); // Reset form ['pi-nom','pi-prenom','pi-date-naissance','pi-lieu-naissance','pi-sexe','pi-classe', 'pi-tuteur-nom','pi-tuteur-prenom','pi-tuteur-tel','pi-tuteur-email','pi-observations'].forEach(id => { const el = document.getElementById(id); if (el) el.value = el.tagName === 'SELECT' ? '' : ''; }); ['acte','bulletin','diplome','carte'].forEach(t => { const zone = document.getElementById('zone-' + t); const fname = document.getElementById('fname-' + t); const inp = zone.querySelector('input[type="file"]'); if (inp) inp.value = ''; zone.classList.remove('has-file'); fname.textContent = ''; }); } else { showPiStatus(data.error || 'Erreur : ' + JSON.stringify(data), false); } } catch (e) { console.error('Erreur pré-inscription:', e); showPiStatus('Erreur de connexion : ' + e.message, false); } btn.disabled = false; btn.innerHTML = ' Envoyer la pré-inscription'; } function showPiStatus(msg, ok) { const s = document.getElementById('pi-status'); s.style.display = 'block'; s.style.background = ok ? '#f0fdf4' : '#fef2f2'; s.style.color = ok ? '#166534' : '#991b1b'; s.innerHTML = (ok ? ' ' : ' ') + escHtml(msg); } async function sendMessage(btn) { const prenom = document.getElementById('msg-prenom').value.trim(); const nom = document.getElementById('msg-nom').value.trim(); const email = document.getElementById('msg-email').value.trim(); const sujet = document.getElementById('msg-sujet').value.trim(); const message = document.getElementById('msg-message').value.trim(); const status = document.getElementById('msg-status'); // Validation if (!message) { status.style.display = 'block'; status.style.background = '#fef2f2'; status.style.color = '#dc2626'; status.style.border = '1px solid #fecaca'; status.textContent = 'Veuillez écrire un message.'; return; } btn.innerHTML = ' Envoi en cours...'; btn.disabled = true; status.style.display = 'none'; try { const params = new URLSearchParams(window.location.search); let url = `${API_BASE}/public/vitrine/message`; const qp = []; if (params.get('ecoleId')) qp.push(`ecoleId=${params.get('ecoleId')}`); if (params.get('domain')) qp.push(`domain=${params.get('domain')}`); if (!qp.length) qp.push(`domain=${window.location.hostname}`); url += '?' + qp.join('&'); const r = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ prenom, nom, email, sujet, message }) }); if (r.ok) { btn.innerHTML = ' Message envoyé !'; btn.style.background = '#22c55e'; status.style.display = 'block'; status.style.background = '#f0fdf4'; status.style.color = '#16a34a'; status.style.border = '1px solid #bbf7d0'; status.textContent = '✅ Votre message a été envoyé. Nous vous répondrons rapidement.'; // Vider le formulaire ['msg-prenom','msg-nom','msg-email','msg-sujet','msg-message'].forEach(id => { const el = document.getElementById(id); if (el) el.value = ''; }); setTimeout(() => { btn.innerHTML = ' Envoyer le message'; btn.style.background = ''; btn.disabled = false; }, 5000); } else { const data = await r.json().catch(() => ({})); throw new Error(data.error || 'Erreur serveur'); } } catch (err) { btn.innerHTML = ' Envoyer le message'; btn.disabled = false; status.style.display = 'block'; status.style.background = '#fef2f2'; status.style.color = '#dc2626'; status.style.border = '1px solid #fecaca'; status.textContent = '❌ ' + err.message; } } // ── Utilitaires ─────────────────────────────────────────────────────── function setText(id, val) { const el = document.getElementById(id); if (el && val != null) el.textContent = val; } function escHtml(str) { if (!str) return ''; return String(str) .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, '''); }