Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

Site vitrine purement statique de la carte éducative **STeaMi**, hébergé sur GitHub Pages d'organisation (`https://steamicc.github.io/` → `https://steami.cc`).

- **Zéro JavaScript client**, **zéro dépendance externe**, **zéro cookie / traceur**.
- **Zéro dépendance externe**, **zéro cookie / traceur**, interactivité légère en JavaScript natif (~2,5 Ko, dégradation gracieuse sans JS).
- **Un seul fichier de contenu** ([`data/contenu.json`](data/contenu.json)) pour modifier tous les textes, liens, spécifications et projets, même directement depuis l'interface web de GitHub.
- **Déploiement automatique** à chaque push sur `main` via GitHub Actions.

## Structure du dépôt

```text
data/contenu.json ← Tous les textes, liens, spécifications et listes (à modifier en priorité)
assets/css/style.css ← Couleurs (:root) et mise en page
assets/css/style.css ← Couleurs (:root), mise en page et transitions
assets/js/main.js ← Interactivité légère (scrollspy, animations d'apparition, retour en haut, menu mobile)
assets/img/ ← Photos de la carte et logos locaux (plateformes, partenaires, financeurs)
scripts/build.py ← Générateur statique (Python 3 stdlib uniquement)
scripts/test_build.py ← Tests de validation (structure JSON, images existantes, génération)
Expand Down
104 changes: 97 additions & 7 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,18 @@ summary:focus-visible {
font-weight: 700;
font-size: 0.92rem;
text-decoration: none;
transition: background-color 0.15s ease, transform 0.12s ease;
transition: background-color 0.25s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.bouton-steami:hover {
background: var(--jaune-survol);
transform: translateY(-1px);
transform: translate(-1px, -1px);
box-shadow: 3px 3px 0 var(--noir);
}

.bouton-steami:active {
transform: translate(1px, 1px);
box-shadow: none;
}

.bouton-blanc {
Expand All @@ -127,6 +133,11 @@ summary:focus-visible {
background: var(--blanc);
border-top: 6px solid var(--noir);
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
transition: box-shadow 0.25s ease;
}

.entete--defilee {
box-shadow: 0 4px 18px rgba(0, 0, 0, 0.09);
}

.entete-interieur {
Expand Down Expand Up @@ -172,11 +183,17 @@ summary:focus-visible {
font-size: 0.92rem;
font-weight: 400;
border-radius: 3px;
transition: background-color 0.15s ease;
transition: background-color 0.25s ease, color 0.2s ease;
}

.nav-liens a:hover {
.nav-liens a:hover,
.nav-liens a.nav-actif {
background: var(--jaune);
color: var(--noir);
}

.nav-liens a.nav-actif {
font-weight: 600;
}

/* Menu mobile sans JavaScript */
Expand Down Expand Up @@ -409,12 +426,23 @@ summary:focus-visible {
background: var(--blanc);
aspect-ratio: 452 / 414;
margin-bottom: 1.25rem;
transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.vignette-encadree img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.35s ease;
}

.carte-fonctionnalite:hover .vignette-encadree {
transform: translate(-2px, -2px);
box-shadow: 4px 4px 0 var(--noir);
}

.carte-fonctionnalite:hover .vignette-encadree img {
transform: scale(1.04);
}

.carte-fonctionnalite h3 {
Expand Down Expand Up @@ -499,6 +527,11 @@ summary:focus-visible {
max-height: 86px;
width: auto;
object-fit: contain;
transition: transform 0.25s ease;
}

.colonne-environnement:hover .colonne-environnement-logo img {
transform: scale(1.06);
}

.colonne-environnement p {
Expand Down Expand Up @@ -552,6 +585,11 @@ summary:focus-visible {

.specs-tableau tr {
border-bottom: 1px solid var(--bordure-tableau);
transition: background-color 0.2s ease;
}

.specs-tableau tbody tr:hover {
background: #fff9e6;
}

.specs-tableau th,
Expand Down Expand Up @@ -618,13 +656,24 @@ summary:focus-visible {
aspect-ratio: 1 / 1;
background: var(--blanc);
margin-bottom: 1.15rem;
transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.projet-vignette img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
transition: transform 0.35s ease;
}

.carte-projet:hover .projet-vignette {
transform: translate(-2px, -2px);
box-shadow: 4px 4px 0 var(--noir);
}

.carte-projet:hover .projet-vignette img {
transform: scale(1.05);
}

.carte-projet h3 {
Expand Down Expand Up @@ -818,14 +867,14 @@ summary:focus-visible {
margin-left: 0.35rem;
}

/* Bouton flottant retour en haut (sans JS) */
/* Bouton flottant retour en haut (apparition progressive au défilement) */
.retour-haut {
position: fixed;
right: 1.25rem;
bottom: 1.25rem;
z-index: 90;
width: 40px;
height: 40px;
width: 44px;
height: 44px;
display: inline-flex;
align-items: center;
justify-content: center;
Expand All @@ -834,6 +883,23 @@ summary:focus-visible {
border-radius: 4px;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
text-decoration: none;
transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.2s ease;
}

.js-prete .retour-haut {
opacity: 0;
pointer-events: none;
transform: translateY(10px);
}

.js-prete .retour-haut.est-visible {
opacity: 1;
pointer-events: auto;
transform: translateY(0);
}

.retour-haut:hover {
border-color: var(--noir);
}

.retour-haut-carre {
Expand All @@ -847,10 +913,34 @@ summary:focus-visible {
border-radius: 2px;
font-size: 0.75rem;
line-height: 1;
transition: background-color 0.2s ease, transform 0.2s ease;
}

.retour-haut:hover .retour-haut-carre {
background: var(--jaune-survol);
transform: scale(1.08);
}

/* --- Animations d'apparition au défilement (dégradation gracieuse sans JS) --- */

@media (prefers-reduced-motion: no-preference) {
.js-prete [data-anim='fade'] {
opacity: 0;
transition: opacity 0.85s cubic-bezier(0.445, 0.05, 0.55, 0.95) var(--delai, 0ms);
}

.js-prete [data-anim='float'] {
opacity: 0;
transform: translateY(24px);
transition:
opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1) var(--delai, 0ms),
transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) var(--delai, 0ms);
}

.js-prete [data-anim].visible {
opacity: 1;
transform: none;
}
}

/* --- Page texte (Politique de confidentialité) --- */
Expand Down
131 changes: 131 additions & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/*
* Interactivité légère de steami.cc (sans dépendance, sans cookie) :
* - suivi de la section active dans la navigation (scrollspy)
* - animations d'apparition au défilement (respecte prefers-reduced-motion)
* - affichage progressif du bouton retour en haut et ombre de l'en-tête
* - fermeture fluide du menu mobile
*/
(() => {
const entete = document.querySelector('.entete');
const retourHaut = document.querySelector('.retour-haut');
const menuMobile = document.querySelector('.menu-mobile');

// 1. Animations d'apparition au défilement
const elementsAnimes = Array.from(document.querySelectorAll('[data-anim]'));
const reduireMouvement = window.matchMedia('(prefers-reduced-motion: reduce)').matches;

if (reduireMouvement || !('IntersectionObserver' in window)) {
elementsAnimes.forEach((el) => el.classList.add('visible'));
} else {
const observateur = new IntersectionObserver(
(entrees) => {
entrees.forEach((entree) => {
if (entree.isIntersecting) {
entree.target.classList.add('visible');
observateur.unobserve(entree.target);
}
});
},
{ threshold: 0.12, rootMargin: '0px 0px -40px 0px' },
);

elementsAnimes.forEach((el) => observateur.observe(el));

// Filet de sécurité : les éléments déjà dans ou au-dessus du viewport sont révélés immédiatement
const revelerVisibles = () => {
const limite = window.innerHeight * 0.96;
elementsAnimes.forEach((el) => {
if (!el.classList.contains('visible') && el.getBoundingClientRect().top < limite) {
el.classList.add('visible');
observateur.unobserve(el);
}
});
};
revelerVisibles();
}

// 2. Scrollspy dans la navigation + ombre d'en-tête + bouton retour en haut
const liensNav = Array.from(document.querySelectorAll('.nav-liens a[href^="#"]'));
const sections = liensNav
.map((lien) => {
const id = lien.getAttribute('href').slice(1);
const section = document.getElementById(id);
return section ? { id, lien, section } : null;
})
.filter(Boolean);

let demandeEnCours = false;

const mettreAJourDefilement = () => {
demandeEnCours = false;
const y = window.scrollY;

if (entete) {
entete.classList.toggle('entete--defilee', y > 12);
}

if (retourHaut) {
retourHaut.classList.toggle('est-visible', y > 320);
}

if (!sections.length) return;

const hauteurEntete = entete ? entete.offsetHeight : 80;
const enBasDePage =
window.innerHeight + y >= document.documentElement.scrollHeight - 24;

let actif = null;
if (enBasDePage) {
actif = sections[sections.length - 1];
} else {
const repere = y + hauteurEntete + Math.min(180, window.innerHeight * 0.25);
for (const item of sections) {
if (item.section.offsetTop <= repere) {
actif = item;
}
}
}

sections.forEach(({ lien }) => {
const estActif = actif !== null && actif.lien === lien;
lien.classList.toggle('nav-actif', estActif);
if (estActif) {
lien.setAttribute('aria-current', 'location');
} else {
lien.removeAttribute('aria-current');
}
});
};

const planifierMiseAJour = () => {
if (!demandeEnCours) {
demandeEnCours = true;
window.requestAnimationFrame(mettreAJourDefilement);
}
};

window.addEventListener('scroll', planifierMiseAJour, { passive: true });
window.addEventListener('resize', planifierMiseAJour, { passive: true });
mettreAJourDefilement();

// 3. Fermeture automatique du menu mobile
if (menuMobile) {
menuMobile.querySelectorAll('a').forEach((lien) => {
lien.addEventListener('click', () => {
menuMobile.removeAttribute('open');
});
});

document.addEventListener('click', (evenement) => {
if (menuMobile.hasAttribute('open') && !menuMobile.contains(evenement.target)) {
menuMobile.removeAttribute('open');
}
});

document.addEventListener('keydown', (evenement) => {
if (evenement.key === 'Escape' && menuMobile.hasAttribute('open')) {
menuMobile.removeAttribute('open');
}
});
}
})();
Loading
Loading