refactor: factoriser le code en plusieurs fichiers (#8)

- Déplace les styles inline vers css/form.css et css/cv.css
- Crée js/main.js comme point d'entrée ES Module (type="module")
- Extrait la logique identité dans js/sections/identite.js
- Ajoute les stubs js/sections/{competences,formation,experience,hobbies}.js
- Crée les dossiers sections/{identite,competences,formation,experience,hobbies}/
  avec .gitkeep et README décrivant le contenu prévu
- Met à jour index.html : liens CSS séparés, script type=module
- Met à jour README.md : avertissement ES Modules, structure des fichiers
This commit is contained in:
stanig2106
2026-04-05 13:55:45 +01:00
parent 18ec285002
commit 792542a71f
19 changed files with 451 additions and 138 deletions
+5
View File
@@ -0,0 +1,5 @@
// Stub — Section Compétences
// À implémenter : collectCompetences(), addCompetence(), renderCompetences()
export function collectCompetences() { return []; }
export function renderCompetences(_competences) { /* no-op */ }
+5
View File
@@ -0,0 +1,5 @@
// Stub — Section Expérience professionnelle
// À implémenter : collectExperience(), addExperienceEntry(), renderExperience()
export function collectExperience() { return []; }
export function renderExperience(_entries) { /* no-op */ }
+5
View File
@@ -0,0 +1,5 @@
// Stub — Section Formation
// À implémenter : collectFormation(), addFormationEntry(), renderFormation()
export function collectFormation() { return []; }
export function renderFormation(_entries) { /* no-op */ }
+5
View File
@@ -0,0 +1,5 @@
// Stub — Section Centres d'intérêt
// À implémenter : collectHobbies(), addHobby(), renderHobbies()
export function collectHobbies() { return []; }
export function renderHobbies(_hobbies) { /* no-op */ }
+30
View File
@@ -0,0 +1,30 @@
/**
* identite.js — Section Identité
* Collecte les champs nom, prénom, email, titre depuis le formulaire.
*/
/**
* @returns {{ nom: string, prenom: string, email: string, titre: string }}
*/
export function collectIdentite() {
const get = (id) => document.getElementById(id)?.value.trim() ?? '';
return {
nom: get('nom'),
prenom: get('prenom'),
email: get('email'),
titre: get('titre'),
};
}
/**
* @param {{ nom: string, prenom: string, email: string, titre: string }} identite
*/
export function renderIdentite(identite) {
const set = (id, value) => {
const el = document.getElementById(id);
if (el) el.textContent = value;
};
set('cv-nom', `${identite.prenom} ${identite.nom}`);
set('cv-titre', identite.titre);
set('cv-email', identite.email);
}