更新天气插件v1.0.0

This commit is contained in:
baby20162016
2026-01-24 09:34:57 +08:00
parent c385363790
commit 2397213709
2 changed files with 552 additions and 0 deletions

312
templates/weather.html Normal file
View File

@@ -0,0 +1,312 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>天气查询结果</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Noto+Sans+SC:wght@400;500;700&display=swap');
:root {
--bg-color: #0f172a; /* 深蓝黑背景 */
--window-bg: rgba(30, 41, 59, 0.85); /* 窗口背景 */
--border-color: rgba(255, 255, 255, 0.08);
--accent: #6366f1; /* 核心强调色 - 靛蓝 */
--accent-glow: rgba(99, 102, 241, 0.4);
--text-title: #f8fafc;
--text-desc: #94a3b8;
--text-code: #a5f3fc; /* 代码高亮色 - 浅青 */
--card-bg: rgba(0, 0, 0, 0.2);
--weather-bg: #0b1120; /* 天气卡片深色背景 */
--sunny-color: #fbbf24; /* 晴天橙色 */
--cloudy-color: #6b7280; /* 多云灰色 */
--rainy-color: #3b82f6; /* 雨天蓝色 */
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Noto Sans SC', system-ui, sans-serif;
background-color: var(--bg-color);
color: var(--text-title);
display: flex;
justify-content: center;
padding: 0;
min-height: 100vh;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* 窗口容器 */
.window {
width: 100%;
min-height: 100vh;
background: var(--window-bg);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-radius: 0;
border: none;
box-shadow: none;
overflow: auto;
display: flex;
flex-direction: column;
}
/* 顶部标题栏 */
.header {
padding: 32px 40px;
border-bottom: 1px solid var(--border-color);
background: rgba(255, 255, 255, 0.02);
display: flex;
justify-content: space-between;
align-items: center;
}
.dots {
display: flex;
gap: 8px;
}
.dot {
width: 12px;
height: 12px;
border-radius: 50%;
}
.red { background: #ef4444; }
.yellow { background: #f59e0b; }
.green { background: #10b981; }
.title {
font-size: 18px;
font-weight: 700;
letter-spacing: 1.5px;
color: var(--text-desc);
text-transform: uppercase;
}
/* 内容区域 */
.content {
padding: 40px;
display: flex;
flex-direction: column;
gap: 32px;
}
.page-title {
margin-bottom: 10px;
}
.page-title h1 {
font-size: 48px;
background: linear-gradient(to right, #fff, #94a3b8);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.page-title p {
color: var(--text-desc);
font-size: 20px;
margin-top: 12px;
}
/* 城市信息 */
.city-info {
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 16px;
padding: 32px;
text-align: center;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.city-name {
font-size: 36px;
font-weight: 700;
color: var(--text-title);
margin-bottom: 8px;
}
.query-time {
font-size: 16px;
color: var(--text-desc);
}
/* 天气网格 */
.weather-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 24px;
}
/* 天气卡片 */
.weather-card {
background: var(--weather-bg);
border-radius: 16px;
padding: 24px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
border: 1px solid var(--border-color);
display: flex;
flex-direction: column;
gap: 16px;
transition: transform 0.2s;
}
.weather-card:hover {
transform: translateY(-2px);
}
.weather-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.weather-day {
font-size: 24px;
font-weight: 700;
color: var(--text-title);
}
.weather-condition {
font-size: 18px;
color: var(--text-desc);
}
.weather-main {
text-align: center;
}
.weather-temp {
font-size: 48px;
font-weight: 900;
color: var(--sunny-color);
margin: 16px 0;
}
.weather-details {
display: flex;
justify-content: space-between;
font-size: 14px;
color: var(--text-desc);
}
.weather-detail-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
}
.detail-label {
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.detail-value {
color: var(--text-title);
}
/* 页脚 */
.footer {
margin-top: auto;
padding: 32px;
border-top: 1px solid var(--border-color);
text-align: center;
color: var(--text-desc);
font-size: 14px;
background: rgba(0, 0, 0, 0.1);
}
.footer .info-row {
margin-bottom: 8px;
}
.footer .version-info {
font-size: 12px;
opacity: 0.8;
margin-top: 16px;
}
/* 响应式设计 */
@media (max-width: 768px) {
.content {
padding: 20px;
}
.page-title h1 {
font-size: 36px;
}
.weather-grid {
grid-template-columns: 1fr;
}
.weather-card {
padding: 20px;
}
.weather-temp {
font-size: 36px;
}
}
</style>
</head>
<body>
<div class="window">
<div class="header">
<div class="dots">
<div class="dot red"></div>
<div class="dot yellow"></div>
<div class="dot green"></div>
</div>
<div class="title">天气查询</div>
</div>
<div class="content">
<div class="page-title">
<h1>天气查询结果</h1>
<p>{{ timestamp }}</p>
</div>
<div class="city-info">
<div class="city-name">{{ city_name }}</div>
<div class="query-time">查询时间: {{ query_time }}</div>
</div>
<div class="weather-grid">
{% for day_weather in weather_data %}
<div class="weather-card">
<div class="weather-header">
<div class="weather-day">{{ day_weather.day }}</div>
<div class="weather-condition">{{ day_weather.weather }}</div>
</div>
<div class="weather-main">
<div class="weather-temp">{{ day_weather.temperature }}</div>
</div>
<div class="weather-details">
<div class="weather-detail-item">
<div class="detail-label">风力</div>
<div class="detail-value">{{ day_weather.wind_power }}</div>
</div>
<div class="weather-detail-item">
<div class="detail-label">风向</div>
<div class="detail-value">{{ day_weather.wind_direction }}</div>
</div>
</div>
</div>
{% endfor %}
</div>
<div class="footer">
<div class="info-row">数据来源: 中国天气网</div>
<div class="info-row">查询城市: {{ city_name }}</div>
<div class="version-info">
CalglauBot | Powered by NeoBot Framework
</div>
</div>
</div>
</div>
</body>
</html></content>