Benzina Abruzzo: PWA completa (mappa PMTiles, lista a pannello, dettaglio impianto)
This commit is contained in:
commit
176e6acd6f
16 changed files with 3180 additions and 0 deletions
259
index.html
Normal file
259
index.html
Normal file
|
|
@ -0,0 +1,259 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover,maximum-scale=1">
|
||||
<title>Benzina Abruzzo — prezzi carburanti</title>
|
||||
<meta name="description" content="Prezzi dei carburanti in Abruzzo dagli open data MIMIT. Trova l'impianto più conveniente vicino a te, calcola il costo del pieno e avvia la navigazione.">
|
||||
<meta name="theme-color" content="#0B7A5A">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
||||
<meta name="apple-mobile-web-app-title" content="Benzina">
|
||||
<link rel="manifest" href="/static/manifest.webmanifest">
|
||||
<link rel="apple-touch-icon" href="/static/icons/apple-touch-icon.png">
|
||||
<link rel="icon" href="/static/icons/favicon-32.png" sizes="32x32">
|
||||
<link rel="stylesheet" href="/static/vendor/leaflet.css">
|
||||
<link rel="stylesheet" href="/static/app.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="app">
|
||||
<div class="map-wrap">
|
||||
<div id="map"></div>
|
||||
|
||||
<div class="topbar">
|
||||
<div class="pill brand" id="brandpill">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 20V6a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v14"/><path d="M4 12h10"/><path d="M14 8h2.5a2 2 0 0 1 2 2v6a1.6 1.6 0 0 0 3.2 0V9.4L18 6"/><path d="M2 20h14"/></svg>
|
||||
Benzina
|
||||
</div>
|
||||
<button class="pill round" id="filterchip" aria-label="Filtri">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M4 7h10M18 7h2M4 17h4M12 17h8"/><circle cx="16" cy="7" r="2.2"/><circle cx="10" cy="17" r="2.2"/></svg>
|
||||
<span class="badge-dot" id="fcount"></span>
|
||||
</button>
|
||||
<button class="pill round" id="vbtn" aria-label="Il mio veicolo">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 17h14M6.5 17V9.8a2 2 0 0 1 .6-1.4l1.6-1.6A2 2 0 0 1 10.1 6h3.8a2 2 0 0 1 1.4.6l1.6 1.6a2 2 0 0 1 .6 1.4V17"/><circle cx="8.2" cy="17.6" r="1.6"/><circle cx="15.8" cy="17.6" r="1.6"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="chips" id="chips">
|
||||
<button class="chip" data-sort="value" aria-pressed="true">Miglior scelta</button>
|
||||
<button class="chip" data-sort="price">Prezzo</button>
|
||||
<button class="chip" data-sort="dist">Distanza</button>
|
||||
</div>
|
||||
|
||||
<div class="fab-stack">
|
||||
<button class="pill round fab" id="locbtn" aria-label="Usa la mia posizione">
|
||||
<svg width="19" height="19" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round"><circle cx="12" cy="12" r="3.2"/><path d="M12 2v3.4M12 18.6V22M2 12h3.4M18.6 12H22"/></svg>
|
||||
</button>
|
||||
<button class="btn-list" id="listbtn">
|
||||
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 6h12M8 12h12M8 18h12"/><circle cx="4" cy="6" r="1"/><circle cx="4" cy="12" r="1"/><circle cx="4" cy="18" r="1"/></svg>
|
||||
<span id="listbtn-label">Impianti</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="sheet" id="sheet" aria-hidden="true">
|
||||
<div class="grab" id="grab"><span></span></div>
|
||||
<div class="sheet-head">
|
||||
<div>
|
||||
<h2 id="listtitle">Impianti</h2>
|
||||
<div class="sub" id="listhint"></div>
|
||||
</div>
|
||||
<button class="icon-btn" id="sheetclose" aria-label="Chiudi">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="list" id="list"></div>
|
||||
<div class="footline" id="foot">—</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- dettaglio impianto -->
|
||||
<div class="modal sheet-modal" id="detail">
|
||||
<div class="shd det" role="dialog" aria-labelledby="d-name">
|
||||
<div class="shd-grab"></div>
|
||||
|
||||
<div class="det-head">
|
||||
<div class="det-title">
|
||||
<h2 id="d-name">—</h2>
|
||||
<p class="det-addr" id="d-addr"></p>
|
||||
</div>
|
||||
<button class="det-x" id="d-close" aria-label="Chiudi">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="fuel-head">
|
||||
<span>Carburante</span>
|
||||
<span class="fuel-cols">Self · Servito</span>
|
||||
</div>
|
||||
<div class="fuel-list" id="d-fuels"></div>
|
||||
|
||||
<p class="det-meta" id="d-meta"></p>
|
||||
|
||||
<div class="det-actions">
|
||||
<a class="det-nav" id="d-nav" target="_blank" rel="noopener">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 3L3 10.5l6.5 2.5L12 21z"/></svg>
|
||||
Indicazioni
|
||||
</a>
|
||||
<button class="det-icon-btn" id="d-share" aria-label="Condividi impianto">
|
||||
<svg width="19" height="19" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 16V4M8 8l4-4 4 4"/><path d="M5 14v5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="histwrap" id="d-histwrap">
|
||||
<div class="histhead"><span id="d-histlabel">Andamento</span><span id="d-histn"></span></div>
|
||||
<svg id="d-hist" viewBox="0 0 300 44" preserveAspectRatio="none"></svg>
|
||||
</div>
|
||||
|
||||
<p class="shd-note" id="d-note"></p>
|
||||
<button class="shd-skip" id="d-vehicle">Imposta il tuo veicolo</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- setup -->
|
||||
<div class="setup" id="setup">
|
||||
<button class="close" id="setupclose" aria-label="Chiudi">✕</button>
|
||||
<h2>Il tuo veicolo</h2>
|
||||
<p class="lede">Serve a stimare il costo reale del rifornimento: quanto ti costa arrivare all'impianto più economico e quanto costa il pieno.</p>
|
||||
|
||||
<div class="field">
|
||||
<label>Tipo</label>
|
||||
<div class="seg" id="vtype">
|
||||
<button data-v="car" aria-pressed="true">Auto</button>
|
||||
<button data-v="moto" aria-pressed="false">Moto</button>
|
||||
<button data-v="van" aria-pressed="false">Furgone</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="vmodel">Modello (consumo tipico)</label>
|
||||
<select id="vmodel">
|
||||
<option value="">— scelgo a mano —</option>
|
||||
</select>
|
||||
<div class="hintline">Seleziona il modello per riempire il consumo tipico dichiarato.</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>Consumo</label>
|
||||
<input id="vcons" type="text" inputmode="decimal" value="5,8" placeholder="6,0">
|
||||
<div class="seg" style="margin-top:8px" id="vunit">
|
||||
<button data-u="l100" aria-pressed="true">L/100 km</button>
|
||||
<button data-u="kml" aria-pressed="false">km/L</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>Serbatoio</label>
|
||||
<input id="vtank" type="text" inputmode="decimal" value="50" placeholder="50">
|
||||
<div class="hintline">Litri. Serve per il costo del pieno.</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>Prezzo valutato per</label>
|
||||
<div class="seg" id="vmode">
|
||||
<button data-m="0" aria-pressed="true">Servito e self</button>
|
||||
<button data-m="1" aria-pressed="false">Solo self</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="btn primary" id="vsave" style="width:100%;margin-top:6px">Salva</button>
|
||||
<div class="hintline" style="margin-top:12px">I dati restano sul tuo telefono, non vengono inviati da nessuna parte.</div>
|
||||
<div class="hintline" id="insthint"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- filtri -->
|
||||
<div class="modal" id="filters">
|
||||
<div class="modal-box">
|
||||
<div class="modal-head">
|
||||
<h2>Filtri</h2>
|
||||
<button class="xbtn" id="filtersclose" aria-label="Chiudi">✕</button>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="f-fuel">Carburante</label>
|
||||
<select id="f-fuel"></select>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="f-band">Bandiera</label>
|
||||
<select id="f-band"><option value="">Tutte le bandiere</option></select>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="f-prov">Provincia</label>
|
||||
<select id="f-prov"><option value="">Tutte le province</option></select>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="f-common">Comune</label>
|
||||
<input id="f-common" type="text" list="comuni-list" placeholder="Tutti i comuni" autocomplete="off">
|
||||
<datalist id="comuni-list"></datalist>
|
||||
<div class="hintline">Cerca un comune per vedere solo i suoi impianti.</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>Modalità</label>
|
||||
<div class="seg" id="f-mode">
|
||||
<button data-m="0" aria-pressed="true">Servito e self</button>
|
||||
<button data-m="1" aria-pressed="false">Solo self</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="actions" style="margin-top:20px">
|
||||
<button class="btn" id="f-reset">Azzera</button>
|
||||
<button class="btn primary" id="f-apply">Applica</button>
|
||||
</div>
|
||||
<button class="btn" id="f-install" style="width:100%;margin-top:10px;background:transparent;color:var(--ink-3)">Installa l'app sul telefono</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- richiesta posizione -->
|
||||
<div class="modal sheet-modal" id="geoprompt">
|
||||
<div class="shd" role="dialog" aria-labelledby="geo-title">
|
||||
<div class="shd-grab"></div>
|
||||
|
||||
<p class="shd-status"><span class="shd-dot"></span><span id="geo-state">Posizione non attiva</span></p>
|
||||
<h2 id="geo-title">Dove ti trovi?</h2>
|
||||
<p class="lede" id="geo-body">Serve per ordinare i distributori per distanza e calcolare quanto costa il viaggio.</p>
|
||||
|
||||
<ol class="shd-steps" id="geo-steps"></ol>
|
||||
|
||||
<button class="shd-btn" id="geo-on">
|
||||
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="3"/><path d="M12 2.5v3M12 18.5v3M2.5 12h3M18.5 12h3"/></svg>
|
||||
<span id="geo-on-label">Consenti la posizione</span>
|
||||
</button>
|
||||
<button class="shd-btn ghost" id="geo-manual">Scegli un comune</button>
|
||||
<button class="shd-skip" id="geo-skip">Non ora</button>
|
||||
<p class="shd-note" id="geo-note"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- installa app -->
|
||||
<div class="modal sheet-modal" id="install">
|
||||
<div class="shd" role="dialog" aria-labelledby="install-title">
|
||||
<div class="shd-grab"></div>
|
||||
|
||||
<p class="shd-status"><span class="shd-dot"></span><span id="install-state">App non installata</span></p>
|
||||
<h2 id="install-title">Tienila in home</h2>
|
||||
<p class="lede" id="install-body">Si apre a schermo intero e mostra gli ultimi prezzi anche senza rete.</p>
|
||||
|
||||
<ol class="shd-steps" id="install-steps"></ol>
|
||||
|
||||
<button class="shd-btn" id="install-go">Installa l'app</button>
|
||||
<button class="shd-skip" id="install-later">Non ora</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="toast" id="toast"></div>
|
||||
|
||||
|
||||
|
||||
<script src="/static/vendor/leaflet.js"></script>
|
||||
<script src="/static/vendor/protomaps-leaflet.js"></script>
|
||||
<script src="/static/app.js"></script>
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) navigator.serviceWorker.register('/static/sw.js');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue