Benzina Abruzzo: PWA completa (mappa PMTiles, lista a pannello, dettaglio impianto)

This commit is contained in:
Claptrap 2026-11-27 22:14:06 +01:00
commit 176e6acd6f
16 changed files with 3180 additions and 0 deletions

7
.gitignore vendored Normal file
View file

@ -0,0 +1,7 @@
data/*.db
data/*.db-*
static/tiles/*.pmtiles
__pycache__/
*.pyc
.DS_Store
*.log

40
README.md Normal file
View file

@ -0,0 +1,40 @@
# Benzina Abruzzo
PWA per i prezzi dei carburanti in Abruzzo, su open data MIMIT.
**Live:** https://benzina.feedme.work
## Cosa fa
Mappa a tutto schermo (PMTiles vettoriali self-hosted), pannello lista che si apre
a richiesta, dettaglio impianto come bottom sheet con tutti i carburanti, storico
prezzi e costo del pieno calcolato sul veicolo scelto.
## Stack
- `app.py` — server HTTP + API (Python stdlib, nessuna dipendenza), gzip, ETag,
cache in memoria; DB SQLite `data/benzina.db`.
- `index.html`, `static/app.css`, `static/app.js` — frontend vanilla, nessun build.
- `static/vendor/` — Leaflet 1.9.4 + protomaps-leaflet 5.1.0, serviti in locale.
- Service worker `benzina-v17`.
## API
| Endpoint | Descrizione |
|---|---|
| `/api/meta` | province, carburanti, data ultima estrazione |
| `/api/data` | impianti filtrati (`carburante`, `provincia`, `self`, `sort`, `tank`, `cons`) |
| `/api/station?id=` | dettaglio impianto, tutti i carburanti |
| `/api/history?id=` | storico prezzi |
| `/api/comuni` | elenco comuni |
| `/healthz` | stato |
## Dati
Open data MIMIT (`anagrafica_impianti_attivi.csv`, `prezzo_alle_8.csv`),
estrazione giornaliera alle 08:45 UTC via timer systemd. Province AQ, CH, PE, TE.
## Setup
```bash
python3 app.py collect # scarica e importa i dati
python3 app.py # server su 172.18.0.1:2590
```
Le tile vettoriali (`static/tiles/abruzzo.pmtiles`, ~104 MB) non sono nel repo:
si estraggono da build.protomaps.com con `pmtiles extract` (bbox 12.9–14.6 / 41.6–43.0, z0–14).

529
app.py Executable file
View file

@ -0,0 +1,529 @@
#!/usr/bin/env python3
# benzina-abruzzo: prezzi carburanti Abruzzo dagli open data MIMIT.
# Uso: app.py collect | serve [porta] [bind] | stats
import csv
import hashlib
import datetime
import io
import json
import math
import mimetypes
import os
import sqlite3
import sys
import threading
import time
import urllib.request
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from urllib.parse import parse_qs, urlparse
BASE = os.path.dirname(os.path.abspath(__file__))
DB = os.path.join(BASE, 'data', 'benzina.db')
PAGE = os.path.join(BASE, 'index.html')
STATIC = os.path.join(BASE, 'static')
URL_ANA = 'https://www.mimit.gov.it/images/exportCSV/anagrafica_impianti_attivi.csv'
URL_PRE = 'https://www.mimit.gov.it/images/exportCSV/prezzo_alle_8.csv'
PROVINCE = ('AQ', 'CH', 'PE', 'TE')
UA = {'User-Agent': 'Mozilla/5.0 (compatible; benzina-abruzzo/1.1)'}
SCHEMA = [
'''CREATE TABLE IF NOT EXISTS stations(
id INTEGER PRIMARY KEY, gestore TEXT, bandiera TEXT, tipo TEXT, nome TEXT,
indirizzo TEXT, comune TEXT, provincia TEXT, lat REAL, lon REAL)''',
'''CREATE TABLE IF NOT EXISTS prices(
id INTEGER, carburante TEXT, prezzo REAL, self INTEGER, dt_comu TEXT,
collected TEXT, PRIMARY KEY(id, carburante, self, collected))''',
'CREATE INDEX IF NOT EXISTS ix_prices ON prices(carburante, self, collected)',
'''CREATE TABLE IF NOT EXISTS runs(
collected TEXT PRIMARY KEY, source_date TEXT, stations INTEGER, prices INTEGER)''',
]
def conn():
os.makedirs(os.path.dirname(DB), exist_ok=True)
c = sqlite3.connect(DB, timeout=15)
for stmt in SCHEMA:
c.execute(stmt)
return c
def fetch(url):
req = urllib.request.Request(url, headers=UA)
with urllib.request.urlopen(req, timeout=180) as r:
return r.read().decode('utf-8', 'replace')
def rows_of(text):
lines = text.splitlines()
src = ''
if lines and 'Estrazione' in lines[0]:
src = lines[0].replace('Estrazione del ', '').strip()
body = '\n'.join(lines[1:])
return src, list(csv.DictReader(io.StringIO(body), delimiter='|'))
def collect():
c = conn()
src, ana = rows_of(fetch(URL_ANA))
_, pre = rows_of(fetch(URL_PRE))
now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
abruzzo = {}
for r in ana:
if (r.get('Provincia') or '').strip().upper() not in PROVINCE:
continue
try:
i = int(r['idImpianto'])
lat = float(r.get('Latitudine') or 0)
lon = float(r.get('Longitudine') or 0)
except (KeyError, ValueError, TypeError):
continue
abruzzo[i] = (r.get('Gestore', ''), r.get('Bandiera', ''), r.get('Tipo Impianto', ''),
r.get('Nome Impianto', ''), r.get('Indirizzo', ''), r.get('Comune', ''),
(r.get('Provincia') or '').strip().upper(), lat, lon)
c.executemany('INSERT OR REPLACE INTO stations VALUES (?,?,?,?,?,?,?,?,?,?)',
[(i,) + v for i, v in abruzzo.items()])
np = 0
for r in pre:
try:
i = int(r['idImpianto'])
except (KeyError, ValueError, TypeError):
continue
if i not in abruzzo:
continue
try:
pr = float((r.get('prezzo') or '').replace(',', '.'))
except ValueError:
continue
if not (0.5 < pr < 4.0):
continue
c.execute('INSERT OR REPLACE INTO prices VALUES (?,?,?,?,?,?)',
(i, (r.get('descCarburante') or '').strip(), pr,
1 if str(r.get('isSelf')).strip() in ('1', 'True', 'true') else 0,
r.get('dtComu', ''), now))
np += 1
c.execute('INSERT OR REPLACE INTO runs VALUES (?,?,?,?)', (now, src, len(abruzzo), np))
c.commit()
print('collected %s | fonte %s | impianti Abruzzo %d | prezzi %d' % (now, src, len(abruzzo), np))
return len(abruzzo), np
def latest(c):
return c.execute('SELECT MAX(collected) FROM prices').fetchone()[0]
def meta(c):
r = c.execute('SELECT collected, source_date FROM runs ORDER BY collected DESC LIMIT 1').fetchone()
n = c.execute('SELECT COUNT(*) FROM stations').fetchone()[0]
return {'aggiornato': r[0] if r else None, 'fonte': r[1] if r else None, 'impianti': n}
def fuels(c):
return [r[0] for r in c.execute(
'SELECT DISTINCT carburante FROM prices WHERE collected=? ORDER BY 1', (latest(c),))]
def summary(c, fuel, self_only):
sql = ('SELECT s.provincia, COUNT(*), MIN(p.prezzo), AVG(p.prezzo), MAX(p.prezzo) '
'FROM prices p JOIN stations s ON s.id=p.id '
'WHERE p.collected=? AND p.carburante=? ' +
('AND p.self=1 ' if self_only else '') +
'GROUP BY s.provincia ORDER BY s.provincia')
return [{'provincia': r[0], 'impianti': r[1], 'min': round(r[2], 3),
'media': round(r[3], 3), 'max': round(r[4], 3)}
for r in c.execute(sql, (latest(c), fuel))]
def haversine(lat1, lon1, lat2, lon2):
if not lat2 or not lon2:
return None
r = 6371.0
p1, p2 = math.radians(lat1), math.radians(lat2)
dp = p2 - p1
dl = math.radians(lon2 - lon1)
a = math.sin(dp / 2) ** 2 + math.cos(p1) * math.cos(p2) * math.sin(dl / 2) ** 2
return round(2 * r * math.asin(math.sqrt(a)), 2)
def bandiere(c):
return [{'bandiera': r[0], 'n': r[1]} for r in c.execute(
'SELECT bandiera, COUNT(*) FROM stations GROUP BY bandiera ORDER BY COUNT(*) DESC')]
def comuni(c):
return [{'comune': r[0], 'provincia': r[1], 'lat': round(r[2], 5), 'lon': round(r[3], 5), 'n': r[4]}
for r in c.execute('''SELECT comune, provincia, AVG(lat), AVG(lon), COUNT(*)
FROM stations WHERE lat<>0 GROUP BY comune, provincia
ORDER BY comune''')]
# ---------- cache ----------
# I prezzi MIMIT cambiano una volta al giorno: ricalcolare le stesse righe a
# ogni caricamento e' lavoro sprecato. Teniamo le righe base in memoria per
# PRICE_TTL secondi, chiave = (estrazione, carburante, self, provincia, bandiera).
PRICE_TTL = 7200
_CACHE = {}
_CACHE_LOCK = threading.Lock()
def cache_get(key, ttl=None):
t = ttl if ttl is not None else PRICE_TTL
with _CACHE_LOCK:
hit = _CACHE.get(key)
if hit and (time.time() - hit[0]) < t:
return hit[1]
return None
def cache_put(key, val):
with _CACHE_LOCK:
_CACHE[key] = (time.time(), val)
if len(_CACHE) > 200: # anti-crescita: via le voci piu vecchie
for k in sorted(_CACHE, key=lambda k: _CACHE[k][0])[:80]:
_CACHE.pop(k, None)
return val
def cache_clear():
with _CACHE_LOCK:
_CACHE.clear()
def stations(c, fuel, self_only, provincia=None, bandiera=None):
sql = ('SELECT s.id, s.bandiera, s.gestore, s.nome, s.indirizzo, s.comune, s.provincia, '
's.tipo, p.prezzo, p.self, p.dt_comu, s.lat, s.lon '
'FROM prices p JOIN stations s ON s.id=p.id '
'WHERE p.collected=? AND p.carburante=? ' +
('AND p.self=1 ' if self_only else '') +
('AND s.provincia=? ' if provincia else '') +
('AND s.bandiera=? ' if bandiera else '') +
'ORDER BY p.prezzo ASC')
lt = latest(c)
args = [lt, fuel]
if provincia:
args.append(provincia)
if bandiera:
args.append(bandiera)
by = {}
for r in c.execute(sql, args):
sid = r[0]
rec = {'bandiera': r[1], 'gestore': r[2], 'nome': r[3], 'indirizzo': r[4],
'comune': r[5], 'provincia': r[6], 'tipo': r[7], 'dt': r[10],
'lat': r[11], 'lon': r[12], 'prezzi': {}}
rec['prezzi']['self' if r[9] else 'servito'] = round(r[8], 3)
if sid in by:
by[sid]['prezzi'].update(rec['prezzi'])
else:
by[sid] = rec
out = []
for sid, rec in by.items():
pz = rec.pop('prezzi')
cheapest = min(pz.items(), key=lambda kv: kv[1])
rec['id'] = sid
rec['prezzo'] = cheapest[1]
rec['self'] = cheapest[0] == 'self'
rec['p_self'] = pz.get('self')
rec['p_serv'] = pz.get('servito')
out.append(rec)
out.sort(key=lambda r: r['prezzo'])
return out
def stations_cached(c, fuel, self_only, provincia=None, bandiera=None, lt=None):
key = ('st', lt, fuel, self_only, provincia, bandiera)
hit = cache_get(key)
if hit is not None:
return hit
return cache_put(key, stations(c, fuel, self_only, provincia, bandiera))
def history(c, sid, fuel):
return [{'t': r[0], 'p': round(r[1], 3)} for r in c.execute(
'SELECT collected, AVG(prezzo) FROM prices WHERE id=? AND carburante=? '
'GROUP BY collected ORDER BY collected', (sid, fuel))]
def station_detail(c, sid):
'''Tutti i carburanti di un impianto, all'ultima estrazione disponibile.
Serve al pannello di dettaglio: "cosa costa qui" in una schermata.'''
st = c.execute('SELECT id, gestore, bandiera, tipo, nome, indirizzo, comune, '
'provincia, lat, lon FROM stations WHERE id=?', (sid,)).fetchone()
if not st:
return None
last = c.execute('SELECT MAX(collected) FROM prices WHERE id=?', (sid,)).fetchone()[0]
rows = c.execute('SELECT carburante, self, prezzo, dt_comu FROM prices '
'WHERE id=? AND collected=? ORDER BY carburante, self',
(sid, last)).fetchall()
fuels = {}
for carb, selbst, prezzo, dt in rows:
f = fuels.setdefault(carb, {'carburante': carb, 'servito': None,
'self': None, 'dt': dt})
if selbst:
f['self'] = round(prezzo, 3)
else:
f['servito'] = round(prezzo, 3)
return {
'id': st[0], 'gestore': st[1], 'bandiera': st[2], 'tipo': st[3],
'nome': st[4], 'indirizzo': st[5], 'comune': st[6], 'provincia': st[7],
'lat': st[8], 'lon': st[9], 'collected': last,
'fuels': sorted(fuels.values(), key=lambda f: f['carburante']),
}
def province_stats(c, fuel):
return {s['provincia']: s for s in summary(c, fuel, False)}
def stats():
c = conn()
m = meta(c)
print('fonte MIMIT: %s | raccolto: %s | impianti Abruzzo: %d'
% (m['fonte'], m['aggiornato'], m['impianti']))
for f in fuels(c):
print('\n' + f)
for s in summary(c, f, False):
print(' %s: min %.3f media %.3f max %.3f (%d impianti)'
% (s['provincia'], s['min'], s['media'], s['max'], s['impianti']))
class Handler(BaseHTTPRequestHandler):
server_version = 'benzina-abruzzo/1.1'
def log_message(self, *a):
pass
def send(self, code, body, ctype='application/json; charset=utf-8', extra=None):
import gzip as _gzip
b = body.encode('utf-8') if isinstance(body, str) else body
extra = dict(extra or {})
if 'Cache-Control' not in extra:
extra['Cache-Control'] = 'no-store'
ae = self.headers.get('Accept-Encoding', '') or ''
compressible = ('json' in ctype or 'javascript' in ctype or 'css' in ctype
or 'text/' in ctype or 'svg' in ctype)
if compressible and 'gzip' in ae and len(b) > 1400:
b = _gzip.compress(b, 6)
extra['Content-Encoding'] = 'gzip'
extra['Vary'] = 'Accept-Encoding'
self.send_response(code)
self.send_header('Content-Type', ctype)
self.send_header('Content-Length', str(len(b)))
self.send_header('Permissions-Policy', 'geolocation=(self)')
for k, v in extra.items():
self.send_header(k, v)
self.end_headers()
try:
self.wfile.write(b)
except (BrokenPipeError, ConnectionResetError):
pass
def serve_file(self, path):
if not os.path.isfile(path):
return self.send(404, json.dumps({'error': 'not found'}))
ctype = mimetypes.guess_type(path)[0] or 'application/octet-stream'
if path.endswith('.webmanifest'):
ctype = 'application/manifest+json'
if path.endswith('.pmtiles'):
ctype = 'application/vnd.pmtiles'
fname = os.path.basename(path)
cache = 'public, max-age=86400'
if path == PAGE or path.endswith('sw.js'):
cache = 'no-cache'
elif fname in ('index.html',):
cache = 'no-cache'
if path.endswith('.pmtiles'):
cache = 'public, max-age=604800, immutable'
size = os.path.getsize(path)
# --- Range requests: indispensabili per PMTiles (lettura a blocchi) ---
rng = self.headers.get('Range')
start, end = 0, size - 1
partial = False
if rng and rng.startswith('bytes='):
try:
spec = rng.split('=', 1)[1].split(',')[0].strip()
a_, _, b_ = spec.partition('-')
if a_:
start = int(a_)
if b_:
end = int(b_)
elif b_:
start = max(0, size - int(b_))
end = min(end, size - 1)
if start > end or start >= size:
self.send_response(416)
self.send_header('Content-Range', 'bytes */%d' % size)
self.send_header('Content-Length', '0')
self.end_headers()
return
partial = True
except Exception:
start, end, partial = 0, size - 1, False
length = end - start + 1
self.send_response(206 if partial else 200)
self.send_header('Content-Type', ctype)
self.send_header('Content-Length', str(length))
self.send_header('Cache-Control', cache)
self.send_header('Accept-Ranges', 'bytes')
self.send_header('Permissions-Policy', 'geolocation=(self)')
if partial:
self.send_header('Content-Range', 'bytes %d-%d/%d' % (start, end, size))
self.end_headers()
remaining = length
with open(path, 'rb') as f:
f.seek(start)
while remaining > 0:
chunk = f.read(min(65536, remaining))
if not chunk:
break
try:
self.wfile.write(chunk)
except (BrokenPipeError, ConnectionResetError):
return
remaining -= len(chunk)
def api_data(self, c, g):
lt = latest(c)
fuel = g('carburante', 'Benzina')
prov = (g('provincia') or '').upper() or None
self_only = g('self', '0') == '1'
band = g('bandiera') or None
try:
ulat = float(g('lat')) if g('lat') else None
ulon = float(g('lon')) if g('lon') else None
except ValueError:
ulat = ulon = None
sort = g('sort', 'price')
try:
tank = float(g('tank', '50') or 50)
except ValueError:
tank = 50.0
try:
cons = float((g('cons', '5.8') or '5.8').replace(',', '.'))
except ValueError:
cons = 5.8
lim = int(g('limit', '800') or 800)
# 1) righe base in cache per 2 ore (dipendono dall'estrazione)
rows = stations_cached(c, fuel, self_only, prov, band, lt)
# 2) risposta gia' calcolata per questa combinazione esatta
lat_r = round(ulat, 3) if ulat is not None else None
lon_r = round(ulon, 3) if ulon is not None else None
rkey = ('resp', lt, fuel, self_only, prov, band, sort,
lat_r, lon_r, round(tank, 1), round(cons, 2), lim)
cached = cache_get(rkey)
if cached is not None:
body, etag = cached
inm = self.headers.get('If-None-Match')
if inm and inm == etag:
self.send_response(304)
self.send_header('ETag', etag)
self.send_header('Cache-Control', 'public, max-age=600')
self.end_headers()
return
return self.send(200, body, extra={
'Cache-Control': 'public, max-age=600, stale-while-revalidate=3600',
'ETag': etag})
# 3) calcolo (copia, per non sporcare la cache con km/costi)
rows = [dict(r) for r in rows]
if ulat is not None and ulon is not None:
for r in rows:
r['km'] = haversine(ulat, ulon, r['lat'], r['lon'])
if sort == 'dist' and ulat is not None:
rows.sort(key=lambda r: (r['km'] if r['km'] is not None else 9999, r['prezzo']))
elif sort == 'value' and ulat is not None:
for r in rows:
k = r['km'] or 0
litres = min(k, 60) * 2 * cons / 100.0
r['costo_pieno'] = round(r['prezzo'] * tank, 2)
r['costo_viaggio'] = round(litres * r['prezzo'], 2)
r['costo_totale'] = round(r['costo_pieno'] + r['costo_viaggio'], 2)
rows.sort(key=lambda r: r['costo_totale'])
body = json.dumps({
'meta': meta(c), 'carburante': fuel, 'self': self_only,
'summary': summary(c, fuel, self_only),
'user': {'lat': ulat, 'lon': ulon},
'cheapest': rows[:lim]})
etag = '"%s"' % hashlib.md5(body.encode('utf-8')).hexdigest()[:16]
cache_put(rkey, (body, etag))
return self.send(200, body, extra={
'Cache-Control': 'public, max-age=600, stale-while-revalidate=3600',
'ETag': etag})
def do_GET(self):
u = urlparse(self.path)
qs = parse_qs(u.query)
def g(k, d=None):
return (qs.get(k) or [d])[0]
try:
if u.path in ('/', '/index.html'):
return self.serve_file(PAGE)
if u.path.startswith('/static/'):
safe = os.path.normpath(u.path.lstrip('/'))
if not safe.startswith('static'):
return self.send(403, json.dumps({'error': 'forbidden'}))
return self.serve_file(os.path.join(BASE, safe))
if u.path == '/healthz':
return self.send(200, json.dumps({'status': 'ok'}))
c = conn()
if u.path == '/api/meta':
mk = ('meta', latest(c), g('carburante', 'Benzina'))
hitc = cache_get(mk)
if hitc is None:
hitc = cache_put(mk, json.dumps({
'meta': meta(c), 'carburanti': fuels(c),
'province': list(PROVINCE),
'province_stats': province_stats(c, g('carburante', 'Benzina')),
'bandiere': bandiere(c)}))
return self.send(200, hitc, extra={
'Cache-Control': 'public, max-age=1800, stale-while-revalidate=7200'})
if u.path == '/api/data':
return self.api_data(c, g)
if u.path == '/api/comuni':
ck = ('comuni',)
hitc = cache_get(ck, 86400)
if hitc is None:
hitc = cache_put(ck, json.dumps(comuni(c)))
return self.send(200, hitc, extra={
'Cache-Control': 'public, max-age=86400'})
if u.path == '/api/station':
sid = int(g('id', '0'))
ck = ('station', sid)
hitc = cache_get(ck, 7200)
if hitc is None:
d = station_detail(c, sid)
if d is None:
return self.send(404, json.dumps({'error': 'impianto sconosciuto'}))
hitc = cache_put(ck, json.dumps(d))
return self.send(200, hitc, extra={
'Cache-Control': 'public, max-age=1800, stale-while-revalidate=7200'})
if u.path == '/api/history':
return self.send(200, json.dumps(history(c, int(g('id', '0')),
g('carburante', 'Benzina'))))
return self.send(404, json.dumps({'error': 'not found'}))
except Exception as e:
return self.send(500, json.dumps({'error': str(e)}))
def serve(port=2590, bind='172.18.0.1'):
ThreadingHTTPServer.allow_reuse_address = True
with ThreadingHTTPServer((bind, port), Handler) as httpd:
print('benzina-abruzzo su %s:%d' % (bind, port), flush=True)
httpd.serve_forever()
if __name__ == '__main__':
cmd = sys.argv[1] if len(sys.argv) > 1 else 'stats'
if cmd == 'collect':
collect()
elif cmd == 'serve':
serve(int(sys.argv[2]) if len(sys.argv) > 2 else 2590,
sys.argv[3] if len(sys.argv) > 3 else '172.18.0.1')
else:
stats()

259
index.html Normal file
View 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 &nbsp;·&nbsp; 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&#39;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>

369
static/app.css Normal file
View file

@ -0,0 +1,369 @@
:root{
--bg:#FBF9F6; --surface:#FFFFFF; --surface-2:#F4F1EC;
--ink:#14181C; --ink-2:#5A6570; --ink-3:#98A2AC;
--brand:#0B7A5A; --brand-2:#0E9C73; --brand-soft:#E4F3ED;
--cheap:#0B7A5A; --mid:#C08A1E; --pricey:#C24A38;
--accent:#E19A2B;
--line:#E7E3DC;
--safe-b:env(safe-area-inset-bottom,0px);
--safe-t:env(safe-area-inset-top,0px);
}
@media (prefers-color-scheme:dark){
:root{
--bg:#0E1114; --surface:#171C21; --surface-2:#1F262C;
--ink:#EEF2F5; --ink-2:#A3AEB8; --ink-3:#6B7883;
--brand:#25B98C; --brand-2:#2FD39F; --brand-soft:#123028;
--cheap:#2FD39F; --mid:#E2B352; --pricey:#E87461;
--line:#262E35;
}
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
margin:0;background:var(--bg);color:var(--ink);
font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,sans-serif;
overscroll-behavior-y:none;
}
button,select,input{font:inherit;color:inherit}
button{border:0;background:none;cursor:pointer}
a{color:var(--brand);text-decoration:none}
/* ============================================================
LAYOUT — la mappa occupa tutto. La lista e' un pannello che si
apre solo se lo chiedi. Riferimenti: Apple Maps e Waze (controlli
in capsule, nessun pannello permanente) e i pattern di Mobbin per
le liste di luoghi (una riga per item, prezzo a destra).
============================================================ */
.app{height:100dvh;display:flex;flex-direction:column;overflow:hidden;position:relative}
#map{position:absolute;inset:0;z-index:0;background:var(--surface-2)}
.map-wrap{position:relative;flex:1;min-height:0}
.leaflet-container{background:var(--surface-2);font:inherit}
.leaflet-control-attribution{
font-size:9px;opacity:.5;background:transparent!important;
padding:0 4px!important;bottom:0!important;right:0!important;
}
/* ---------- barra superiore ---------- */
.topbar{
position:absolute;top:calc(10px + var(--safe-t));left:10px;right:10px;z-index:600;
display:flex;gap:8px;align-items:center;pointer-events:none;
}
.topbar>*{pointer-events:auto}
.pill{
display:flex;align-items:center;gap:7px;height:42px;padding:0 14px;
background:var(--surface);
font-size:14px;font-weight:650;white-space:nowrap;color:var(--ink);
}
.pill.round{width:42px;padding:0;justify-content:center;position:relative}
.pill.brand{font-size:15px;letter-spacing:-.01em}
.pill.brand svg{color:var(--brand)}
#filterchip,#vbtn{margin-left:auto}
#filterchip+#vbtn{margin-left:0}
.badge-dot{
position:absolute;top:-2px;right:-2px;min-width:17px;height:17px;padding:0 5px;
background:var(--brand);color:#fff;
font-size:10.5px;font-weight:800;display:none;align-items:center;justify-content:center;
}
.badge-dot.on{display:flex}
.pill:active{background:var(--surface-2)}
/* ---------- chips ordinamento ---------- */
.chips{
position:absolute;top:calc(60px + var(--safe-t));left:10px;right:10px;z-index:600;
display:flex;gap:7px;padding:0 0 4px;overflow-x:auto;scrollbar-width:none;
}
.chips::-webkit-scrollbar{display:none}
.chip{
flex:0 0 auto;height:32px;padding:0 13px;background:var(--surface);color:var(--ink-2);
font-size:13px;font-weight:600;display:flex;align-items:center;
transition:background .15s,color .15s;
}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
/* ---------- comandi in basso a destra ---------- */
.fab-stack{
position:absolute;right:10px;bottom:calc(14px + var(--safe-b));z-index:600;
display:flex;flex-direction:column;gap:9px;align-items:flex-end;
transition:opacity .22s ease,transform .22s ease;
}
/* con la lista aperta i comandi spariscono: la lista e' il contesto */
.app.sheet-open .fab-stack{opacity:0;pointer-events:none;transform:translateY(8px)}
.fab{width:44px;height:44px}
.fab.on{background:var(--brand);color:#fff}
.btn-list{
display:flex;align-items:center;gap:8px;height:46px;padding:0 18px 0 15px;
background:var(--ink);color:var(--bg);
font-size:14.5px;font-weight:650;letter-spacing:-.01em;
}
.btn-list:active{transform:scale(.97)}
/* ============================================================
PANNELLO LISTA — chiuso per default, si apre dal pulsante
============================================================ */
.sheet{
position:absolute;left:0;right:0;bottom:0;z-index:700;
background:var(--bg);
display:flex;flex-direction:column;
height:min(74dvh,620px);
padding-bottom:var(--safe-b);
transform:translateY(102%);visibility:hidden;
transition:transform .3s cubic-bezier(.32,.72,0,1),visibility .3s;
}
.sheet.open{transform:none;visibility:visible}
.grab{width:100%;padding:10px 0 2px;display:flex;justify-content:center;flex:0 0 auto}
.grab span{width:34px;height:4px;border-radius:99px;background:var(--ink-3);opacity:.3}
.sheet-head{
padding:6px 16px 10px;display:flex;align-items:flex-start;
justify-content:space-between;gap:12px;flex:0 0 auto;
}
.sheet-head h2{font-size:19px;margin:0;letter-spacing:-.022em;font-weight:700}
.sheet-head .sub{font-size:12.5px;color:var(--ink-3);font-weight:500;margin-top:1px}
.icon-btn{
width:32px;height:32px;border-radius:50%;background:var(--surface-2);
display:flex;align-items:center;justify-content:center;color:var(--ink-2);flex:0 0 auto;
}
.list{flex:1;overflow-y:auto;padding:0 8px 8px;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.list.empty{display:flex;align-items:center;justify-content:center;color:var(--ink-3);font-size:14px;padding:30px}
.footline{padding:8px 16px calc(6px + var(--safe-b));font-size:11px;color:var(--ink-3);font-weight:500;
border-top:1px solid var(--line);flex:0 0 auto}
/* ---------- riga impianto: una linea, prezzo a destra ---------- */
.card{
display:flex;align-items:center;gap:12px;
padding:11px 10px;transition:background .15s;cursor:pointer;
}
.card+.card{border-top:1px solid var(--line);}
.card:active,.card.sel{background:var(--surface-2)}
.card .dot{
width:9px;height:9px;border-radius:50%;flex:0 0 auto;background:var(--ink-3);
box-shadow:0 0 0 3px color-mix(in srgb,var(--ink-3) 14%,transparent);
}
.card .dot.c-cheap{background:var(--cheap);box-shadow:0 0 0 3px color-mix(in srgb,var(--cheap) 16%,transparent)}
.card .dot.c-mid{background:var(--mid);box-shadow:0 0 0 3px color-mix(in srgb,var(--mid) 16%,transparent)}
.card .dot.c-pricey{background:var(--pricey);box-shadow:0 0 0 3px color-mix(in srgb,var(--pricey) 16%,transparent)}
.card .body{flex:1;min-width:0}
.card .brand{
font-size:14.5px;font-weight:600;letter-spacing:-.012em;
white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.card .sub{
font-size:12.5px;color:var(--ink-3);margin-top:1px;
white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.card .sub .d{color:var(--ink-2);font-weight:600}
.card .right{display:flex;flex-direction:column;align-items:flex-end;flex:0 0 auto}
.card .price{
font-size:16.5px;font-weight:700;letter-spacing:-.022em;
font-variant-numeric:tabular-nums;line-height:1.15;
}
.card .per{font-size:10.5px;color:var(--ink-3);font-weight:600;letter-spacing:.03em;text-transform:uppercase}
.c-cheap{color:var(--cheap)} .c-mid{color:var(--mid)} .c-pricey{color:var(--pricey)}
.dist{color:var(--ink-3);font-size:12px;font-weight:600}
/* ============================================================
DETTAGLIO — il pannello che risponde a "cosa costa qui".
Non un cruscotto: una tabella di prezzi leggibile, un pulsante.
============================================================ */
.modal.sheet-modal#detail{align-items:flex-end;padding:0;overflow:hidden}
#detail .det{
width:100%;max-height:min(90dvh,700px);overflow-y:auto;overscroll-behavior:contain;
background:var(--bg);padding:6px 18px calc(18px + var(--safe-b));
animation:sheetUp .3s cubic-bezier(.32,.72,0,1);
}
.det-head{display:flex;align-items:flex-start;gap:12px;margin-bottom:16px}
.det-title{flex:1;min-width:0}
.det-x{
width:32px;height:32px;border-radius:50%;background:var(--surface-2);flex:0 0 auto;
display:flex;align-items:center;justify-content:center;color:var(--ink-2);margin-top:2px;
}
#detail h2{
font-size:19px;line-height:1.28;letter-spacing:-.022em;margin:0;font-weight:700;
overflow-wrap:anywhere;
}
.det-addr{font-size:13px;line-height:1.4;color:var(--ink-3);margin:3px 0 0;overflow-wrap:anywhere}
/* tabella carburanti: nome a sinistra, self e servito incolonnati */
.fuel-head{
display:flex;justify-content:space-between;align-items:baseline;
font-size:10.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
color:var(--ink-3);padding:0 2px 7px;border-bottom:1px solid var(--line);
}
.fuel-list{display:flex;flex-direction:column}
.fuel-row{
display:flex;align-items:baseline;gap:10px;
padding:11px 2px;border-bottom:1px solid var(--line);
}
.fuel-row:last-child{border-bottom:0}
.fuel-row .fname{flex:1;min-width:0;font-size:14.5px;font-weight:600;letter-spacing:-.012em}
.fuel-row .fv{
font-size:14.5px;font-weight:650;font-variant-numeric:tabular-nums;
min-width:56px;text-align:right;letter-spacing:-.015em;
}
.fuel-row .fv.empty{color:var(--ink-3);font-weight:500}
.fuel-row.main{background:var(--brand-soft);margin:0 -8px;padding:11px 10px;border-bottom:0}
.fuel-row.main .fname{font-weight:700;color:var(--brand)}
.det-meta{font-size:11.5px;color:var(--ink-3);margin:12px 0 16px;line-height:1.45}
.det-actions{display:flex;gap:9px;margin-bottom:16px}
.det-nav{
flex:1;height:50px;background:var(--brand);color:#fff;
display:flex;align-items:center;justify-content:center;gap:8px;
font-size:15.5px;font-weight:650;letter-spacing:-.01em;
}
.det-nav:active{opacity:.9}
.det-icon-btn{
width:50px;height:50px;background:var(--surface-2);
display:flex;align-items:center;justify-content:center;color:var(--ink);flex:0 0 auto;
}
.histwrap{background:var(--surface-2);padding:10px 12px;margin-bottom:12px}
.histhead{
font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;color:var(--ink-3);
font-weight:700;margin-bottom:6px;display:flex;justify-content:space-between;
}
#d-hist{width:100%;height:44px;display:block;overflow:visible}
#d-hist polyline{fill:none;stroke:var(--brand);stroke-width:2;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}
#d-hist polygon{fill:var(--brand);opacity:.10}
#d-hist circle{fill:var(--brand);r:2.2}
#d-hist text{font-size:8px;fill:var(--ink-3);font-weight:600}
/* ---------- setup sheet ---------- */
.setup{display:none;position:fixed;inset:0;z-index:950;background:var(--bg);overflow-y:auto;
padding:calc(20px + var(--safe-t)) 20px calc(28px + var(--safe-b));
overscroll-behavior:contain}
.setup.open{display:block}
.setup h2{font-size:22px;margin:8px 0 6px;letter-spacing:-.02em}
.setup p.lede{color:var(--ink-2);font-size:14px;margin:0 0 20px}
.field{margin-bottom:16px}
.field label{display:block;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--ink-3);margin-bottom:7px}
.field input,.field select{
width:100%;height:52px;padding:0 14px;background:var(--surface-2);
font-size:16px;
}
.hintline{font-size:12px;color:var(--ink-3);margin-top:6px}
.seg{display:flex;background:var(--surface-2);padding:4px;gap:4px}
.seg button{flex:1;height:44px;font-weight:600;font-size:14px;color:var(--ink-2)}
.seg button[aria-pressed="true"]{background:var(--bg);color:var(--ink)}
/* ---------- misc ---------- */
.toast{
position:fixed;left:50%;bottom:calc(26px + var(--safe-b));transform:translate(-50%,20px);
background:var(--ink);color:var(--bg);padding:11px 18px;font-size:13.5px;font-weight:600;
opacity:0;pointer-events:none;transition:.25s;z-index:1000;max-width:88vw;text-align:center;
}
.toast.show{opacity:1;transform:translate(-50%,0)}
.skel{height:74px;background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface) 50%,var(--surface-2) 75%);
background-size:200% 100%;animation:sh 1.3s infinite;margin-bottom:6px}
@keyframes sh{0%{background-position:200% 0}100%{background-position:-200% 0}}
.mk{width:30px;height:30px;border-radius:50%;background:var(--brand);color:#fff;border:2.5px solid #fff;
box-shadow:0 2px 8px rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center;
font-size:11px;font-weight:800;font-variant-numeric:tabular-nums}
.mk.cheap{background:var(--cheap)} .mk.mid{background:var(--brand)} .mk.pricey{background:var(--pricey)}
.mk.user{background:#2E7DF6;width:16px;height:16px;border-width:3px}
@media (min-width:820px){
.sheet{
left:auto;right:16px;bottom:16px;width:400px;
height:min(72dvh,640px);transform:translateX(112%);
}
.sheet.open{transform:none}
.fab-stack{bottom:16px;transition:right .3s cubic-bezier(.32,.72,0,1),opacity .2s}
.app.sheet-open .fab-stack{opacity:1;pointer-events:auto;transform:none}
.app.sheet-open .fab-stack{right:432px}
.modal.sheet-modal#detail{align-items:flex-end}
}
/* ---------- modali ---------- */
.modal{
position:fixed;inset:0;z-index:980;display:none;
background:rgba(20,24,28,.42);backdrop-filter:blur(3px);
padding:16px;overflow-y:auto;
}
.modal.open{display:flex;align-items:flex-start;justify-content:center}
/* margin-top:auto spinge il box in basso ma, se e' piu' alto dello schermo,
il margine collassa a 0 e il contenuto resta raggiungibile in cima (niente
taglio del titolo su iPhone SE). Niente align-items:flex-end, che creerebbe
overflow non scrollabile. */
.modal-box{margin-top:auto}
@media(min-width:640px){.modal-box{margin-top:auto;margin-bottom:auto}}
.modal-box{
width:100%;max-width:440px;background:var(--bg);padding:20px 20px calc(20px + var(--safe-b));
animation:up .25s cubic-bezier(.32,.72,0,1);
}
@keyframes up{from{transform:translateY(24px);opacity:.6}to{transform:none;opacity:1}}
.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.modal-head h2{font-size:20px;margin:0;letter-spacing:-.02em}
.xbtn{width:36px;height:36px;border-radius:50%;background:var(--surface-2);display:flex;align-items:center;justify-content:center;font-size:15px}
.geolook{width:72px;height:72px;border-radius:50%;background:var(--brand-soft);color:var(--brand);
display:flex;align-items:center;justify-content:center;margin:4px auto 14px}
.modal-box h2{text-align:center}
.modal-box .lede{text-align:center}
.modal-box .field label{text-align:left}
.modal-box .btn{height:50px}
/* ============================================================
SHEET D'AVVISO — una sola grammatica per GPS e installazione
Riferimenti: sheet di Apple Maps (grabber, stato, azione singola)
e HIG iOS (pre-prompt con beneficio, non con il nome del permesso).
Niente icone giganti, niente gradienti: tipografia e spazi.
============================================================ */
.modal.sheet-modal{align-items:flex-end;padding:0;overflow:hidden}
.sheet-modal .shd{
width:100%;max-width:520px;margin:auto auto 0;background:var(--surface);
padding:10px 22px calc(22px + var(--safe-b));
animation:sheetUp .32s cubic-bezier(.32,.72,0,1);
}
@keyframes sheetUp{from{transform:translateY(100%)}to{transform:none}}
.shd-grab{width:36px;height:4px;border-radius:99px;background:var(--ink-3);opacity:.28;margin:0 auto 18px}
.shd-status{
display:flex;align-items:center;gap:7px;margin:0 0 10px;
font-size:11.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--ink-3);
}
.shd-dot{width:6px;height:6px;border-radius:50%;background:var(--ink-3);flex:none}
.shd-status.ok .shd-dot{background:var(--brand)}
.shd-status.bad .shd-dot{background:var(--pricey)}
.shd-status.wait .shd-dot{background:var(--mid);animation:blink 1.1s steps(2,start) infinite}
@keyframes blink{50%{opacity:.25}}
.shd h2{
font-size:24px;line-height:1.22;letter-spacing:-.026em;font-weight:700;
margin:0 0 8px;text-align:left;
}
.shd .lede{font-size:14.5px;line-height:1.5;color:var(--ink-2);margin:0 0 20px;text-align:left}
.shd-steps{list-style:none;margin:0 0 20px;padding:0;display:flex;flex-direction:column;gap:0}
.shd-steps:empty{display:none}
.shd-steps li{display:flex;gap:13px;align-items:flex-start;padding:11px 0;border-top:1px solid var(--line)}
.shd-steps li:first-child{border-top:0;padding-top:0}
.shd-steps .k{
flex:none;width:24px;height:24px;background:var(--surface-2);
display:flex;align-items:center;justify-content:center;
font-size:11.5px;font-weight:700;color:var(--ink-2);
}
.shd-steps .v{font-size:14px;line-height:1.42;color:var(--ink-2);padding-top:2px}
.shd-steps .v b{color:var(--ink);font-weight:600}
.shd-btn{
width:100%;height:50px;background:var(--ink);color:var(--bg);
font-size:15.5px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:8px;
transition:transform .12s ease,opacity .12s ease;
}
.shd-btn:active{transform:scale(.985);opacity:.9}
.shd-btn[disabled]{opacity:.4}
.shd-btn.ghost{background:var(--surface-2);color:var(--ink);margin-top:8px}
.shd-skip{
display:block;width:100%;margin-top:6px;padding:13px 8px 4px;
font-size:14px;font-weight:500;color:var(--ink-3);
}
.shd-note{font-size:12.5px;line-height:1.45;color:var(--ink-3);margin:8px 0 0;text-align:left}
.shd-note:empty{display:none}
@media (prefers-color-scheme:dark){
.shd-btn{background:var(--brand);color:#06231B}
}
@media(min-width:640px){
.modal.sheet-modal{align-items:center;padding:20px;overflow-y:auto}
.sheet-modal .shd{margin:auto;padding-bottom:22px;animation:up .25s cubic-bezier(.32,.72,0,1)}
.shd-grab{display:none}
.shd h2{font-size:22px}
}
@media (prefers-reduced-motion: reduce){
.sheet-modal .shd{animation:none}
.shd-status.wait .shd-dot{animation:none}
.shd-btn:active{transform:none}
}

1225
static/app.js Normal file

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

BIN
static/icons/favicon-32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/icons/icon-192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
static/icons/icon-512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View file

@ -0,0 +1,22 @@
{
"name": "Benzina Abruzzo — prezzi carburanti",
"short_name": "Benzina",
"description": "Prezzi dei carburanti in Abruzzo dagli open data MIMIT: impianto piu economico vicino a te, navigazione e costo del pieno.",
"start_url": "/?src=pwa",
"scope": "/",
"display": "standalone",
"orientation": "portrait",
"background_color": "#FBF9F6",
"theme_color": "#0B7A5A",
"lang": "it",
"categories": ["travel", "navigation", "utilities"],
"icons": [
{"src": "/static/icons/icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any"},
{"src": "/static/icons/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any"},
{"src": "/static/icons/maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable"}
],
"shortcuts": [
{"name": "Vicino a me", "url": "/?view=near"},
{"name": "Piu economici", "url": "/?view=cheap"}
]
}

39
static/sw.js Normal file
View file

@ -0,0 +1,39 @@
const V = 'benzina-v17';
const SHELL = [
'/', '/static/app.css', '/static/app.js', '/static/manifest.webmanifest',
'/static/icons/apple-touch-icon.png', '/static/icons/favicon-32.png',
'/static/icons/icon-192.png', '/static/icons/icon-512.png'
];
self.addEventListener('install', e => {
e.waitUntil(caches.open(V).then(c => c.addAll(SHELL)).then(() => self.skipWaiting()));
});
self.addEventListener('activate', e => {
e.waitUntil(
caches.keys().then(keys => Promise.all(keys.filter(k => k !== V).map(k => caches.delete(k))))
.then(() => self.clients.claim())
);
});
// HTML, JS, CSS: prima la rete (cosi un deploy si vede subito), cache solo se offline.
function networkFirst(req) {
return fetch(req, { cache: 'no-store' }).then(r => {
const copy = r.clone();
caches.open(V).then(c => c.put(req, copy));
return r;
}).catch(() => caches.match(req).then(m => m || caches.match('/')));
}
self.addEventListener('fetch', e => {
const url = new URL(e.request.url);
if (e.request.method !== 'GET') return;
if (url.origin !== location.origin) return;
// Le API hanno la loro cache (server: 2h in memoria + ETag; client: snapshot
// in localStorage con revalidation condizionale). Il SW non ci mette mano.
if (url.pathname.startsWith('/api/')) return;
if (url.pathname === '/static/sw.js') return;
e.respondWith(networkFirst(e.request));
});

661
static/vendor/leaflet.css vendored Normal file
View file

@ -0,0 +1,661 @@
/* required styles */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
image-rendering: -webkit-optimize-contrast;
}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
width: 1600px;
height: 1600px;
-webkit-transform-origin: 0 0;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg {
max-width: none !important;
max-height: none !important;
}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
max-width: none !important;
max-height: none !important;
width: auto;
padding: 0;
}
.leaflet-container img.leaflet-tile {
/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
mix-blend-mode: plus-lighter;
}
.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
}
.leaflet-container.leaflet-touch-drag {
-ms-touch-action: pinch-zoom;
/* Fallback for FF which doesn't support pinch-zoom */
touch-action: none;
touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
-ms-touch-action: none;
touch-action: none;
}
.leaflet-container {
-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
z-index: 800;
}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
-moz-user-select: none;
}
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
/* control positioning */
.leaflet-control {
position: relative;
z-index: 800;
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-animated {
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
}
svg.leaflet-zoom-animated {
will-change: transform;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
-webkit-transition: none;
-moz-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-interactive {
cursor: pointer;
}
.leaflet-grab {
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
cursor: crosshair;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
pointer-events: none;
}
.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
/* visual tweaks */
.leaflet-container {
background: #ddd;
outline-offset: 1px;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255,255,255,0.5);
}
/* general typography */
.leaflet-container {
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
font-size: 12px;
font-size: 0.75rem;
line-height: 1.5;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
border-radius: 4px;
}
.leaflet-bar a {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar a:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar a.leaflet-disabled {
cursor: default;
background-color: #f4f4f4;
color: #bbb;
}
.leaflet-touch .leaflet-bar a {
width: 30px;
height: 30px;
line-height: 30px;
}
.leaflet-touch .leaflet-bar a:first-child {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.leaflet-touch .leaflet-bar a:last-child {
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
/* zoom control */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px;
}
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
font-size: 22px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
background: #fff;
border-radius: 5px;
}
.leaflet-control-layers-toggle {
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(images/layers-2x.png);
background-size: 26px 26px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-scrollbar {
overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
font-size: 13px;
font-size: 1.08333em;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
background-image: url(images/marker-icon.png);
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.8);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
line-height: 1.4;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
text-decoration: underline;
}
.leaflet-attribution-flag {
display: inline !important;
vertical-align: baseline !important;
width: 1em;
height: 0.6669em;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
white-space: nowrap;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: rgba(255, 255, 255, 0.8);
text-shadow: 1px 1px #fff;
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
border: 2px solid rgba(0,0,0,0.2);
background-clip: padding-box;
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
margin-bottom: 20px;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 24px 13px 20px;
line-height: 1.3;
font-size: 13px;
font-size: 1.08333em;
min-height: 1px;
}
.leaflet-popup-content p {
margin: 17px 0;
margin: 1.3em 0;
}
.leaflet-popup-tip-container {
width: 40px;
height: 20px;
position: absolute;
left: 50%;
margin-top: -1px;
margin-left: -20px;
overflow: hidden;
pointer-events: none;
}
.leaflet-popup-tip {
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
pointer-events: auto;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
background: white;
color: #333;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
border: none;
text-align: center;
width: 24px;
height: 24px;
font: 16px/24px Tahoma, Verdana, sans-serif;
color: #757575;
text-decoration: none;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
color: #585858;
}
.leaflet-popup-scrolled {
overflow: auto;
}
.leaflet-oldie .leaflet-popup-content-wrapper {
-ms-zoom: 1;
}
.leaflet-oldie .leaflet-popup-tip {
width: 24px;
margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
border: 1px solid #999;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}
/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
position: absolute;
padding: 6px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 3px;
color: #222;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.leaflet-tooltip.leaflet-interactive {
cursor: pointer;
pointer-events: auto;
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
position: absolute;
pointer-events: none;
border: 6px solid transparent;
background: transparent;
content: "";
}
/* Directions */
.leaflet-tooltip-bottom {
margin-top: 6px;
}
.leaflet-tooltip-top {
margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
left: 50%;
margin-left: -6px;
}
.leaflet-tooltip-top:before {
bottom: 0;
margin-bottom: -12px;
border-top-color: #fff;
}
.leaflet-tooltip-bottom:before {
top: 0;
margin-top: -12px;
margin-left: -6px;
border-bottom-color: #fff;
}
.leaflet-tooltip-left {
margin-left: -6px;
}
.leaflet-tooltip-right {
margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
top: 50%;
margin-top: -6px;
}
.leaflet-tooltip-left:before {
right: 0;
margin-right: -12px;
border-left-color: #fff;
}
.leaflet-tooltip-right:before {
left: 0;
margin-left: -12px;
border-right-color: #fff;
}
/* Printing */
@media print {
/* Prevent printers from removing background-images of controls. */
.leaflet-control {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}

6
static/vendor/leaflet.js vendored Normal file

File diff suppressed because one or more lines are too long

23
static/vendor/protomaps-leaflet.js vendored Normal file

File diff suppressed because one or more lines are too long