Comparer les révisions
10
Révisions
ff42faca16
..
main
| Auteur | SHA1 | Date | ||
|---|---|---|---|---|
| ||||
|
|
6ec2910d76 | |||
|
|
3884dc5401 | |||
|
|
11d44a563e | |||
|
|
c955635e4e | |||
|
|
8e22a0185b | |||
|
|
6c254eb2dd | |||
|
|
4676ae95fd | |||
|
|
9a4472d83e | |||
|
|
f7e9d77de2 | |||
|
|
d40201d089 | |||
Aucun fichier ne correspond à votre recherche
@@ -35,6 +35,9 @@ SCHEMA = """CREATE TABLE IF NOT EXISTS obs (
|
||||
PRIMARY KEY (id, ts)) WITHOUT ROWID"""
|
||||
|
||||
|
||||
# Stations sans anémomètre ni pluviomètre (la VP2 de Lans village enregistre 0 par défaut)
|
||||
SANS_CAPTEUR = {"lans": ("v", "r")}
|
||||
|
||||
def epoch(dh_utc):
|
||||
d = dt.datetime.strptime(dh_utc[:19].replace("T", " "), "%Y-%m-%d %H:%M:%S").replace(tzinfo=dt.timezone.utc)
|
||||
return int(d.timestamp())
|
||||
@@ -99,6 +102,8 @@ def courbes(db, maintenant, jours=JOURS):
|
||||
"v": [moyenne(c[2] for c in cs) for cs in cases],
|
||||
"r": pluie,
|
||||
}
|
||||
for grandeur in SANS_CAPTEUR.get(sid, ()): # station sans ce capteur : les zéros du logger ne sont pas des mesures
|
||||
courbe[grandeur] = [None] * len(courbe[grandeur])
|
||||
courbe["capteurs"] = {"vent": any(x is not None for x in courbe["v"]),
|
||||
"pluie": any(x is not None for x in courbe["r"]),
|
||||
"humidite": any(x is not None for x in courbe["h"])}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
# Envoie les JSON publics de vercors.me (data/*.json et data/semaine/*.json) vers le VPS, par la clé restreinte.
|
||||
# Lancé après chaque collecte (voir ExecStartPost de meteo-vercors-mf.service). Aucune donnée privée : seuls les fichiers déjà publics.
|
||||
set -eu
|
||||
DATA="$HOME/services/pages-temp/www/accueil-vercors/data"
|
||||
CLE="$HOME/.ssh/vercors_push"
|
||||
cd "$DATA"
|
||||
tar -cf - $(ls *.json) $(ls semaine/*.json 2>/dev/null) \
|
||||
| ssh -i "$CLE" -o BatchMode=yes -o ConnectTimeout=15 -o StrictHostKeyChecking=yes debian@179.237.102.233
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Récepteur des données publiques de vercors.me, sur le VPS (commande forcée d'une clé ssh restreinte).
|
||||
|
||||
Lit une archive tar sur l'entrée standard et n'écrit QUE des fichiers JSON de données dans /srv/vercors.me/data :
|
||||
<nom>.json ou semaine/<nom>.json (nom : lettres minuscules, chiffres, tiret, souligné, point)
|
||||
Tout le reste (chemin absolu, "..", lien, répertoire autre, fichier trop gros) est refusé.
|
||||
Écriture atomique : fichier temporaire puis renommage.
|
||||
"""
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import tarfile
|
||||
|
||||
RACINE = "/srv/vercors.me/data"
|
||||
NOM = re.compile(r"^(?:semaine/)?[a-z0-9][a-z0-9._-]{0,63}\.json$")
|
||||
TAILLE_MAX = 2_000_000
|
||||
FICHIERS_MAX = 100
|
||||
|
||||
|
||||
def main():
|
||||
ecrits = 0
|
||||
with tarfile.open(fileobj=sys.stdin.buffer, mode="r|") as archive:
|
||||
for m in archive:
|
||||
if m.isdir():
|
||||
continue
|
||||
if not m.isreg() or not NOM.match(m.name) or m.size > TAILLE_MAX:
|
||||
print("refusé :", m.name, file=sys.stderr)
|
||||
return 2
|
||||
if ecrits >= FICHIERS_MAX:
|
||||
print("trop de fichiers", file=sys.stderr)
|
||||
return 2
|
||||
contenu = archive.extractfile(m).read()
|
||||
cible = os.path.join(RACINE, m.name)
|
||||
os.makedirs(os.path.dirname(cible), exist_ok=True)
|
||||
tmp = cible + ".tmp"
|
||||
with open(tmp, "wb") as f:
|
||||
f.write(contenu)
|
||||
os.chmod(tmp, 0o644)
|
||||
os.replace(tmp, cible)
|
||||
ecrits += 1
|
||||
print("reçus :", ecrits)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -63,13 +63,12 @@ th{background:#faf9f5;font-weight:600}
|
||||
<p>Site indépendant, sans lien avec le Parc naturel régional du Vercors ni avec une commune. Les relevés ne remplacent pas un bulletin officiel (Météo-France, Vigilance) pour la sécurité en montagne.</p>
|
||||
|
||||
<h2 id="mentions">Mentions légales</h2>
|
||||
<p><b>Éditeur</b> : Théo Gastinel, micro-entreprise. Directeur de la publication : Théo Gastinel.<br>
|
||||
SIRET et adresse : [À COMPLÉTER].<br>
|
||||
<p><b>Éditeur</b> : Richard GASTINEL, entrepreneur individuel (EI), micro-entreprise dont Théo et Richard Gastinel sont tous deux responsables (SIRET 10481674900014 ; 621, avenue Léopold Fabre, 38250 Lans-en-Vercors, France ; 06 36 27 64 19). Directeur de la publication : Théo Gastinel.<br>
|
||||
Contact : <a href="mailto:studio@gastinel.me">studio@gastinel.me</a></p>
|
||||
<p><b>Hébergement</b> : [À COMPLÉTER : nom, adresse et contact de l'hébergeur].</p>
|
||||
<p><b>Hébergement</b> : Infomaniak Network SA, Rue Eugène-Marziano 25, 1227 Les Acacias (Genève), Suisse, +41 22 820 35 44, www.infomaniak.com. Les relevés sont collectés et archivés sur un serveur de l'éditeur à Lans-en-Vercors.</p>
|
||||
<p><b>Données personnelles</b> : la page ne dépose aucun cookie et n'a pas de compte. Les journaux techniques du serveur (adresse IP, page demandée) servent à la sécurité ; durée de conservation : voir la politique de confidentialité à venir. Pour toute demande : studio@gastinel.me.</p>
|
||||
<p><b>Propriété</b> : le code et la mise en page sont de Théo Gastinel. Les mesures appartiennent à leurs exploitants (voir sources).</p>
|
||||
</main>
|
||||
<footer class="pied">© Théo Gastinel · <a href="cgu.html">CGU</a> · <a href="confidentialite.html">Confidentialité</a> · <a href="./">Retour à la carte</a></footer>
|
||||
<footer class="pied">© Théo Gastinel · <a href="./">Retour à la carte</a></footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -61,10 +61,9 @@ th{background:#faf9f5;font-weight:600}
|
||||
<p>Site indépendant, sans lien avec le Parc naturel régional du Vercors ni avec une commune. Les relevés ne remplacent pas un bulletin officiel (Météo-France, Vigilance) pour la sécurité en montagne.</p>
|
||||
|
||||
<h2 id="mentions">Mentions légales</h2>
|
||||
<p><b>Éditeur</b> : Théo Gastinel, micro-entreprise. Directeur de la publication : Théo Gastinel.<br>
|
||||
SIRET et adresse : [À COMPLÉTER].<br>
|
||||
<p><b>Éditeur</b> : Richard GASTINEL, entrepreneur individuel (EI), micro-entreprise dont Théo et Richard Gastinel sont tous deux responsables (SIRET 10481674900014 ; 621, avenue Léopold Fabre, 38250 Lans-en-Vercors, France ; 06 36 27 64 19). Directeur de la publication : Théo Gastinel.<br>
|
||||
Contact : <a href="mailto:studio@gastinel.me">studio@gastinel.me</a></p>
|
||||
<p><b>Hébergement</b> : [À COMPLÉTER : nom, adresse et contact de l'hébergeur].</p>
|
||||
<p><b>Hébergement</b> : Infomaniak Network SA, Rue Eugène-Marziano 25, 1227 Les Acacias (Genève), Suisse, +41 22 820 35 44, www.infomaniak.com. Les relevés sont collectés et archivés sur un serveur de l'éditeur à Lans-en-Vercors.</p>
|
||||
<p><b>Données personnelles</b> : la page ne dépose aucun cookie et n'a pas de compte. Les journaux techniques du serveur (adresse IP, page demandée) servent à la sécurité ; durée de conservation : voir la politique de confidentialité à venir. Pour toute demande : studio@gastinel.me.</p>
|
||||
<p><b>Propriété</b> : le code et la mise en page sont de Théo Gastinel. Les mesures appartiennent à leurs exploitants (voir sources).</p>
|
||||
</main>
|
||||
|
||||
@@ -11,7 +11,8 @@ import sys
|
||||
|
||||
ICI = os.path.dirname(os.path.abspath(__file__))
|
||||
DEST = os.path.join(os.path.dirname(os.path.dirname(ICI)), "site-v2")
|
||||
PAGES = ("index.html", "a-propos.html", "cgu.html", "confidentialite.html")
|
||||
# CGU et confidentialité : retirées de la version publique jusqu'à la relecture juridique (textes dans maquettes/ et Documents/Meteo-Vercors/08-Juridique)
|
||||
PAGES = ("index.html", "a-propos.html")
|
||||
|
||||
|
||||
def main():
|
||||
@@ -21,6 +22,15 @@ def main():
|
||||
src = os.path.join(ICI, "a-propos-build.html" if nom == "a-propos.html" else nom)
|
||||
if os.path.exists(src):
|
||||
shutil.copy(src, os.path.join(DEST, nom))
|
||||
# forum non ouvert : pas de lien vers des pages qui n'existent pas encore en ligne
|
||||
ip = os.path.join(DEST, "index.html")
|
||||
t = open(ip, encoding="utf-8").read()
|
||||
t = t.replace('<li><a href="cgu.html">CGU</a></li>', '').replace('<li><a href="confidentialite.html">Confidentialité</a></li>', '')
|
||||
t = t.replace('href="forum/index.html"', 'aria-disabled="true"').replace('href="forum/connexion.html"', 'aria-disabled="true"')
|
||||
open(ip, "w", encoding="utf-8").write(t)
|
||||
open(os.path.join(DEST, "robots.txt"), "w", encoding="utf-8").write("User-agent: *\nAllow: /\nSitemap: https://vercors.me/sitemap.xml\n")
|
||||
urls = "".join("<url><loc>https://vercors.me/%s</loc></url>" % u for u in ("", "a-propos"))
|
||||
open(os.path.join(DEST, "sitemap.xml"), "w", encoding="utf-8").write('<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">%s</urlset>\n' % urls)
|
||||
for dossier in ("polices", "tuiles"):
|
||||
src = os.path.join(ICI, dossier)
|
||||
if os.path.isdir(src):
|
||||
|
||||
@@ -46,10 +46,10 @@ th{background:#faf9f5;font-weight:600}
|
||||
<p>La politique de confidentialité, document distinct et autonome, décrit le traitement des données personnelles.</p>
|
||||
<h2>Article 1 : Éditeur et hébergement</h2>
|
||||
<ul>
|
||||
<li><b>Éditeur</b> : Théo Gastinel, micro-entreprise. SIRET : <mark class="a-trancher">[À COMPLÉTER]</mark>. Adresse : <mark class="a-trancher">[À COMPLÉTER]</mark>. <mark class="a-trancher">[À VÉRIFIER : gastinel.me désigne comme éditeur « Richard GASTINEL, entrepreneur individuel (EI) » ; l'éditeur de vercors.me doit être la personne qui détient le SIRET indiqué.]</mark></li>
|
||||
<li><b>Éditeur</b> : Richard GASTINEL, entrepreneur individuel (EI), micro-entreprise dont Théo et Richard Gastinel sont tous deux responsables (SIRET 10481674900014 ; 621, avenue Léopold Fabre, 38250 Lans-en-Vercors, France ; 06 36 27 64 19). Directeur de la publication : Théo Gastinel.</li>
|
||||
<li><b>Directeur de la publication</b> : Théo Gastinel.</li>
|
||||
<li><b>Contact</b> : <a href="mailto:studio@gastinel.me">studio@gastinel.me</a></li>
|
||||
<li><b>Hébergeur</b> : <mark class="a-trancher">[À COMPLÉTER : nom ou raison sociale, adresse et téléphone, mentions obligatoires au titre de l'article 6-III de la loi n° 2004-575 du 21 juin 2004 pour la confiance dans l'économie numérique (LCEN)]</mark>.</li>
|
||||
<li><b>Hébergeur</b> : Infomaniak Network SA, Rue Eugène-Marziano 25, 1227 Les Acacias (Genève), Suisse, +41 22 820 35 44, www.infomaniak.com. Les relevés sont collectés et archivés sur un serveur de l'éditeur à Lans-en-Vercors.</li>
|
||||
</ul>
|
||||
<h2>Article 2 : Objet du Site</h2>
|
||||
<p>Le Site affiche en direct les mesures de stations météorologiques situées dans le Vercors : carte des stations, courbes des sept derniers jours (température, humidité, et vent et pluie selon les capteurs) et archive des relevés. C'est un projet personnel, indépendant et non commercial, sans lien avec le Parc naturel régional du Vercors ni avec une commune.</p>
|
||||
|
||||
@@ -44,10 +44,10 @@ th{background:#faf9f5;font-weight:600}
|
||||
<p>Cette page décrit de manière autonome la façon dont vos données personnelles sont collectées, utilisées et protégées sur vercors.me, et les droits dont vous disposez. Elle constitue l'information prévue aux articles 12 et 13 du Règlement général sur la protection des données (RGPD). Elle se lit sans avoir à consulter les conditions générales d'utilisation.</p>
|
||||
<p><b>En bref</b> : pas de publicité, pas de cookie tiers, pas d'outil d'analyse, pas de compte aujourd'hui. La page ne contacte aucun serveur tiers : la carte et les polices sont servies par le site. Vos données ne servent jamais à autre chose qu'au service lui-même : ni publicité, ni revente, ni entraînement d'intelligence artificielle, ni analyse commerciale.</p>
|
||||
<h2>1. Responsable du traitement</h2>
|
||||
<p>Le responsable du traitement est <b>Théo Gastinel</b>, micro-entreprise (SIRET : <mark class="a-trancher">[À COMPLÉTER]</mark> ; adresse : <mark class="a-trancher">[À COMPLÉTER]</mark>) <mark class="a-trancher">[À VÉRIFIER : sur gastinel.me, le responsable désigné est « Richard GASTINEL, entrepreneur individuel (EI) » ; les deux sites doivent désigner la bonne personne juridique]</mark>.</p>
|
||||
<p>Le responsable du traitement est <b>Richard GASTINEL, entrepreneur individuel (EI), micro-entreprise dont Théo et Richard Gastinel sont tous deux responsables (SIRET 10481674900014 ; 621, avenue Léopold Fabre, 38250 Lans-en-Vercors, France ; 06 36 27 64 19)</b>.</p>
|
||||
<p>Toute question ou demande relative à vos données s'adresse par écrit à <b><a href="mailto:studio@gastinel.me">studio@gastinel.me</a></b>. Aucun délégué à la protection des données (DPO) n'a été désigné, la structure n'y étant pas soumise <mark class="a-trancher">[À VÉRIFIER si le forum ouvre à grande échelle]</mark>.</p>
|
||||
<h2>2. Hébergement et transferts</h2>
|
||||
<p>Le site est hébergé par <mark class="a-trancher">[À COMPLÉTER : nom, adresse et pays de l'hébergeur]</mark>. <mark class="a-trancher">[À COMPLÉTER : si l'hébergeur est Infomaniak (Suisse), comme pour gastinel.me, reprendre la mention : la Suisse bénéficie d'une décision d'adéquation de la Commission européenne (art. 45 RGPD).]</mark></p>
|
||||
<p>Le site est hébergé par Infomaniak Network SA, Rue Eugène-Marziano 25, 1227 Les Acacias (Genève), Suisse, +41 22 820 35 44, www.infomaniak.com. Les relevés sont collectés et archivés sur un serveur de l'éditeur à Lans-en-Vercors. La Suisse bénéficie d'une décision d'adéquation de la Commission européenne (art. 45 RGPD)</p>
|
||||
<p>Aucune donnée personnelle n'est transférée hors de l'Union européenne ou d'un pays reconnu adéquat. Les données de stations sont récupérées par le serveur du site auprès des sources (Météo-France, Infoclimat, WeatherLink) : votre navigateur n'entre jamais en contact avec elles, et elles ne reçoivent aucune information vous concernant.</p>
|
||||
<h2>3. Journaux techniques du serveur</h2>
|
||||
<p><b>Ce qui est enregistré</b>, pour chaque requête : la date et l'heure, l'adresse IP, la page ou le fichier demandé, le code de réponse du serveur <mark class="a-trancher">[À VÉRIFIER : le navigateur (« user-agent ») est-il aussi journalisé ? Le mentionner le cas échéant]</mark>.</p>
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
<!doctype html>
|
||||
<html lang="fr"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Se connecter avec Gastinel · Météo Vercors</title><meta name="description" content="Connexion avec le compte Gastinel.">
|
||||
<style>@font-face{font-family:'GastinelG';font-weight:700;font-display:swap;src:url(../polices/inter-g.woff2) format('woff2')}
|
||||
@font-face{font-family:'Bitter';font-style:normal;font-weight:500 700;font-display:swap;src:url(../polices/bitter-normal.woff2) format('woff2')}
|
||||
@font-face{font-family:'Bitter';font-style:italic;font-weight:500;font-display:swap;src:url(../polices/bitter-italic.woff2) format('woff2')}
|
||||
@font-face{font-family:'Outfit';font-style:normal;font-weight:400 600;font-display:swap;src:url(../polices/outfit-normal.woff2) format('woff2')}
|
||||
:root{--sapin:#1f4d3a;--mousse:#6f8f5c;--calcaire:#f5f3ee;--pierre:#e4e0d6;--roche:#2b2f2c;--glacier:#6eb5bd;--chaud:#b5643c;--gris:#5d635e;--titre:'Bitter',Georgia,serif;--texte:'Outfit',system-ui,sans-serif}
|
||||
*{box-sizing:border-box}
|
||||
html,body{margin:0;background:var(--calcaire);color:var(--roche);font-family:var(--texte);line-height:1.5}
|
||||
body{min-height:100vh;display:flex;flex-direction:column}
|
||||
a{color:var(--sapin)}
|
||||
a:focus-visible,button:focus-visible{outline:2px solid var(--sapin);outline-offset:2px}
|
||||
.haut{max-width:900px;margin:0 auto;padding:18px 24px 0;display:flex;justify-content:space-between;align-items:baseline;font-size:12px;font-weight:600;letter-spacing:.16em;text-transform:uppercase}
|
||||
.haut a{color:var(--gris);text-decoration:none}.haut a:hover{color:var(--roche);text-decoration:underline}
|
||||
.haut .nom{color:var(--sapin);font-size:15px;letter-spacing:.22em}
|
||||
main{flex:1 0 auto;width:100%;max-width:900px;margin:0 auto;padding:18px 24px 48px}
|
||||
h1{font-family:var(--titre);font-weight:700;font-size:44px;line-height:1;margin:6px 0 8px;color:var(--sapin)}
|
||||
h2{font-family:var(--titre);font-weight:600;font-size:22px;margin:34px 0 10px;color:var(--sapin)}
|
||||
.chapeau{margin:0 0 6px;color:var(--gris);font-size:15px}
|
||||
.apercu{margin:12px 0 0;padding:8px 12px;border:1px dashed var(--gris);font-size:12.5px;color:var(--gris)}
|
||||
.cats{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));border-top:1px solid var(--roche);border-left:1px solid var(--roche);margin-top:16px}
|
||||
.cat{padding:14px 16px;border-right:1px solid var(--roche);border-bottom:1px solid var(--roche);background:#faf9f5}
|
||||
.cat b{display:block;font-family:var(--titre);font-size:19px;color:var(--sapin)}
|
||||
.cat span{font-size:13px;color:var(--gris)}
|
||||
.cat em{display:block;margin-top:6px;font-size:12px;font-style:normal;color:var(--roche)}
|
||||
.sujets{list-style:none;margin:0;padding:0;border-top:1px solid var(--roche)}
|
||||
.sujets li{display:grid;grid-template-columns:1fr auto;gap:2px 14px;padding:12px 4px;border-bottom:1px solid var(--pierre)}
|
||||
.sujets a{font-family:var(--titre);font-weight:600;font-size:17px;text-decoration:none}
|
||||
.sujets a:hover{text-decoration:underline}
|
||||
.sujets small{color:var(--gris);font-size:12.5px}
|
||||
.sujets .n{grid-row:1/3;grid-column:2;align-self:center;font-size:12.5px;color:var(--gris);text-align:right}
|
||||
.badge{display:inline-block;margin-left:6px;padding:0 7px;font-size:10.5px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;vertical-align:1px;border:1px solid}
|
||||
.b-dir{background:var(--sapin);border-color:var(--sapin);color:#fff}
|
||||
.b-mod{background:#000;border-color:#000;color:#fff}
|
||||
.b-prop{background:rgba(110,181,189,.18);border-color:var(--glacier);color:#2f6f78}
|
||||
.b-adh{background:rgba(111,143,92,.16);border-color:var(--mousse);color:var(--sapin)}
|
||||
.b-mem{background:#fff;border-color:#b9b5aa;color:var(--gris)}
|
||||
.msg{display:grid;grid-template-columns:150px 1fr;border-top:1px solid var(--roche)}
|
||||
.msg:last-of-type{border-bottom:1px solid var(--roche)}
|
||||
.msg aside{padding:14px 12px 14px 4px;font-size:13px;color:var(--gris)}
|
||||
.msg aside b{display:block;font-family:var(--titre);font-size:16px;color:var(--roche);margin-bottom:4px}
|
||||
.msg aside .badge{margin:2px 4px 2px 0}
|
||||
.msg .corps{padding:14px 4px;border-left:1px solid var(--pierre);padding-left:18px}
|
||||
.msg time{display:block;font-size:12px;color:var(--gris);margin-bottom:6px}
|
||||
.msg p{margin:0 0 10px}
|
||||
.repondre{margin-top:22px;padding:16px;border:1px solid var(--roche);background:#faf9f5}
|
||||
.repondre textarea{width:100%;min-height:90px;font:inherit;border:1px solid var(--pierre);border-radius:0;padding:8px;background:#eeece6;color:var(--gris)}
|
||||
.btn{display:inline-flex;align-items:center;gap:10px;padding:8px 14px 8px 10px;background:#fff;border:1px solid #000;color:#000;font:inherit;font-size:14px;font-weight:600;text-decoration:none;cursor:pointer;border-radius:0}
|
||||
.btn:hover{background:#ecebe5}
|
||||
.btn .gmark{font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:26px;line-height:1;color:#000;letter-spacing:-.02em}
|
||||
.carte-co{max-width:520px;margin:30px auto 0;padding:26px 26px 22px;border:1px solid var(--roche);background:#faf9f5;box-shadow:0 0 0 4px var(--calcaire),0 0 0 5px var(--pierre)}
|
||||
.carte-co h1{font-size:32px}
|
||||
.carte-co ul{margin:14px 0;padding:0;list-style:none}
|
||||
.carte-co li{padding:7px 0 7px 22px;position:relative;font-size:14.5px;border-bottom:1px solid var(--pierre)}
|
||||
.carte-co li::before{content:"";position:absolute;left:2px;top:15px;width:8px;height:8px;background:var(--sapin)}
|
||||
.carte-co .promesse{margin:16px 0 0;padding:10px 12px;border-left:3px solid var(--mousse);background:rgba(111,143,92,.1);font-size:13px}
|
||||
.carte-co .autres{margin:14px 0 0;font-size:12.5px;color:var(--gris)}
|
||||
.roles{width:100%;border-collapse:collapse;font-size:13.5px;margin-top:10px}
|
||||
.roles td,.roles th{padding:8px 10px;border:1px solid var(--pierre);text-align:left;vertical-align:top}
|
||||
.roles th{background:#eeece6;font-family:var(--titre)}
|
||||
.pied{flex:0 0 auto;background:#303336;color:#d1d3d6;padding:24px 24px 20px;font-size:13px}
|
||||
.pied a{color:#b9c2cc;text-decoration:none}.pied a:hover{color:#fff;text-decoration:underline}
|
||||
.pied p{max-width:900px;margin:4px auto}
|
||||
@media (max-width:640px){h1{font-size:34px}.msg{grid-template-columns:1fr}.msg .corps{border-left:0;padding-left:4px;border-top:1px solid var(--pierre)}.sujets li{grid-template-columns:1fr}.sujets .n{grid-row:auto;grid-column:1;text-align:left}}
|
||||
</style></head><body>
|
||||
<div class="haut"><a class="nom" href="../index.html">Météo</a><span><a href="index.html">Forum</a> <a href="connexion.html">Se connecter</a></span></div>
|
||||
<main><div class="carte-co">
|
||||
<h1>Se connecter avec Gastinel</h1>
|
||||
<p class="chapeau">Un seul compte pour tout ce qui porte le nom Gastinel.</p>
|
||||
<ul><li>Participer au forum, avec ton rôle affiché à côté de ton pseudo</li><li>Retrouver tes stations favorites sur tous tes appareils</li><li>Être prévenu quand il gèle chez toi</li></ul>
|
||||
<p class="promesse"><b>Ce que le forum reçoit :</b> ton pseudo et un identifiant. Jamais ton mot de passe, jamais ton adresse e-mail. Aucune publicité, aucune revente de données.</p>
|
||||
<p style="margin:18px 0 0"><button class="btn" type="button" disabled aria-disabled="true" title="Bientôt : la connexion Gastinel sera branchée avant la mise en service du forum"><span class="gmark" aria-hidden="true">G</span>Continuer avec Gastinel</button></p>
|
||||
<p class="autres">Aperçu de maquette : la connexion sera branchée au compte Gastinel (hub.gastinel.me) avant l'ouverture. Voir la <a href="../confidentialite.html">politique de confidentialité</a>.</p>
|
||||
</div>
|
||||
</main>
|
||||
<footer class="pied"><p>Des stations de chez nous, des chiffres d'ici.</p><p><a href="../index.html">Carte</a> · <a href="../a-propos.html">À propos</a> · <a href="../cgu.html">CGU</a> · <a href="../confidentialite.html">Confidentialité</a> · <a href="mailto:studio@gastinel.me">studio@gastinel.me</a></p></footer>
|
||||
</body></html>
|
||||
@@ -0,0 +1,92 @@
|
||||
<!doctype html>
|
||||
<html lang="fr"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Forum · Météo Vercors</title><meta name="description" content="Le forum de Météo Vercors : récapitulatifs, observations, discussions.">
|
||||
<style>@font-face{font-family:'GastinelG';font-weight:700;font-display:swap;src:url(../polices/inter-g.woff2) format('woff2')}
|
||||
@font-face{font-family:'Bitter';font-style:normal;font-weight:500 700;font-display:swap;src:url(../polices/bitter-normal.woff2) format('woff2')}
|
||||
@font-face{font-family:'Bitter';font-style:italic;font-weight:500;font-display:swap;src:url(../polices/bitter-italic.woff2) format('woff2')}
|
||||
@font-face{font-family:'Outfit';font-style:normal;font-weight:400 600;font-display:swap;src:url(../polices/outfit-normal.woff2) format('woff2')}
|
||||
:root{--sapin:#1f4d3a;--mousse:#6f8f5c;--calcaire:#f5f3ee;--pierre:#e4e0d6;--roche:#2b2f2c;--glacier:#6eb5bd;--chaud:#b5643c;--gris:#5d635e;--titre:'Bitter',Georgia,serif;--texte:'Outfit',system-ui,sans-serif}
|
||||
*{box-sizing:border-box}
|
||||
html,body{margin:0;background:var(--calcaire);color:var(--roche);font-family:var(--texte);line-height:1.5}
|
||||
body{min-height:100vh;display:flex;flex-direction:column}
|
||||
a{color:var(--sapin)}
|
||||
a:focus-visible,button:focus-visible{outline:2px solid var(--sapin);outline-offset:2px}
|
||||
.haut{max-width:900px;margin:0 auto;padding:18px 24px 0;display:flex;justify-content:space-between;align-items:baseline;font-size:12px;font-weight:600;letter-spacing:.16em;text-transform:uppercase}
|
||||
.haut a{color:var(--gris);text-decoration:none}.haut a:hover{color:var(--roche);text-decoration:underline}
|
||||
.haut .nom{color:var(--sapin);font-size:15px;letter-spacing:.22em}
|
||||
main{flex:1 0 auto;width:100%;max-width:900px;margin:0 auto;padding:18px 24px 48px}
|
||||
h1{font-family:var(--titre);font-weight:700;font-size:44px;line-height:1;margin:6px 0 8px;color:var(--sapin)}
|
||||
h2{font-family:var(--titre);font-weight:600;font-size:22px;margin:34px 0 10px;color:var(--sapin)}
|
||||
.chapeau{margin:0 0 6px;color:var(--gris);font-size:15px}
|
||||
.apercu{margin:12px 0 0;padding:8px 12px;border:1px dashed var(--gris);font-size:12.5px;color:var(--gris)}
|
||||
.cats{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));border-top:1px solid var(--roche);border-left:1px solid var(--roche);margin-top:16px}
|
||||
.cat{padding:14px 16px;border-right:1px solid var(--roche);border-bottom:1px solid var(--roche);background:#faf9f5}
|
||||
.cat b{display:block;font-family:var(--titre);font-size:19px;color:var(--sapin)}
|
||||
.cat span{font-size:13px;color:var(--gris)}
|
||||
.cat em{display:block;margin-top:6px;font-size:12px;font-style:normal;color:var(--roche)}
|
||||
.sujets{list-style:none;margin:0;padding:0;border-top:1px solid var(--roche)}
|
||||
.sujets li{display:grid;grid-template-columns:1fr auto;gap:2px 14px;padding:12px 4px;border-bottom:1px solid var(--pierre)}
|
||||
.sujets a{font-family:var(--titre);font-weight:600;font-size:17px;text-decoration:none}
|
||||
.sujets a:hover{text-decoration:underline}
|
||||
.sujets small{color:var(--gris);font-size:12.5px}
|
||||
.sujets .n{grid-row:1/3;grid-column:2;align-self:center;font-size:12.5px;color:var(--gris);text-align:right}
|
||||
.badge{display:inline-block;margin-left:6px;padding:0 7px;font-size:10.5px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;vertical-align:1px;border:1px solid}
|
||||
.b-dir{background:var(--sapin);border-color:var(--sapin);color:#fff}
|
||||
.b-mod{background:#000;border-color:#000;color:#fff}
|
||||
.b-prop{background:rgba(110,181,189,.18);border-color:var(--glacier);color:#2f6f78}
|
||||
.b-adh{background:rgba(111,143,92,.16);border-color:var(--mousse);color:var(--sapin)}
|
||||
.b-mem{background:#fff;border-color:#b9b5aa;color:var(--gris)}
|
||||
.msg{display:grid;grid-template-columns:150px 1fr;border-top:1px solid var(--roche)}
|
||||
.msg:last-of-type{border-bottom:1px solid var(--roche)}
|
||||
.msg aside{padding:14px 12px 14px 4px;font-size:13px;color:var(--gris)}
|
||||
.msg aside b{display:block;font-family:var(--titre);font-size:16px;color:var(--roche);margin-bottom:4px}
|
||||
.msg aside .badge{margin:2px 4px 2px 0}
|
||||
.msg .corps{padding:14px 4px;border-left:1px solid var(--pierre);padding-left:18px}
|
||||
.msg time{display:block;font-size:12px;color:var(--gris);margin-bottom:6px}
|
||||
.msg p{margin:0 0 10px}
|
||||
.repondre{margin-top:22px;padding:16px;border:1px solid var(--roche);background:#faf9f5}
|
||||
.repondre textarea{width:100%;min-height:90px;font:inherit;border:1px solid var(--pierre);border-radius:0;padding:8px;background:#eeece6;color:var(--gris)}
|
||||
.btn{display:inline-flex;align-items:center;gap:10px;padding:8px 14px 8px 10px;background:#fff;border:1px solid #000;color:#000;font:inherit;font-size:14px;font-weight:600;text-decoration:none;cursor:pointer;border-radius:0}
|
||||
.btn:hover{background:#ecebe5}
|
||||
.btn .gmark{font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:26px;line-height:1;color:#000;letter-spacing:-.02em}
|
||||
.carte-co{max-width:520px;margin:30px auto 0;padding:26px 26px 22px;border:1px solid var(--roche);background:#faf9f5;box-shadow:0 0 0 4px var(--calcaire),0 0 0 5px var(--pierre)}
|
||||
.carte-co h1{font-size:32px}
|
||||
.carte-co ul{margin:14px 0;padding:0;list-style:none}
|
||||
.carte-co li{padding:7px 0 7px 22px;position:relative;font-size:14.5px;border-bottom:1px solid var(--pierre)}
|
||||
.carte-co li::before{content:"";position:absolute;left:2px;top:15px;width:8px;height:8px;background:var(--sapin)}
|
||||
.carte-co .promesse{margin:16px 0 0;padding:10px 12px;border-left:3px solid var(--mousse);background:rgba(111,143,92,.1);font-size:13px}
|
||||
.carte-co .autres{margin:14px 0 0;font-size:12.5px;color:var(--gris)}
|
||||
.roles{width:100%;border-collapse:collapse;font-size:13.5px;margin-top:10px}
|
||||
.roles td,.roles th{padding:8px 10px;border:1px solid var(--pierre);text-align:left;vertical-align:top}
|
||||
.roles th{background:#eeece6;font-family:var(--titre)}
|
||||
.pied{flex:0 0 auto;background:#303336;color:#d1d3d6;padding:24px 24px 20px;font-size:13px}
|
||||
.pied a{color:#b9c2cc;text-decoration:none}.pied a:hover{color:#fff;text-decoration:underline}
|
||||
.pied p{max-width:900px;margin:4px auto}
|
||||
@media (max-width:640px){h1{font-size:34px}.msg{grid-template-columns:1fr}.msg .corps{border-left:0;padding-left:4px;border-top:1px solid var(--pierre)}.sujets li{grid-template-columns:1fr}.sujets .n{grid-row:auto;grid-column:1;text-align:left}}
|
||||
</style></head><body>
|
||||
<div class="haut"><a class="nom" href="../index.html">Météo</a><span><a href="index.html">Forum</a> <a href="connexion.html">Se connecter</a></span></div>
|
||||
<main><h1>Forum</h1>
|
||||
<p class="chapeau">Le coin des gens du Vercors : récapitulatifs de la semaine, observations, discussions.</p>
|
||||
<p class="apercu">Aperçu de maquette : pseudos et messages sont des exemples, rien n'est encore en service.</p>
|
||||
<div class="cats">
|
||||
<div class="cat"><b>Récapitulatif de la semaine</b><span>Le bilan météo, par les adhérents</span><em>Publier : adhérents météo</em></div>
|
||||
<div class="cat"><b>Observations</b><span>Givre, neige, vent, combes qui gèlent</span><em>Publier : adhérents météo</em></div>
|
||||
<div class="cat"><b>Discussion générale</b><span>Tout le reste, avec le sourire</span><em>Répondre : tous les membres</em></div>
|
||||
</div>
|
||||
<h2>Derniers sujets</h2>
|
||||
<ul class="sujets">
|
||||
<li><div><a href="sujet.html">Récapitulatif de la semaine du 26 octobre au 1er novembre</a><br><small>par pseudo-1 <span class="badge b-dir">Directeur</span> · exemple</small></div><span class="n">3 réponses</span></li>
|
||||
<li><div><a href="sujet.html">Combe de l'Oscence : −9 °C ce matin</a><br><small>par pseudo-2 <span class="badge b-prop">Propriétaire · Gêve</span> · exemple</small></div><span class="n">5 réponses</span></li>
|
||||
<li><div><a href="sujet.html">Quelle station pour le vent à Autrans ?</a><br><small>par pseudo-3 <span class="badge b-mem">Membre</span> · exemple</small></div><span class="n">2 réponses</span></li>
|
||||
</ul>
|
||||
<h2>Qui est qui</h2>
|
||||
<p class="chapeau">Chaque personne affiche son rôle à côté de son pseudo, pour savoir à qui on parle.</p>
|
||||
<table class="roles"><tr><th>Rôle</th><th>Ce que ça veut dire</th></tr>
|
||||
<tr><td><span class="badge b-dir">Directeur</span></td><td>Les responsables du site. Ils administrent le forum.</td></tr>
|
||||
<tr><td><span class="badge b-mod">Modérateur</span></td><td>Veille au respect des règles : masque ou verrouille un message au besoin.</td></tr>
|
||||
<tr><td><span class="badge b-prop">Propriétaire · Gêve</span></td><td>Possède une station affichée sur la carte ; le lien est vérifié par l'équipe.</td></tr>
|
||||
<tr><td><span class="badge b-adh">Adhérent météo</span></td><td>Peut ouvrir des sujets (récapitulatifs, observations).</td></tr>
|
||||
<tr><td><span class="badge b-mem">Membre</span></td><td>Compte Gastinel : répond, signale, modifie ses messages.</td></tr></table>
|
||||
</main>
|
||||
<footer class="pied"><p>Des stations de chez nous, des chiffres d'ici.</p><p><a href="../index.html">Carte</a> · <a href="../a-propos.html">À propos</a> · <a href="../cgu.html">CGU</a> · <a href="../confidentialite.html">Confidentialité</a> · <a href="mailto:studio@gastinel.me">studio@gastinel.me</a></p></footer>
|
||||
</body></html>
|
||||
@@ -0,0 +1,80 @@
|
||||
<!doctype html>
|
||||
<html lang="fr"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Récapitulatif de la semaine · Forum Météo Vercors</title><meta name="description" content="Exemple de sujet du forum.">
|
||||
<style>@font-face{font-family:'GastinelG';font-weight:700;font-display:swap;src:url(../polices/inter-g.woff2) format('woff2')}
|
||||
@font-face{font-family:'Bitter';font-style:normal;font-weight:500 700;font-display:swap;src:url(../polices/bitter-normal.woff2) format('woff2')}
|
||||
@font-face{font-family:'Bitter';font-style:italic;font-weight:500;font-display:swap;src:url(../polices/bitter-italic.woff2) format('woff2')}
|
||||
@font-face{font-family:'Outfit';font-style:normal;font-weight:400 600;font-display:swap;src:url(../polices/outfit-normal.woff2) format('woff2')}
|
||||
:root{--sapin:#1f4d3a;--mousse:#6f8f5c;--calcaire:#f5f3ee;--pierre:#e4e0d6;--roche:#2b2f2c;--glacier:#6eb5bd;--chaud:#b5643c;--gris:#5d635e;--titre:'Bitter',Georgia,serif;--texte:'Outfit',system-ui,sans-serif}
|
||||
*{box-sizing:border-box}
|
||||
html,body{margin:0;background:var(--calcaire);color:var(--roche);font-family:var(--texte);line-height:1.5}
|
||||
body{min-height:100vh;display:flex;flex-direction:column}
|
||||
a{color:var(--sapin)}
|
||||
a:focus-visible,button:focus-visible{outline:2px solid var(--sapin);outline-offset:2px}
|
||||
.haut{max-width:900px;margin:0 auto;padding:18px 24px 0;display:flex;justify-content:space-between;align-items:baseline;font-size:12px;font-weight:600;letter-spacing:.16em;text-transform:uppercase}
|
||||
.haut a{color:var(--gris);text-decoration:none}.haut a:hover{color:var(--roche);text-decoration:underline}
|
||||
.haut .nom{color:var(--sapin);font-size:15px;letter-spacing:.22em}
|
||||
main{flex:1 0 auto;width:100%;max-width:900px;margin:0 auto;padding:18px 24px 48px}
|
||||
h1{font-family:var(--titre);font-weight:700;font-size:44px;line-height:1;margin:6px 0 8px;color:var(--sapin)}
|
||||
h2{font-family:var(--titre);font-weight:600;font-size:22px;margin:34px 0 10px;color:var(--sapin)}
|
||||
.chapeau{margin:0 0 6px;color:var(--gris);font-size:15px}
|
||||
.apercu{margin:12px 0 0;padding:8px 12px;border:1px dashed var(--gris);font-size:12.5px;color:var(--gris)}
|
||||
.cats{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));border-top:1px solid var(--roche);border-left:1px solid var(--roche);margin-top:16px}
|
||||
.cat{padding:14px 16px;border-right:1px solid var(--roche);border-bottom:1px solid var(--roche);background:#faf9f5}
|
||||
.cat b{display:block;font-family:var(--titre);font-size:19px;color:var(--sapin)}
|
||||
.cat span{font-size:13px;color:var(--gris)}
|
||||
.cat em{display:block;margin-top:6px;font-size:12px;font-style:normal;color:var(--roche)}
|
||||
.sujets{list-style:none;margin:0;padding:0;border-top:1px solid var(--roche)}
|
||||
.sujets li{display:grid;grid-template-columns:1fr auto;gap:2px 14px;padding:12px 4px;border-bottom:1px solid var(--pierre)}
|
||||
.sujets a{font-family:var(--titre);font-weight:600;font-size:17px;text-decoration:none}
|
||||
.sujets a:hover{text-decoration:underline}
|
||||
.sujets small{color:var(--gris);font-size:12.5px}
|
||||
.sujets .n{grid-row:1/3;grid-column:2;align-self:center;font-size:12.5px;color:var(--gris);text-align:right}
|
||||
.badge{display:inline-block;margin-left:6px;padding:0 7px;font-size:10.5px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;vertical-align:1px;border:1px solid}
|
||||
.b-dir{background:var(--sapin);border-color:var(--sapin);color:#fff}
|
||||
.b-mod{background:#000;border-color:#000;color:#fff}
|
||||
.b-prop{background:rgba(110,181,189,.18);border-color:var(--glacier);color:#2f6f78}
|
||||
.b-adh{background:rgba(111,143,92,.16);border-color:var(--mousse);color:var(--sapin)}
|
||||
.b-mem{background:#fff;border-color:#b9b5aa;color:var(--gris)}
|
||||
.msg{display:grid;grid-template-columns:150px 1fr;border-top:1px solid var(--roche)}
|
||||
.msg:last-of-type{border-bottom:1px solid var(--roche)}
|
||||
.msg aside{padding:14px 12px 14px 4px;font-size:13px;color:var(--gris)}
|
||||
.msg aside b{display:block;font-family:var(--titre);font-size:16px;color:var(--roche);margin-bottom:4px}
|
||||
.msg aside .badge{margin:2px 4px 2px 0}
|
||||
.msg .corps{padding:14px 4px;border-left:1px solid var(--pierre);padding-left:18px}
|
||||
.msg time{display:block;font-size:12px;color:var(--gris);margin-bottom:6px}
|
||||
.msg p{margin:0 0 10px}
|
||||
.repondre{margin-top:22px;padding:16px;border:1px solid var(--roche);background:#faf9f5}
|
||||
.repondre textarea{width:100%;min-height:90px;font:inherit;border:1px solid var(--pierre);border-radius:0;padding:8px;background:#eeece6;color:var(--gris)}
|
||||
.btn{display:inline-flex;align-items:center;gap:10px;padding:8px 14px 8px 10px;background:#fff;border:1px solid #000;color:#000;font:inherit;font-size:14px;font-weight:600;text-decoration:none;cursor:pointer;border-radius:0}
|
||||
.btn:hover{background:#ecebe5}
|
||||
.btn .gmark{font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:26px;line-height:1;color:#000;letter-spacing:-.02em}
|
||||
.carte-co{max-width:520px;margin:30px auto 0;padding:26px 26px 22px;border:1px solid var(--roche);background:#faf9f5;box-shadow:0 0 0 4px var(--calcaire),0 0 0 5px var(--pierre)}
|
||||
.carte-co h1{font-size:32px}
|
||||
.carte-co ul{margin:14px 0;padding:0;list-style:none}
|
||||
.carte-co li{padding:7px 0 7px 22px;position:relative;font-size:14.5px;border-bottom:1px solid var(--pierre)}
|
||||
.carte-co li::before{content:"";position:absolute;left:2px;top:15px;width:8px;height:8px;background:var(--sapin)}
|
||||
.carte-co .promesse{margin:16px 0 0;padding:10px 12px;border-left:3px solid var(--mousse);background:rgba(111,143,92,.1);font-size:13px}
|
||||
.carte-co .autres{margin:14px 0 0;font-size:12.5px;color:var(--gris)}
|
||||
.roles{width:100%;border-collapse:collapse;font-size:13.5px;margin-top:10px}
|
||||
.roles td,.roles th{padding:8px 10px;border:1px solid var(--pierre);text-align:left;vertical-align:top}
|
||||
.roles th{background:#eeece6;font-family:var(--titre)}
|
||||
.pied{flex:0 0 auto;background:#303336;color:#d1d3d6;padding:24px 24px 20px;font-size:13px}
|
||||
.pied a{color:#b9c2cc;text-decoration:none}.pied a:hover{color:#fff;text-decoration:underline}
|
||||
.pied p{max-width:900px;margin:4px auto}
|
||||
@media (max-width:640px){h1{font-size:34px}.msg{grid-template-columns:1fr}.msg .corps{border-left:0;padding-left:4px;border-top:1px solid var(--pierre)}.sujets li{grid-template-columns:1fr}.sujets .n{grid-row:auto;grid-column:1;text-align:left}}
|
||||
</style></head><body>
|
||||
<div class="haut"><a class="nom" href="../index.html">Météo</a><span><a href="index.html">Forum</a> <a href="connexion.html">Se connecter</a></span></div>
|
||||
<main><p class="chapeau"><a href="index.html">Forum</a> › Récapitulatif de la semaine</p>
|
||||
<h1 style="font-size:32px">Récapitulatif de la semaine du 26 octobre au 1er novembre</h1>
|
||||
<p class="apercu">Aperçu de maquette : contenu d'exemple.</p>
|
||||
<div style="margin-top:16px">
|
||||
<div class="msg"><aside><b>pseudo-1</b><span class="badge b-dir">Directeur</span><br>12 messages</aside><div class="corps"><time>Dimanche 1er novembre · 18 h 05</time><p>Semaine marquée par une nette inversion : le plus froid dans les combes, plus doux sur les crêtes. Voir les courbes de Darbounouse et de l'Oscence.</p><p>Texte d'exemple.</p></div></div>
|
||||
<div class="msg"><aside><b>pseudo-2</b><span class="badge b-prop">Propriétaire · Gêve</span><br>7 messages</aside><div class="corps"><time>Lundi 2 novembre · 07 h 40</time><p>Confirmé à Gêve : −6 °C au lever du jour, givre sur les clôtures.</p></div></div>
|
||||
<div class="msg"><aside><b>pseudo-4</b><span class="badge b-mod">Modérateur</span></aside><div class="corps"><time>Lundi 2 novembre · 09 h 12</time><p>Rappel : merci de citer la station et l'heure de la mesure.</p></div></div>
|
||||
<div class="msg"><aside><b>pseudo-3</b><span class="badge b-mem">Membre</span></aside><div class="corps"><time>Lundi 2 novembre · 20 h 30</time><p>Merci pour le récap, c'est clair !</p></div></div>
|
||||
</div>
|
||||
<div class="repondre"><p style="margin:0 0 8px"><b>Répondre</b></p><textarea disabled aria-label="Votre réponse" placeholder="Connecte-toi avec ton compte Gastinel pour répondre."></textarea><p style="margin:10px 0 0"><a class="btn" href="connexion.html"><span class="gmark" aria-hidden="true">G</span>Se connecter avec Gastinel</a></p></div>
|
||||
</main>
|
||||
<footer class="pied"><p>Des stations de chez nous, des chiffres d'ici.</p><p><a href="../index.html">Carte</a> · <a href="../a-propos.html">À propos</a> · <a href="../cgu.html">CGU</a> · <a href="../confidentialite.html">Confidentialité</a> · <a href="mailto:studio@gastinel.me">studio@gastinel.me</a></p></footer>
|
||||
</body></html>
|
||||
@@ -0,0 +1,141 @@
|
||||
"""Pages du forum de vercors.me (aperçu statique, contenu d'exemple) : forum/index.html, sujet.html, connexion.html."""
|
||||
import os
|
||||
|
||||
FONTS = """@font-face{font-family:'GastinelG';font-weight:700;font-display:swap;src:url(../polices/inter-g.woff2) format('woff2')}
|
||||
@font-face{font-family:'Bitter';font-style:normal;font-weight:500 700;font-display:swap;src:url(../polices/bitter-normal.woff2) format('woff2')}
|
||||
@font-face{font-family:'Bitter';font-style:italic;font-weight:500;font-display:swap;src:url(../polices/bitter-italic.woff2) format('woff2')}
|
||||
@font-face{font-family:'Outfit';font-style:normal;font-weight:400 600;font-display:swap;src:url(../polices/outfit-normal.woff2) format('woff2')}"""
|
||||
|
||||
CSS = FONTS + """
|
||||
:root{--sapin:#1f4d3a;--mousse:#6f8f5c;--calcaire:#f5f3ee;--pierre:#e4e0d6;--roche:#2b2f2c;--glacier:#6eb5bd;--chaud:#b5643c;--gris:#5d635e;--titre:'Bitter',Georgia,serif;--texte:'Outfit',system-ui,sans-serif}
|
||||
*{box-sizing:border-box}
|
||||
html,body{margin:0;background:var(--calcaire);color:var(--roche);font-family:var(--texte);line-height:1.5}
|
||||
body{min-height:100vh;display:flex;flex-direction:column}
|
||||
a{color:var(--sapin)}
|
||||
a:focus-visible,button:focus-visible{outline:2px solid var(--sapin);outline-offset:2px}
|
||||
.haut{max-width:900px;margin:0 auto;padding:18px 24px 0;display:flex;justify-content:space-between;align-items:baseline;font-size:12px;font-weight:600;letter-spacing:.16em;text-transform:uppercase}
|
||||
.haut a{color:var(--gris);text-decoration:none}.haut a:hover{color:var(--roche);text-decoration:underline}
|
||||
.haut .nom{color:var(--sapin);font-size:15px;letter-spacing:.22em}
|
||||
main{flex:1 0 auto;width:100%;max-width:900px;margin:0 auto;padding:18px 24px 48px}
|
||||
h1{font-family:var(--titre);font-weight:700;font-size:44px;line-height:1;margin:6px 0 8px;color:var(--sapin)}
|
||||
h2{font-family:var(--titre);font-weight:600;font-size:22px;margin:34px 0 10px;color:var(--sapin)}
|
||||
.chapeau{margin:0 0 6px;color:var(--gris);font-size:15px}
|
||||
.apercu{margin:12px 0 0;padding:8px 12px;border:1px dashed var(--gris);font-size:12.5px;color:var(--gris)}
|
||||
.cats{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));border-top:1px solid var(--roche);border-left:1px solid var(--roche);margin-top:16px}
|
||||
.cat{padding:14px 16px;border-right:1px solid var(--roche);border-bottom:1px solid var(--roche);background:#faf9f5}
|
||||
.cat b{display:block;font-family:var(--titre);font-size:19px;color:var(--sapin)}
|
||||
.cat span{font-size:13px;color:var(--gris)}
|
||||
.cat em{display:block;margin-top:6px;font-size:12px;font-style:normal;color:var(--roche)}
|
||||
.sujets{list-style:none;margin:0;padding:0;border-top:1px solid var(--roche)}
|
||||
.sujets li{display:grid;grid-template-columns:1fr auto;gap:2px 14px;padding:12px 4px;border-bottom:1px solid var(--pierre)}
|
||||
.sujets a{font-family:var(--titre);font-weight:600;font-size:17px;text-decoration:none}
|
||||
.sujets a:hover{text-decoration:underline}
|
||||
.sujets small{color:var(--gris);font-size:12.5px}
|
||||
.sujets .n{grid-row:1/3;grid-column:2;align-self:center;font-size:12.5px;color:var(--gris);text-align:right}
|
||||
.badge{display:inline-block;margin-left:6px;padding:0 7px;font-size:10.5px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;vertical-align:1px;border:1px solid}
|
||||
.b-dir{background:var(--sapin);border-color:var(--sapin);color:#fff}
|
||||
.b-mod{background:#000;border-color:#000;color:#fff}
|
||||
.b-prop{background:rgba(110,181,189,.18);border-color:var(--glacier);color:#2f6f78}
|
||||
.b-adh{background:rgba(111,143,92,.16);border-color:var(--mousse);color:var(--sapin)}
|
||||
.b-mem{background:#fff;border-color:#b9b5aa;color:var(--gris)}
|
||||
.msg{display:grid;grid-template-columns:150px 1fr;border-top:1px solid var(--roche)}
|
||||
.msg:last-of-type{border-bottom:1px solid var(--roche)}
|
||||
.msg aside{padding:14px 12px 14px 4px;font-size:13px;color:var(--gris)}
|
||||
.msg aside b{display:block;font-family:var(--titre);font-size:16px;color:var(--roche);margin-bottom:4px}
|
||||
.msg aside .badge{margin:2px 4px 2px 0}
|
||||
.msg .corps{padding:14px 4px;border-left:1px solid var(--pierre);padding-left:18px}
|
||||
.msg time{display:block;font-size:12px;color:var(--gris);margin-bottom:6px}
|
||||
.msg p{margin:0 0 10px}
|
||||
.repondre{margin-top:22px;padding:16px;border:1px solid var(--roche);background:#faf9f5}
|
||||
.repondre textarea{width:100%;min-height:90px;font:inherit;border:1px solid var(--pierre);border-radius:0;padding:8px;background:#eeece6;color:var(--gris)}
|
||||
.btn{display:inline-flex;align-items:center;gap:10px;padding:8px 14px 8px 10px;background:#fff;border:1px solid #000;color:#000;font:inherit;font-size:14px;font-weight:600;text-decoration:none;cursor:pointer;border-radius:0}
|
||||
.btn:hover{background:#ecebe5}
|
||||
.btn .gmark{font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:26px;line-height:1;color:#000;letter-spacing:-.02em}
|
||||
.carte-co{max-width:520px;margin:30px auto 0;padding:26px 26px 22px;border:1px solid var(--roche);background:#faf9f5;box-shadow:0 0 0 4px var(--calcaire),0 0 0 5px var(--pierre)}
|
||||
.carte-co h1{font-size:32px}
|
||||
.carte-co ul{margin:14px 0;padding:0;list-style:none}
|
||||
.carte-co li{padding:7px 0 7px 22px;position:relative;font-size:14.5px;border-bottom:1px solid var(--pierre)}
|
||||
.carte-co li::before{content:"";position:absolute;left:2px;top:15px;width:8px;height:8px;background:var(--sapin)}
|
||||
.carte-co .promesse{margin:16px 0 0;padding:10px 12px;border-left:3px solid var(--mousse);background:rgba(111,143,92,.1);font-size:13px}
|
||||
.carte-co .autres{margin:14px 0 0;font-size:12.5px;color:var(--gris)}
|
||||
.roles{width:100%;border-collapse:collapse;font-size:13.5px;margin-top:10px}
|
||||
.roles td,.roles th{padding:8px 10px;border:1px solid var(--pierre);text-align:left;vertical-align:top}
|
||||
.roles th{background:#eeece6;font-family:var(--titre)}
|
||||
.pied{flex:0 0 auto;background:#303336;color:#d1d3d6;padding:24px 24px 20px;font-size:13px}
|
||||
.pied a{color:#b9c2cc;text-decoration:none}.pied a:hover{color:#fff;text-decoration:underline}
|
||||
.pied p{max-width:900px;margin:4px auto}
|
||||
@media (max-width:640px){h1{font-size:34px}.msg{grid-template-columns:1fr}.msg .corps{border-left:0;padding-left:4px;border-top:1px solid var(--pierre)}.sujets li{grid-template-columns:1fr}.sujets .n{grid-row:auto;grid-column:1;text-align:left}}
|
||||
"""
|
||||
|
||||
def page(titre, corps, desc):
|
||||
return f"""<!doctype html>
|
||||
<html lang="fr"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>{titre}</title><meta name="description" content="{desc}">
|
||||
<style>{CSS}</style></head><body>
|
||||
<div class="haut"><a class="nom" href="../index.html">Météo</a><span><a href="index.html">Forum</a> <a href="connexion.html">Se connecter</a></span></div>
|
||||
<main>{corps}</main>
|
||||
<footer class="pied"><p>Des stations de chez nous, des chiffres d'ici.</p><p><a href="../index.html">Carte</a> · <a href="../a-propos.html">À propos</a> · <a href="../cgu.html">CGU</a> · <a href="../confidentialite.html">Confidentialité</a> · <a href="mailto:studio@gastinel.me">studio@gastinel.me</a></p></footer>
|
||||
</body></html>"""
|
||||
|
||||
B = {
|
||||
'dir': '<span class="badge b-dir">Directeur</span>',
|
||||
'mod': '<span class="badge b-mod">Modérateur</span>',
|
||||
'prop': '<span class="badge b-prop">Propriétaire · Gêve</span>',
|
||||
'adh': '<span class="badge b-adh">Adhérent météo</span>',
|
||||
'mem': '<span class="badge b-mem">Membre</span>',
|
||||
}
|
||||
|
||||
index = f"""<h1>Forum</h1>
|
||||
<p class="chapeau">Le coin des gens du Vercors : récapitulatifs de la semaine, observations, discussions.</p>
|
||||
<p class="apercu">Aperçu de maquette : pseudos et messages sont des exemples, rien n'est encore en service.</p>
|
||||
<div class="cats">
|
||||
<div class="cat"><b>Récapitulatif de la semaine</b><span>Le bilan météo, par les adhérents</span><em>Publier : adhérents météo</em></div>
|
||||
<div class="cat"><b>Observations</b><span>Givre, neige, vent, combes qui gèlent</span><em>Publier : adhérents météo</em></div>
|
||||
<div class="cat"><b>Discussion générale</b><span>Tout le reste, avec le sourire</span><em>Répondre : tous les membres</em></div>
|
||||
</div>
|
||||
<h2>Derniers sujets</h2>
|
||||
<ul class="sujets">
|
||||
<li><div><a href="sujet.html">Récapitulatif de la semaine du 26 octobre au 1er novembre</a><br><small>par pseudo-1 {B['dir']} · exemple</small></div><span class="n">3 réponses</span></li>
|
||||
<li><div><a href="sujet.html">Combe de l'Oscence : −9 °C ce matin</a><br><small>par pseudo-2 {B['prop']} · exemple</small></div><span class="n">5 réponses</span></li>
|
||||
<li><div><a href="sujet.html">Quelle station pour le vent à Autrans ?</a><br><small>par pseudo-3 {B['mem']} · exemple</small></div><span class="n">2 réponses</span></li>
|
||||
</ul>
|
||||
<h2>Qui est qui</h2>
|
||||
<p class="chapeau">Chaque personne affiche son rôle à côté de son pseudo, pour savoir à qui on parle.</p>
|
||||
<table class="roles"><tr><th>Rôle</th><th>Ce que ça veut dire</th></tr>
|
||||
<tr><td>{B['dir']}</td><td>Les responsables du site. Ils administrent le forum.</td></tr>
|
||||
<tr><td>{B['mod']}</td><td>Veille au respect des règles : masque ou verrouille un message au besoin.</td></tr>
|
||||
<tr><td>{B['prop']}</td><td>Possède une station affichée sur la carte ; le lien est vérifié par l'équipe.</td></tr>
|
||||
<tr><td>{B['adh']}</td><td>Peut ouvrir des sujets (récapitulatifs, observations).</td></tr>
|
||||
<tr><td>{B['mem']}</td><td>Compte Gastinel : répond, signale, modifie ses messages.</td></tr></table>
|
||||
"""
|
||||
|
||||
sujet = f"""<p class="chapeau"><a href="index.html">Forum</a> › Récapitulatif de la semaine</p>
|
||||
<h1 style="font-size:32px">Récapitulatif de la semaine du 26 octobre au 1er novembre</h1>
|
||||
<p class="apercu">Aperçu de maquette : contenu d'exemple.</p>
|
||||
<div style="margin-top:16px">
|
||||
<div class="msg"><aside><b>pseudo-1</b>{B['dir']}<br>12 messages</aside><div class="corps"><time>Dimanche 1er novembre · 18 h 05</time><p>Semaine marquée par une nette inversion : le plus froid dans les combes, plus doux sur les crêtes. Voir les courbes de Darbounouse et de l'Oscence.</p><p>Texte d'exemple.</p></div></div>
|
||||
<div class="msg"><aside><b>pseudo-2</b>{B['prop']}<br>7 messages</aside><div class="corps"><time>Lundi 2 novembre · 07 h 40</time><p>Confirmé à Gêve : −6 °C au lever du jour, givre sur les clôtures.</p></div></div>
|
||||
<div class="msg"><aside><b>pseudo-4</b>{B['mod']}</aside><div class="corps"><time>Lundi 2 novembre · 09 h 12</time><p>Rappel : merci de citer la station et l'heure de la mesure.</p></div></div>
|
||||
<div class="msg"><aside><b>pseudo-3</b>{B['mem']}</aside><div class="corps"><time>Lundi 2 novembre · 20 h 30</time><p>Merci pour le récap, c'est clair !</p></div></div>
|
||||
</div>
|
||||
<div class="repondre"><p style="margin:0 0 8px"><b>Répondre</b></p><textarea disabled aria-label="Votre réponse" placeholder="Connecte-toi avec ton compte Gastinel pour répondre."></textarea><p style="margin:10px 0 0"><a class="btn" href="connexion.html"><span class="gmark" aria-hidden="true">G</span>Se connecter avec Gastinel</a></p></div>
|
||||
"""
|
||||
|
||||
connexion = f"""<div class="carte-co">
|
||||
<h1>Se connecter avec Gastinel</h1>
|
||||
<p class="chapeau">Un seul compte pour tout ce qui porte le nom Gastinel.</p>
|
||||
<ul><li>Participer au forum, avec ton rôle affiché à côté de ton pseudo</li><li>Retrouver tes stations favorites sur tous tes appareils</li><li>Être prévenu quand il gèle chez toi</li></ul>
|
||||
<p class="promesse"><b>Ce que le forum reçoit :</b> ton pseudo et un identifiant. Jamais ton mot de passe, jamais ton adresse e-mail. Aucune publicité, aucune revente de données.</p>
|
||||
<p style="margin:18px 0 0"><button class="btn" type="button" disabled aria-disabled="true" title="Bientôt : la connexion Gastinel sera branchée avant la mise en service du forum"><span class="gmark" aria-hidden="true">G</span>Continuer avec Gastinel</button></p>
|
||||
<p class="autres">Aperçu de maquette : la connexion sera branchée au compte Gastinel (hub.gastinel.me) avant l'ouverture. Voir la <a href="../confidentialite.html">politique de confidentialité</a>.</p>
|
||||
</div>
|
||||
"""
|
||||
|
||||
if __name__ == '__main__':
|
||||
os.makedirs('forum', exist_ok=True)
|
||||
for nom, titre, corps, desc in [
|
||||
('index.html', 'Forum · Météo Vercors', index, 'Le forum de Météo Vercors : récapitulatifs, observations, discussions.'),
|
||||
('sujet.html', 'Récapitulatif de la semaine · Forum Météo Vercors', sujet, 'Exemple de sujet du forum.'),
|
||||
('connexion.html', 'Se connecter avec Gastinel · Météo Vercors', connexion, 'Connexion avec le compte Gastinel.')]:
|
||||
open(os.path.join('forum', nom), 'w', encoding='utf-8').write(page(titre, corps, desc))
|
||||
print('forum : 3 pages')
|
||||
@@ -22,6 +22,9 @@
|
||||
--roche:#2b2f2c; --glacier:#6eb5bd; --chaud:#b5643c; --gris:#5d635e;
|
||||
}
|
||||
*{box-sizing:border-box}
|
||||
@font-face{font-family:'GastinelG';font-weight:700;font-display:swap;src:url(polices/inter-g.woff2) format('woff2')}
|
||||
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}
|
||||
|
||||
@@ -130,6 +133,8 @@ a{color:inherit}
|
||||
.plein-onglets button.on{background:var(--roche);color:#fff}
|
||||
.plein-corps{max-width:980px;margin:0 auto;padding:20px 16px 64px}
|
||||
.plein-corps h2{margin:0;font-family:var(--titre);font-weight:600;font-size:26px;line-height:1.15;color:var(--sapin)}
|
||||
.origine{display:inline-flex;flex-direction:column;vertical-align:middle;margin-left:12px;padding:3px 9px;border:1px solid var(--glacier);background:rgba(110,181,189,.14);color:#2f6f78;font-family:var(--texte,inherit);font-size:12px;font-weight:500;line-height:1.25}
|
||||
.origine small{font-size:11px;font-weight:400;color:var(--gris)}
|
||||
.plein-sous{margin:4px 0 0;font-size:13px;color:var(--gris)}
|
||||
.plein-val{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;margin-top:14px;padding-top:12px;border-top:1px solid var(--pierre)}
|
||||
.plein-val b{font-family:var(--titre);font-weight:600;font-size:52px;line-height:1;letter-spacing:-.01em}
|
||||
@@ -150,7 +155,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)}
|
||||
@@ -164,7 +169,7 @@ a{color:inherit}
|
||||
.pendule .corde.g{left:18%}.pendule .corde.d{right:18%}
|
||||
.pancarte{display:block;white-space:nowrap;background:#faf9f5;border:1px solid var(--roche);padding:5px 11px 6px;
|
||||
font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--sapin)}
|
||||
.outils{display:flex;gap:8px;margin-top:12px}
|
||||
.outils{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
|
||||
.rech{position:relative;flex:1;min-width:0}
|
||||
#rech{width:100%;font:inherit;font-size:13.5px;color:var(--roche);background:#fff;border:1px solid var(--roche);border-radius:0;padding:7px 9px;-webkit-appearance:none;appearance:none}
|
||||
#rech::placeholder{color:#8a8f88}
|
||||
@@ -173,11 +178,22 @@ a{color:inherit}
|
||||
#rech-res li:first-child{border-top:0}
|
||||
#rech-res li.on,#rech-res li:hover{background:#eef2ea}
|
||||
#rech-res small{color:var(--gris);margin-left:6px}
|
||||
#filtre{font:inherit;font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--sapin);background:#fff;border:1px solid var(--sapin);border-radius:0;padding:7px 9px;cursor:pointer;white-space:nowrap}
|
||||
#filtre[aria-pressed=true]{background:var(--sapin);color:#fff}
|
||||
.carte.filtre .puce > button.sans{opacity:.2}
|
||||
.reglages{max-width:1080px;margin:0 auto;padding:10px 28px 0;display:flex;flex-wrap:wrap;gap:10px 22px;align-items:center}
|
||||
.modes{display:flex;flex:0 0 auto}
|
||||
.aide{flex:0 0 100%;margin:0;font-size:11.5px;color:var(--gris)}
|
||||
.temps{flex:1 1 300px;display:flex;align-items:center;gap:10px;min-width:0}
|
||||
.temps button{font:inherit;font-size:13px;color:var(--sapin);background:#fff;border:1px solid var(--sapin);border-radius:0;width:34px;height:31px;cursor:pointer;padding:0}
|
||||
.temps button:disabled{opacity:.4;cursor:default}
|
||||
.temps input{flex:1;min-width:0;accent-color:var(--sapin);height:24px}
|
||||
.temps output{font-size:12.5px;color:var(--gris);min-width:112px;text-align:right}
|
||||
.temps.passe output{color:var(--chaud);font-weight:600}
|
||||
@media (max-width:719px){.reglages{padding:10px 16px 0}.temps{flex:1 1 100%;flex-wrap:wrap}.temps input{flex:1 1 140px}.temps output{min-width:0;flex:0 0 100%;text-align:left;order:3}}
|
||||
.modes button{flex:none;font:inherit;font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--sapin);background:#fff;border:1px solid var(--sapin);border-radius:0;margin-left:-1px;padding:7px 14px;cursor:pointer;white-space:nowrap}
|
||||
.modes button:first-child{margin-left:0}
|
||||
.modes button[aria-pressed=true]{background:var(--sapin);color:#fff}
|
||||
.modes button[data-tri="2"][aria-pressed=true]{background:#000;border-color:#000}
|
||||
.puce.horsmode{display:none}
|
||||
.puce .ics{display:none;margin-left:6px;vertical-align:1px}
|
||||
.carte.filtre .puce .ics{display:inline}
|
||||
a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(--sapin);outline-offset:2px}
|
||||
.vieux{color:var(--chaud)!important}
|
||||
#retour{display:none;margin-top:12px;font:inherit;font-size:12px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;background:var(--sapin);color:#fff;border:0;border-radius:0;padding:7px 10px;cursor:pointer}
|
||||
@@ -200,6 +216,67 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
background-repeat:no-repeat;-webkit-backdrop-filter:blur(8px) saturate(1.2);backdrop-filter:blur(8px) saturate(1.2);transition:background-color .15s}
|
||||
.suite:hover{background-color:rgba(255,255,255,.75)}
|
||||
|
||||
.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{display:inline-flex;align-items:center;gap:8px;padding:5px 11px 5px 7px;background:#fff;border:1px solid #000;color:#000;font-size:12px;font-weight:600;text-decoration:none}
|
||||
.compte:hover{background:#ecebe5}
|
||||
.compte .gmark{font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:22px;line-height:1;color:#000;letter-spacing:-.02em}
|
||||
.legende{left:auto;right:222px}
|
||||
.forum-box{position:absolute;left:28px;bottom:16px;z-index:3;width:372px;background:rgba(250,249,245,.97);border:1px solid var(--roche);box-shadow:0 0 0 3px rgba(250,249,245,.97),0 0 0 4px var(--pierre);color:var(--roche)}
|
||||
.fb-haut{display:flex;justify-content:space-between;align-items:baseline;padding:12px 16px 2px}
|
||||
.fb-haut b{font-family:var(--titre);font-weight:700;font-size:28px;color:var(--sapin);line-height:1.1}
|
||||
.fb-haut small{font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--gris)}
|
||||
.fb-une{padding:4px 16px 12px;border-bottom:1px solid var(--pierre)}
|
||||
.fb-une small{display:block;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--gris)}
|
||||
.fb-une a{display:block;margin-top:2px;font-family:var(--titre);font-weight:600;font-size:17px;line-height:1.3;color:var(--roche);text-decoration:none}
|
||||
.fb-une a:hover{text-decoration:underline}
|
||||
.fb-une span{font-size:12.5px;color:var(--gris)}
|
||||
.fb-cta{display:block;margin:12px 16px 6px;padding:11px 14px;background:var(--sapin);color:#fff;text-align:center;font-size:13px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;text-decoration:none;border:1px solid var(--sapin)}
|
||||
.fb-cta:hover{background:#17382b}
|
||||
.fb-co{margin:0 16px 12px;text-align:center;font-size:12.5px;color:var(--gris)}
|
||||
.fb-co a{display:inline-flex;align-items:center;gap:5px;color:#000;font-weight:600;text-decoration:underline;text-underline-offset:2px}
|
||||
.fb-co .g{font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:17px;line-height:1;text-decoration:none}
|
||||
.fb-bas{display:flex;gap:12px;align-items:center;padding:10px 16px;background:#303336;color:#d9dbde;font-size:12.5px;line-height:1.4}
|
||||
.fb-bas .gcarre{flex:0 0 32px;height:32px;display:grid;place-items:center;background:#fff;color:#000;font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:22px}
|
||||
.fb-bas strong{color:#fff;font-weight:600}
|
||||
.forum-box.ferme .fb-co{display:none}
|
||||
.forum-box.ferme .fb-cta{background:#7d8a82;border-color:#7d8a82;cursor:default}
|
||||
.forum-box.ferme .fb-une a{pointer-events:none}
|
||||
.forum-box.mobile{display:none}
|
||||
@media (max-width:1000px){.forum-box{left:auto;right:28px;bottom:68px;width:320px}.legende{left:28px;right:auto}}
|
||||
@media (max-width:719px){.carte .forum-box{display:none}.forum-box.mobile{display:block;position:static;width:auto;flex:0 0 100%;margin:6px 0 4px}}
|
||||
.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)}
|
||||
@media (max-width:719px){#coupe-svg text{font-size:10.5px}}
|
||||
#coupe-svg .st{cursor:pointer}
|
||||
#coupe-svg .st rect{stroke:#fff;stroke-width:1.5}
|
||||
#coupe-svg .st:hover rect,#coupe-svg .st:focus rect,#coupe-svg .st.on rect{stroke:var(--roche);stroke-width:2}
|
||||
#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)}
|
||||
@@ -213,10 +290,15 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
.case strong{display:block;font-size:14.5px;font-weight:600;margin:2px 0 6px}
|
||||
.case b{font-family:var(--titre);font-size:30px;font-weight:600;line-height:1}
|
||||
.case em{display:block;font-style:normal;font-size:12px;color:var(--gris);margin-top:5px}
|
||||
.pied{max-width:1080px;margin:0 auto;padding:22px 28px 44px;font-size:12.5px;color:var(--gris);border-top:1px solid var(--pierre)}
|
||||
.pied{background:#303336;color:#d1d3d6;padding:34px 28px 22px;font-size:13px;line-height:1.7;border-top:4px solid #1c1d1f}
|
||||
.pied-grille{max-width:1080px;margin:0 auto;display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:34px}
|
||||
.pied p{margin:6px 0}
|
||||
.pied .accroche{font-family:var(--titre);font-style:italic;font-size:17px;color:var(--sapin)}
|
||||
.pied a{color:var(--sapin)}
|
||||
.pied h4{margin:0 0 8px;font-family:var(--texte);font-size:11.5px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:#fff;border-bottom:1px solid #4a4d51;padding-bottom:7px}
|
||||
.pied ul{list-style:none;margin:0;padding:0}
|
||||
.pied .accroche{font-family:var(--titre);font-style:italic;font-size:17px;color:#fff}
|
||||
.pied a{color:#b9c2cc;text-decoration:none;font-weight:500}
|
||||
.pied a:hover{color:#fff;text-decoration:underline}
|
||||
.pied-bas{max-width:1080px;margin:26px auto 0!important;padding-top:14px;border-top:1px solid #45484c;font-size:12px;color:#8e9298}
|
||||
|
||||
@media (max-width:720px){
|
||||
.carte{min-height:0}
|
||||
@@ -241,9 +323,16 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
.puce .val{font-size:18px}
|
||||
.fiche{width:244px}
|
||||
.liste{padding:40px 16px 24px}
|
||||
.pied{padding:18px 16px 36px}
|
||||
.pied{padding:26px 16px 30px}
|
||||
.pied-grille{grid-template-columns:1fr;gap:22px}
|
||||
.sous-carte{padding:8px 16px 0}
|
||||
}
|
||||
.sanscookie{position:fixed;left:16px;bottom:16px;z-index:60;max-width:340px;padding:10px 34px 10px 14px;background:var(--calcaire);border:1px solid var(--sapin);box-shadow:0 0 0 3px var(--calcaire),0 0 0 4px var(--pierre);color:var(--roche);font-family:var(--texte);transition:opacity .5s}
|
||||
.sanscookie.parti{opacity:0;pointer-events:none}
|
||||
.sanscookie b{display:block;font-family:var(--titre);font-weight:600;font-size:15px;color:var(--sapin)}
|
||||
.sanscookie span{font-size:12.5px;color:var(--gris)}
|
||||
.sanscookie button{position:absolute;top:2px;right:4px;border:0;background:none;font-size:20px;line-height:1;color:var(--gris);cursor:pointer;padding:4px 6px}
|
||||
@media (prefers-reduced-motion:reduce){.sanscookie{transition:none}}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -254,14 +343,15 @@ 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>
|
||||
<p class="reseau" id="reseau"></p>
|
||||
<div class="outils" id="outils">
|
||||
<div class="rech"><input type="search" id="rech" placeholder="Une station, un village…" autocomplete="off" aria-label="Chercher une station ou un village"><ul id="rech-res" hidden></ul></div>
|
||||
<button type="button" id="filtre" aria-pressed="false" title="Montrer les stations qui mesurent le vent ou la pluie">Vent · pluie</button>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
@@ -272,25 +362,73 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
<div class="echelle"><i id="barre"></i><span id="km">5 km</span></div>
|
||||
</div>
|
||||
<a class="suite" href="#stations">Toutes les stations ↓</a>
|
||||
<div class="forum-box">
|
||||
<div class="fb-haut"><b>Forum</b><small data-n></small></div>
|
||||
<div class="fb-une"><small>À la une · Récapitulatif de la semaine</small><a href="forum/index.html" data-une>Le récapitulatif de la semaine arrive ici</a><span data-auteur></span></div>
|
||||
<a class="fb-cta" href="forum/index.html">Rejoindre la discussion →</a>
|
||||
<p class="fb-co">Déjà un compte ? <a href="forum/connexion.html"><span class="g" aria-hidden="true">G</span>Se connecter avec Gastinel</a></p>
|
||||
<div class="fb-bas"><span class="gcarre" aria-hidden="true">G</span><span><strong>L'écosystème Gastinel.</strong> Un compte pour le forum, vos favoris et toutes nos applications. Sans publicité, une alternative aux GAFAM.</span></div>
|
||||
</div>
|
||||
<div class="thermo" id="thermo"><i id="degrade"></i><span><span>−10°</span><span>0°</span><span>+15°</span></span></div>
|
||||
</main>
|
||||
|
||||
<p class="sous-carte">Courbes de niveau tous les 100 m · molette sur le Parc ou deux doigts pour zoomer</p>
|
||||
<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>
|
||||
<p class="sous-carte">Courbes de niveau tous les 100 m · zoom : molette (PC) ou deux doigts (téléphone)</p>
|
||||
<div class="reglages" id="reglages"><div class="modes" id="modes" role="group" aria-label="Valeur affichée sur les étiquettes"><button type="button" data-mode="t" aria-pressed="true">Temp</button><button type="button" data-mode="alt" aria-pressed="false" title="Classe la liste par altitude : un clic croissant, un deuxième clic décroissant">Alt</button><button type="button" data-mode="vent" aria-pressed="false" title="Seules les stations qui mesurent le vent">Vent</button><button type="button" data-mode="pluie" aria-pressed="false" title="Seules les stations qui mesurent la pluie">Pluie</button></div>
|
||||
<div class="temps" id="temps"><button type="button" id="lecture" aria-label="Rejouer les dernières 24 heures" disabled>▶</button><input type="range" id="curseur" min="0" max="0" step="1" value="0" disabled aria-label="Remonter le temps, sept jours"><output id="temps-txt" for="curseur">Maintenant</output></div>
|
||||
<p class="aide">Ces choix valent aussi pour la liste des stations, plus bas.</p>
|
||||
<div class="forum-box mobile">
|
||||
<div class="fb-haut"><b>Forum</b><small data-n></small></div>
|
||||
<div class="fb-une"><small>À la une · Récapitulatif de la semaine</small><a href="forum/index.html" data-une>Le récapitulatif de la semaine arrive ici</a><span data-auteur></span></div>
|
||||
<a class="fb-cta" href="forum/index.html">Rejoindre la discussion →</a>
|
||||
<p class="fb-co">Déjà un compte ? <a href="forum/connexion.html"><span class="g" aria-hidden="true">G</span>Se connecter avec Gastinel</a></p>
|
||||
<div class="fb-bas"><span class="gcarre" aria-hidden="true">G</span><span><strong>L'écosystème Gastinel.</strong> Un compte pour le forum, vos favoris et toutes nos applications. Sans publicité, une alternative aux GAFAM.</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<section class="liste coupe" id="coupe">
|
||||
<h2>La coupe du massif</h2>
|
||||
<p id="coupe-txt">Chaque carré est une station : plus il est haut, plus la station est en altitude ; plus il est à gauche, plus il fait froid.</p>
|
||||
<div id="coupe-svg"></div>
|
||||
<p class="coupe-lect" id="coupe-lect" aria-live="polite">Survole ou touche une station.</p>
|
||||
</section>
|
||||
<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">
|
||||
<p class="accroche">Des stations de chez nous, des chiffres d'ici.</p>
|
||||
<p>Données : Météo-France (Licence Ouverte), Infoclimat (CC BY ou CC BY-NC selon la station), WeatherLink, station Gastinel. Fond de carte : IGN, licence ouverte.</p>
|
||||
<p><a href="a-propos.html">À propos</a> · <a href="a-propos.html#sources">Sources et licences</a> · <a href="a-propos.html#mentions">Mentions légales</a> · <a href="cgu.html">CGU</a> · <a href="confidentialite.html">Confidentialité</a> · © Théo Gastinel</p>
|
||||
<div class="pied-grille">
|
||||
<div>
|
||||
<p class="accroche">Des stations de chez nous, des chiffres d'ici.</p>
|
||||
<p>Données : Météo-France (Licence Ouverte), Infoclimat (CC BY ou CC BY-NC selon la station), WeatherLink, station Gastinel. Fond de carte : IGN, licence ouverte.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Contact</h4>
|
||||
<ul><li><a href="mailto:studio@gastinel.me">studio@gastinel.me</a></li>
|
||||
<li><a href="https://wa.me/message/XAHBYTJZNQ6TK1" rel="noopener">WhatsApp</a></li>
|
||||
<li><a href="tel:+33636276419">06 36 27 64 19</a></li></ul>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Le site</h4>
|
||||
<ul><li><a href="a-propos.html">À propos</a></li><li><a href="a-propos.html#sources">Sources et licences</a></li><li><a href="a-propos.html#mentions">Mentions légales</a></li><li><a href="cgu.html">CGU</a></li><li><a href="confidentialite.html">Confidentialité</a></li></ul>
|
||||
<p>SIRET <a href="https://entreprises.lefigaro.fr/nd-38/entreprise-104816749" rel="noopener">10481674900014</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="pied-bas">© Théo Gastinel · Météo Vercors</p>
|
||||
</footer>
|
||||
<noscript><p style="max-width:640px;margin:0 auto;padding:16px;font-family:system-ui">Météo Vercors a besoin de JavaScript pour afficher la carte et les relevés en direct. Les sources et les mentions légales sont sur la page <a href="a-propos.html">À propos</a>.</p></noscript>
|
||||
|
||||
<script>
|
||||
const C = {"vw": 551.2, "vh": 723.6, "k": 0.7072918770746889, "m": 1113.2, "lon0": 5.12, "lat1": 45.31};
|
||||
const ETIQ = [{"n": "Villard-de-Lans", "lon": 5.5522, "lat": 45.0707, "p": 1, "t": "village", "ele": null}, {"n": "La Chapelle-en-Vercors", "lon": 5.4161, "lat": 44.9683, "p": 1, "t": "village", "ele": null}, {"n": "Die", "lon": 5.3689, "lat": 44.753, "p": 1, "t": "village", "ele": null}, {"n": "Pont-en-Royans", "lon": 5.3441, "lat": 45.0608, "p": 1, "t": "village", "ele": null}, {"n": "Saint-Jean-en-Royans", "lon": 5.2916, "lat": 45.0169, "p": 1, "t": "village", "ele": null}, {"n": "Gresse-en-Vercors", "lon": 5.5661, "lat": 44.9013, "p": 1, "t": "village", "ele": null}, {"n": "Vassieux-en-Vercors", "lon": 5.3711, "lat": 44.8954, "p": 1, "t": "village", "ele": null}, {"n": "Corrençon-en-Vercors", "lon": 5.5266, "lat": 45.0316, "p": 2, "t": "village", "ele": null}, {"n": "Autrans", "lon": 5.5442, "lat": 45.176, "p": 1, "t": "village", "ele": null}, {"n": "Méaudre", "lon": 5.5271, "lat": 45.1269, "p": 2, "t": "village", "ele": null}, {"n": "Lans-en-Vercors", "lon": 5.5885, "lat": 45.128, "p": 2, "t": "village", "ele": null}, {"n": "Engins", "lon": 5.6169, "lat": 45.1806, "p": 2, "t": "village", "ele": null}, {"n": "Saint-Nizier-du-Moucherotte", "lon": 5.6286, "lat": 45.1708, "p": 3, "t": "village", "ele": null}, {"n": "Saint-Julien-en-Vercors", "lon": 5.4498, "lat": 45.0511, "p": 2, "t": "village", "ele": null}, {"n": "Saint-Martin-en-Vercors", "lon": 5.4429, "lat": 45.0214, "p": 2, "t": "village", "ele": null}, {"n": "Saint-Agnan-en-Vercors", "lon": 5.4307, "lat": 44.9356, "p": 2, "t": "village", "ele": null}, {"n": "Rencurel", "lon": 5.473, "lat": 45.104, "p": 2, "t": "village", "ele": null}, {"n": "Chichilianne", "lon": 5.5736, "lat": 44.812, "p": 2, "t": "village", "ele": null}, {"n": "Châtillon-en-Diois", "lon": 5.485, "lat": 44.6953, "p": 2, "t": "village", "ele": null}, {"n": "Bouvante", "lon": 5.271, "lat": 44.9649, "p": 2, "t": "village", "ele": null}, {"n": "Monestier-de-Clermont", "lon": 5.6348, "lat": 44.9166, "p": 2, "t": "village", "ele": null}, {"n": "Romeyer", "lon": 5.4086, "lat": 44.7789, "p": 3, "t": "village", "ele": null}, {"n": "Malleval-en-Vercors", "lon": 5.4376, "lat": 45.147, "p": 3, "t": "village", "ele": null}, {"n": "Choranche", "lon": 5.3912, "lat": 45.067, "p": 3, "t": "village", "ele": null}, {"n": "Léoncel", "lon": 5.1936, "lat": 44.9108, "p": 3, "t": "village", "ele": null}, {"n": "Glandage", "lon": 5.5982, "lat": 44.6878, "p": 3, "t": "village", "ele": null}, {"n": "Grenoble", "lon": 5.7364, "lat": 45.1864, "p": 1, "t": "ville", "ele": null}, {"n": "Saint-Marcellin", "lon": 5.32, "lat": 45.1541, "p": 2, "t": "ville", "ele": null}, {"n": "Vif", "lon": 5.6691, "lat": 45.0563, "p": 2, "t": "ville", "ele": null}, {"n": "Grand Veymont", "lon": 5.5266, "lat": 44.8697, "p": 1, "t": "pic", "ele": 2341}, {"n": "Mont Aiguille", "lon": 5.55305, "lat": 44.84202, "p": 1, "t": "pic", "ele": 2087}, {"n": "Grande Moucherolle", "lon": 5.56401, "lat": 45.00494, "p": 2, "t": "pic", "ele": 2284}, {"n": "Moucherotte", "lon": 5.63947, "lat": 45.14781, "p": 2, "t": "pic", "ele": 1901}, {"n": "Pic Saint-Michel", "lon": 5.61996, "lat": 45.0902, "p": 3, "t": "pic", "ele": 1966}, {"n": "Roc Cornafion", "lon": 5.60086, "lat": 45.06258, "p": 3, "t": "pic", "ele": 2049}, {"n": "But Saint-Genix", "lon": 5.33145, "lat": 44.83031, "p": 3, "t": "pic", "ele": 1645}, {"n": "Royans", "lon": 5.235, "lat": 45.085, "p": 1, "t": "region"}, {"n": "Diois", "lon": 5.45, "lat": 44.72, "p": 1, "t": "region"}, {"n": "Trièves", "lon": 5.675, "lat": 44.855, "p": 1, "t": "region"}, {"n": "Hauts-Plateaux", "lon": 5.47, "lat": 44.885, "p": 2, "t": "region"}, {"n": "Quatre-Montagnes", "lon": 5.45, "lat": 45.19, "p": 2, "t": "region"}, {"n": "Vallée de l'Isère", "lon": 5.42, "lat": 45.245, "p": 2, "t": "region"}, {"n": "Chartreuse", "lon": 5.775, "lat": 45.285, "p": 2, "t": "region"}, {"n": "Gorges de la Bourne", "lon": 5.425, "lat": 45.083, "p": 3, "t": "lieudit"}, {"n": "Forêt de Lente", "lon": 5.315, "lat": 44.955, "p": 3, "t": "lieudit"}, {"n": "Drac", "lon": 5.70018, "lat": 45.05229, "p": 1, "t": "fleuve"}, {"n": "Isère", "lon": 5.45887, "lat": 45.20526, "p": 1, "t": "fleuve"}, {"n": "Drôme", "lon": 5.27026, "lat": 44.73626, "p": 1, "t": "fleuve"}, {"n": "Rhône", "lon": 4.82383421, "lat": 45.10713902, "p": 1, "t": "fleuve"}, {"n": "Valence", "lon": 4.8921, "lat": 44.9333, "p": 1, "t": "ville"}, {"n": "Romans-sur-Isère", "lon": 5.0524, "lat": 45.0447, "p": 1, "t": "ville"}, {"n": "Voiron", "lon": 5.5915, "lat": 45.3627, "p": 1, "t": "ville"}, {"n": "Crest", "lon": 5.024, "lat": 44.7284, "p": 2, "t": "ville"}, {"n": "La Mure", "lon": 5.7846, "lat": 44.9065, "p": 2, "t": "ville"}, {"n": "Mens", "lon": 5.752, "lat": 44.8178, "p": 2, "t": "ville"}, {"n": "Saint-Égrève", "lon": 5.6815, "lat": 45.2334, "p": 3, "t": "ville"}];
|
||||
const FORUM_OUVERT = false; // passer à true quand le forum et la connexion Gastinel sont en ligne
|
||||
|
||||
// Stations du Vercors relevées dans les notes (Boîte + liste du 16/10) ; valeurs d'exemple (matin d'inversion)
|
||||
const STATIONS = {
|
||||
@@ -336,6 +474,17 @@ const GROUPES = [
|
||||
{nom:'Marignac', st:['marignac'], sect:'Diois'},
|
||||
{nom:'Solaure', st:['solaure'], sect:'Diois'},
|
||||
];
|
||||
// Propriétaire des stations « de chez nous » ; 'dispo' = où l'on retrouve aussi la station (jamais Infoclimat en premier)
|
||||
const PROPRIO = {lans:'Station Gastinel', moucherolle:'Station Gastinel',
|
||||
geve:'Station Richard Gastinel', allieres:'Station Richard Gastinel', bruyeres:'Station Richard Gastinel',
|
||||
darbounouse:'Station Richard Gastinel', oscence:'Station Richard Gastinel'};
|
||||
const DISPO = ['WeatherLink', 'ROMMA', 'Infoclimat'];
|
||||
function origine(id){
|
||||
const s = STATIONS[id], p = PROPRIO[id];
|
||||
if (p) return {titre: p, aussi: 'Aussi consultable sur ' + DISPO.join(' · ')};
|
||||
const src = s.src || '';
|
||||
return {titre: src ? 'Vient ' + (/^[AEIOUÉ]/i.test(src) ? "d'" : 'de ') + src : '', aussi: ''};
|
||||
}
|
||||
const MASSIF = [5.06, 45.305, 5.835, 44.635]; // ouest, nord, est, sud : tout le Parc (limite IGN)
|
||||
// Une puce par station : la 1re station d'un groupe porte le nom du village et passe en priorité ;
|
||||
// les autres viennent après, elles rejoignent la puce du village tant que la place manque.
|
||||
@@ -365,6 +514,13 @@ Object.values(STATIONS).forEach(x => { x.t = x.mn = x.mx = null; x.exemple = tru
|
||||
|
||||
// phrase du jour : le point le plus froid, et l'inversion si elle se voit
|
||||
const MOMENT = h => h < 5 ? 'Cette nuit' : h < 12 ? 'Ce matin' : h < 18 ? 'Cet après-midi' : h < 23 ? 'Ce soir' : 'Cette nuit';
|
||||
let RECORD = 'auto';
|
||||
try { RECORD = localStorage.getItem('vm-record') || 'auto'; } catch (e) {}
|
||||
// saisons météorologiques : hiver = décembre à février, été = juin à août
|
||||
function saisonMeteo(){
|
||||
const m = parseInt(new Intl.DateTimeFormat('fr-FR', {month: 'numeric', timeZone: 'Europe/Paris'}).format(new Date()), 10);
|
||||
return m === 12 || m <= 2 ? 'hiver' : m >= 6 && m <= 8 ? 'ete' : 'entre';
|
||||
}
|
||||
function phraseDuJour(){
|
||||
const toutes = Object.values(STATIONS), reelles = toutes.filter(x => x.t != null);
|
||||
if (!reelles.length) {
|
||||
@@ -372,10 +528,23 @@ function phraseDuJour(){
|
||||
document.getElementById('reseau').textContent = `${toutes.length} stations dans le massif`;
|
||||
return;
|
||||
}
|
||||
const l = reelles.sort((a, b) => a.t - b.t), f = l[0];
|
||||
let s = `${MOMENT(heureParis())}, <strong>${fmt(f.t).replace('°',' °C')} à ${court(f.nom)}</strong>, le point le plus froid du massif en ce moment.`;
|
||||
const h = l.filter(x => x.alt - f.alt >= 300 && x.t - f.t >= 3).sort((a, b) => b.alt - a.alt)[0];
|
||||
if (h) s += ` ${h.alt - f.alt} m plus haut, ${court(h.nom)} : ${fmt(h.t).replace('°',' °C')}. L'air froid est resté au fond.`;
|
||||
const l = [...reelles].sort((a, b) => a.t - b.t), f = l[0], c = l[l.length - 1], deg = t => fmt(t).replace('°', ' °C');
|
||||
const sais = saisonMeteo(), mode = RECORD !== 'auto' ? RECORD : sais === 'hiver' ? 'froid' : sais === 'ete' ? 'chaud' : 'ecart';
|
||||
const mom = MOMENT(heureParis());
|
||||
let s;
|
||||
if (mode === 'chaud') s = `${mom}, <strong>${deg(c.t)} à ${court(c.nom)}</strong>, le point le plus chaud du massif en ce moment.`;
|
||||
else if (mode === 'ecart') s = `${mom}, de <strong>${deg(f.t)} à ${court(f.nom)}</strong> à <strong>${deg(c.t)} à ${court(c.nom)}</strong> : le plus froid et le plus chaud du massif.`;
|
||||
else if (mode === 'vent') {
|
||||
const v = toutes.filter(x => x.vent != null && capteur(Object.keys(STATIONS).find(k => STATIONS[k] === x), 'vent')).sort((a, b) => b.vent - a.vent)[0];
|
||||
s = v ? `${mom}, <strong>${Math.round(v.vent)} km/h à ${court(v.nom)}</strong>, le vent moyen le plus fort du massif.` : `${mom}, aucun vent mesuré pour l'instant.`;
|
||||
} else if (mode === 'pluie') {
|
||||
const r = toutes.filter(x => x.pluie != null && x.pluie > 0).sort((a, b) => b.pluie - a.pluie)[0];
|
||||
s = r ? `${mom}, <strong>${nb1(r.pluie)} mm en une heure à ${court(r.nom)}</strong>, la pluie la plus forte du massif.` : `${mom}, pas de pluie mesurée dans le massif.`;
|
||||
} else {
|
||||
s = `${mom}, <strong>${deg(f.t)} à ${court(f.nom)}</strong>, le point le plus froid du massif en ce moment.`;
|
||||
const h = l.filter(x => x.alt - f.alt >= 300 && x.t - f.t >= 3).sort((a, b) => b.alt - a.alt)[0];
|
||||
if (h) s += ` ${h.alt - f.alt} m plus haut, ${court(h.nom)} : ${deg(h.t)}. L'air froid est resté au fond.`;
|
||||
}
|
||||
document.getElementById('phrase').innerHTML = s;
|
||||
document.getElementById('reseau').textContent = `${reelles.length} stations en direct sur ${toutes.length} · Météo-France, Infoclimat, station Gastinel`;
|
||||
}
|
||||
@@ -424,14 +593,22 @@ document.addEventListener('click', fermer);
|
||||
carte.addEventListener('touchmove', ev => { if (ev.touches.length > 1) ev.preventDefault(); }, {passive: false});
|
||||
carte.addEventListener('gesturestart', ev => ev.preventDefault());
|
||||
|
||||
let MODE = 't'; // t, alt, vent, pluie
|
||||
function valMode(r){
|
||||
return MODE === 'alt' ? [`${r.alt} m`, 'var(--sapin)']
|
||||
: MODE === 'vent' ? [r.vent == null ? '—' : `${Math.round(r.vent)} km/h`, '#3d6f8e']
|
||||
: MODE === 'pluie' ? [r.pluie == null ? '—' : `${nb1(r.pluie)} mm`, '#3d6f8e'] : [fmt(r.t), couleur(r.t)];
|
||||
}
|
||||
const capteur = (id, m) => m === 'vent' ? !!(SEM[id] && SEM[id].vent) : m === 'pluie' ? !!(SEM[id] && SEM[id].pluie) : true;
|
||||
const nb1 = v => v == null ? '—' : String(Math.round(v * 10) / 10).replace('.', ',');
|
||||
// contenu d'une puce : ses stations propres + celles qu'elle a absorbées faute de place
|
||||
function remplir(p){
|
||||
const st = p.ids.map(id => ({id, ...STATIONS[id]})), r = st.find(x => x.t != null) || st[0];
|
||||
const st = p.ids.map(id => ({id, ...STATIONS[id]})), pool = st.filter(x => capteur(x.id, MODE)), r = pool.find(x => x.t != null) || pool[0] || st.find(x => x.t != null) || st[0];
|
||||
const autres = st.length - 1;
|
||||
p.b.classList.toggle('ex', !!r.exemple); p.b.classList.toggle('hl', !!r.horsLigne);
|
||||
const cap = st.some(x => SEM[x.id] && SEM[x.id].pluie), vent = st.some(x => SEM[x.id] && SEM[x.id].vent);
|
||||
p.b.classList.toggle('sans', !cap && !vent);
|
||||
const hb = `<span class="val" style="color:${couleur(r.t)}">${fmt(r.t)}</span>${autres ? `<span class="n">+${autres}</span>` : ''}<span class="nom">${p.titre}<span class="ics">${cap ? IC_GOUTTE : ''}${vent ? IC_EOLIENNE : ''}</span></span>`;
|
||||
const vm = valMode(r);
|
||||
const hb = `<span class="val" style="color:${vm[1]}">${vm[0]}</span>${autres ? `<span class="n">+${autres}</span>` : ''}<span class="nom">${p.titre}<span class="ics">${cap ? IC_GOUTTE : ''}${vent ? IC_EOLIENNE : ''}</span></span>`;
|
||||
const hf = `<h3>${p.titre}${p.absorbe ? ' et alentours' : ''}</h3><ul>${st.map((s, i) => `<li style="--i:${i}"><span>${s.nom}</span><b style="color:${couleur(s.t)}">${fmt(s.t)}</b>
|
||||
<em>${icones(s.id)}${s.alt} m · ${s.src}${s.licence ? ` (${s.licence})` : ''}${s.exemple ? ' · pas de données en direct' : s.horsLigne ? ' · hors ligne' : ''}${s.mn != null ? ` · 24 h : ${fmt(s.mn)} / ${fmt(s.mx)}` : ''}</em></li>`).join('')}</ul>` +
|
||||
`<div class="actions"><button type="button" class="pleinbtn">Ouvrir en plein écran →</button>${p.mini ? '' : '<button type="button" class="zoom">Zoomer sur ce secteur →</button>'}</div>`;
|
||||
@@ -682,19 +859,28 @@ function disposer(){
|
||||
const extremes = new Set(vivantes.length ? [
|
||||
vivantes.reduce((a, b) => STATIONS[a.g.st[0]].t <= STATIONS[b.g.st[0]].t ? a : b),
|
||||
vivantes.reduce((a, b) => STATIONS[a.g.st[0]].t >= STATIONS[b.g.st[0]].t ? a : b)] : []);
|
||||
const pointsAutres = puces.filter(q => !q.force && (MODE === 't' || MODE === 'alt' || q.ids.some(id => capteur(id, MODE)))).map(q => {
|
||||
const [px, py] = ecran(q.xy);
|
||||
return {p: q, r: {left: r0.left + px - 6, right: r0.left + px + 6, top: r0.top + py - 6, bottom: r0.top + py + 6}};
|
||||
});
|
||||
[...extremes, ...puces.filter(p => !extremes.has(p))].forEach(p => {
|
||||
const [x, y] = ecran(p.xy);
|
||||
p.x = x; p.y = y;
|
||||
p.m.style.left = x + 'px'; p.m.style.top = y + 'px';
|
||||
if (MODE === 'vent' || MODE === 'pluie') { if (!p.ids.some(id => capteur(id, MODE))) { p.m.classList.add('cache'); return; } p.m.classList.remove('cache'); }
|
||||
if (p.force) { p.etat = 'dans'; p.dans = p.force; p.m.classList.add('cache'); return; }
|
||||
remplir(p);
|
||||
const bw = p.b.offsetWidth, bh = p.b.offsetHeight;
|
||||
const essais = [[-bw / 2, -bh - 12], [-bw / 2, 12], [14, -bh / 2], [-bw - 14, -bh / 2], [12, -bh - 8], [-bw - 12, -bh - 8]];
|
||||
let choix = null;
|
||||
for (const [dx, dy] of essais) {
|
||||
const r = {left: r0.left + x + dx, top: r0.top + y + dy, right: r0.left + x + dx + bw, bottom: r0.top + y + dy + bh};
|
||||
const m = {left: r.left - 3, right: r.right + 3, top: r.top - 3, bottom: r.bottom + 3}; // 3 px d'air entre étiquettes
|
||||
if (dedans(r) && !interdits.some(z => chevauche(m, z)) && !posees.some(q => chevauche(m, q.r))) { choix = {dx, dy, r}; break; }
|
||||
for (const strict of [true, false]) {
|
||||
for (const [dx, dy] of essais) {
|
||||
const r = {left: r0.left + x + dx, top: r0.top + y + dy, right: r0.left + x + dx + bw, bottom: r0.top + y + dy + bh};
|
||||
const m = {left: r.left - 3, right: r.right + 3, top: r.top - 3, bottom: r.bottom + 3}; // 3 px d'air entre étiquettes
|
||||
if (dedans(r) && !interdits.some(z => chevauche(m, z)) && !posees.some(q => chevauche(m, q.r))
|
||||
&& !(strict && pointsAutres.some(z => z.p !== p && chevauche(r, z.r)))) { choix = {dx, dy, r}; break; }
|
||||
}
|
||||
if (choix) break;
|
||||
}
|
||||
if (!choix) {
|
||||
// pas de place : la station rejoint la puce posée la plus proche
|
||||
@@ -764,20 +950,109 @@ function disposer(){
|
||||
}
|
||||
|
||||
// liste sous la carte, par secteur
|
||||
let TRI = 0; // 0 par secteur, 1 altitude croissante, 2 décroissante
|
||||
function listeStations(){
|
||||
const carteCase = id => {
|
||||
const s = STATIONS[id], vm = valMode(s);
|
||||
return `<button type="button" class="case${s.exemple ? ' ex' : ''}" data-id="${id}"><small>${s.alt} m · ${s.src}${s.exemple ? ' · pas de données' : s.horsLigne ? ' · hors ligne' : ''}</small><strong>${s.nom}</strong><b style="color:${vm[1]}">${vm[0]}</b></button>`;
|
||||
};
|
||||
if (TRI) {
|
||||
const ids = GROUPES.flatMap(g => g.st).filter(id => capteur(id, MODE)).sort((a, b) => (STATIONS[a].alt - STATIONS[b].alt) * (TRI === 1 ? 1 : -1));
|
||||
document.getElementById('secteurs').innerHTML = `<div class="grille">${ids.map(carteCase).join('')}</div>`;
|
||||
return;
|
||||
}
|
||||
const sects = {};
|
||||
GROUPES.forEach(g => g.st.forEach(id => (sects[g.sect] ||= []).push(id)));
|
||||
const ordre = ['Quatre-Montagnes', 'Hauts-Plateaux et Vercors drômois', 'Trièves et Gresse', 'Royans', 'Diois'];
|
||||
document.getElementById('secteurs').innerHTML = ordre.map(n => `<h3>${n}</h3><div class="grille">${sects[n].map(id => {
|
||||
const s = STATIONS[id];
|
||||
return `<button type="button" class="case${s.exemple ? ' ex' : ''}" data-id="${id}"><small>${s.alt} m · ${s.src}${s.exemple ? ' · pas de données' : s.horsLigne ? ' · hors ligne' : ''}</small><strong>${s.nom}</strong><b style="color:${couleur(s.t)}">${fmt(s.t)}</b></button>`;
|
||||
}).join('')}</div>`).join('');
|
||||
document.getElementById('secteurs').innerHTML = ordre.map(n => { const l = sects[n].filter(id => capteur(id, MODE)); return l.length ? `<h3>${n}</h3><div class="grille">${l.map(carteCase).join('')}</div>` : ''; }).join('');
|
||||
}
|
||||
function coupe(){
|
||||
const L = Object.entries(STATIONS).filter(([, x]) => x.t != null).map(([id, x]) => ({id, ...x}));
|
||||
const cible = document.getElementById('coupe-svg');
|
||||
if (L.length < 3) { cible.innerHTML = ''; return; }
|
||||
const W = Math.max(300, Math.min(720, cible.clientWidth || 720)), H = W < 500 ? 330 : 380, g = W < 500 ? 46 : 52, d = 14, b = 30, h = 12;
|
||||
const tMin = Math.floor(Math.min(...L.map(x => x.t)) - 1), tMax = Math.ceil(Math.max(...L.map(x => x.t)) + 1);
|
||||
const aMin = Math.floor(Math.min(...L.map(x => x.alt)) / 250) * 250 - 100, aMax = Math.ceil(Math.max(...L.map(x => x.alt)) / 250) * 250 + 100;
|
||||
const X = t => g + (t - tMin) / (tMax - tMin) * (W - g - d), Y = a => H - b - (a - aMin) / (aMax - aMin) * (H - b - h);
|
||||
const pas = (tMax - tMin) > 14 ? 5 : 2;
|
||||
let o = '';
|
||||
for (let t = Math.ceil(tMin / pas) * pas; t <= tMax; t += pas) o += `<line x1="${X(t)}" x2="${X(t)}" y1="${h}" y2="${H - b}" stroke="#e4e0d6"/><text x="${X(t)}" y="${H - b + 16}" text-anchor="middle">${t}°</text>`;
|
||||
for (let a = Math.ceil(aMin / 500) * 500; a <= aMax; a += 500) o += `<line x1="${g}" x2="${W - d}" y1="${Y(a)}" y2="${Y(a)}" stroke="#e4e0d6"/><text x="${g - 6}" y="${Y(a) + 4}" text-anchor="end">${a} m</text>`;
|
||||
// atmosphère standard : −0,65 °C par 100 m, depuis la station la plus basse
|
||||
const bas = L.reduce((a, c) => c.alt < a.alt ? c : a);
|
||||
const tAt = a => bas.t - 0.0065 * (a - bas.alt);
|
||||
o += `<line x1="${X(tAt(aMin))}" y1="${Y(aMin)}" x2="${X(tAt(aMax))}" y2="${Y(aMax)}" stroke="#6f8f5c" stroke-width="1.5" stroke-dasharray="5 4"/><text x="${g + 6}" y="${H - b - 8}" style="fill:#6f8f5c">- - refroidissement normal</text>`;
|
||||
const ext = new Set([L.reduce((a, c) => c.t < a.t ? c : a).id, L.reduce((a, c) => c.t > a.t ? c : a).id, L.reduce((a, c) => c.alt > a.alt ? c : a).id, bas.id]);
|
||||
L.sort((a, c) => a.alt - c.alt).forEach(x => {
|
||||
o += `<g class="st" tabindex="0" data-id="${x.id}" role="button" aria-label="${x.nom}, ${x.alt} mètres, ${fmt(x.t)}"><rect x="${X(x.t) - 6}" y="${Y(x.alt) - 6}" width="12" height="12" fill="${couleur(x.t)}"/>${ext.has(x.id) ? `<text x="${X(x.t) + (X(x.t) > W - 130 ? -10 : 10)}" y="${Y(x.alt) + 4}" text-anchor="${X(x.t) > W - 130 ? 'end' : 'start'}">${NOMS[x.id] || court(x.nom)}</text>` : ''}</g>`;
|
||||
});
|
||||
cible.innerHTML = `<svg viewBox="0 0 ${W} ${H}" role="img" aria-label="Température des stations selon l'altitude">${o}</svg>`;
|
||||
// inversion : corrélation entre altitude et température
|
||||
const n = L.length, ma = L.reduce((a, c) => a + c.alt, 0) / n, mt = L.reduce((a, c) => a + c.t, 0) / n;
|
||||
const pente = L.reduce((a, c) => a + (c.alt - ma) * (c.t - mt), 0) / L.reduce((a, c) => a + (c.alt - ma) ** 2, 0) * 100;
|
||||
document.getElementById('coupe-txt').textContent = Math.abs(pente) < 0.15 ? 'En ce moment, il fait presque la même température à toutes les altitudes : pas d’inversion, pas de refroidissement net.' : pente > 0
|
||||
? `Inversion : en ce moment, il fait plus chaud en altitude (${nb1(pente)} °C de plus tous les 100 m en moyenne). Les combes sont les plus froides.`
|
||||
: `La température baisse de ${nb1(-pente)} °C tous les 100 m en moyenne ; la ligne verte montre le refroidissement normal (0,65 °C).`;
|
||||
}
|
||||
let largeurCoupe = 0;
|
||||
addEventListener('resize', () => { const w = document.getElementById('coupe-svg').clientWidth; if (w !== largeurCoupe) { largeurCoupe = w; coupe(); } });
|
||||
function surlignerCarte(id, oui){ puces.forEach(q => q.m.classList.toggle('mis', oui && q.ids.includes(id))); }
|
||||
const coupeSvg = document.getElementById('coupe-svg'), coupeLect = document.getElementById('coupe-lect');
|
||||
const lectureCoupe = id => { const x = STATIONS[id]; coupeLect.textContent = `${x.nom} · ${x.alt} m · ${fmt(x.t)}`; };
|
||||
coupeSvg.addEventListener('mouseover', ev => { const g = ev.target.closest('.st'); if (g) { lectureCoupe(g.dataset.id); surlignerCarte(g.dataset.id, true); } });
|
||||
coupeSvg.addEventListener('mouseout', ev => { if (ev.target.closest('.st')) surlignerCarte('', false); });
|
||||
coupeSvg.addEventListener('focusin', ev => { const g = ev.target.closest('.st'); if (g) { lectureCoupe(g.dataset.id); surlignerCarte(g.dataset.id, true); } });
|
||||
coupeSvg.addEventListener('focusout', () => surlignerCarte('', false));
|
||||
coupeSvg.addEventListener('click', ev => { const g = ev.target.closest('.st'); if (g) { lectureCoupe(g.dataset.id); ouvrirPlein([g.dataset.id], g.dataset.id); } });
|
||||
listeStations();
|
||||
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);
|
||||
});
|
||||
|
||||
// Forum : tant qu'il n'est pas ouvert (connexion Gastinel non branchée), l'encadré annonce l'ouverture sans faux bouton
|
||||
if (!FORUM_OUVERT) document.querySelectorAll('.forum-box').forEach(b => {
|
||||
b.classList.add('ferme');
|
||||
const cta = b.querySelector('.fb-cta'); cta.removeAttribute('href'); cta.setAttribute('aria-disabled', 'true'); cta.textContent = 'Ouverture prochainement';
|
||||
const une = b.querySelector('[data-une]'); une.removeAttribute('href'); une.textContent = 'Le récapitulatif de la semaine, par les adhérents, arrive bientôt.';
|
||||
b.querySelector('.fb-une small').textContent = 'Bientôt';
|
||||
});
|
||||
// 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'});
|
||||
}));
|
||||
// lien partagé #stations : on ouvre le panneau puis on efface l'ancre, pour qu'un rechargement depuis le haut de page ne redescende pas
|
||||
if (location.hash === '#stations') { basculer(document.getElementById('p-stations'), true); history.replaceState(null, '', location.pathname + location.search); }
|
||||
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'};
|
||||
@@ -840,21 +1115,93 @@ rech.addEventListener('keydown', ev => {
|
||||
});
|
||||
resultats.addEventListener('mousedown', ev => { const li = ev.target.closest('li'); if (li) { ev.preventDefault(); allerA(RECH[+li.dataset.i]); } });
|
||||
rech.addEventListener('blur', () => setTimeout(() => { resultats.hidden = true; }, 120));
|
||||
const filtre = document.getElementById('filtre');
|
||||
filtre.addEventListener('click', () => { const on = filtre.getAttribute('aria-pressed') !== 'true'; filtre.setAttribute('aria-pressed', on); carte.classList.toggle('filtre', on); relancer(); });
|
||||
['rech', 'filtre'].forEach(i => document.getElementById(i).addEventListener('click', ev => ev.stopPropagation()));
|
||||
const modes = document.getElementById('modes');
|
||||
modes.addEventListener('click', ev => {
|
||||
const b = ev.target.closest('button'); if (!b) return;
|
||||
const m = b.dataset.mode;
|
||||
TRI = m !== 'alt' ? 0 : MODE === 'alt' ? (TRI === 1 ? 2 : 1) : 1;
|
||||
MODE = m;
|
||||
const alt = modes.querySelector('[data-mode=alt]'); alt.dataset.tri = TRI; alt.textContent = ['Alt', 'Alt ↑', 'Alt ↓'][TRI];
|
||||
modes.querySelectorAll('button').forEach(x => x.setAttribute('aria-pressed', x === b));
|
||||
puces.forEach(q => { q.hb = null; });
|
||||
listeStations();
|
||||
disposer(); relancer();
|
||||
});
|
||||
// ----- curseur du temps -----
|
||||
let SERIES = null, TEMPS = null, LIVE = null, T0 = 0, N = 0, lectureId = null, majAttente = false, chargeSeries = null;
|
||||
const curseur = document.getElementById('curseur'), tempsBox = document.getElementById('temps'), tempsTxt = document.getElementById('temps-txt'), btnLecture = document.getElementById('lecture');
|
||||
function chargerSeries(){
|
||||
if (chargeSeries) return chargeSeries;
|
||||
chargeSeries = Promise.all(Object.keys(STATIONS).map(id => fetch(`data/semaine/${id}.json?${Math.floor(Date.now() / 300000)}`).then(r => r.ok ? r.json() : null).catch(() => null))).then(rs => {
|
||||
SERIES = {}; let a = Infinity, b = 0;
|
||||
rs.forEach(d => { if (!d || !d.t) return; SERIES[d.id] = d; a = Math.min(a, d.archive_depuis || d.debut); b = Math.max(b, d.debut + (d.t.length - 1) * d.pas); });
|
||||
if (!isFinite(a) || b <= a) return;
|
||||
const fin = Math.floor(b / 1800) * 1800, deb = Math.max(Math.ceil(a / 1800) * 1800, fin - 7 * 86400);
|
||||
T0 = deb; N = (fin - deb) / 1800;
|
||||
curseur.max = N; curseur.value = N; curseur.disabled = false; btnLecture.disabled = false;
|
||||
});
|
||||
return chargeSeries;
|
||||
}
|
||||
function valeurA(id, ts, k){
|
||||
const d = SERIES && SERIES[id]; if (!d) return null;
|
||||
const i = Math.round((ts - d.debut) / d.pas); if (i < 0 || i >= d.t.length) return null;
|
||||
const v = d[k][i]; return v == null ? null : v;
|
||||
}
|
||||
function snapshotLive(){ LIVE = {}; Object.entries(STATIONS).forEach(([id, x]) => { LIVE[id] = {t: x.t, vent: x.vent, pluie: x.pluie, mn: x.mn, mx: x.mx}; }); }
|
||||
function appliquerTemps(){
|
||||
if (TEMPS == null || !LIVE) return;
|
||||
Object.entries(STATIONS).forEach(([id, x]) => Object.assign(x, {t: valeurA(id, TEMPS, 't'), vent: valeurA(id, TEMPS, 'v'), pluie: valeurA(id, TEMPS, 'r'), mn: null, mx: null}));
|
||||
}
|
||||
function rafraichirTemps(){
|
||||
if (majAttente) return; majAttente = true;
|
||||
setTimeout(() => { majAttente = false; puces.forEach(q => { q.hb = null; }); disposer(); relancer(); listeStations(); coupe(); }, 30);
|
||||
}
|
||||
function poserTemps(){
|
||||
const v = +curseur.value;
|
||||
if (v >= N) { // retour au direct
|
||||
if (TEMPS != null && LIVE) Object.entries(LIVE).forEach(([id, x]) => Object.assign(STATIONS[id], x));
|
||||
TEMPS = null; tempsBox.classList.remove('passe'); tempsTxt.textContent = 'Maintenant';
|
||||
} else {
|
||||
if (TEMPS == null) snapshotLive();
|
||||
TEMPS = T0 + v * 1800; tempsBox.classList.add('passe');
|
||||
tempsTxt.textContent = fmtJH.format(new Date(TEMPS * 1000)).replace(',', '');
|
||||
appliquerTemps();
|
||||
}
|
||||
rafraichirTemps();
|
||||
}
|
||||
function arreterLecture(){ if (lectureId) { clearInterval(lectureId); lectureId = null; } btnLecture.textContent = '▶'; btnLecture.setAttribute('aria-label', 'Rejouer les dernières 24 heures'); }
|
||||
curseur.addEventListener('input', () => { arreterLecture(); poserTemps(); });
|
||||
btnLecture.addEventListener('click', () => {
|
||||
if (lectureId) { arreterLecture(); return; }
|
||||
if (+curseur.value >= N - 1) curseur.value = Math.max(0, N - 48);
|
||||
poserTemps();
|
||||
btnLecture.textContent = '❚❚'; btnLecture.setAttribute('aria-label', 'Mettre en pause');
|
||||
lectureId = setInterval(() => { curseur.value = Math.min(N, +curseur.value + 1); poserTemps(); if (+curseur.value >= N) arreterLecture(); }, 260);
|
||||
});
|
||||
(FORUM_OUVERT ? fetch('data/forum-une.json?' + Math.floor(Date.now() / 300000)).then(r => r.ok ? r.json() : null).then(u => {
|
||||
if (!u || !u.titre) return;
|
||||
document.querySelectorAll('[data-une]').forEach(a => { a.textContent = u.titre; if (u.url) a.href = u.url; });
|
||||
document.querySelectorAll('[data-auteur]').forEach(e => { e.textContent = u.auteur ? 'par ' + u.auteur : ''; });
|
||||
if (u.n) document.querySelectorAll('[data-n]').forEach(e => { e.textContent = u.n + (u.n > 1 ? ' sujets' : ' sujet') + ' cette semaine'; });
|
||||
}).catch(() => {}) : 0);
|
||||
function apresDonnees(){ chargerSeries(); if (TEMPS != null) { snapshotLive(); appliquerTemps(); } }
|
||||
const selRecord = document.getElementById('record');
|
||||
selRecord.value = RECORD;
|
||||
selRecord.addEventListener('change', () => { RECORD = selRecord.value; try { localStorage.setItem('vm-record', RECORD); } catch (e) {} phraseDuJour(); });
|
||||
['rech', 'modes'].forEach(i => document.getElementById(i).addEventListener('click', ev => ev.stopPropagation()));
|
||||
|
||||
// téléphone : le cartouche se replie (10 s en haut de page, tout de suite si on descend ou zoome), se rouvre en remontant
|
||||
// téléphone : le cartouche se replie tout de suite dès qu'on touche la carte, qu'on descend ou qu'on zoome, se rouvre en remontant
|
||||
let minuteurRepli = 0;
|
||||
function replier(oui){
|
||||
if (carte.clientWidth >= 720) oui = false;
|
||||
if (cart.classList.contains('replie') === oui) return;
|
||||
cart.classList.toggle('replie', oui); relancer();
|
||||
}
|
||||
function armerRepli(){ clearTimeout(minuteurRepli); minuteurRepli = setTimeout(() => replier(true), 10000); }
|
||||
function armerRepli(){} // plus de délai : le cartouche se replie dès qu'on touche la carte ou qu'on descend
|
||||
carte.addEventListener('pointerdown', ev => { if (!ev.target.closest('.cartouche')) replier(true); });
|
||||
addEventListener('scroll', () => { if (scrollY > 30) replier(true); else { replier(false); armerRepli(); } }, {passive: true});
|
||||
cart.addEventListener('click', ev => {
|
||||
if (ev.target.closest('a, button, input, .rech') || carte.clientWidth >= 720) return;
|
||||
if (ev.target.closest('a, button, input, select, label, .rech') || carte.clientWidth >= 720) return;
|
||||
const ouvrir = cart.classList.contains('replie');
|
||||
replier(!ouvrir); if (ouvrir) armerRepli();
|
||||
});
|
||||
@@ -904,7 +1251,7 @@ function rendrePlein(){
|
||||
? pleinIds.map(i => `<button type="button" data-id="${i}" class="${i === id ? 'on' : ''}">${NOMS[i] || court(STATIONS[i].nom)} ${fmt(STATIONS[i].t)}</button>`).join('') : '';
|
||||
const etat = s.t == null ? (s.horsLigne ? 'hors ligne' : 'pas de données en direct') : (s.mn != null ? `24 h : ${fmt(s.mn)} / ${fmt(s.mx)}` : '');
|
||||
plein.querySelector('.plein-corps').innerHTML =
|
||||
`<h2>${s.nom}${icones(id)}</h2>
|
||||
`<h2>${s.nom}${icones(id)}${(o => o.titre ? `<span class="origine">${o.titre}${o.aussi ? `<small>${o.aussi}</small>` : ''}</span>` : '')(origine(id))}</h2>
|
||||
<p class="plein-sous">${s.alt} m · ${s.src}${s.licence ? ` (${s.licence})` : ''}</p>
|
||||
<div class="plein-val"><b style="color:${couleur(s.t)}">${fmt(s.t)}</b><span>${etat}</span>
|
||||
<button type="button" class="plein-carte">Voir sur la carte</button></div>
|
||||
@@ -1035,7 +1382,7 @@ async function chargerDonnees(){
|
||||
const st = d && d.stations && d.stations[cle], r = st && st.releves && st.releves.at(-1);
|
||||
if (!st || !STATIONS[id]) return;
|
||||
const enLigne = r && !st.hors_ligne;
|
||||
Object.assign(STATIONS[id], {t: enLigne ? r.temperature : null, mn: enLigne ? r.temperature_min : null, mx: enLigne ? r.temperature_max : null,
|
||||
Object.assign(STATIONS[id], {t: enLigne ? r.temperature : null, mn: enLigne ? r.temperature_min : null, mx: enLigne ? r.temperature_max : null, vent: enLigne && r.vent_moyen != null ? r.vent_moyen : null, pluie: enLigne && r.pluie_1h != null ? r.pluie_1h : null,
|
||||
exemple: false, horsLigne: !enLigne, src: st.source || STATIONS[id].src, licence: licenceCourte(d.metadonnees && d.metadonnees[cle] && d.metadonnees[cle].licence)});
|
||||
if (enLigne) { const t = new Date(r.dh_utc.replace(' ', 'T') + 'Z'); if (!dernier || t > dernier) dernier = t; }
|
||||
};
|
||||
@@ -1049,7 +1396,7 @@ async function chargerDonnees(){
|
||||
document.getElementById('date').textContent = jour[0].toUpperCase() + jour.slice(1);
|
||||
dernierReleve = dernier; heureReleve = heure; afficherDirect();
|
||||
}
|
||||
phraseDuJour(); listeStations(); disposer(); relancer(); // les puces qui se regroupent s'animent
|
||||
apresDonnees(); phraseDuJour(); listeStations(); coupe(); disposer(); relancer(); // les puces qui se regroupent s'animent
|
||||
}
|
||||
Promise.race([chargerDonnees(), new Promise(r => setTimeout(r, 1500))]).then(() => { ouverture(); ouvrirDepuisAdresse(); });
|
||||
setInterval(chargerDonnees, 60 * 1000); // les relevés arrivent toutes les 6 à 15 minutes
|
||||
@@ -1099,6 +1446,27 @@ function ouverture(){
|
||||
puces.forEach(p => p.m.style.removeProperty('--d'));
|
||||
}, T + 50);
|
||||
}
|
||||
// Bandeau « pas de cookie » : une fois par appareil, s'efface après 6250 ms (pause au survol / toucher)
|
||||
(function(){
|
||||
// Dynamique : affiché à la 1re visite, puis seulement après 7 jours sans visite (?cookie force l'affichage). La date de dernière visite reste dans le navigateur, jamais envoyée au serveur.
|
||||
let montrer = true;
|
||||
try {
|
||||
const dernier = +localStorage.getItem('vm-derniere-visite') || 0, maintenant = Date.now();
|
||||
montrer = !dernier || maintenant - dernier >= 7 * 86400000 || /[?&]cookie\b/.test(location.search);
|
||||
localStorage.setItem('vm-derniere-visite', String(maintenant));
|
||||
} catch (e) {}
|
||||
if (!montrer) return;
|
||||
const b = document.createElement('div'); b.className = 'sanscookie'; b.setAttribute('role', 'status');
|
||||
b.innerHTML = '<b>Non, désolé, je ne veux pas de cookie,<br>Je n\'ai pas faim, ni envie de me faire traquer.</b><span>Ici, rien à accepter : ni cookie de suivi, ni publicité.</span><button type="button" aria-label="Fermer">×</button>';
|
||||
document.body.appendChild(b);
|
||||
let t, fini = false;
|
||||
const partir = () => { if (fini) return; fini = true; b.classList.add('parti'); setTimeout(() => b.remove(), 600); };
|
||||
const armer = () => { clearTimeout(t); t = setTimeout(partir, 6250); };
|
||||
b.addEventListener('pointerenter', () => clearTimeout(t)); b.addEventListener('pointerleave', armer);
|
||||
b.addEventListener('focusin', () => clearTimeout(t));
|
||||
b.querySelector('button').addEventListener('click', partir);
|
||||
armer();
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -22,6 +22,9 @@
|
||||
--roche:#2b2f2c; --glacier:#6eb5bd; --chaud:#b5643c; --gris:#5d635e;
|
||||
}
|
||||
*{box-sizing:border-box}
|
||||
@font-face{font-family:'GastinelG';font-weight:700;font-display:swap;src:url(polices/inter-g.woff2) format('woff2')}
|
||||
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}
|
||||
|
||||
@@ -130,6 +133,8 @@ a{color:inherit}
|
||||
.plein-onglets button.on{background:var(--roche);color:#fff}
|
||||
.plein-corps{max-width:980px;margin:0 auto;padding:20px 16px 64px}
|
||||
.plein-corps h2{margin:0;font-family:var(--titre);font-weight:600;font-size:26px;line-height:1.15;color:var(--sapin)}
|
||||
.origine{display:inline-flex;flex-direction:column;vertical-align:middle;margin-left:12px;padding:3px 9px;border:1px solid var(--glacier);background:rgba(110,181,189,.14);color:#2f6f78;font-family:var(--texte,inherit);font-size:12px;font-weight:500;line-height:1.25}
|
||||
.origine small{font-size:11px;font-weight:400;color:var(--gris)}
|
||||
.plein-sous{margin:4px 0 0;font-size:13px;color:var(--gris)}
|
||||
.plein-val{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;margin-top:14px;padding-top:12px;border-top:1px solid var(--pierre)}
|
||||
.plein-val b{font-family:var(--titre);font-weight:600;font-size:52px;line-height:1;letter-spacing:-.01em}
|
||||
@@ -150,7 +155,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)}
|
||||
@@ -164,7 +169,7 @@ a{color:inherit}
|
||||
.pendule .corde.g{left:18%}.pendule .corde.d{right:18%}
|
||||
.pancarte{display:block;white-space:nowrap;background:#faf9f5;border:1px solid var(--roche);padding:5px 11px 6px;
|
||||
font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--sapin)}
|
||||
.outils{display:flex;gap:8px;margin-top:12px}
|
||||
.outils{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
|
||||
.rech{position:relative;flex:1;min-width:0}
|
||||
#rech{width:100%;font:inherit;font-size:13.5px;color:var(--roche);background:#fff;border:1px solid var(--roche);border-radius:0;padding:7px 9px;-webkit-appearance:none;appearance:none}
|
||||
#rech::placeholder{color:#8a8f88}
|
||||
@@ -173,11 +178,22 @@ a{color:inherit}
|
||||
#rech-res li:first-child{border-top:0}
|
||||
#rech-res li.on,#rech-res li:hover{background:#eef2ea}
|
||||
#rech-res small{color:var(--gris);margin-left:6px}
|
||||
#filtre{font:inherit;font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--sapin);background:#fff;border:1px solid var(--sapin);border-radius:0;padding:7px 9px;cursor:pointer;white-space:nowrap}
|
||||
#filtre[aria-pressed=true]{background:var(--sapin);color:#fff}
|
||||
.carte.filtre .puce > button.sans{opacity:.2}
|
||||
.reglages{max-width:1080px;margin:0 auto;padding:10px 28px 0;display:flex;flex-wrap:wrap;gap:10px 22px;align-items:center}
|
||||
.modes{display:flex;flex:0 0 auto}
|
||||
.aide{flex:0 0 100%;margin:0;font-size:11.5px;color:var(--gris)}
|
||||
.temps{flex:1 1 300px;display:flex;align-items:center;gap:10px;min-width:0}
|
||||
.temps button{font:inherit;font-size:13px;color:var(--sapin);background:#fff;border:1px solid var(--sapin);border-radius:0;width:34px;height:31px;cursor:pointer;padding:0}
|
||||
.temps button:disabled{opacity:.4;cursor:default}
|
||||
.temps input{flex:1;min-width:0;accent-color:var(--sapin);height:24px}
|
||||
.temps output{font-size:12.5px;color:var(--gris);min-width:112px;text-align:right}
|
||||
.temps.passe output{color:var(--chaud);font-weight:600}
|
||||
@media (max-width:719px){.reglages{padding:10px 16px 0}.temps{flex:1 1 100%;flex-wrap:wrap}.temps input{flex:1 1 140px}.temps output{min-width:0;flex:0 0 100%;text-align:left;order:3}}
|
||||
.modes button{flex:none;font:inherit;font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--sapin);background:#fff;border:1px solid var(--sapin);border-radius:0;margin-left:-1px;padding:7px 14px;cursor:pointer;white-space:nowrap}
|
||||
.modes button:first-child{margin-left:0}
|
||||
.modes button[aria-pressed=true]{background:var(--sapin);color:#fff}
|
||||
.modes button[data-tri="2"][aria-pressed=true]{background:#000;border-color:#000}
|
||||
.puce.horsmode{display:none}
|
||||
.puce .ics{display:none;margin-left:6px;vertical-align:1px}
|
||||
.carte.filtre .puce .ics{display:inline}
|
||||
a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(--sapin);outline-offset:2px}
|
||||
.vieux{color:var(--chaud)!important}
|
||||
#retour{display:none;margin-top:12px;font:inherit;font-size:12px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;background:var(--sapin);color:#fff;border:0;border-radius:0;padding:7px 10px;cursor:pointer}
|
||||
@@ -200,6 +216,67 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
background-repeat:no-repeat;-webkit-backdrop-filter:blur(8px) saturate(1.2);backdrop-filter:blur(8px) saturate(1.2);transition:background-color .15s}
|
||||
.suite:hover{background-color:rgba(255,255,255,.75)}
|
||||
|
||||
.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{display:inline-flex;align-items:center;gap:8px;padding:5px 11px 5px 7px;background:#fff;border:1px solid #000;color:#000;font-size:12px;font-weight:600;text-decoration:none}
|
||||
.compte:hover{background:#ecebe5}
|
||||
.compte .gmark{font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:22px;line-height:1;color:#000;letter-spacing:-.02em}
|
||||
.legende{left:auto;right:222px}
|
||||
.forum-box{position:absolute;left:28px;bottom:16px;z-index:3;width:372px;background:rgba(250,249,245,.97);border:1px solid var(--roche);box-shadow:0 0 0 3px rgba(250,249,245,.97),0 0 0 4px var(--pierre);color:var(--roche)}
|
||||
.fb-haut{display:flex;justify-content:space-between;align-items:baseline;padding:12px 16px 2px}
|
||||
.fb-haut b{font-family:var(--titre);font-weight:700;font-size:28px;color:var(--sapin);line-height:1.1}
|
||||
.fb-haut small{font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--gris)}
|
||||
.fb-une{padding:4px 16px 12px;border-bottom:1px solid var(--pierre)}
|
||||
.fb-une small{display:block;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--gris)}
|
||||
.fb-une a{display:block;margin-top:2px;font-family:var(--titre);font-weight:600;font-size:17px;line-height:1.3;color:var(--roche);text-decoration:none}
|
||||
.fb-une a:hover{text-decoration:underline}
|
||||
.fb-une span{font-size:12.5px;color:var(--gris)}
|
||||
.fb-cta{display:block;margin:12px 16px 6px;padding:11px 14px;background:var(--sapin);color:#fff;text-align:center;font-size:13px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;text-decoration:none;border:1px solid var(--sapin)}
|
||||
.fb-cta:hover{background:#17382b}
|
||||
.fb-co{margin:0 16px 12px;text-align:center;font-size:12.5px;color:var(--gris)}
|
||||
.fb-co a{display:inline-flex;align-items:center;gap:5px;color:#000;font-weight:600;text-decoration:underline;text-underline-offset:2px}
|
||||
.fb-co .g{font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:17px;line-height:1;text-decoration:none}
|
||||
.fb-bas{display:flex;gap:12px;align-items:center;padding:10px 16px;background:#303336;color:#d9dbde;font-size:12.5px;line-height:1.4}
|
||||
.fb-bas .gcarre{flex:0 0 32px;height:32px;display:grid;place-items:center;background:#fff;color:#000;font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:22px}
|
||||
.fb-bas strong{color:#fff;font-weight:600}
|
||||
.forum-box.ferme .fb-co{display:none}
|
||||
.forum-box.ferme .fb-cta{background:#7d8a82;border-color:#7d8a82;cursor:default}
|
||||
.forum-box.ferme .fb-une a{pointer-events:none}
|
||||
.forum-box.mobile{display:none}
|
||||
@media (max-width:1000px){.forum-box{left:auto;right:28px;bottom:68px;width:320px}.legende{left:28px;right:auto}}
|
||||
@media (max-width:719px){.carte .forum-box{display:none}.forum-box.mobile{display:block;position:static;width:auto;flex:0 0 100%;margin:6px 0 4px}}
|
||||
.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)}
|
||||
@media (max-width:719px){#coupe-svg text{font-size:10.5px}}
|
||||
#coupe-svg .st{cursor:pointer}
|
||||
#coupe-svg .st rect{stroke:#fff;stroke-width:1.5}
|
||||
#coupe-svg .st:hover rect,#coupe-svg .st:focus rect,#coupe-svg .st.on rect{stroke:var(--roche);stroke-width:2}
|
||||
#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)}
|
||||
@@ -213,10 +290,15 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
.case strong{display:block;font-size:14.5px;font-weight:600;margin:2px 0 6px}
|
||||
.case b{font-family:var(--titre);font-size:30px;font-weight:600;line-height:1}
|
||||
.case em{display:block;font-style:normal;font-size:12px;color:var(--gris);margin-top:5px}
|
||||
.pied{max-width:1080px;margin:0 auto;padding:22px 28px 44px;font-size:12.5px;color:var(--gris);border-top:1px solid var(--pierre)}
|
||||
.pied{background:#303336;color:#d1d3d6;padding:34px 28px 22px;font-size:13px;line-height:1.7;border-top:4px solid #1c1d1f}
|
||||
.pied-grille{max-width:1080px;margin:0 auto;display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:34px}
|
||||
.pied p{margin:6px 0}
|
||||
.pied .accroche{font-family:var(--titre);font-style:italic;font-size:17px;color:var(--sapin)}
|
||||
.pied a{color:var(--sapin)}
|
||||
.pied h4{margin:0 0 8px;font-family:var(--texte);font-size:11.5px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:#fff;border-bottom:1px solid #4a4d51;padding-bottom:7px}
|
||||
.pied ul{list-style:none;margin:0;padding:0}
|
||||
.pied .accroche{font-family:var(--titre);font-style:italic;font-size:17px;color:#fff}
|
||||
.pied a{color:#b9c2cc;text-decoration:none;font-weight:500}
|
||||
.pied a:hover{color:#fff;text-decoration:underline}
|
||||
.pied-bas{max-width:1080px;margin:26px auto 0!important;padding-top:14px;border-top:1px solid #45484c;font-size:12px;color:#8e9298}
|
||||
|
||||
@media (max-width:720px){
|
||||
.carte{min-height:0}
|
||||
@@ -241,9 +323,16 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
.puce .val{font-size:18px}
|
||||
.fiche{width:244px}
|
||||
.liste{padding:40px 16px 24px}
|
||||
.pied{padding:18px 16px 36px}
|
||||
.pied{padding:26px 16px 30px}
|
||||
.pied-grille{grid-template-columns:1fr;gap:22px}
|
||||
.sous-carte{padding:8px 16px 0}
|
||||
}
|
||||
.sanscookie{position:fixed;left:16px;bottom:16px;z-index:60;max-width:340px;padding:10px 34px 10px 14px;background:var(--calcaire);border:1px solid var(--sapin);box-shadow:0 0 0 3px var(--calcaire),0 0 0 4px var(--pierre);color:var(--roche);font-family:var(--texte);transition:opacity .5s}
|
||||
.sanscookie.parti{opacity:0;pointer-events:none}
|
||||
.sanscookie b{display:block;font-family:var(--titre);font-weight:600;font-size:15px;color:var(--sapin)}
|
||||
.sanscookie span{font-size:12.5px;color:var(--gris)}
|
||||
.sanscookie button{position:absolute;top:2px;right:4px;border:0;background:none;font-size:20px;line-height:1;color:var(--gris);cursor:pointer;padding:4px 6px}
|
||||
@media (prefers-reduced-motion:reduce){.sanscookie{transition:none}}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -254,14 +343,15 @@ 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>
|
||||
<p class="reseau" id="reseau"></p>
|
||||
<div class="outils" id="outils">
|
||||
<div class="rech"><input type="search" id="rech" placeholder="Une station, un village…" autocomplete="off" aria-label="Chercher une station ou un village"><ul id="rech-res" hidden></ul></div>
|
||||
<button type="button" id="filtre" aria-pressed="false" title="Montrer les stations qui mesurent le vent ou la pluie">Vent · pluie</button>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
@@ -272,25 +362,73 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(-
|
||||
<div class="echelle"><i id="barre"></i><span id="km">5 km</span></div>
|
||||
</div>
|
||||
<a class="suite" href="#stations">Toutes les stations ↓</a>
|
||||
<div class="forum-box">
|
||||
<div class="fb-haut"><b>Forum</b><small data-n></small></div>
|
||||
<div class="fb-une"><small>À la une · Récapitulatif de la semaine</small><a href="forum/index.html" data-une>Le récapitulatif de la semaine arrive ici</a><span data-auteur></span></div>
|
||||
<a class="fb-cta" href="forum/index.html">Rejoindre la discussion →</a>
|
||||
<p class="fb-co">Déjà un compte ? <a href="forum/connexion.html"><span class="g" aria-hidden="true">G</span>Se connecter avec Gastinel</a></p>
|
||||
<div class="fb-bas"><span class="gcarre" aria-hidden="true">G</span><span><strong>L'écosystème Gastinel.</strong> Un compte pour le forum, vos favoris et toutes nos applications. Sans publicité, une alternative aux GAFAM.</span></div>
|
||||
</div>
|
||||
<div class="thermo" id="thermo"><i id="degrade"></i><span><span>−10°</span><span>0°</span><span>+15°</span></span></div>
|
||||
</main>
|
||||
|
||||
<p class="sous-carte">Courbes de niveau tous les 100 m · molette sur le Parc ou deux doigts pour zoomer</p>
|
||||
<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>
|
||||
<p class="sous-carte">Courbes de niveau tous les 100 m · zoom : molette (PC) ou deux doigts (téléphone)</p>
|
||||
<div class="reglages" id="reglages"><div class="modes" id="modes" role="group" aria-label="Valeur affichée sur les étiquettes"><button type="button" data-mode="t" aria-pressed="true">Temp</button><button type="button" data-mode="alt" aria-pressed="false" title="Classe la liste par altitude : un clic croissant, un deuxième clic décroissant">Alt</button><button type="button" data-mode="vent" aria-pressed="false" title="Seules les stations qui mesurent le vent">Vent</button><button type="button" data-mode="pluie" aria-pressed="false" title="Seules les stations qui mesurent la pluie">Pluie</button></div>
|
||||
<div class="temps" id="temps"><button type="button" id="lecture" aria-label="Rejouer les dernières 24 heures" disabled>▶</button><input type="range" id="curseur" min="0" max="0" step="1" value="0" disabled aria-label="Remonter le temps, sept jours"><output id="temps-txt" for="curseur">Maintenant</output></div>
|
||||
<p class="aide">Ces choix valent aussi pour la liste des stations, plus bas.</p>
|
||||
<div class="forum-box mobile">
|
||||
<div class="fb-haut"><b>Forum</b><small data-n></small></div>
|
||||
<div class="fb-une"><small>À la une · Récapitulatif de la semaine</small><a href="forum/index.html" data-une>Le récapitulatif de la semaine arrive ici</a><span data-auteur></span></div>
|
||||
<a class="fb-cta" href="forum/index.html">Rejoindre la discussion →</a>
|
||||
<p class="fb-co">Déjà un compte ? <a href="forum/connexion.html"><span class="g" aria-hidden="true">G</span>Se connecter avec Gastinel</a></p>
|
||||
<div class="fb-bas"><span class="gcarre" aria-hidden="true">G</span><span><strong>L'écosystème Gastinel.</strong> Un compte pour le forum, vos favoris et toutes nos applications. Sans publicité, une alternative aux GAFAM.</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<section class="liste coupe" id="coupe">
|
||||
<h2>La coupe du massif</h2>
|
||||
<p id="coupe-txt">Chaque carré est une station : plus il est haut, plus la station est en altitude ; plus il est à gauche, plus il fait froid.</p>
|
||||
<div id="coupe-svg"></div>
|
||||
<p class="coupe-lect" id="coupe-lect" aria-live="polite">Survole ou touche une station.</p>
|
||||
</section>
|
||||
<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">
|
||||
<p class="accroche">Des stations de chez nous, des chiffres d'ici.</p>
|
||||
<p>Données : Météo-France (Licence Ouverte), Infoclimat (CC BY ou CC BY-NC selon la station), WeatherLink, station Gastinel. Fond de carte : IGN, licence ouverte.</p>
|
||||
<p><a href="a-propos.html">À propos</a> · <a href="a-propos.html#sources">Sources et licences</a> · <a href="a-propos.html#mentions">Mentions légales</a> · <a href="cgu.html">CGU</a> · <a href="confidentialite.html">Confidentialité</a> · © Théo Gastinel</p>
|
||||
<div class="pied-grille">
|
||||
<div>
|
||||
<p class="accroche">Des stations de chez nous, des chiffres d'ici.</p>
|
||||
<p>Données : Météo-France (Licence Ouverte), Infoclimat (CC BY ou CC BY-NC selon la station), WeatherLink, station Gastinel. Fond de carte : IGN, licence ouverte.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Contact</h4>
|
||||
<ul><li><a href="mailto:studio@gastinel.me">studio@gastinel.me</a></li>
|
||||
<li><a href="https://wa.me/message/XAHBYTJZNQ6TK1" rel="noopener">WhatsApp</a></li>
|
||||
<li><a href="tel:+33636276419">06 36 27 64 19</a></li></ul>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Le site</h4>
|
||||
<ul><li><a href="a-propos.html">À propos</a></li><li><a href="a-propos.html#sources">Sources et licences</a></li><li><a href="a-propos.html#mentions">Mentions légales</a></li><li><a href="cgu.html">CGU</a></li><li><a href="confidentialite.html">Confidentialité</a></li></ul>
|
||||
<p>SIRET <a href="https://entreprises.lefigaro.fr/nd-38/entreprise-104816749" rel="noopener">10481674900014</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="pied-bas">© Théo Gastinel · Météo Vercors</p>
|
||||
</footer>
|
||||
<noscript><p style="max-width:640px;margin:0 auto;padding:16px;font-family:system-ui">Météo Vercors a besoin de JavaScript pour afficher la carte et les relevés en direct. Les sources et les mentions légales sont sur la page <a href="a-propos.html">À propos</a>.</p></noscript>
|
||||
|
||||
<script>
|
||||
const C = /*CARTE*/;
|
||||
const ETIQ = /*ETIQUETTES*/;
|
||||
const FORUM_OUVERT = false; // passer à true quand le forum et la connexion Gastinel sont en ligne
|
||||
|
||||
// Stations du Vercors relevées dans les notes (Boîte + liste du 16/10) ; valeurs d'exemple (matin d'inversion)
|
||||
const STATIONS = {
|
||||
@@ -336,6 +474,17 @@ const GROUPES = [
|
||||
{nom:'Marignac', st:['marignac'], sect:'Diois'},
|
||||
{nom:'Solaure', st:['solaure'], sect:'Diois'},
|
||||
];
|
||||
// Propriétaire des stations « de chez nous » ; 'dispo' = où l'on retrouve aussi la station (jamais Infoclimat en premier)
|
||||
const PROPRIO = {lans:'Station Gastinel', moucherolle:'Station Gastinel',
|
||||
geve:'Station Richard Gastinel', allieres:'Station Richard Gastinel', bruyeres:'Station Richard Gastinel',
|
||||
darbounouse:'Station Richard Gastinel', oscence:'Station Richard Gastinel'};
|
||||
const DISPO = ['WeatherLink', 'ROMMA', 'Infoclimat'];
|
||||
function origine(id){
|
||||
const s = STATIONS[id], p = PROPRIO[id];
|
||||
if (p) return {titre: p, aussi: 'Aussi consultable sur ' + DISPO.join(' · ')};
|
||||
const src = s.src || '';
|
||||
return {titre: src ? 'Vient ' + (/^[AEIOUÉ]/i.test(src) ? "d'" : 'de ') + src : '', aussi: ''};
|
||||
}
|
||||
const MASSIF = [5.06, 45.305, 5.835, 44.635]; // ouest, nord, est, sud : tout le Parc (limite IGN)
|
||||
// Une puce par station : la 1re station d'un groupe porte le nom du village et passe en priorité ;
|
||||
// les autres viennent après, elles rejoignent la puce du village tant que la place manque.
|
||||
@@ -365,6 +514,13 @@ Object.values(STATIONS).forEach(x => { x.t = x.mn = x.mx = null; x.exemple = tru
|
||||
|
||||
// phrase du jour : le point le plus froid, et l'inversion si elle se voit
|
||||
const MOMENT = h => h < 5 ? 'Cette nuit' : h < 12 ? 'Ce matin' : h < 18 ? 'Cet après-midi' : h < 23 ? 'Ce soir' : 'Cette nuit';
|
||||
let RECORD = 'auto';
|
||||
try { RECORD = localStorage.getItem('vm-record') || 'auto'; } catch (e) {}
|
||||
// saisons météorologiques : hiver = décembre à février, été = juin à août
|
||||
function saisonMeteo(){
|
||||
const m = parseInt(new Intl.DateTimeFormat('fr-FR', {month: 'numeric', timeZone: 'Europe/Paris'}).format(new Date()), 10);
|
||||
return m === 12 || m <= 2 ? 'hiver' : m >= 6 && m <= 8 ? 'ete' : 'entre';
|
||||
}
|
||||
function phraseDuJour(){
|
||||
const toutes = Object.values(STATIONS), reelles = toutes.filter(x => x.t != null);
|
||||
if (!reelles.length) {
|
||||
@@ -372,10 +528,23 @@ function phraseDuJour(){
|
||||
document.getElementById('reseau').textContent = `${toutes.length} stations dans le massif`;
|
||||
return;
|
||||
}
|
||||
const l = reelles.sort((a, b) => a.t - b.t), f = l[0];
|
||||
let s = `${MOMENT(heureParis())}, <strong>${fmt(f.t).replace('°',' °C')} à ${court(f.nom)}</strong>, le point le plus froid du massif en ce moment.`;
|
||||
const h = l.filter(x => x.alt - f.alt >= 300 && x.t - f.t >= 3).sort((a, b) => b.alt - a.alt)[0];
|
||||
if (h) s += ` ${h.alt - f.alt} m plus haut, ${court(h.nom)} : ${fmt(h.t).replace('°',' °C')}. L'air froid est resté au fond.`;
|
||||
const l = [...reelles].sort((a, b) => a.t - b.t), f = l[0], c = l[l.length - 1], deg = t => fmt(t).replace('°', ' °C');
|
||||
const sais = saisonMeteo(), mode = RECORD !== 'auto' ? RECORD : sais === 'hiver' ? 'froid' : sais === 'ete' ? 'chaud' : 'ecart';
|
||||
const mom = MOMENT(heureParis());
|
||||
let s;
|
||||
if (mode === 'chaud') s = `${mom}, <strong>${deg(c.t)} à ${court(c.nom)}</strong>, le point le plus chaud du massif en ce moment.`;
|
||||
else if (mode === 'ecart') s = `${mom}, de <strong>${deg(f.t)} à ${court(f.nom)}</strong> à <strong>${deg(c.t)} à ${court(c.nom)}</strong> : le plus froid et le plus chaud du massif.`;
|
||||
else if (mode === 'vent') {
|
||||
const v = toutes.filter(x => x.vent != null && capteur(Object.keys(STATIONS).find(k => STATIONS[k] === x), 'vent')).sort((a, b) => b.vent - a.vent)[0];
|
||||
s = v ? `${mom}, <strong>${Math.round(v.vent)} km/h à ${court(v.nom)}</strong>, le vent moyen le plus fort du massif.` : `${mom}, aucun vent mesuré pour l'instant.`;
|
||||
} else if (mode === 'pluie') {
|
||||
const r = toutes.filter(x => x.pluie != null && x.pluie > 0).sort((a, b) => b.pluie - a.pluie)[0];
|
||||
s = r ? `${mom}, <strong>${nb1(r.pluie)} mm en une heure à ${court(r.nom)}</strong>, la pluie la plus forte du massif.` : `${mom}, pas de pluie mesurée dans le massif.`;
|
||||
} else {
|
||||
s = `${mom}, <strong>${deg(f.t)} à ${court(f.nom)}</strong>, le point le plus froid du massif en ce moment.`;
|
||||
const h = l.filter(x => x.alt - f.alt >= 300 && x.t - f.t >= 3).sort((a, b) => b.alt - a.alt)[0];
|
||||
if (h) s += ` ${h.alt - f.alt} m plus haut, ${court(h.nom)} : ${deg(h.t)}. L'air froid est resté au fond.`;
|
||||
}
|
||||
document.getElementById('phrase').innerHTML = s;
|
||||
document.getElementById('reseau').textContent = `${reelles.length} stations en direct sur ${toutes.length} · Météo-France, Infoclimat, station Gastinel`;
|
||||
}
|
||||
@@ -424,14 +593,22 @@ document.addEventListener('click', fermer);
|
||||
carte.addEventListener('touchmove', ev => { if (ev.touches.length > 1) ev.preventDefault(); }, {passive: false});
|
||||
carte.addEventListener('gesturestart', ev => ev.preventDefault());
|
||||
|
||||
let MODE = 't'; // t, alt, vent, pluie
|
||||
function valMode(r){
|
||||
return MODE === 'alt' ? [`${r.alt} m`, 'var(--sapin)']
|
||||
: MODE === 'vent' ? [r.vent == null ? '—' : `${Math.round(r.vent)} km/h`, '#3d6f8e']
|
||||
: MODE === 'pluie' ? [r.pluie == null ? '—' : `${nb1(r.pluie)} mm`, '#3d6f8e'] : [fmt(r.t), couleur(r.t)];
|
||||
}
|
||||
const capteur = (id, m) => m === 'vent' ? !!(SEM[id] && SEM[id].vent) : m === 'pluie' ? !!(SEM[id] && SEM[id].pluie) : true;
|
||||
const nb1 = v => v == null ? '—' : String(Math.round(v * 10) / 10).replace('.', ',');
|
||||
// contenu d'une puce : ses stations propres + celles qu'elle a absorbées faute de place
|
||||
function remplir(p){
|
||||
const st = p.ids.map(id => ({id, ...STATIONS[id]})), r = st.find(x => x.t != null) || st[0];
|
||||
const st = p.ids.map(id => ({id, ...STATIONS[id]})), pool = st.filter(x => capteur(x.id, MODE)), r = pool.find(x => x.t != null) || pool[0] || st.find(x => x.t != null) || st[0];
|
||||
const autres = st.length - 1;
|
||||
p.b.classList.toggle('ex', !!r.exemple); p.b.classList.toggle('hl', !!r.horsLigne);
|
||||
const cap = st.some(x => SEM[x.id] && SEM[x.id].pluie), vent = st.some(x => SEM[x.id] && SEM[x.id].vent);
|
||||
p.b.classList.toggle('sans', !cap && !vent);
|
||||
const hb = `<span class="val" style="color:${couleur(r.t)}">${fmt(r.t)}</span>${autres ? `<span class="n">+${autres}</span>` : ''}<span class="nom">${p.titre}<span class="ics">${cap ? IC_GOUTTE : ''}${vent ? IC_EOLIENNE : ''}</span></span>`;
|
||||
const vm = valMode(r);
|
||||
const hb = `<span class="val" style="color:${vm[1]}">${vm[0]}</span>${autres ? `<span class="n">+${autres}</span>` : ''}<span class="nom">${p.titre}<span class="ics">${cap ? IC_GOUTTE : ''}${vent ? IC_EOLIENNE : ''}</span></span>`;
|
||||
const hf = `<h3>${p.titre}${p.absorbe ? ' et alentours' : ''}</h3><ul>${st.map((s, i) => `<li style="--i:${i}"><span>${s.nom}</span><b style="color:${couleur(s.t)}">${fmt(s.t)}</b>
|
||||
<em>${icones(s.id)}${s.alt} m · ${s.src}${s.licence ? ` (${s.licence})` : ''}${s.exemple ? ' · pas de données en direct' : s.horsLigne ? ' · hors ligne' : ''}${s.mn != null ? ` · 24 h : ${fmt(s.mn)} / ${fmt(s.mx)}` : ''}</em></li>`).join('')}</ul>` +
|
||||
`<div class="actions"><button type="button" class="pleinbtn">Ouvrir en plein écran →</button>${p.mini ? '' : '<button type="button" class="zoom">Zoomer sur ce secteur →</button>'}</div>`;
|
||||
@@ -682,19 +859,28 @@ function disposer(){
|
||||
const extremes = new Set(vivantes.length ? [
|
||||
vivantes.reduce((a, b) => STATIONS[a.g.st[0]].t <= STATIONS[b.g.st[0]].t ? a : b),
|
||||
vivantes.reduce((a, b) => STATIONS[a.g.st[0]].t >= STATIONS[b.g.st[0]].t ? a : b)] : []);
|
||||
const pointsAutres = puces.filter(q => !q.force && (MODE === 't' || MODE === 'alt' || q.ids.some(id => capteur(id, MODE)))).map(q => {
|
||||
const [px, py] = ecran(q.xy);
|
||||
return {p: q, r: {left: r0.left + px - 6, right: r0.left + px + 6, top: r0.top + py - 6, bottom: r0.top + py + 6}};
|
||||
});
|
||||
[...extremes, ...puces.filter(p => !extremes.has(p))].forEach(p => {
|
||||
const [x, y] = ecran(p.xy);
|
||||
p.x = x; p.y = y;
|
||||
p.m.style.left = x + 'px'; p.m.style.top = y + 'px';
|
||||
if (MODE === 'vent' || MODE === 'pluie') { if (!p.ids.some(id => capteur(id, MODE))) { p.m.classList.add('cache'); return; } p.m.classList.remove('cache'); }
|
||||
if (p.force) { p.etat = 'dans'; p.dans = p.force; p.m.classList.add('cache'); return; }
|
||||
remplir(p);
|
||||
const bw = p.b.offsetWidth, bh = p.b.offsetHeight;
|
||||
const essais = [[-bw / 2, -bh - 12], [-bw / 2, 12], [14, -bh / 2], [-bw - 14, -bh / 2], [12, -bh - 8], [-bw - 12, -bh - 8]];
|
||||
let choix = null;
|
||||
for (const [dx, dy] of essais) {
|
||||
const r = {left: r0.left + x + dx, top: r0.top + y + dy, right: r0.left + x + dx + bw, bottom: r0.top + y + dy + bh};
|
||||
const m = {left: r.left - 3, right: r.right + 3, top: r.top - 3, bottom: r.bottom + 3}; // 3 px d'air entre étiquettes
|
||||
if (dedans(r) && !interdits.some(z => chevauche(m, z)) && !posees.some(q => chevauche(m, q.r))) { choix = {dx, dy, r}; break; }
|
||||
for (const strict of [true, false]) {
|
||||
for (const [dx, dy] of essais) {
|
||||
const r = {left: r0.left + x + dx, top: r0.top + y + dy, right: r0.left + x + dx + bw, bottom: r0.top + y + dy + bh};
|
||||
const m = {left: r.left - 3, right: r.right + 3, top: r.top - 3, bottom: r.bottom + 3}; // 3 px d'air entre étiquettes
|
||||
if (dedans(r) && !interdits.some(z => chevauche(m, z)) && !posees.some(q => chevauche(m, q.r))
|
||||
&& !(strict && pointsAutres.some(z => z.p !== p && chevauche(r, z.r)))) { choix = {dx, dy, r}; break; }
|
||||
}
|
||||
if (choix) break;
|
||||
}
|
||||
if (!choix) {
|
||||
// pas de place : la station rejoint la puce posée la plus proche
|
||||
@@ -764,20 +950,109 @@ function disposer(){
|
||||
}
|
||||
|
||||
// liste sous la carte, par secteur
|
||||
let TRI = 0; // 0 par secteur, 1 altitude croissante, 2 décroissante
|
||||
function listeStations(){
|
||||
const carteCase = id => {
|
||||
const s = STATIONS[id], vm = valMode(s);
|
||||
return `<button type="button" class="case${s.exemple ? ' ex' : ''}" data-id="${id}"><small>${s.alt} m · ${s.src}${s.exemple ? ' · pas de données' : s.horsLigne ? ' · hors ligne' : ''}</small><strong>${s.nom}</strong><b style="color:${vm[1]}">${vm[0]}</b></button>`;
|
||||
};
|
||||
if (TRI) {
|
||||
const ids = GROUPES.flatMap(g => g.st).filter(id => capteur(id, MODE)).sort((a, b) => (STATIONS[a].alt - STATIONS[b].alt) * (TRI === 1 ? 1 : -1));
|
||||
document.getElementById('secteurs').innerHTML = `<div class="grille">${ids.map(carteCase).join('')}</div>`;
|
||||
return;
|
||||
}
|
||||
const sects = {};
|
||||
GROUPES.forEach(g => g.st.forEach(id => (sects[g.sect] ||= []).push(id)));
|
||||
const ordre = ['Quatre-Montagnes', 'Hauts-Plateaux et Vercors drômois', 'Trièves et Gresse', 'Royans', 'Diois'];
|
||||
document.getElementById('secteurs').innerHTML = ordre.map(n => `<h3>${n}</h3><div class="grille">${sects[n].map(id => {
|
||||
const s = STATIONS[id];
|
||||
return `<button type="button" class="case${s.exemple ? ' ex' : ''}" data-id="${id}"><small>${s.alt} m · ${s.src}${s.exemple ? ' · pas de données' : s.horsLigne ? ' · hors ligne' : ''}</small><strong>${s.nom}</strong><b style="color:${couleur(s.t)}">${fmt(s.t)}</b></button>`;
|
||||
}).join('')}</div>`).join('');
|
||||
document.getElementById('secteurs').innerHTML = ordre.map(n => { const l = sects[n].filter(id => capteur(id, MODE)); return l.length ? `<h3>${n}</h3><div class="grille">${l.map(carteCase).join('')}</div>` : ''; }).join('');
|
||||
}
|
||||
function coupe(){
|
||||
const L = Object.entries(STATIONS).filter(([, x]) => x.t != null).map(([id, x]) => ({id, ...x}));
|
||||
const cible = document.getElementById('coupe-svg');
|
||||
if (L.length < 3) { cible.innerHTML = ''; return; }
|
||||
const W = Math.max(300, Math.min(720, cible.clientWidth || 720)), H = W < 500 ? 330 : 380, g = W < 500 ? 46 : 52, d = 14, b = 30, h = 12;
|
||||
const tMin = Math.floor(Math.min(...L.map(x => x.t)) - 1), tMax = Math.ceil(Math.max(...L.map(x => x.t)) + 1);
|
||||
const aMin = Math.floor(Math.min(...L.map(x => x.alt)) / 250) * 250 - 100, aMax = Math.ceil(Math.max(...L.map(x => x.alt)) / 250) * 250 + 100;
|
||||
const X = t => g + (t - tMin) / (tMax - tMin) * (W - g - d), Y = a => H - b - (a - aMin) / (aMax - aMin) * (H - b - h);
|
||||
const pas = (tMax - tMin) > 14 ? 5 : 2;
|
||||
let o = '';
|
||||
for (let t = Math.ceil(tMin / pas) * pas; t <= tMax; t += pas) o += `<line x1="${X(t)}" x2="${X(t)}" y1="${h}" y2="${H - b}" stroke="#e4e0d6"/><text x="${X(t)}" y="${H - b + 16}" text-anchor="middle">${t}°</text>`;
|
||||
for (let a = Math.ceil(aMin / 500) * 500; a <= aMax; a += 500) o += `<line x1="${g}" x2="${W - d}" y1="${Y(a)}" y2="${Y(a)}" stroke="#e4e0d6"/><text x="${g - 6}" y="${Y(a) + 4}" text-anchor="end">${a} m</text>`;
|
||||
// atmosphère standard : −0,65 °C par 100 m, depuis la station la plus basse
|
||||
const bas = L.reduce((a, c) => c.alt < a.alt ? c : a);
|
||||
const tAt = a => bas.t - 0.0065 * (a - bas.alt);
|
||||
o += `<line x1="${X(tAt(aMin))}" y1="${Y(aMin)}" x2="${X(tAt(aMax))}" y2="${Y(aMax)}" stroke="#6f8f5c" stroke-width="1.5" stroke-dasharray="5 4"/><text x="${g + 6}" y="${H - b - 8}" style="fill:#6f8f5c">- - refroidissement normal</text>`;
|
||||
const ext = new Set([L.reduce((a, c) => c.t < a.t ? c : a).id, L.reduce((a, c) => c.t > a.t ? c : a).id, L.reduce((a, c) => c.alt > a.alt ? c : a).id, bas.id]);
|
||||
L.sort((a, c) => a.alt - c.alt).forEach(x => {
|
||||
o += `<g class="st" tabindex="0" data-id="${x.id}" role="button" aria-label="${x.nom}, ${x.alt} mètres, ${fmt(x.t)}"><rect x="${X(x.t) - 6}" y="${Y(x.alt) - 6}" width="12" height="12" fill="${couleur(x.t)}"/>${ext.has(x.id) ? `<text x="${X(x.t) + (X(x.t) > W - 130 ? -10 : 10)}" y="${Y(x.alt) + 4}" text-anchor="${X(x.t) > W - 130 ? 'end' : 'start'}">${NOMS[x.id] || court(x.nom)}</text>` : ''}</g>`;
|
||||
});
|
||||
cible.innerHTML = `<svg viewBox="0 0 ${W} ${H}" role="img" aria-label="Température des stations selon l'altitude">${o}</svg>`;
|
||||
// inversion : corrélation entre altitude et température
|
||||
const n = L.length, ma = L.reduce((a, c) => a + c.alt, 0) / n, mt = L.reduce((a, c) => a + c.t, 0) / n;
|
||||
const pente = L.reduce((a, c) => a + (c.alt - ma) * (c.t - mt), 0) / L.reduce((a, c) => a + (c.alt - ma) ** 2, 0) * 100;
|
||||
document.getElementById('coupe-txt').textContent = Math.abs(pente) < 0.15 ? 'En ce moment, il fait presque la même température à toutes les altitudes : pas d’inversion, pas de refroidissement net.' : pente > 0
|
||||
? `Inversion : en ce moment, il fait plus chaud en altitude (${nb1(pente)} °C de plus tous les 100 m en moyenne). Les combes sont les plus froides.`
|
||||
: `La température baisse de ${nb1(-pente)} °C tous les 100 m en moyenne ; la ligne verte montre le refroidissement normal (0,65 °C).`;
|
||||
}
|
||||
let largeurCoupe = 0;
|
||||
addEventListener('resize', () => { const w = document.getElementById('coupe-svg').clientWidth; if (w !== largeurCoupe) { largeurCoupe = w; coupe(); } });
|
||||
function surlignerCarte(id, oui){ puces.forEach(q => q.m.classList.toggle('mis', oui && q.ids.includes(id))); }
|
||||
const coupeSvg = document.getElementById('coupe-svg'), coupeLect = document.getElementById('coupe-lect');
|
||||
const lectureCoupe = id => { const x = STATIONS[id]; coupeLect.textContent = `${x.nom} · ${x.alt} m · ${fmt(x.t)}`; };
|
||||
coupeSvg.addEventListener('mouseover', ev => { const g = ev.target.closest('.st'); if (g) { lectureCoupe(g.dataset.id); surlignerCarte(g.dataset.id, true); } });
|
||||
coupeSvg.addEventListener('mouseout', ev => { if (ev.target.closest('.st')) surlignerCarte('', false); });
|
||||
coupeSvg.addEventListener('focusin', ev => { const g = ev.target.closest('.st'); if (g) { lectureCoupe(g.dataset.id); surlignerCarte(g.dataset.id, true); } });
|
||||
coupeSvg.addEventListener('focusout', () => surlignerCarte('', false));
|
||||
coupeSvg.addEventListener('click', ev => { const g = ev.target.closest('.st'); if (g) { lectureCoupe(g.dataset.id); ouvrirPlein([g.dataset.id], g.dataset.id); } });
|
||||
listeStations();
|
||||
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);
|
||||
});
|
||||
|
||||
// Forum : tant qu'il n'est pas ouvert (connexion Gastinel non branchée), l'encadré annonce l'ouverture sans faux bouton
|
||||
if (!FORUM_OUVERT) document.querySelectorAll('.forum-box').forEach(b => {
|
||||
b.classList.add('ferme');
|
||||
const cta = b.querySelector('.fb-cta'); cta.removeAttribute('href'); cta.setAttribute('aria-disabled', 'true'); cta.textContent = 'Ouverture prochainement';
|
||||
const une = b.querySelector('[data-une]'); une.removeAttribute('href'); une.textContent = 'Le récapitulatif de la semaine, par les adhérents, arrive bientôt.';
|
||||
b.querySelector('.fb-une small').textContent = 'Bientôt';
|
||||
});
|
||||
// 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'});
|
||||
}));
|
||||
// lien partagé #stations : on ouvre le panneau puis on efface l'ancre, pour qu'un rechargement depuis le haut de page ne redescende pas
|
||||
if (location.hash === '#stations') { basculer(document.getElementById('p-stations'), true); history.replaceState(null, '', location.pathname + location.search); }
|
||||
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'};
|
||||
@@ -840,21 +1115,93 @@ rech.addEventListener('keydown', ev => {
|
||||
});
|
||||
resultats.addEventListener('mousedown', ev => { const li = ev.target.closest('li'); if (li) { ev.preventDefault(); allerA(RECH[+li.dataset.i]); } });
|
||||
rech.addEventListener('blur', () => setTimeout(() => { resultats.hidden = true; }, 120));
|
||||
const filtre = document.getElementById('filtre');
|
||||
filtre.addEventListener('click', () => { const on = filtre.getAttribute('aria-pressed') !== 'true'; filtre.setAttribute('aria-pressed', on); carte.classList.toggle('filtre', on); relancer(); });
|
||||
['rech', 'filtre'].forEach(i => document.getElementById(i).addEventListener('click', ev => ev.stopPropagation()));
|
||||
const modes = document.getElementById('modes');
|
||||
modes.addEventListener('click', ev => {
|
||||
const b = ev.target.closest('button'); if (!b) return;
|
||||
const m = b.dataset.mode;
|
||||
TRI = m !== 'alt' ? 0 : MODE === 'alt' ? (TRI === 1 ? 2 : 1) : 1;
|
||||
MODE = m;
|
||||
const alt = modes.querySelector('[data-mode=alt]'); alt.dataset.tri = TRI; alt.textContent = ['Alt', 'Alt ↑', 'Alt ↓'][TRI];
|
||||
modes.querySelectorAll('button').forEach(x => x.setAttribute('aria-pressed', x === b));
|
||||
puces.forEach(q => { q.hb = null; });
|
||||
listeStations();
|
||||
disposer(); relancer();
|
||||
});
|
||||
// ----- curseur du temps -----
|
||||
let SERIES = null, TEMPS = null, LIVE = null, T0 = 0, N = 0, lectureId = null, majAttente = false, chargeSeries = null;
|
||||
const curseur = document.getElementById('curseur'), tempsBox = document.getElementById('temps'), tempsTxt = document.getElementById('temps-txt'), btnLecture = document.getElementById('lecture');
|
||||
function chargerSeries(){
|
||||
if (chargeSeries) return chargeSeries;
|
||||
chargeSeries = Promise.all(Object.keys(STATIONS).map(id => fetch(`data/semaine/${id}.json?${Math.floor(Date.now() / 300000)}`).then(r => r.ok ? r.json() : null).catch(() => null))).then(rs => {
|
||||
SERIES = {}; let a = Infinity, b = 0;
|
||||
rs.forEach(d => { if (!d || !d.t) return; SERIES[d.id] = d; a = Math.min(a, d.archive_depuis || d.debut); b = Math.max(b, d.debut + (d.t.length - 1) * d.pas); });
|
||||
if (!isFinite(a) || b <= a) return;
|
||||
const fin = Math.floor(b / 1800) * 1800, deb = Math.max(Math.ceil(a / 1800) * 1800, fin - 7 * 86400);
|
||||
T0 = deb; N = (fin - deb) / 1800;
|
||||
curseur.max = N; curseur.value = N; curseur.disabled = false; btnLecture.disabled = false;
|
||||
});
|
||||
return chargeSeries;
|
||||
}
|
||||
function valeurA(id, ts, k){
|
||||
const d = SERIES && SERIES[id]; if (!d) return null;
|
||||
const i = Math.round((ts - d.debut) / d.pas); if (i < 0 || i >= d.t.length) return null;
|
||||
const v = d[k][i]; return v == null ? null : v;
|
||||
}
|
||||
function snapshotLive(){ LIVE = {}; Object.entries(STATIONS).forEach(([id, x]) => { LIVE[id] = {t: x.t, vent: x.vent, pluie: x.pluie, mn: x.mn, mx: x.mx}; }); }
|
||||
function appliquerTemps(){
|
||||
if (TEMPS == null || !LIVE) return;
|
||||
Object.entries(STATIONS).forEach(([id, x]) => Object.assign(x, {t: valeurA(id, TEMPS, 't'), vent: valeurA(id, TEMPS, 'v'), pluie: valeurA(id, TEMPS, 'r'), mn: null, mx: null}));
|
||||
}
|
||||
function rafraichirTemps(){
|
||||
if (majAttente) return; majAttente = true;
|
||||
setTimeout(() => { majAttente = false; puces.forEach(q => { q.hb = null; }); disposer(); relancer(); listeStations(); coupe(); }, 30);
|
||||
}
|
||||
function poserTemps(){
|
||||
const v = +curseur.value;
|
||||
if (v >= N) { // retour au direct
|
||||
if (TEMPS != null && LIVE) Object.entries(LIVE).forEach(([id, x]) => Object.assign(STATIONS[id], x));
|
||||
TEMPS = null; tempsBox.classList.remove('passe'); tempsTxt.textContent = 'Maintenant';
|
||||
} else {
|
||||
if (TEMPS == null) snapshotLive();
|
||||
TEMPS = T0 + v * 1800; tempsBox.classList.add('passe');
|
||||
tempsTxt.textContent = fmtJH.format(new Date(TEMPS * 1000)).replace(',', '');
|
||||
appliquerTemps();
|
||||
}
|
||||
rafraichirTemps();
|
||||
}
|
||||
function arreterLecture(){ if (lectureId) { clearInterval(lectureId); lectureId = null; } btnLecture.textContent = '▶'; btnLecture.setAttribute('aria-label', 'Rejouer les dernières 24 heures'); }
|
||||
curseur.addEventListener('input', () => { arreterLecture(); poserTemps(); });
|
||||
btnLecture.addEventListener('click', () => {
|
||||
if (lectureId) { arreterLecture(); return; }
|
||||
if (+curseur.value >= N - 1) curseur.value = Math.max(0, N - 48);
|
||||
poserTemps();
|
||||
btnLecture.textContent = '❚❚'; btnLecture.setAttribute('aria-label', 'Mettre en pause');
|
||||
lectureId = setInterval(() => { curseur.value = Math.min(N, +curseur.value + 1); poserTemps(); if (+curseur.value >= N) arreterLecture(); }, 260);
|
||||
});
|
||||
(FORUM_OUVERT ? fetch('data/forum-une.json?' + Math.floor(Date.now() / 300000)).then(r => r.ok ? r.json() : null).then(u => {
|
||||
if (!u || !u.titre) return;
|
||||
document.querySelectorAll('[data-une]').forEach(a => { a.textContent = u.titre; if (u.url) a.href = u.url; });
|
||||
document.querySelectorAll('[data-auteur]').forEach(e => { e.textContent = u.auteur ? 'par ' + u.auteur : ''; });
|
||||
if (u.n) document.querySelectorAll('[data-n]').forEach(e => { e.textContent = u.n + (u.n > 1 ? ' sujets' : ' sujet') + ' cette semaine'; });
|
||||
}).catch(() => {}) : 0);
|
||||
function apresDonnees(){ chargerSeries(); if (TEMPS != null) { snapshotLive(); appliquerTemps(); } }
|
||||
const selRecord = document.getElementById('record');
|
||||
selRecord.value = RECORD;
|
||||
selRecord.addEventListener('change', () => { RECORD = selRecord.value; try { localStorage.setItem('vm-record', RECORD); } catch (e) {} phraseDuJour(); });
|
||||
['rech', 'modes'].forEach(i => document.getElementById(i).addEventListener('click', ev => ev.stopPropagation()));
|
||||
|
||||
// téléphone : le cartouche se replie (10 s en haut de page, tout de suite si on descend ou zoome), se rouvre en remontant
|
||||
// téléphone : le cartouche se replie tout de suite dès qu'on touche la carte, qu'on descend ou qu'on zoome, se rouvre en remontant
|
||||
let minuteurRepli = 0;
|
||||
function replier(oui){
|
||||
if (carte.clientWidth >= 720) oui = false;
|
||||
if (cart.classList.contains('replie') === oui) return;
|
||||
cart.classList.toggle('replie', oui); relancer();
|
||||
}
|
||||
function armerRepli(){ clearTimeout(minuteurRepli); minuteurRepli = setTimeout(() => replier(true), 10000); }
|
||||
function armerRepli(){} // plus de délai : le cartouche se replie dès qu'on touche la carte ou qu'on descend
|
||||
carte.addEventListener('pointerdown', ev => { if (!ev.target.closest('.cartouche')) replier(true); });
|
||||
addEventListener('scroll', () => { if (scrollY > 30) replier(true); else { replier(false); armerRepli(); } }, {passive: true});
|
||||
cart.addEventListener('click', ev => {
|
||||
if (ev.target.closest('a, button, input, .rech') || carte.clientWidth >= 720) return;
|
||||
if (ev.target.closest('a, button, input, select, label, .rech') || carte.clientWidth >= 720) return;
|
||||
const ouvrir = cart.classList.contains('replie');
|
||||
replier(!ouvrir); if (ouvrir) armerRepli();
|
||||
});
|
||||
@@ -904,7 +1251,7 @@ function rendrePlein(){
|
||||
? pleinIds.map(i => `<button type="button" data-id="${i}" class="${i === id ? 'on' : ''}">${NOMS[i] || court(STATIONS[i].nom)} ${fmt(STATIONS[i].t)}</button>`).join('') : '';
|
||||
const etat = s.t == null ? (s.horsLigne ? 'hors ligne' : 'pas de données en direct') : (s.mn != null ? `24 h : ${fmt(s.mn)} / ${fmt(s.mx)}` : '');
|
||||
plein.querySelector('.plein-corps').innerHTML =
|
||||
`<h2>${s.nom}${icones(id)}</h2>
|
||||
`<h2>${s.nom}${icones(id)}${(o => o.titre ? `<span class="origine">${o.titre}${o.aussi ? `<small>${o.aussi}</small>` : ''}</span>` : '')(origine(id))}</h2>
|
||||
<p class="plein-sous">${s.alt} m · ${s.src}${s.licence ? ` (${s.licence})` : ''}</p>
|
||||
<div class="plein-val"><b style="color:${couleur(s.t)}">${fmt(s.t)}</b><span>${etat}</span>
|
||||
<button type="button" class="plein-carte">Voir sur la carte</button></div>
|
||||
@@ -1035,7 +1382,7 @@ async function chargerDonnees(){
|
||||
const st = d && d.stations && d.stations[cle], r = st && st.releves && st.releves.at(-1);
|
||||
if (!st || !STATIONS[id]) return;
|
||||
const enLigne = r && !st.hors_ligne;
|
||||
Object.assign(STATIONS[id], {t: enLigne ? r.temperature : null, mn: enLigne ? r.temperature_min : null, mx: enLigne ? r.temperature_max : null,
|
||||
Object.assign(STATIONS[id], {t: enLigne ? r.temperature : null, mn: enLigne ? r.temperature_min : null, mx: enLigne ? r.temperature_max : null, vent: enLigne && r.vent_moyen != null ? r.vent_moyen : null, pluie: enLigne && r.pluie_1h != null ? r.pluie_1h : null,
|
||||
exemple: false, horsLigne: !enLigne, src: st.source || STATIONS[id].src, licence: licenceCourte(d.metadonnees && d.metadonnees[cle] && d.metadonnees[cle].licence)});
|
||||
if (enLigne) { const t = new Date(r.dh_utc.replace(' ', 'T') + 'Z'); if (!dernier || t > dernier) dernier = t; }
|
||||
};
|
||||
@@ -1049,7 +1396,7 @@ async function chargerDonnees(){
|
||||
document.getElementById('date').textContent = jour[0].toUpperCase() + jour.slice(1);
|
||||
dernierReleve = dernier; heureReleve = heure; afficherDirect();
|
||||
}
|
||||
phraseDuJour(); listeStations(); disposer(); relancer(); // les puces qui se regroupent s'animent
|
||||
apresDonnees(); phraseDuJour(); listeStations(); coupe(); disposer(); relancer(); // les puces qui se regroupent s'animent
|
||||
}
|
||||
Promise.race([chargerDonnees(), new Promise(r => setTimeout(r, 1500))]).then(() => { ouverture(); ouvrirDepuisAdresse(); });
|
||||
setInterval(chargerDonnees, 60 * 1000); // les relevés arrivent toutes les 6 à 15 minutes
|
||||
@@ -1099,6 +1446,27 @@ function ouverture(){
|
||||
puces.forEach(p => p.m.style.removeProperty('--d'));
|
||||
}, T + 50);
|
||||
}
|
||||
// Bandeau « pas de cookie » : une fois par appareil, s'efface après 6250 ms (pause au survol / toucher)
|
||||
(function(){
|
||||
// Dynamique : affiché à la 1re visite, puis seulement après 7 jours sans visite (?cookie force l'affichage). La date de dernière visite reste dans le navigateur, jamais envoyée au serveur.
|
||||
let montrer = true;
|
||||
try {
|
||||
const dernier = +localStorage.getItem('vm-derniere-visite') || 0, maintenant = Date.now();
|
||||
montrer = !dernier || maintenant - dernier >= 7 * 86400000 || /[?&]cookie\b/.test(location.search);
|
||||
localStorage.setItem('vm-derniere-visite', String(maintenant));
|
||||
} catch (e) {}
|
||||
if (!montrer) return;
|
||||
const b = document.createElement('div'); b.className = 'sanscookie'; b.setAttribute('role', 'status');
|
||||
b.innerHTML = '<b>Non, désolé, je ne veux pas de cookie,<br>Je n\'ai pas faim, ni envie de me faire traquer.</b><span>Ici, rien à accepter : ni cookie de suivi, ni publicité.</span><button type="button" aria-label="Fermer">×</button>';
|
||||
document.body.appendChild(b);
|
||||
let t, fini = false;
|
||||
const partir = () => { if (fini) return; fini = true; b.classList.add('parti'); setTimeout(() => b.remove(), 600); };
|
||||
const armer = () => { clearTimeout(t); t = setTimeout(partir, 6250); };
|
||||
b.addEventListener('pointerenter', () => clearTimeout(t)); b.addEventListener('pointerleave', armer);
|
||||
b.addEventListener('focusin', () => clearTimeout(t));
|
||||
b.querySelector('button').addEventListener('click', partir);
|
||||
armer();
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,27 @@
|
||||
p='modele.html'; s=open(p,encoding='utf-8').read()
|
||||
css=""".sanscookie{position:fixed;left:16px;bottom:16px;z-index:60;max-width:340px;padding:10px 34px 10px 14px;background:var(--calcaire);border:1px solid var(--sapin);box-shadow:0 0 0 3px var(--calcaire),0 0 0 4px var(--pierre);color:var(--roche);font-family:var(--texte);transition:opacity .5s}
|
||||
.sanscookie.parti{opacity:0;pointer-events:none}
|
||||
.sanscookie b{display:block;font-family:var(--titre);font-weight:600;font-size:15px;color:var(--sapin)}
|
||||
.sanscookie span{font-size:12.5px;color:var(--gris)}
|
||||
.sanscookie button{position:absolute;top:2px;right:4px;border:0;background:none;font-size:20px;line-height:1;color:var(--gris);cursor:pointer;padding:4px 6px}
|
||||
@media (prefers-reduced-motion:reduce){.sanscookie{transition:none}}
|
||||
</style>"""
|
||||
s=s.replace("</style>",css,1)
|
||||
js="""
|
||||
// Bandeau « pas de cookie » : une fois par appareil, s'efface après 4250 ms (pause au survol / toucher)
|
||||
(function(){
|
||||
try { if (localStorage.getItem('vm-sanscookie')) return; } catch (e) {}
|
||||
const b = document.createElement('div'); b.className = 'sanscookie'; b.setAttribute('role', 'status');
|
||||
b.innerHTML = '<b>Non, désolé, je ne veux pas de cookie.</b><span>Ici, rien à accepter : ni cookie de suivi, ni publicité.</span><button type="button" aria-label="Fermer">×</button>';
|
||||
document.body.appendChild(b);
|
||||
let t, fini = false;
|
||||
const partir = () => { if (fini) return; fini = true; b.classList.add('parti'); setTimeout(() => b.remove(), 600); try { localStorage.setItem('vm-sanscookie', '1'); } catch (e) {} };
|
||||
const armer = () => { clearTimeout(t); t = setTimeout(partir, 4250); };
|
||||
b.addEventListener('pointerenter', () => clearTimeout(t)); b.addEventListener('pointerleave', armer);
|
||||
b.addEventListener('focusin', () => clearTimeout(t));
|
||||
b.querySelector('button').addEventListener('click', partir);
|
||||
armer();
|
||||
})();
|
||||
</script>"""
|
||||
i=s.rfind("</script>"); s=s[:i]+js.lstrip('\n')+s[i+9:]
|
||||
open(p,'w',encoding='utf-8').write(s)
|
||||
@@ -0,0 +1,64 @@
|
||||
p='modele.html'; s=open(p,encoding='utf-8').read()
|
||||
def sub(a,b):
|
||||
global s
|
||||
assert s.count(a)==1, a[:50]; s=s.replace(a,b)
|
||||
sub(' <button type="button" id="retour">',' <p class="compte">Compte Gastinel · <span>bientôt</span></p>\n <button type="button" id="retour">')
|
||||
sub('<section class="liste" id="stations">','''<section class="liste coupe" id="coupe">
|
||||
<h2>La coupe du massif</h2>
|
||||
<p id="coupe-txt">Chaque carré est une station : plus il est haut, plus la station est en altitude ; plus il est à gauche, plus il fait froid.</p>
|
||||
<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">''')
|
||||
sub('/* ---------- sous la carte ---------- */','''.compte{margin:10px 0 0;font-size:12px;color:var(--gris)}
|
||||
.compte span{color:var(--sapin);font-weight:600}
|
||||
.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)}
|
||||
#coupe-svg .st{cursor:pointer}
|
||||
#coupe-svg .st rect{stroke:#fff;stroke-width:1.5}
|
||||
#coupe-svg .st:hover rect,#coupe-svg .st:focus rect,#coupe-svg .st.on rect{stroke:var(--roche);stroke-width:2}
|
||||
#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}
|
||||
/* ---------- sous la carte ---------- */''')
|
||||
sub("listeStations();\nconst triBtn",'''function coupe(){
|
||||
const L = Object.entries(STATIONS).filter(([, x]) => x.t != null).map(([id, x]) => ({id, ...x}));
|
||||
const cible = document.getElementById('coupe-svg');
|
||||
if (L.length < 3) { cible.innerHTML = ''; return; }
|
||||
const W = 720, H = 380, g = 52, d = 18, b = 34, h = 14;
|
||||
const tMin = Math.floor(Math.min(...L.map(x => x.t)) - 1), tMax = Math.ceil(Math.max(...L.map(x => x.t)) + 1);
|
||||
const aMin = Math.floor(Math.min(...L.map(x => x.alt)) / 250) * 250 - 100, aMax = Math.ceil(Math.max(...L.map(x => x.alt)) / 250) * 250 + 100;
|
||||
const X = t => g + (t - tMin) / (tMax - tMin) * (W - g - d), Y = a => H - b - (a - aMin) / (aMax - aMin) * (H - b - h);
|
||||
const pas = (tMax - tMin) > 14 ? 5 : 2;
|
||||
let o = '';
|
||||
for (let t = Math.ceil(tMin / pas) * pas; t <= tMax; t += pas) o += `<line x1="${X(t)}" x2="${X(t)}" y1="${h}" y2="${H - b}" stroke="#e4e0d6"/><text x="${X(t)}" y="${H - b + 16}" text-anchor="middle">${t}°</text>`;
|
||||
for (let a = Math.ceil(aMin / 500) * 500; a <= aMax; a += 500) o += `<line x1="${g}" x2="${W - d}" y1="${Y(a)}" y2="${Y(a)}" stroke="#e4e0d6"/><text x="${g - 6}" y="${Y(a) + 4}" text-anchor="end">${a} m</text>`;
|
||||
// atmosphère standard : −0,65 °C par 100 m, depuis la station la plus basse
|
||||
const bas = L.reduce((a, c) => c.alt < a.alt ? c : a);
|
||||
const tAt = a => bas.t - 0.0065 * (a - bas.alt);
|
||||
o += `<line x1="${X(tAt(aMin))}" y1="${Y(aMin)}" x2="${X(tAt(aMax))}" y2="${Y(aMax)}" stroke="#6f8f5c" stroke-width="1.5" stroke-dasharray="5 4"/><text x="${X(tAt(aMax)) + 6}" y="${Y(aMax) + 12}" style="fill:#6f8f5c">refroidissement normal</text>`;
|
||||
const ext = new Set([L.reduce((a, c) => c.t < a.t ? c : a).id, L.reduce((a, c) => c.t > a.t ? c : a).id, L.reduce((a, c) => c.alt > a.alt ? c : a).id, bas.id]);
|
||||
L.sort((a, c) => a.alt - c.alt).forEach(x => {
|
||||
o += `<g class="st" tabindex="0" data-id="${x.id}" role="button" aria-label="${x.nom}, ${x.alt} mètres, ${fmt(x.t)}"><rect x="${X(x.t) - 6}" y="${Y(x.alt) - 6}" width="12" height="12" fill="${couleur(x.t)}"/>${ext.has(x.id) ? `<text x="${X(x.t) + 10}" y="${Y(x.alt) + 4}">${NOMS[x.id] || court(x.nom)}</text>` : ''}</g>`;
|
||||
});
|
||||
cible.innerHTML = `<svg viewBox="0 0 ${W} ${H}" role="img" aria-label="Température des stations selon l'altitude">${o}</svg>`;
|
||||
// inversion : corrélation entre altitude et température
|
||||
const n = L.length, ma = L.reduce((a, c) => a + c.alt, 0) / n, mt = L.reduce((a, c) => a + c.t, 0) / n;
|
||||
const pente = L.reduce((a, c) => a + (c.alt - ma) * (c.t - mt), 0) / L.reduce((a, c) => a + (c.alt - ma) ** 2, 0) * 100;
|
||||
document.getElementById('coupe-txt').textContent = pente > 0
|
||||
? `Inversion : en ce moment, il fait plus chaud en altitude (${nb1(pente)} °C de plus tous les 100 m en moyenne). Les combes sont les plus froides.`
|
||||
: `Ce matin, la température baisse de ${nb1(-pente)} °C tous les 100 m en moyenne ; la ligne verte montre le refroidissement normal (0,65 °C).`;
|
||||
}
|
||||
function surlignerCarte(id, oui){ puces.forEach(q => q.m.classList.toggle('mis', oui && q.ids.includes(id))); }
|
||||
const coupeSvg = document.getElementById('coupe-svg'), coupeLect = document.getElementById('coupe-lect');
|
||||
const lectureCoupe = id => { const x = STATIONS[id]; coupeLect.textContent = `${x.nom} · ${x.alt} m · ${fmt(x.t)}`; };
|
||||
coupeSvg.addEventListener('mouseover', ev => { const g = ev.target.closest('.st'); if (g) { lectureCoupe(g.dataset.id); surlignerCarte(g.dataset.id, true); } });
|
||||
coupeSvg.addEventListener('mouseout', ev => { if (ev.target.closest('.st')) surlignerCarte('', false); });
|
||||
coupeSvg.addEventListener('focusin', ev => { const g = ev.target.closest('.st'); if (g) { lectureCoupe(g.dataset.id); surlignerCarte(g.dataset.id, true); } });
|
||||
coupeSvg.addEventListener('focusout', () => surlignerCarte('', false));
|
||||
coupeSvg.addEventListener('click', ev => { const g = ev.target.closest('.st'); if (g) { lectureCoupe(g.dataset.id); ouvrirPlein([g.dataset.id], g.dataset.id); } });
|
||||
listeStations();
|
||||
const triBtn''')
|
||||
sub("phraseDuJour(); listeStations(); disposer();","phraseDuJour(); listeStations(); coupe(); disposer();")
|
||||
open(p,'w',encoding='utf-8').write(s)
|
||||
@@ -0,0 +1,65 @@
|
||||
import re
|
||||
p='modele.html'; s=open(p,encoding='utf-8').read()
|
||||
def sub(a,b):
|
||||
global s
|
||||
assert s.count(a)==1, a[:70]; s=s.replace(a,b)
|
||||
|
||||
# ---- CSS : nouvel encadré Forum (grand, un seul bouton, bande Gastinel) ----
|
||||
a=s.index(".forum-box{position:absolute;left:28px;bottom:16px")
|
||||
b=s.index("\n",s.index("@media (max-width:719px){.carte .forum-box{display:none}"))+1
|
||||
s=s[:a]+""".forum-box{position:absolute;left:28px;bottom:16px;z-index:3;width:372px;background:rgba(250,249,245,.97);border:1px solid var(--roche);box-shadow:0 0 0 3px rgba(250,249,245,.97),0 0 0 4px var(--pierre);color:var(--roche)}
|
||||
.fb-haut{display:flex;justify-content:space-between;align-items:baseline;padding:12px 16px 2px}
|
||||
.fb-haut b{font-family:var(--titre);font-weight:700;font-size:28px;color:var(--sapin);line-height:1.1}
|
||||
.fb-haut small{font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--gris)}
|
||||
.fb-une{padding:4px 16px 12px;border-bottom:1px solid var(--pierre)}
|
||||
.fb-une small{display:block;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--gris)}
|
||||
.fb-une a{display:block;margin-top:2px;font-family:var(--titre);font-weight:600;font-size:17px;line-height:1.3;color:var(--roche);text-decoration:none}
|
||||
.fb-une a:hover{text-decoration:underline}
|
||||
.fb-une span{font-size:12.5px;color:var(--gris)}
|
||||
.fb-cta{display:block;margin:12px 16px 6px;padding:11px 14px;background:var(--sapin);color:#fff;text-align:center;font-size:13px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;text-decoration:none;border:1px solid var(--sapin)}
|
||||
.fb-cta:hover{background:#17382b}
|
||||
.fb-co{margin:0 16px 12px;text-align:center;font-size:12.5px;color:var(--gris)}
|
||||
.fb-co a{display:inline-flex;align-items:center;gap:5px;color:#000;font-weight:600;text-decoration:underline;text-underline-offset:2px}
|
||||
.fb-co .g{font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:17px;line-height:1;text-decoration:none}
|
||||
.fb-bas{display:flex;gap:12px;align-items:center;padding:10px 16px;background:#303336;color:#d9dbde;font-size:12.5px;line-height:1.4}
|
||||
.fb-bas .gcarre{flex:0 0 32px;height:32px;display:grid;place-items:center;background:#fff;color:#000;font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:22px}
|
||||
.fb-bas strong{color:#fff;font-weight:600}
|
||||
.forum-box.mobile{display:none}
|
||||
@media (max-width:1000px){.forum-box{left:auto;right:28px;bottom:68px;width:320px}.legende{left:28px;right:auto}}
|
||||
@media (max-width:719px){.carte .forum-box{display:none}.forum-box.mobile{display:block;position:static;width:auto;flex:0 0 100%;margin:6px 0 4px}}
|
||||
"""+s[b:]
|
||||
|
||||
# ---- HTML : les deux emplacements (carte, sous la carte sur téléphone) ----
|
||||
BOX='''<div class="forum-box%s">
|
||||
<div class="fb-haut"><b>Forum</b><small data-n></small></div>
|
||||
<div class="fb-une"><small>À la une · Récapitulatif de la semaine</small><a href="forum/index.html" data-une>Le récapitulatif de la semaine arrive ici</a><span data-auteur></span></div>
|
||||
<a class="fb-cta" href="forum/index.html">Rejoindre la discussion →</a>
|
||||
<p class="fb-co">Déjà un compte ? <a href="forum/connexion.html"><span class="g" aria-hidden="true">G</span>Se connecter avec Gastinel</a></p>
|
||||
<div class="fb-bas"><span class="gcarre" aria-hidden="true">G</span><span><strong>L'écosystème Gastinel.</strong> Un compte pour le forum, vos favoris et toutes nos applications. Sans publicité, une alternative aux GAFAM.</span></div>
|
||||
</div>'''
|
||||
for suffixe in ('',' mobile'):
|
||||
i=s.index('<div class="forum-box'+suffixe+'">'); j=s.index('Se connecter avec Gastinel</a></div>',i)+len('Se connecter avec Gastinel</a></div>')
|
||||
s=s[:i]+(BOX % suffixe)+s[j:]
|
||||
|
||||
# ---- JS : « à la une » depuis data/forum-une.json ({titre, auteur, url, n}) ----
|
||||
a=s.index("fetch('data/forum-une.json?'"); b=s.index("}).catch(() => {});",a)+len("}).catch(() => {});")
|
||||
s=s[:a]+"""fetch('data/forum-une.json?' + Math.floor(Date.now() / 300000)).then(r => r.ok ? r.json() : null).then(u => {
|
||||
if (!u || !u.titre) return;
|
||||
document.querySelectorAll('[data-une]').forEach(a => { a.textContent = u.titre; if (u.url) a.href = u.url; });
|
||||
document.querySelectorAll('[data-auteur]').forEach(e => { e.textContent = u.auteur ? 'par ' + u.auteur : ''; });
|
||||
if (u.n) document.querySelectorAll('[data-n]').forEach(e => { e.textContent = u.n + (u.n > 1 ? ' sujets' : ' sujet') + ' cette semaine'; });
|
||||
}).catch(() => {});"""+s[b:]
|
||||
|
||||
# ---- bandeau « pas de cookie » dynamique : 1re visite, puis après 7 jours d'absence ----
|
||||
a=s.index(" const TOUJOURS = true;"); b=s.index("\n",s.index("if (!TOUJOURS)"))+1
|
||||
s=s[:a]+""" // Dynamique : affiché à la 1re visite, puis seulement après 7 jours sans visite (?cookie force l'affichage). La date de dernière visite reste dans le navigateur, jamais envoyée au serveur.
|
||||
let montrer = true;
|
||||
try {
|
||||
const dernier = +localStorage.getItem('vm-derniere-visite') || 0, maintenant = Date.now();
|
||||
montrer = !dernier || maintenant - dernier >= 7 * 86400000 || /[?&]cookie\\b/.test(location.search);
|
||||
localStorage.setItem('vm-derniere-visite', String(maintenant));
|
||||
} catch (e) {}
|
||||
if (!montrer) return;
|
||||
"""+s[b:]
|
||||
sub(" try { localStorage.setItem('vm-sanscookie', '1'); } catch (e) {} };"," };")
|
||||
open(p,'w',encoding='utf-8').write(s)
|
||||
@@ -0,0 +1,52 @@
|
||||
p='modele.html'; s=open(p,encoding='utf-8').read()
|
||||
def sub(a,b):
|
||||
global s
|
||||
assert s.count(a)==1, a[:60]; s=s.replace(a,b)
|
||||
# 1. le G de Gastinel (Inter gras, comme le logo « Gastinel. » du Hub), en noir
|
||||
sub("html{scroll-behavior:smooth}","@font-face{font-family:'GastinelG';font-weight:700;font-display:swap;src:url(polices/inter-g.woff2) format('woff2')}\nhtml{scroll-behavior:smooth}")
|
||||
# 2. retirer le bouton de l'encadré du titre
|
||||
i=s.index('<div class="compte-bloc">'); j=s.index('</div>',i)+6; s=s[:i]+s[j:].lstrip('\n ')
|
||||
a=s.index(".compte-bloc{margin-top:10px}"); b=s.index(".compte-bloc small{display:block;margin-top:5px;font-size:11px;color:var(--gris)}")+len(".compte-bloc small{display:block;margin-top:5px;font-size:11px;color:var(--gris)}")
|
||||
s=s[:a]+""".compte{display:inline-flex;align-items:center;gap:8px;padding:5px 11px 5px 7px;background:#fff;border:1px solid #000;color:#000;font-size:12px;font-weight:600;text-decoration:none}
|
||||
.compte:hover{background:#ecebe5}
|
||||
.compte .gmark{font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:22px;line-height:1;color:#000;letter-spacing:-.02em}
|
||||
.forum-box{position:absolute;right:226px;bottom:16px;z-index:3;width:262px;padding:9px 12px 10px;background:rgba(250,249,245,.94);border:1px solid var(--roche);box-shadow:0 0 0 3px rgba(250,249,245,.94),0 0 0 4px var(--pierre);font-size:12px;color:var(--roche)}
|
||||
.forum-box .fb-titre{display:flex;justify-content:space-between;align-items:baseline;font-family:var(--titre);font-weight:700;font-size:17px;color:var(--sapin);text-decoration:none}
|
||||
.forum-box .fb-titre small{font-family:var(--texte);font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase}
|
||||
.forum-box .fb-titre:hover{text-decoration:underline}
|
||||
.forum-box p{margin:3px 0 7px;line-height:1.35}
|
||||
.forum-box .fb-une{font-family:var(--titre);font-size:13px}
|
||||
.forum-box .fb-atouts{font-size:11px;color:var(--gris);margin-bottom:8px}
|
||||
.forum-box.mobile{display:none}
|
||||
@media (max-width:1240px){.forum-box{right:28px;bottom:68px;width:244px}}
|
||||
@media (max-width:719px){.carte .forum-box{display:none}.forum-box.mobile{display:block;position:static;width:auto;flex:0 0 100%;margin:4px 0 0}}"""+s[b:]
|
||||
sub(".cartouche.replie #retour,.cartouche.replie .outils,.cartouche.replie .compte-bloc{display:none}",".cartouche.replie #retour,.cartouche.replie .outils{display:none}")
|
||||
# 3. encadré Forum sur la carte (bureau) et sous la carte (téléphone)
|
||||
BOX = '''<div class="forum-box%s"><a class="fb-titre" href="forum/index.html">Forum <small>Entrer →</small></a>
|
||||
<p class="fb-une" data-une>Le récapitulatif de la semaine, par les adhérents, arrive ici.</p>
|
||||
<p class="fb-atouts">Un compte Gastinel : forum avec rôle, favoris, alerte gel.</p>
|
||||
<a class="compte" href="forum/connexion.html"><span class="gmark" aria-hidden="true">G</span>Se connecter avec Gastinel</a></div>'''
|
||||
sub(' <a class="suite" href="#stations">Toutes les stations ↓</a>',' <a class="suite" href="#stations">Toutes les stations ↓</a>\n '+(BOX % ''))
|
||||
sub('<div class="temps" id="temps">','<div class="temps" id="temps">',) if False else None
|
||||
sub(' <p class="aide">Ces choix valent aussi pour la liste des stations, plus bas.</p>',' <p class="aide">Ces choix valent aussi pour la liste des stations, plus bas.</p>\n '+(BOX % ' mobile'))
|
||||
# 4. « À la une » du forum : data/forum-une.json si présent ({titre, auteur, url})
|
||||
sub("function apresDonnees(){","""fetch('data/forum-une.json?' + Math.floor(Date.now() / 300000)).then(r => r.ok ? r.json() : null).then(u => {
|
||||
if (!u || !u.titre) return;
|
||||
document.querySelectorAll('[data-une]').forEach(p => { p.innerHTML = ''; const a = document.createElement('a'); a.href = u.url || 'forum/index.html'; a.textContent = u.titre; a.style.color = 'inherit'; p.append(a); if (u.auteur) p.append(' · ' + u.auteur); });
|
||||
}).catch(() => {});
|
||||
function apresDonnees(){""")
|
||||
open(p,'w',encoding='utf-8').write(s)
|
||||
|
||||
# forum : G, pied de page collé en bas
|
||||
g=open('gen_forum.py',encoding='utf-8').read()
|
||||
def sg(a,b):
|
||||
global g
|
||||
assert g.count(a)==1, a[:60]; g=g.replace(a,b)
|
||||
sg("FONTS = \"\"\"@font-face{font-family:'Bitter';font-style:normal;","FONTS = \"\"\"@font-face{font-family:'GastinelG';font-weight:700;font-display:swap;src:url(../polices/inter-g.woff2) format('woff2')}\n@font-face{font-family:'Bitter';font-style:normal;")
|
||||
sg("html,body{margin:0;background:var(--calcaire);color:var(--roche);font-family:var(--texte);line-height:1.5}","html,body{margin:0;background:var(--calcaire);color:var(--roche);font-family:var(--texte);line-height:1.5}\nbody{min-height:100vh;display:flex;flex-direction:column}")
|
||||
sg("main{max-width:900px;margin:0 auto;padding:18px 24px 48px}","main{flex:1 0 auto;width:100%;max-width:900px;margin:0 auto;padding:18px 24px 48px}")
|
||||
sg(".btn{display:inline-flex;align-items:center;gap:10px;padding:8px 14px 8px 8px;background:#fff;border:1px solid var(--sapin);color:var(--sapin);",".btn{display:inline-flex;align-items:center;gap:10px;padding:8px 14px 8px 10px;background:#fff;border:1px solid #000;color:#000;")
|
||||
sg(".btn:hover{background:var(--sapin);color:#fff}\n.btn .gmark{display:inline-grid;place-items:center;width:26px;height:26px;background:var(--sapin);color:#fff;font-family:var(--titre);font-weight:700;font-size:16px}\n.btn:hover .gmark{background:#fff;color:var(--sapin)}",
|
||||
".btn:hover{background:#ecebe5}\n.btn .gmark{font-family:'GastinelG','Inter',system-ui,sans-serif;font-weight:700;font-size:26px;line-height:1;color:#000;letter-spacing:-.02em}")
|
||||
sg(".pied{background:#303336;color:#d1d3d6;padding:24px 24px 20px;font-size:13px}",".pied{flex:0 0 auto;background:#303336;color:#d1d3d6;padding:24px 24px 20px;font-size:13px}")
|
||||
open('gen_forum.py','w',encoding='utf-8').write(g)
|
||||
@@ -0,0 +1,32 @@
|
||||
p='modele.html'; s=open(p,encoding='utf-8').read()
|
||||
def sub(a,b):
|
||||
global s
|
||||
assert s.count(a)==1, a[:60]; s=s.replace(a,b)
|
||||
# barre du temps lisible sur téléphone
|
||||
sub("@media (max-width:719px){.reglages{padding:10px 16px 0}.temps output{min-width:0;flex:0 0 100%;text-align:left;order:3}}",
|
||||
"@media (max-width:719px){.reglages{padding:10px 16px 0}.temps{flex:1 1 100%;flex-wrap:wrap}.temps input{flex:1 1 140px}.temps output{min-width:0;flex:0 0 100%;text-align:left;order:3}}")
|
||||
# une ligne d'aide, discrète
|
||||
sub('</div>\n</div>\n<section class="liste coupe"','</div>\n <p class="aide">Ces choix valent aussi pour la liste des stations, plus bas.</p>\n</div>\n<section class="liste coupe"')
|
||||
sub(".temps{flex:1 1 300px;",".aide{flex:0 0 100%;margin:0;font-size:11.5px;color:var(--gris)}\n.temps{flex:1 1 300px;")
|
||||
# phrase de la coupe quand la pente est nulle
|
||||
sub("document.getElementById('coupe-txt').textContent = pente > 0","document.getElementById('coupe-txt').textContent = Math.abs(pente) < 0.15 ? 'En ce moment, il fait presque la même température à toutes les altitudes : pas d’inversion, pas de refroidissement net.' : pente > 0")
|
||||
# étiquettes : ne pas recouvrir le point d'une autre station (d'abord strictement, sinon comme avant)
|
||||
sub(" [...extremes, ...puces.filter(p => !extremes.has(p))].forEach(p => {",""" const pointsAutres = puces.filter(q => !q.force && (MODE === 't' || MODE === 'alt' || q.ids.some(id => capteur(id, MODE)))).map(q => {
|
||||
const [px, py] = ecran(q.xy);
|
||||
return {p: q, r: {left: r0.left + px - 6, right: r0.left + px + 6, top: r0.top + py - 6, bottom: r0.top + py + 6}};
|
||||
});
|
||||
[...extremes, ...puces.filter(p => !extremes.has(p))].forEach(p => {""")
|
||||
sub(""" for (const [dx, dy] of essais) {
|
||||
const r = {left: r0.left + x + dx, top: r0.top + y + dy, right: r0.left + x + dx + bw, bottom: r0.top + y + dy + bh};
|
||||
const m = {left: r.left - 3, right: r.right + 3, top: r.top - 3, bottom: r.bottom + 3}; // 3 px d'air entre étiquettes
|
||||
if (dedans(r) && !interdits.some(z => chevauche(m, z)) && !posees.some(q => chevauche(m, q.r))) { choix = {dx, dy, r}; break; }
|
||||
}""",""" for (const strict of [true, false]) {
|
||||
for (const [dx, dy] of essais) {
|
||||
const r = {left: r0.left + x + dx, top: r0.top + y + dy, right: r0.left + x + dx + bw, bottom: r0.top + y + dy + bh};
|
||||
const m = {left: r.left - 3, right: r.right + 3, top: r.top - 3, bottom: r.bottom + 3}; // 3 px d'air entre étiquettes
|
||||
if (dedans(r) && !interdits.some(z => chevauche(m, z)) && !posees.some(q => chevauche(m, q.r))
|
||||
&& !(strict && pointsAutres.some(z => z.p !== p && chevauche(r, z.r)))) { choix = {dx, dy, r}; break; }
|
||||
}
|
||||
if (choix) break;
|
||||
}""")
|
||||
open(p,'w',encoding='utf-8').write(s)
|
||||
@@ -0,0 +1,73 @@
|
||||
p='modele.html'; s=open(p,encoding='utf-8').read()
|
||||
def sub(a,b,n=1):
|
||||
global s
|
||||
assert a in s, a[:60]
|
||||
s=s.replace(a,b,n)
|
||||
# HTML : groupe de modes à la place du bouton « Vent · pluie »
|
||||
sub('<button type="button" id="filtre" aria-pressed="false" title="Montrer les stations qui mesurent le vent ou la pluie">Vent · pluie</button>',
|
||||
'<div class="modes" id="modes" role="group" aria-label="Valeur affichée sur les étiquettes"><button type="button" data-mode="t" aria-pressed="true">Temp</button><button type="button" data-mode="alt" aria-pressed="false">Alt</button><button type="button" data-mode="vent" aria-pressed="false" title="Seules les stations qui mesurent le vent">Vent</button><button type="button" data-mode="pluie" aria-pressed="false" title="Seules les stations qui mesurent la pluie">Pluie</button></div>')
|
||||
# CSS
|
||||
i=s.index('#filtre{'); j=s.index('.puce .ics{display:none')
|
||||
s=s[:i]+""".modes{display:flex;flex:0 0 100%}
|
||||
.modes button{flex:1;font:inherit;font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--sapin);background:#fff;border:1px solid var(--sapin);border-radius:0;margin-left:-1px;padding:7px 6px;cursor:pointer;white-space:nowrap}
|
||||
.modes button:first-child{margin-left:0}
|
||||
.modes button[aria-pressed=true]{background:var(--sapin);color:#fff}
|
||||
.puce.horsmode{display:none}
|
||||
#tri{font:inherit;font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--sapin);background:#fff;border:1px solid var(--sapin);border-radius:0;padding:8px 12px;cursor:pointer;margin:6px 0 10px}
|
||||
#tri[data-etat="1"]{background:var(--sapin);color:#fff}
|
||||
#tri[data-etat="2"]{background:#000;border-color:#000;color:#fff}
|
||||
"""+s[j:]
|
||||
sub(".carte.filtre .puce .ics{display:inline}\n","")
|
||||
sub(".outils{display:flex;gap:8px;margin-top:12px}",".outils{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}")
|
||||
# tri par altitude
|
||||
sub('<div id="secteurs"></div>','<button type="button" id="tri" data-etat="0" title="Trier les stations par altitude : un clic croissant, un deuxième décroissant, un troisième remet par secteur">Trier par altitude</button>\n <div id="secteurs"></div>')
|
||||
sub("function listeStations(){","""let TRI = 0; // 0 par secteur, 1 altitude croissante, 2 décroissante
|
||||
function listeStations(){
|
||||
const carteCase = id => {
|
||||
const s = STATIONS[id];
|
||||
return `<button type="button" class="case${s.exemple ? ' ex' : ''}" data-id="${id}"><small>${s.alt} m · ${s.src}${s.exemple ? ' · pas de données' : s.horsLigne ? ' · hors ligne' : ''}</small><strong>${s.nom}</strong><b style="color:${couleur(s.t)}">${fmt(s.t)}</b></button>`;
|
||||
};
|
||||
if (TRI) {
|
||||
const ids = GROUPES.flatMap(g => g.st).sort((a, b) => (STATIONS[a].alt - STATIONS[b].alt) * (TRI === 1 ? 1 : -1));
|
||||
document.getElementById('secteurs').innerHTML = `<div class="grille">${ids.map(carteCase).join('')}</div>`;
|
||||
return;
|
||||
}""")
|
||||
sub("""sects[n].map(id => {
|
||||
const s = STATIONS[id];
|
||||
return `<button type="button" class="case${s.exemple ? ' ex' : ''}" data-id="${id}"><small>${s.alt} m · ${s.src}${s.exemple ? ' · pas de données' : s.horsLigne ? ' · hors ligne' : ''}</small><strong>${s.nom}</strong><b style="color:${couleur(s.t)}">${fmt(s.t)}</b></button>`;
|
||||
}).join('')""","sects[n].map(carteCase).join('')")
|
||||
sub("listeStations();\ndocument.getElementById('secteurs')","""listeStations();
|
||||
const triBtn = document.getElementById('tri');
|
||||
triBtn.addEventListener('click', () => {
|
||||
TRI = (TRI + 1) % 3; triBtn.dataset.etat = TRI;
|
||||
triBtn.textContent = ['Trier par altitude', 'Altitude ↑ croissante', 'Altitude ↓ décroissante'][TRI];
|
||||
listeStations();
|
||||
});
|
||||
document.getElementById('secteurs')""")
|
||||
# données vent / pluie
|
||||
sub("mx: enLigne ? r.temperature_max : null,","mx: enLigne ? r.temperature_max : null, vent: enLigne && r.vent_moyen != null ? r.vent_moyen : null, pluie: enLigne && r.pluie_1h != null ? r.pluie_1h : null,")
|
||||
# étiquettes selon le mode
|
||||
sub("// contenu d'une puce :","""let MODE = 't'; // t, alt, vent, pluie
|
||||
const capteur = (id, m) => m === 'vent' ? !!(SEM[id] && SEM[id].vent) : m === 'pluie' ? !!(SEM[id] && SEM[id].pluie) : true;
|
||||
const nb1 = v => v == null ? '—' : String(Math.round(v * 10) / 10).replace('.', ',');
|
||||
// contenu d'une puce :""")
|
||||
sub("const st = p.ids.map(id => ({id, ...STATIONS[id]})), r = st.find(x => x.t != null) || st[0];",
|
||||
"const st = p.ids.map(id => ({id, ...STATIONS[id]})), pool = st.filter(x => capteur(x.id, MODE)), r = pool.find(x => x.t != null) || pool[0] || st.find(x => x.t != null) || st[0];")
|
||||
sub("const hb = `<span class=\"val\" style=\"color:${couleur(r.t)}\">${fmt(r.t)}</span>",
|
||||
"const vm = MODE === 'alt' ? [`${r.alt} m`, 'var(--sapin)'] : MODE === 'vent' ? [r.vent == null ? '—' : `${Math.round(r.vent)} km/h`, '#3d6f8e'] : MODE === 'pluie' ? [r.pluie == null ? '—' : `${nb1(r.pluie)} mm`, '#3d6f8e'] : [fmt(r.t), couleur(r.t)];\n const hb = `<span class=\"val\" style=\"color:${vm[1]}\">${vm[0]}</span>")
|
||||
sub(" p.b.classList.toggle('sans', !cap && !vent);\n","")
|
||||
# placement : en mode vent / pluie, les stations sans capteur ne sont pas posées
|
||||
sub(" if (p.force) { p.etat = 'dans'; p.dans = p.force; p.m.classList.add('cache'); return; }",
|
||||
" if (MODE === 'vent' || MODE === 'pluie') { if (!p.ids.some(id => capteur(id, MODE))) { p.m.classList.add('cache'); return; } p.m.classList.remove('cache'); }\n if (p.force) { p.etat = 'dans'; p.dans = p.force; p.m.classList.add('cache'); return; }")
|
||||
# commutateur
|
||||
i=s.index("const filtre = document.getElementById('filtre');"); j=s.index("\n",s.index("['rech', 'filtre']"))
|
||||
s=s[:i]+"""const modes = document.getElementById('modes');
|
||||
modes.addEventListener('click', ev => {
|
||||
const b = ev.target.closest('button'); if (!b) return;
|
||||
MODE = b.dataset.mode;
|
||||
modes.querySelectorAll('button').forEach(x => x.setAttribute('aria-pressed', x === b));
|
||||
puces.forEach(q => { q.hb = null; });
|
||||
disposer(); relancer();
|
||||
});
|
||||
['rech', 'modes'].forEach(i => document.getElementById(i).addEventListener('click', ev => ev.stopPropagation()));"""+s[j:]
|
||||
open(p,'w',encoding='utf-8').write(s)
|
||||
@@ -0,0 +1,20 @@
|
||||
p='modele.html'; s=open(p,encoding='utf-8').read()
|
||||
# 1. propriétaires et lieux de consultation
|
||||
s=s.replace("const MASSIF =", """// Propriétaire des stations « de chez nous » ; 'dispo' = où l'on retrouve aussi la station (jamais Infoclimat en premier)
|
||||
const PROPRIO = {lans:'Station Gastinel', moucherolle:'Station Gastinel',
|
||||
geve:'Station Richard Gastinel', allieres:'Station Richard Gastinel', bruyeres:'Station Richard Gastinel',
|
||||
darbounouse:'Station Richard Gastinel', oscence:'Station Richard Gastinel'};
|
||||
const DISPO = ['WeatherLink', 'ROMMA', 'Infoclimat'];
|
||||
function origine(id){
|
||||
const s = STATIONS[id], p = PROPRIO[id];
|
||||
if (p) return {titre: p, aussi: 'Aussi consultable sur ' + DISPO.join(' · ')};
|
||||
const src = s.src || '';
|
||||
return {titre: src ? 'Vient ' + (/^[AEIOUÉ]/i.test(src) ? "d'" : 'de ') + src : '', aussi: ''};
|
||||
}
|
||||
const MASSIF =""",1)
|
||||
# 2. encadré bleu à côté du titre
|
||||
s=s.replace("`<h2>${s.nom}${icones(id)}</h2>","`<h2>${s.nom}${icones(id)}${(o => o.titre ? `<span class=\"origine\">${o.titre}${o.aussi ? `<small>${o.aussi}</small>` : ''}</span>` : '')(origine(id))}</h2>",1)
|
||||
s=s.replace(".plein-sous{", """.origine{display:inline-flex;flex-direction:column;vertical-align:middle;margin-left:12px;padding:3px 9px;border:1px solid var(--glacier);background:rgba(110,181,189,.14);color:#2f6f78;font-family:var(--texte,inherit);font-size:12px;font-weight:500;line-height:1.25}
|
||||
.origine small{font-size:11px;font-weight:400;color:var(--gris)}
|
||||
.plein-sous{""",1)
|
||||
open(p,'w',encoding='utf-8').write(s)
|
||||
@@ -0,0 +1,97 @@
|
||||
p='modele.html'; s=open(p,encoding='utf-8').read()
|
||||
def sub(a,b):
|
||||
global s
|
||||
assert s.count(a)==1, a[:60]; s=s.replace(a,b)
|
||||
# nav : « Météo » plus grand ; « À propos » mène à la page
|
||||
sub(".cartouche nav span{color:var(--sapin)}",".cartouche nav span{color:var(--sapin);font-size:16px;letter-spacing:.22em}")
|
||||
sub('<a href="#">À propos</a>','<a href="a-propos.html">À propos</a>')
|
||||
# bouton « Se connecter avec Gastinel »
|
||||
sub('<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>')
|
||||
sub(".compte{margin:10px 0 0;font-size:12px;color:var(--gris)}\n.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)}""")
|
||||
sub(".cartouche.replie #retour,.cartouche.replie .outils{display:none}",".cartouche.replie #retour,.cartouche.replie .outils,.cartouche.replie .compte-bloc{display:none}")
|
||||
# défilement doux
|
||||
sub("html,body{margin:0;","html{scroll-behavior:smooth}\n@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}\nhtml,body{margin:0;")
|
||||
# panneaux déroulants
|
||||
i=s.index('<section class="liste" id="stations">'); j=s.index('</section>',i)+10
|
||||
s=s[:i]+'''<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>'''+s[j:]
|
||||
sub("/* ---------- sous la carte ---------- */","""/* ---------- 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 ---------- */""")
|
||||
# JS : panneaux, ancres, bilan
|
||||
sub("// données en direct : postes Météo-France","""// 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""")
|
||||
open(p,'w',encoding='utf-8').write(s)
|
||||
@@ -0,0 +1,84 @@
|
||||
p='modele.html'; s=open(p,encoding='utf-8').read()
|
||||
def sub(a,b):
|
||||
global s
|
||||
assert s.count(a)==1, a[:60]; s=s.replace(a,b)
|
||||
# ---- pied de page sombre, avec contact et SIRET comme sur gastinel.me ----
|
||||
i=s.index('<footer class="pied">'); j=s.index('</footer>',i)+9
|
||||
s=s[:i]+'''<footer class="pied">
|
||||
<div class="pied-grille">
|
||||
<div>
|
||||
<p class="accroche">Des stations de chez nous, des chiffres d'ici.</p>
|
||||
<p>Données : Météo-France (Licence Ouverte), Infoclimat (CC BY ou CC BY-NC selon la station), WeatherLink, station Gastinel. Fond de carte : IGN, licence ouverte.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Contact</h4>
|
||||
<ul><li><a href="mailto:studio@gastinel.me">studio@gastinel.me</a></li>
|
||||
<li><a href="https://wa.me/message/XAHBYTJZNQ6TK1" rel="noopener">WhatsApp</a></li>
|
||||
<li><a href="tel:+33636276419">06 36 27 64 19</a></li></ul>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Le site</h4>
|
||||
<ul><li><a href="a-propos.html">À propos</a></li><li><a href="a-propos.html#sources">Sources et licences</a></li><li><a href="a-propos.html#mentions">Mentions légales</a></li><li><a href="cgu.html">CGU</a></li><li><a href="confidentialite.html">Confidentialité</a></li></ul>
|
||||
<p>SIRET <a href="https://entreprises.lefigaro.fr/nd-38/entreprise-104816749" rel="noopener">10481674900014</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="pied-bas">© Théo Gastinel · Météo Vercors</p>
|
||||
</footer>'''+s[j:]
|
||||
a=s.index('.pied{max-width:1080px'); b=s.index('.pied a{color:var(--sapin)}')+len('.pied a{color:var(--sapin)}')
|
||||
s=s[:a]+""".pied{background:#303336;color:#d1d3d6;padding:34px 28px 22px;font-size:13px;line-height:1.7;border-top:4px solid #1c1d1f}
|
||||
.pied-grille{max-width:1080px;margin:0 auto;display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:34px}
|
||||
.pied p{margin:6px 0}
|
||||
.pied h4{margin:0 0 8px;font-family:var(--texte);font-size:11.5px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:#fff;border-bottom:1px solid #4a4d51;padding-bottom:7px}
|
||||
.pied ul{list-style:none;margin:0;padding:0}
|
||||
.pied .accroche{font-family:var(--titre);font-style:italic;font-size:17px;color:#fff}
|
||||
.pied a{color:#b9c2cc;text-decoration:none;font-weight:500}
|
||||
.pied a:hover{color:#fff;text-decoration:underline}
|
||||
.pied-bas{max-width:1080px;margin:26px auto 0!important;padding-top:14px;border-top:1px solid #45484c;font-size:12px;color:#8e9298}"""+s[b:]
|
||||
sub(" .pied{padding:18px 16px 36px}"," .pied{padding:26px 16px 30px}\n .pied-grille{grid-template-columns:1fr;gap:22px}")
|
||||
# ---- mise en avant (record) : saisonnière, réglable ----
|
||||
a=s.index("function phraseDuJour(){"); b=s.index("\n}\n",a)+3
|
||||
s=s[:a]+"""let RECORD = 'auto';
|
||||
try { RECORD = localStorage.getItem('vm-record') || 'auto'; } catch (e) {}
|
||||
// saisons météorologiques : hiver = décembre à février, été = juin à août
|
||||
function saisonMeteo(){
|
||||
const m = parseInt(new Intl.DateTimeFormat('fr-FR', {month: 'numeric', timeZone: 'Europe/Paris'}).format(new Date()), 10);
|
||||
return m === 12 || m <= 2 ? 'hiver' : m >= 6 && m <= 8 ? 'ete' : 'entre';
|
||||
}
|
||||
function phraseDuJour(){
|
||||
const toutes = Object.values(STATIONS), reelles = toutes.filter(x => x.t != null);
|
||||
if (!reelles.length) {
|
||||
document.getElementById('phrase').textContent = 'Relevés en cours de chargement…';
|
||||
document.getElementById('reseau').textContent = `${toutes.length} stations dans le massif`;
|
||||
return;
|
||||
}
|
||||
const l = [...reelles].sort((a, b) => a.t - b.t), f = l[0], c = l[l.length - 1], deg = t => fmt(t).replace('°', ' °C');
|
||||
const sais = saisonMeteo(), mode = RECORD !== 'auto' ? RECORD : sais === 'hiver' ? 'froid' : sais === 'ete' ? 'chaud' : 'ecart';
|
||||
const mom = MOMENT(heureParis());
|
||||
let s;
|
||||
if (mode === 'chaud') s = `${mom}, <strong>${deg(c.t)} à ${court(c.nom)}</strong>, le point le plus chaud du massif en ce moment.`;
|
||||
else if (mode === 'ecart') s = `${mom}, de <strong>${deg(f.t)} à ${court(f.nom)}</strong> à <strong>${deg(c.t)} à ${court(c.nom)}</strong> : le plus froid et le plus chaud du massif.`;
|
||||
else if (mode === 'vent') {
|
||||
const v = toutes.filter(x => x.vent != null && capteur(Object.keys(STATIONS).find(k => STATIONS[k] === x), 'vent')).sort((a, b) => b.vent - a.vent)[0];
|
||||
s = v ? `${mom}, <strong>${Math.round(v.vent)} km/h à ${court(v.nom)}</strong>, le vent moyen le plus fort du massif.` : `${mom}, aucun vent mesuré pour l'instant.`;
|
||||
} else if (mode === 'pluie') {
|
||||
const r = toutes.filter(x => x.pluie != null && x.pluie > 0).sort((a, b) => b.pluie - a.pluie)[0];
|
||||
s = r ? `${mom}, <strong>${nb1(r.pluie)} mm en une heure à ${court(r.nom)}</strong>, la pluie la plus forte du massif.` : `${mom}, pas de pluie mesurée dans le massif.`;
|
||||
} else {
|
||||
s = `${mom}, <strong>${deg(f.t)} à ${court(f.nom)}</strong>, le point le plus froid du massif en ce moment.`;
|
||||
const h = l.filter(x => x.alt - f.alt >= 300 && x.t - f.t >= 3).sort((a, b) => b.alt - a.alt)[0];
|
||||
if (h) s += ` ${h.alt - f.alt} m plus haut, ${court(h.nom)} : ${deg(h.t)}. L'air froid est resté au fond.`;
|
||||
}
|
||||
document.getElementById('phrase').innerHTML = s;
|
||||
document.getElementById('reseau').textContent = `${reelles.length} stations en direct sur ${toutes.length} · Météo-France, Infoclimat, station Gastinel`;
|
||||
}
|
||||
"""+s[b:]
|
||||
sub('</div>\n <p class="compte">','''<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">''')
|
||||
sub(".compte{margin:10px 0 0;",".record{flex:0 0 100%;font-size:11.5px;color:var(--gris)}\n.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}\n.compte{margin:10px 0 0;")
|
||||
sub("['rech', 'modes'].forEach(","""const selRecord = document.getElementById('record');
|
||||
selRecord.value = RECORD;
|
||||
selRecord.addEventListener('change', () => { RECORD = selRecord.value; try { localStorage.setItem('vm-record', RECORD); } catch (e) {} phraseDuJour(); });
|
||||
['rech', 'modes'].forEach(""")
|
||||
sub("if (ev.target.closest('a, button, input, .rech') || carte.clientWidth >= 720) return;","if (ev.target.closest('a, button, input, select, label, .rech') || carte.clientWidth >= 720) return;")
|
||||
open(p,'w',encoding='utf-8').write(s)
|
||||
@@ -0,0 +1,93 @@
|
||||
p='modele.html'; s=open(p,encoding='utf-8').read()
|
||||
def sub(a,b):
|
||||
global s
|
||||
assert s.count(a)==1, a[:60]; s=s.replace(a,b)
|
||||
# 1. les modes quittent le cartouche et passent sous la carte, avec le curseur du temps
|
||||
i=s.index('<div class="modes" id="modes"'); j=s.index('</div>',i)+6
|
||||
modes_html=s[i:j]; s=s[:i]+s[j:]
|
||||
sub('<p class="sous-carte">Courbes de niveau tous les 100 m · molette sur le Parc ou deux doigts pour zoomer</p>',
|
||||
'<p class="sous-carte">Courbes de niveau tous les 100 m · molette sur le Parc ou deux doigts pour zoomer</p>\n<div class="reglages" id="reglages">'+modes_html+'''
|
||||
<div class="temps" id="temps"><button type="button" id="lecture" aria-label="Rejouer les dernières 24 heures" disabled>▶</button><input type="range" id="curseur" min="0" max="0" step="1" value="0" disabled aria-label="Remonter le temps, sept jours"><output id="temps-txt" for="curseur">Maintenant</output></div>
|
||||
</div>''')
|
||||
sub(".modes{display:flex;flex:0 0 100%}",""".reglages{max-width:1080px;margin:0 auto;padding:10px 28px 0;display:flex;flex-wrap:wrap;gap:10px 22px;align-items:center}
|
||||
.modes{display:flex;flex:0 0 auto}
|
||||
.temps{flex:1 1 300px;display:flex;align-items:center;gap:10px;min-width:0}
|
||||
.temps button{font:inherit;font-size:13px;color:var(--sapin);background:#fff;border:1px solid var(--sapin);border-radius:0;width:34px;height:31px;cursor:pointer;padding:0}
|
||||
.temps button:disabled{opacity:.4;cursor:default}
|
||||
.temps input{flex:1;min-width:0;accent-color:var(--sapin);height:24px}
|
||||
.temps output{font-size:12.5px;color:var(--gris);min-width:112px;text-align:right}
|
||||
.temps.passe output{color:var(--chaud);font-weight:600}
|
||||
@media (max-width:719px){.reglages{padding:10px 16px 0}.temps output{min-width:0;flex:0 0 100%;text-align:left;order:3}}""")
|
||||
sub("flex:1;font:inherit;font-size:11.5px;font-weight:600;letter-spacing:.08em","flex:none;font:inherit;font-size:11.5px;font-weight:600;letter-spacing:.08em")
|
||||
sub("margin-left:-1px;padding:7px 6px;","margin-left:-1px;padding:7px 14px;")
|
||||
# 2. valeur selon le mode (carte et liste)
|
||||
a=s.index("const vm = MODE === 'alt'"); b=s.index("\n",a)
|
||||
s=s[:a]+"const vm = valMode(r);"+s[b:]
|
||||
sub("let MODE = 't'; // t, alt, vent, pluie","""let MODE = 't'; // t, alt, vent, pluie
|
||||
function valMode(r){
|
||||
return MODE === 'alt' ? [`${r.alt} m`, 'var(--sapin)']
|
||||
: MODE === 'vent' ? [r.vent == null ? '—' : `${Math.round(r.vent)} km/h`, '#3d6f8e']
|
||||
: MODE === 'pluie' ? [r.pluie == null ? '—' : `${nb1(r.pluie)} mm`, '#3d6f8e'] : [fmt(r.t), couleur(r.t)];
|
||||
}""")
|
||||
sub("<b style=\"color:${couleur(s.t)}\">${fmt(s.t)}</b></button>`;\n };","<b style=\"color:${vm[1]}\">${vm[0]}</b></button>`;\n };")
|
||||
sub("const carteCase = id => {\n const s = STATIONS[id];","const carteCase = id => {\n const s = STATIONS[id], vm = valMode(s);")
|
||||
sub("GROUPES.flatMap(g => g.st).sort(","GROUPES.flatMap(g => g.st).filter(id => capteur(id, MODE)).sort(")
|
||||
sub("ordre.map(n => `<h3>${n}</h3><div class=\"grille\">${sects[n].map(carteCase).join('')}</div>`).join('');",
|
||||
"ordre.map(n => { const l = sects[n].filter(id => capteur(id, MODE)); return l.length ? `<h3>${n}</h3><div class=\"grille\">${l.map(carteCase).join('')}</div>` : ''; }).join('');")
|
||||
sub(" puces.forEach(q => { q.hb = null; });\n disposer(); relancer();"," puces.forEach(q => { q.hb = null; });\n listeStations();\n disposer(); relancer();")
|
||||
# 3. curseur du temps : sept jours d'archive, lecture des dernières 24 h
|
||||
sub("['rech', 'modes'].forEach(","""// ----- curseur du temps -----
|
||||
let SERIES = null, TEMPS = null, LIVE = null, T0 = 0, N = 0, lectureId = null, majAttente = false, chargeSeries = null;
|
||||
const curseur = document.getElementById('curseur'), tempsBox = document.getElementById('temps'), tempsTxt = document.getElementById('temps-txt'), btnLecture = document.getElementById('lecture');
|
||||
function chargerSeries(){
|
||||
if (chargeSeries) return chargeSeries;
|
||||
chargeSeries = Promise.all(Object.keys(STATIONS).map(id => fetch(`data/semaine/${id}.json?${Math.floor(Date.now() / 300000)}`).then(r => r.ok ? r.json() : null).catch(() => null))).then(rs => {
|
||||
SERIES = {}; let a = Infinity, b = 0;
|
||||
rs.forEach(d => { if (!d || !d.t) return; SERIES[d.id] = d; a = Math.min(a, d.archive_depuis || d.debut); b = Math.max(b, d.debut + (d.t.length - 1) * d.pas); });
|
||||
if (!isFinite(a) || b <= a) return;
|
||||
const fin = Math.floor(b / 1800) * 1800, deb = Math.max(Math.ceil(a / 1800) * 1800, fin - 7 * 86400);
|
||||
T0 = deb; N = (fin - deb) / 1800;
|
||||
curseur.max = N; curseur.value = N; curseur.disabled = false; btnLecture.disabled = false;
|
||||
});
|
||||
return chargeSeries;
|
||||
}
|
||||
function valeurA(id, ts, k){
|
||||
const d = SERIES && SERIES[id]; if (!d) return null;
|
||||
const i = Math.round((ts - d.debut) / d.pas); if (i < 0 || i >= d.t.length) return null;
|
||||
const v = d[k][i]; return v == null ? null : v;
|
||||
}
|
||||
function snapshotLive(){ LIVE = {}; Object.entries(STATIONS).forEach(([id, x]) => { LIVE[id] = {t: x.t, vent: x.vent, pluie: x.pluie, mn: x.mn, mx: x.mx}; }); }
|
||||
function appliquerTemps(){
|
||||
if (TEMPS == null || !LIVE) return;
|
||||
Object.entries(STATIONS).forEach(([id, x]) => Object.assign(x, {t: valeurA(id, TEMPS, 't'), vent: valeurA(id, TEMPS, 'v'), pluie: valeurA(id, TEMPS, 'r'), mn: null, mx: null}));
|
||||
}
|
||||
function rafraichirTemps(){
|
||||
if (majAttente) return; majAttente = true;
|
||||
requestAnimationFrame(() => { majAttente = false; puces.forEach(q => { q.hb = null; }); disposer(); relancer(); listeStations(); coupe(); });
|
||||
}
|
||||
function poserTemps(){
|
||||
const v = +curseur.value;
|
||||
if (v >= N) { // retour au direct
|
||||
if (TEMPS != null && LIVE) Object.entries(LIVE).forEach(([id, x]) => Object.assign(STATIONS[id], x));
|
||||
TEMPS = null; tempsBox.classList.remove('passe'); tempsTxt.textContent = 'Maintenant';
|
||||
} else {
|
||||
if (TEMPS == null) snapshotLive();
|
||||
TEMPS = T0 + v * 1800; tempsBox.classList.add('passe');
|
||||
tempsTxt.textContent = fmtJH.format(new Date(TEMPS * 1000)).replace(',', '');
|
||||
appliquerTemps();
|
||||
}
|
||||
rafraichirTemps();
|
||||
}
|
||||
function arreterLecture(){ if (lectureId) { clearInterval(lectureId); lectureId = null; } btnLecture.textContent = '▶'; btnLecture.setAttribute('aria-label', 'Rejouer les dernières 24 heures'); }
|
||||
curseur.addEventListener('input', () => { arreterLecture(); poserTemps(); });
|
||||
btnLecture.addEventListener('click', () => {
|
||||
if (lectureId) { arreterLecture(); return; }
|
||||
curseur.value = Math.max(0, N - 48); poserTemps();
|
||||
btnLecture.textContent = '❚❚'; btnLecture.setAttribute('aria-label', 'Mettre en pause');
|
||||
lectureId = setInterval(() => { curseur.value = Math.min(N, +curseur.value + 1); poserTemps(); if (+curseur.value >= N) arreterLecture(); }, 260);
|
||||
});
|
||||
function apresDonnees(){ chargerSeries(); if (TEMPS != null) { snapshotLive(); appliquerTemps(); } }
|
||||
['rech', 'modes'].forEach(""")
|
||||
sub(" phraseDuJour(); listeStations(); coupe(); disposer();"," apresDonnees(); phraseDuJour(); listeStations(); coupe(); disposer();")
|
||||
sub("`Ce matin, la température baisse de","`La température baisse de")
|
||||
open(p,'w',encoding='utf-8').write(s)
|
||||
Fichier binaire non affiché.
@@ -0,0 +1,19 @@
|
||||
import re,sys
|
||||
ED="Richard GASTINEL, entrepreneur individuel (EI), micro-entreprise dont Théo et Richard Gastinel sont tous deux responsables (SIRET 10481674900014 ; 621, avenue Léopold Fabre, 38250 Lans-en-Vercors, France ; 06 36 27 64 19)"
|
||||
HEB="Infomaniak Network SA, Rue Eugène-Marziano 25, 1227 Les Acacias (Genève), Suisse, +41 22 820 35 44, www.infomaniak.com. Les relevés sont collectés et archivés sur un serveur de l'éditeur à Lans-en-Vercors"
|
||||
def trait(t, html):
|
||||
m = (lambda x:x)
|
||||
# CGU / md et html : éditeur
|
||||
t = re.sub(r"Théo Gastinel, micro-entreprise\. SIRET : (?:<mark[^>]*>\[À COMPLÉTER\]</mark>|\[À COMPLÉTER\])\. Adresse : (?:<mark[^>]*>\[À COMPLÉTER\]</mark>|\[À COMPLÉTER\])\. (?:<mark[^>]*>\[À VÉRIFIER : gastinel[^\]]*\]</mark>|\[À VÉRIFIER : gastinel[^\]]*\])", ED + ". Directeur de la publication : Théo Gastinel.", t)
|
||||
t = re.sub(r"(?:<mark[^>]*>)?\[À COMPLÉTER : nom ou raison sociale, adresse et téléphone[^\]]*\](?:</mark>)?", HEB, t)
|
||||
# confidentialité
|
||||
t = re.sub(r"<b>Théo Gastinel</b>, micro-entreprise \(SIRET : (?:<mark[^>]*>\[À COMPLÉTER\]</mark>) ; adresse : (?:<mark[^>]*>\[À COMPLÉTER\]</mark>)\) <mark[^>]*>\[À VÉRIFIER : sur gastinel\.me[^\]]*\]</mark>", "<b>"+ED+"</b>", t)
|
||||
t = re.sub(r"\*\*Théo Gastinel\*\*, micro-entreprise \(SIRET : \[À COMPLÉTER\] ; adresse : \[À COMPLÉTER\]\) \[À VÉRIFIER : sur gastinel\.me[^\]]*\]", "**"+ED+"**", t)
|
||||
t = re.sub(r"(?:<mark[^>]*>)?\[À COMPLÉTER : nom, adresse et pays de l'hébergeur\](?:</mark>)?\. (?:<mark[^>]*>)?\[À COMPLÉTER : si l'hébergeur est Infomaniak[^\]]*\](?:</mark>)?", HEB + ". La Suisse bénéficie d'une décision d'adéquation de la Commission européenne (art. 45 RGPD)", t)
|
||||
# a-propos
|
||||
t = t.replace("<b>Éditeur</b> : Théo Gastinel, micro-entreprise. Directeur de la publication : Théo Gastinel.<br>\nSIRET et adresse : [À COMPLÉTER].<br>", "<b>Éditeur</b> : "+ED+". Directeur de la publication : Théo Gastinel.<br>")
|
||||
t = t.replace("[À COMPLÉTER : nom, adresse et contact de l'hébergeur]", HEB)
|
||||
return t
|
||||
for f in sys.argv[1:]:
|
||||
t=open(f,encoding='utf-8').read(); n=trait(t, f.endswith('.html'))
|
||||
open(f,'w',encoding='utf-8').write(n); print(f, 'modifié' if n!=t else 'INCHANGÉ', n.count('À COMPLÉTER'))
|
||||
@@ -77,3 +77,8 @@ if __name__ == "__main__":
|
||||
f()
|
||||
n += 1
|
||||
print("%d tests OK" % n)
|
||||
|
||||
|
||||
def test_station_sans_capteur_vent_pluie():
|
||||
import archiver_historique as a
|
||||
assert a.SANS_CAPTEUR["lans"] == ("v", "r")
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur