Skip to content

Commit df879c5

Browse files
committed
fix(HatsuneMiku): 完善
1 parent ae96ea9 commit df879c5

11 files changed

Lines changed: 552 additions & 334 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ scripts/output_all/debug_scrapbook_test_group_*.pdf
2828
scripts/output_all/debug_simple_test_group_*.pdf
2929
scripts/output_all/debug_spring_festival_test_group_*.pdf
3030
scripts/data/avatar/cache.db
31+
debug_miku.html
32+
scripts/output_all/debug_HatsuneMiku_test_group_*.pdf
33+
scripts/output/mock_report_test_group_mock_*.pdf

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<a href="https://t.me/AstrBotPluginGroupDailyAnalysis"><img src="https://fastly.jsdelivr.net/gh/SXP-Simon/astrbot_plugin_qq_group_daily_analysis@main/assets/TG.png" width="300" alt="Telegram Group"></a>
1717
</td>
1818
</tr>
19+
<tr>
20+
<td style="border: none;" align="center"><b>QQ群</b></td>
21+
<td style="border: none;" align="center"><b>Telegram群</b></td>
22+
</tr>
1923
</table>
2024

2125

@@ -401,6 +405,7 @@ uv run scripts\debug_render.py -t retro_futurism -o debug_retro.html
401405
uv run scripts\debug_render.py -t format -o debug_format.html
402406
uv run scripts\debug_render.py -t simple -o debug_simple.html
403407
uv run scripts\debug_render.py -t spring_festival -o debug_spring.html
408+
uv run scripts\debug_render.py -t HatsuneMiku -o debug_miku.html
404409
```
405410

406411

_conf_schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"options": [
7070
"scrapbook",
7171
"retro_futurism",
72+
"HatsuneMiku",
7273
"hack",
7374
"spring_festival",
7475
"simple",

scripts/debug_all_pdf_themes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ async def main():
226226
"simple",
227227
"spring_festival",
228228
"format",
229+
"HatsuneMiku",
229230
]
230231
for theme in themes:
231232
await generate_theme(theme)

src/infrastructure/reporting/templates/HatsuneMiku/activity_chart.html

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<div class="card-common" style="padding: 30px 20px 15px 20px;">
2-
<div style="display: flex; align-items: flex-end; justify-content: space-between; height: 180px; gap: 4px;">
3-
{# 定义一个从 葱绿 -> 薄荷 -> 鹅黄 -> 蜜桃粉 的完美过渡色板 #}
1+
<div style="display: flex; flex-direction: column; gap: 12px; width: 100%; min-width: 600px;">
2+
{# 柱状图主体层:确保底部对齐 #}
3+
<div style="display: flex; align-items: flex-end; justify-content: space-between; height: 160px; gap: 4px; padding-bottom: 5px; border-bottom: 2px solid rgba(57, 197, 187, 0.1);">
44
{% set chart_colors = [
55
'#66D1C7', '#6FD3C6', '#79D5C4', '#85D8C3', '#93DAC1', '#A3DDBF',
66
'#B4E0BD', '#C7E2BA', '#DBE5B8', '#EFE8B5', '#FFEAB3', '#FFDF9E',
@@ -10,33 +10,35 @@
1010

1111
{% for item in chart_data %}
1212
{% set h = item.percentage | float %}
13-
14-
{# 使用 loop.index0 从色板中依次取色,形成从左到右的全局渐变 #}
1513
{% set bar_color = chart_colors[loop.index0 % 24] %}
16-
1714
{% set bar_opacity = '1' %}
1815
{% if item.count == 0 %}
1916
{% set h = '4' %}
2017
{% set bar_opacity = '0.3' %}
2118
{% set bar_color = 'var(--miku-blue)' %}
2219
{% endif %}
2320

24-
<div style="flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; position: relative;">
21+
<div style="flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%;">
2522
{% if item.count > 0 %}
26-
{# 数字去掉背景框,颜色与柱子保持一致,视觉更通透 #}
27-
<span style="font-family: var(--font-num); font-size: 0.8rem; color: {{ bar_color }}; margin-bottom: 6px; font-weight: bold; text-shadow: 0 1px 2px rgba(0,0,0,0.02);">{{ item.count }}</span>
23+
<span style="font-family: var(--font-num); font-size: 0.75rem; color: {{ bar_color }}; margin-bottom: 4px; font-weight: 800;">{{ item.count }}</span>
2824
{% endif %}
2925

30-
{# 柱状体 #}
3126
<div style="width: 100%; height: {{ h }}%;
3227
background: {{ bar_color }};
3328
border-radius: 4px 4px 1px 1px;
34-
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
35-
transition: height 0.3s ease;
36-
opacity: {{ bar_opacity }};"></div>
37-
38-
{# X轴标签 #}
39-
<span style="margin-top: 10px; font-family: var(--font-num); font-size: 0.75rem; color: var(--text-sub); font-weight: bold;">{{ "%02d"|format(item.hour) }}时</span>
29+
opacity: {{ bar_opacity }};
30+
transition: height 0.3s ease;"></div>
31+
</div>
32+
{% endfor %}
33+
</div>
34+
35+
{# X轴标签层:独立容器确保水平对齐且不换行 #}
36+
<div style="display: flex; justify-content: space-between; gap: 4px;">
37+
{% for item in chart_data %}
38+
<div style="flex: 1; text-align: center;">
39+
<span style="font-family: var(--font-num); font-size: 0.7rem; color: var(--text-sub); font-weight: bold; white-space: nowrap; display: inline-block;">
40+
{{ "%02d"|format(item.hour) }}{% if loop.index0 % 4 == 0 or loop.last %}时{% endif %}
41+
</span>
4042
</div>
4143
{% endfor %}
4244
</div>

src/infrastructure/reporting/templates/HatsuneMiku/chat_quality_item.html

Lines changed: 12 additions & 12 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)