vercors.me : panneaux déroulants (stations, bilan), bouton Gastinel, pages d'aperçu du forum
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cette révision appartient à :
1 Parent
f7e9d77de2
révision
9a4472d83e
8 fichiers modifiés
+651
-21
Aucun fichier ne correspond à votre recherche
@@ -22,6 +22,8 @@
|
||||
--roche:#2b2f2c; --glacier:#6eb5bd; --chaud:#b5643c; --gris:#5d635e;
|
||||
}
|
||||
*{box-sizing:border-box}
|
||||
html{scroll-behavior:smooth}
|
||||
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
|
||||
html,body{margin:0;background:var(--calcaire);color:var(--roche);font-family:var(--texte)}
|
||||
a{color:inherit}
|
||||
|
||||
@@ -152,7 +154,7 @@ a{color:inherit}
|
||||
.cartouche{position:absolute;top:28px;left:28px;width:340px;z-index:4;
|
||||
background:rgba(250,249,245,.95);border:1px solid var(--roche);outline:1px solid var(--roche);outline-offset:4px;padding:16px 20px 18px}
|
||||
.cartouche nav{display:flex;justify-content:space-between;align-items:baseline;font-size:11px;font-weight:600;letter-spacing:.16em;text-transform:uppercase}
|
||||
.cartouche nav span{color:var(--sapin)}
|
||||
.cartouche nav span{color:var(--sapin);font-size:16px;letter-spacing:.22em}
|
||||
.cartouche nav a{text-decoration:none;margin-left:14px;color:var(--gris)}
|
||||
.cartouche nav a:hover{color:var(--roche);text-decoration:underline}
|
||||
.cartouche h1{margin:6px 0 0;font-family:var(--titre);font-weight:700;font-size:66px;line-height:.95;letter-spacing:-.015em;color:var(--sapin)}
|
||||
@@ -215,8 +217,12 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
|
||||
.record{flex:0 0 100%;font-size:11.5px;color:var(--gris)}
|
||||
.record select{font:inherit;font-size:11.5px;color:var(--sapin);background:#fff;border:1px solid var(--pierre);border-radius:0;padding:3px 4px;margin-left:4px}
|
||||
.compte{margin:10px 0 0;font-size:12px;color:var(--gris)}
|
||||
.compte span{color:var(--sapin);font-weight:600}
|
||||
.compte-bloc{margin-top:10px}
|
||||
.compte{display:inline-flex;align-items:center;gap:10px;padding:6px 12px 6px 6px;background:#fff;border:1px solid var(--sapin);color:var(--sapin);font-size:12.5px;font-weight:600;text-decoration:none}
|
||||
.compte:hover{background:var(--sapin);color:#fff}
|
||||
.compte .gmark{display:inline-grid;place-items:center;width:22px;height:22px;background:var(--sapin);color:#fff;font-family:var(--titre);font-weight:700;font-size:14px}
|
||||
.compte:hover .gmark{background:#fff;color:var(--sapin)}
|
||||
.compte-bloc small{display:block;margin-top:5px;font-size:11px;color:var(--gris)}
|
||||
.coupe{padding-bottom:8px}
|
||||
#coupe-svg svg{width:100%;height:auto;display:block;background:#faf9f5;border:1px solid var(--roche)}
|
||||
#coupe-svg text{font-family:var(--texte);font-size:11px;fill:var(--gris)}
|
||||
@@ -227,6 +233,28 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
#coupe-svg .st text{fill:var(--roche);font-size:11px;font-weight:600}
|
||||
.coupe-lect{min-height:1.5em;font-size:14px;color:var(--roche)}
|
||||
.puce.mis > button{outline:2px solid var(--roche);outline-offset:2px}
|
||||
/* ---------- panneaux déroulants ---------- */
|
||||
.panneaux{max-width:1080px;margin:0 auto;padding:36px 28px 32px;display:grid;gap:14px}
|
||||
.panneau{border:1px solid var(--roche);background:#faf9f5}
|
||||
.panneau-tete{display:flex;align-items:baseline;gap:14px;width:100%;padding:18px 20px;background:none;border:0;border-radius:0;cursor:pointer;text-align:left;font:inherit;color:var(--sapin)}
|
||||
.panneau-tete b{font-family:var(--titre);font-weight:600;font-size:24px}
|
||||
.panneau-tete small{font-size:13px;color:var(--gris)}
|
||||
.panneau-tete i{margin-left:auto;align-self:center;width:9px;height:9px;border-right:2px solid var(--sapin);border-bottom:2px solid var(--sapin);transform:rotate(45deg);transition:transform .4s ease}
|
||||
.panneau.ouvert .panneau-tete i{transform:rotate(225deg)}
|
||||
.panneau-corps{display:grid;grid-template-rows:0fr;transition:grid-template-rows .45s ease}
|
||||
.panneau.ouvert .panneau-corps{grid-template-rows:1fr}
|
||||
.panneau-in{overflow:hidden;min-height:0}
|
||||
.corps-liste{padding:2px 20px 22px}
|
||||
.corps-liste > p{margin:0 0 14px;color:var(--gris);font-size:14.5px}
|
||||
.corps-liste h3{font-family:var(--titre);font-weight:600;font-size:18px;margin:22px 0 10px}
|
||||
.bilan{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));border-top:1px solid var(--roche);border-left:1px solid var(--roche)}
|
||||
.bilan div{padding:12px 14px;border-right:1px solid var(--roche);border-bottom:1px solid var(--roche);background:#faf9f5}
|
||||
.bilan small{display:block;font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--gris)}
|
||||
.bilan b{display:block;font-family:var(--titre);font-size:28px;margin:2px 0}
|
||||
.bilan span{font-size:13px;color:var(--roche)}
|
||||
.bilan-note{margin:10px 0 0;font-size:12px;color:var(--gris)}
|
||||
@media (prefers-reduced-motion:reduce){.panneau-corps,.panneau-tete i{transition:none}}
|
||||
@media (max-width:719px){.panneaux{padding:24px 16px 24px}.panneau-tete{padding:14px 14px;flex-wrap:wrap;gap:2px 10px}.panneau-tete b{font-size:20px}.corps-liste{padding:2px 14px 18px}}
|
||||
/* ---------- sous la carte ---------- */
|
||||
.liste{max-width:1080px;margin:0 auto;padding:56px 28px 32px}
|
||||
.liste h2{font-family:var(--titre);font-weight:600;font-size:28px;margin:0 0 4px;color:var(--sapin)}
|
||||
@@ -260,7 +288,7 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
.cartouche h1{transition:font-size .35s ease,margin .35s ease}
|
||||
.cartouche .phrase,.cartouche .reseau,.cartouche .date{max-height:160px;overflow:hidden;transition:max-height .35s ease,opacity .25s ease,margin .35s ease,padding .35s ease}
|
||||
.cartouche.replie .phrase,.cartouche.replie .reseau,.cartouche.replie .date{max-height:0;opacity:0;margin-top:0;padding-top:0;border-top-color:transparent}
|
||||
.cartouche.replie #retour,.cartouche.replie .outils{display:none}
|
||||
.cartouche.replie #retour,.cartouche.replie .outils,.cartouche.replie .compte-bloc{display:none}
|
||||
.cartouche.replie h1{font-size:30px;margin-top:2px}
|
||||
.cartouche.replie{padding-bottom:9px}
|
||||
.cartouche .phrase{font-size:14.5px;margin-top:10px;padding-top:9px}
|
||||
@@ -293,7 +321,7 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
<div class="commandes" id="commandes"><button type="button" id="plus" aria-label="Zoomer">+</button><button type="button" id="moins" aria-label="Dézoomer">−</button></div>
|
||||
|
||||
<header class="cartouche" id="cartouche">
|
||||
<nav><span>Météo</span><div><a href="#stations">Stations</a><a href="#">À propos</a></div></nav>
|
||||
<nav><span>Météo</span><div><a href="#stations">Stations</a><a href="a-propos.html">À propos</a></div></nav>
|
||||
<h1>Vercors</h1>
|
||||
<p class="date" id="date">Mardi 3 novembre · relevés de 7 h 40</p>
|
||||
<p class="phrase" id="phrase"></p>
|
||||
@@ -303,7 +331,7 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
|
||||
<label class="record">Mise en avant <select id="record"><option value="auto">Selon la saison</option><option value="froid">Plus froid</option><option value="chaud">Plus chaud</option><option value="vent">Plus de vent</option><option value="pluie">Plus de pluie</option></select></label>
|
||||
</div>
|
||||
<p class="compte">Compte Gastinel · <span>bientôt</span></p>
|
||||
<div class="compte-bloc"><a class="compte" href="forum/connexion.html"><span class="gmark" aria-hidden="true">G</span>Se connecter avec Gastinel</a><small>Un seul compte : favoris, alerte gel, forum.</small></div>
|
||||
<button type="button" id="retour">← Tout le massif</button>
|
||||
<div class="pendule" id="pendule" aria-live="polite"><i class="corde g"></i><i class="corde d"></i>
|
||||
<span class="pancarte" id="direct">Relevés en cours…</span></div>
|
||||
@@ -327,10 +355,18 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
<div id="coupe-svg"></div>
|
||||
<p class="coupe-lect" id="coupe-lect" aria-live="polite">Survole ou touche une station.</p>
|
||||
</section>
|
||||
<section class="liste" id="stations">
|
||||
<h2>Les stations</h2>
|
||||
<p>Toutes les stations du massif, du nord au sud. Sur la carte : une valeur par village ou par site ; le détail ici.</p>
|
||||
<div id="secteurs"></div>
|
||||
<section class="panneaux" id="stations">
|
||||
<div class="panneau" id="p-stations">
|
||||
<button type="button" class="panneau-tete" aria-expanded="false" aria-controls="c-stations"><b>Les stations</b><small>toutes, du nord au sud</small><i aria-hidden="true"></i></button>
|
||||
<div class="panneau-corps" id="c-stations" inert><div class="panneau-in"><div class="corps-liste">
|
||||
<p>Sur la carte : une valeur par village ou par site ; le détail ici.</p>
|
||||
<div id="secteurs"></div>
|
||||
</div></div></div>
|
||||
</div>
|
||||
<div class="panneau" id="p-bilan">
|
||||
<button type="button" class="panneau-tete" aria-expanded="false" aria-controls="c-bilan"><b>Bilan de la semaine</b><small>records des 7 derniers jours</small><i aria-hidden="true"></i></button>
|
||||
<div class="panneau-corps" id="c-bilan" inert><div class="panneau-in"><div class="corps-liste" id="bilan">Chargement…</div></div></div>
|
||||
</div>
|
||||
</section>
|
||||
<footer class="pied">
|
||||
<div class="pied-grille">
|
||||
@@ -937,6 +973,43 @@ document.getElementById('secteurs').addEventListener('click', ev => {
|
||||
const c = ev.target.closest('.case'); if (c && STATIONS[c.dataset.id]) ouvrirPlein([c.dataset.id], c.dataset.id);
|
||||
});
|
||||
|
||||
// panneaux déroulants (stations, bilan)
|
||||
function basculer(p, oui){
|
||||
const o = oui == null ? !p.classList.contains('ouvert') : oui;
|
||||
p.classList.toggle('ouvert', o);
|
||||
p.querySelector('.panneau-tete').setAttribute('aria-expanded', o);
|
||||
p.querySelector('.panneau-corps').inert = !o;
|
||||
if (o && p.id === 'p-bilan') remplirBilan();
|
||||
}
|
||||
document.querySelectorAll('.panneau-tete').forEach(b => b.addEventListener('click', () => basculer(b.closest('.panneau'))));
|
||||
document.querySelectorAll('a[href="#stations"]').forEach(a => a.addEventListener('click', ev => {
|
||||
ev.preventDefault(); basculer(document.getElementById('p-stations'), true);
|
||||
document.getElementById('stations').scrollIntoView({behavior: reduit ? 'auto' : 'smooth', block: 'start'});
|
||||
history.replaceState(null, '', '#stations');
|
||||
}));
|
||||
if (location.hash === '#stations') basculer(document.getElementById('p-stations'), true);
|
||||
async function remplirBilan(){
|
||||
const z = document.getElementById('bilan');
|
||||
await chargerSeries();
|
||||
if (!SERIES || !Object.keys(SERIES).length) { z.textContent = 'Pas encore assez de relevés.'; return; }
|
||||
let fr, ch, vt, pl, debut = Infinity;
|
||||
Object.entries(SERIES).forEach(([id, d]) => {
|
||||
debut = Math.min(debut, d.archive_depuis || d.debut);
|
||||
const cap = SEM[id] || {};
|
||||
d.t.forEach((v, i) => {
|
||||
const ts = d.debut + i * d.pas;
|
||||
if (v != null) { if (!fr || v < fr.v) fr = {v, id, ts}; if (!ch || v > ch.v) ch = {v, id, ts}; }
|
||||
if (cap.vent && d.v[i] != null && (!vt || d.v[i] > vt.v)) vt = {v: d.v[i], id, ts};
|
||||
if (cap.pluie && d.r[i] != null && d.r[i] > 0 && (!pl || d.r[i] > pl.v)) pl = {v: d.r[i], id, ts};
|
||||
});
|
||||
});
|
||||
const jours = (Date.now() / 1000 - debut) / 86400;
|
||||
const quand = r => `${court(STATIONS[r.id].nom)} · ${fmtJH.format(new Date(r.ts * 1000)).replace(',', '')}`;
|
||||
const carte = (titre, r, val) => `<div><small>${titre}</small><b>${r ? val(r.v) : '—'}</b><span>${r ? quand(r) : 'aucune mesure'}</span></div>`;
|
||||
z.innerHTML = `<div class="bilan">${carte('Le plus froid', fr, fmt)}${carte('Le plus chaud', ch, fmt)}${carte('Vent moyen maximal', vt, v => Math.round(v) + ' km/h')}${carte('Pluie la plus forte en 1 h', pl, v => nb1(v) + ' mm')}</div>`
|
||||
+ (jours < 6.5 ? `<p class="bilan-note">L'archive couvre ${Math.max(1, Math.round(jours * 10) / 10).toString().replace('.', ',')} jours pour l'instant ; elle se complète jour après jour.</p>` : '');
|
||||
}
|
||||
|
||||
// données en direct : postes Météo-France (collecteur toutes les 6 min) et stations Infoclimat (extraction du fichier LAN)
|
||||
const POSTES_MF = {'mf-autrans': 'autrans', 'mf-villard': 'villard', 'mf-chapelle': 'chapelle',
|
||||
'mf-rousset': 'rousset', 'mf-gresse': 'gresse', 'mf-st-jean': 'st-jean'};
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur