feat: introduce dark theme styling for the web UI and a module for weather data sources.
This commit is contained in:
@@ -707,8 +707,12 @@ class WeatherDataCollector:
|
|||||||
ids_str = ",".join(icaos)
|
ids_str = ",".join(icaos)
|
||||||
# AviationWeather API 支持批量请求 IDs
|
# AviationWeather API 支持批量请求 IDs
|
||||||
url = f"https://aviationweather.gov/api/data/metar?ids={ids_str}&format=json"
|
url = f"https://aviationweather.gov/api/data/metar?ids={ids_str}&format=json"
|
||||||
resp = self.session.get(url, timeout=self.timeout)
|
headers = {
|
||||||
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
|
||||||
|
}
|
||||||
|
resp = self.session.get(url, headers=headers, timeout=self.timeout)
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
|
logger.warning(f"METAR cluster fetch HTTP {resp.status_code} for {icaos}")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
data = resp.json()
|
data = resp.json()
|
||||||
@@ -1377,7 +1381,7 @@ class WeatherDataCollector:
|
|||||||
# 后面可以扩展更多土耳其城市,只需在这里添加映射
|
# 后面可以扩展更多土耳其城市,只需在这里添加映射
|
||||||
turkish_provinces = {
|
turkish_provinces = {
|
||||||
"ankara": ("17130", "Ankara"), # (主测站ID, 省份名用于周边)
|
"ankara": ("17130", "Ankara"), # (主测站ID, 省份名用于周边)
|
||||||
# "istanbul": ("17060", "Istanbul"),
|
"istanbul": ("17060", "Istanbul"),
|
||||||
}
|
}
|
||||||
|
|
||||||
if city_lower in turkish_provinces:
|
if city_lower in turkish_provinces:
|
||||||
|
|||||||
+30
-9
@@ -825,16 +825,37 @@ body {
|
|||||||
|
|
||||||
/* ── Nearby Markers ── */
|
/* ── Nearby Markers ── */
|
||||||
.nearby-marker {
|
.nearby-marker {
|
||||||
background: rgba(30, 41, 59, 0.85); /* 暗夜蓝透明背景 */
|
background: rgba(15, 23, 42, 0.85); /* 深蓝玻璃背景 */
|
||||||
color: #94a3b8; /* 灰白字体 */
|
color: var(--accent-cyan); /* 亮青色 */
|
||||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
border: 1px solid rgba(34, 211, 238, 0.3); /* 青色边框 */
|
||||||
border-radius: 12px;
|
border-radius: 6px;
|
||||||
padding: 2px 6px;
|
padding: 3px 8px;
|
||||||
font-size: 11px; /* 比主站小 */
|
font-size: 11px;
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
|
font-weight: 500;
|
||||||
|
box-shadow:
|
||||||
|
0 0 15px rgba(34, 211, 238, 0.1),
|
||||||
|
0 4px 6px rgba(0, 0, 0, 0.3);
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
backdrop-filter: blur(4px); /* 玻璃质感 */
|
backdrop-filter: blur(8px);
|
||||||
pointer-events: none; /* Make them click-through to avoid interfering with map clicking unless tooltipped */
|
pointer-events: none;
|
||||||
|
animation: markerFadeIn 0.5s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nearby-temp {
|
||||||
|
font-weight: 700;
|
||||||
|
color: #fff;
|
||||||
|
margin: 0 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes markerFadeIn {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(5px);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Custom Map Markers ── */
|
/* ── Custom Map Markers ── */
|
||||||
|
|||||||
Reference in New Issue
Block a user