diff --git a/README.md b/README.md index 4ee25d2..75d72cf 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,8 @@ _✨ 一个基于 AstrBot 的智能群聊分析插件,支持 **QQ (OneBot)** retro_futurism -

Spring Festival

- spring_festival +

HatsuneMiku

+ HatsuneMiku diff --git a/assets/HatsuneMiku.jpg b/assets/HatsuneMiku.jpg new file mode 100644 index 0000000..cd6f16d Binary files /dev/null and b/assets/HatsuneMiku.jpg differ diff --git a/src/infrastructure/reporting/templates/HatsuneMiku/activity_chart.html b/src/infrastructure/reporting/templates/HatsuneMiku/activity_chart.html new file mode 100644 index 0000000..95ee5a8 --- /dev/null +++ b/src/infrastructure/reporting/templates/HatsuneMiku/activity_chart.html @@ -0,0 +1,43 @@ +
+
+ {# 定义一个从 葱绿 -> 薄荷 -> 鹅黄 -> 蜜桃粉 的完美过渡色板 #} + {% set chart_colors = [ + '#66D1C7', '#6FD3C6', '#79D5C4', '#85D8C3', '#93DAC1', '#A3DDBF', + '#B4E0BD', '#C7E2BA', '#DBE5B8', '#EFE8B5', '#FFEAB3', '#FFDF9E', + '#FFD38B', '#FFC67A', '#FFB96D', '#FFAC62', '#FFA059', '#FF9552', + '#FF8B4D', '#FF834B', '#FF7D4D', '#FF7752', '#FF745A', '#FF7365' + ] %} + + {% for item in chart_data %} + {% set h = item.percentage | float %} + + {# 使用 loop.index0 从色板中依次取色,形成从左到右的全局渐变 #} + {% set bar_color = chart_colors[loop.index0 % 24] %} + + {% set bar_opacity = '1' %} + {% if item.count == 0 %} + {% set h = '4' %} + {% set bar_opacity = '0.3' %} + {% set bar_color = 'var(--miku-blue)' %} + {% endif %} + +
+ {% if item.count > 0 %} + {# 数字去掉背景框,颜色与柱子保持一致,视觉更通透 #} + {{ item.count }} + {% endif %} + + {# 柱状体 #} +
+ + {# X轴标签 #} + {{ "%02d"|format(item.hour) }}时 +
+ {% endfor %} +
+
diff --git a/src/infrastructure/reporting/templates/HatsuneMiku/chat_quality_item.html b/src/infrastructure/reporting/templates/HatsuneMiku/chat_quality_item.html new file mode 100644 index 0000000..1d18ff3 --- /dev/null +++ b/src/infrastructure/reporting/templates/HatsuneMiku/chat_quality_item.html @@ -0,0 +1,39 @@ +
+
+
+
聊天质量分析
+
+
+
+
{{ title }}
+
{{ subtitle }}
+
+ +
+ {% set colors = ['var(--miku-base)', 'var(--miku-pink-light)', 'var(--miku-light)', 'var(--miku-yellow)', '#80CBC4'] %} + {% for dim in dimensions %} +
+ {% endfor %} +
+ +
+ {% for dim in dimensions %} +
+
+
+
{{ dim.name }} ({{ '%.1f'|format(dim.percentage|float) }}%)
+
{{ dim.comment }}
+
+
+ {% endfor %} +
+ +
+
+ 🎤 + Miku 综合点评 +
+
{{ summary }}
+
+
+
diff --git a/src/infrastructure/reporting/templates/HatsuneMiku/image_template.html b/src/infrastructure/reporting/templates/HatsuneMiku/image_template.html new file mode 100644 index 0000000..3d7721b --- /dev/null +++ b/src/infrastructure/reporting/templates/HatsuneMiku/image_template.html @@ -0,0 +1,326 @@ + + + + + + + 群聊日常分析看板 · {{current_date}} + + + + + +
+
01
+
39
+
[ SYSTEM_VOCALOID_INITIALIZED ]
HATSUNE MIKU v4X
+
+ +
+

群聊日常分析看板

+ +
+ +
+
+
+
+
今日消息数
+
+
{{message_count}}
+
+
+
+
+
活跃成员数
+
+
{{participant_count}}
+
+
+
+
+
表情互动
+
+
{{emoji_count}}
+
+
+
+
+
今日字数累计
+
+
{{total_characters}}
+
+
+ +
+
+
峰值活跃时间段
+
{{most_active_period}}
+
+ +
+ Peak Activity Visualization +
+
+ +
+
+
+
24小时活动图段
+
+ {{hourly_chart_html | safe}} +
+ + {{topics_html | safe}} + {{titles_html | safe}} + {{quotes_html | safe}} + {{chat_quality_html | safe}} + + +
+ + \ No newline at end of file diff --git a/src/infrastructure/reporting/templates/HatsuneMiku/pdf_template.html b/src/infrastructure/reporting/templates/HatsuneMiku/pdf_template.html new file mode 100644 index 0000000..b058c10 --- /dev/null +++ b/src/infrastructure/reporting/templates/HatsuneMiku/pdf_template.html @@ -0,0 +1,295 @@ + + + + + + + 群聊日常分析看板 · {{current_date}} + + + + + +
+
01
+
39
+
[ SYSTEM_VOCALOID_INITIALIZED ]
HATSUNE MIKU v4X
+
+ +
+

群聊日常分析看板

+ +
+ +
+
+
+
+
今日消息数
+
+
{{message_count}}
+
+
+
+
+
活跃成员数
+
+
{{participant_count}}
+
+
+
+
+
表情互动
+
+
{{emoji_count}}
+
+
+
+
+
今日字数累计
+
+
{{total_characters}}
+
+
+ +
+
+
峰值活跃时间段
+
{{most_active_period}}
+
+ +
+ Peak Activity Visualization +
+
+ +
+
+
+
24小时活动图段
+
+ {{hourly_chart_html | safe}} +
+ + {{topics_html | safe}} + {{titles_html | safe}} + {{quotes_html | safe}} + {{chat_quality_html | safe}} + + +
+ + \ No newline at end of file diff --git a/src/infrastructure/reporting/templates/HatsuneMiku/quote_item.html b/src/infrastructure/reporting/templates/HatsuneMiku/quote_item.html new file mode 100644 index 0000000..1e3e20d --- /dev/null +++ b/src/infrastructure/reporting/templates/HatsuneMiku/quote_item.html @@ -0,0 +1,32 @@ +{% if quotes %} +
+
+
+
每日回响
+
+ {% for quote in quotes %} +
+
+
+ {% if quote.avatar_url %}{% endif %} +
+
+
{{ quote.sender }}
+ +
+
{{ quote.content }}
+
+ +
+
+ 🎵 + Miku 锐评 +
+
{{ quote.reason | safe }}
+
+
+
+
+ {% endfor %} +
+{% endif %} diff --git a/src/infrastructure/reporting/templates/HatsuneMiku/topic_item.html b/src/infrastructure/reporting/templates/HatsuneMiku/topic_item.html new file mode 100644 index 0000000..d38032f --- /dev/null +++ b/src/infrastructure/reporting/templates/HatsuneMiku/topic_item.html @@ -0,0 +1,152 @@ + +
+
+
+
今日话题
+
+ +
+
+ #01 +
+
+
关于AstrBot插件开发的讨论
+
大家深入探讨了专家 🐧 张三 提到的如何利用Jinja2模板渲染出精美的分析报告, 🐧 李四 也分享了技巧。
+ +
+ +
+ 🎵 + 参与主唱: + 张三、李四、王五 +
+ +
+ 装饰图 +
+ +
+
+
+ +
+
+ #02 +
+
+
测试话题 2
+
这是第二条测试内容。
+ +
+ +
+ 🎵 + 参与主唱: + 用户A +
+ +
+ 装饰图 +
+ +
+
+
+ +
+
+ #03 +
+
+
测试话题 3
+
这是第三条测试内容。
+ +
+ +
+ 🎵 + 参与主唱: + 用户B +
+ +
+ 装饰图 +
+ +
+
+
+ +
+
+ #04 +
+
+
测试话题 4
+
这是第四条测试内容。
+ +
+ +
+ 🎵 + 参与主唱: + 用户C +
+ +
+ 装饰图 +
+ +
+
+
+ +
+
+ #05 +
+
+
测试话题 5
+
这是第五条测试内容。
+ +
+ +
+ 🎵 + 参与主唱: + 用户D +
+ +
+ 装饰图 +
+ +
+
+
+ +
+
+ #06 +
+
+
测试话题 6(应循环显示第一张图)
+
这条将使用 base64 (1).txt。
+ +
+ +
+ 🎵 + 参与主唱: + 用户E +
+ +
+ 装饰图 +
+ +
+
+
+ +
diff --git a/src/infrastructure/reporting/templates/HatsuneMiku/user_title_item.html b/src/infrastructure/reporting/templates/HatsuneMiku/user_title_item.html new file mode 100644 index 0000000..b696f4a --- /dev/null +++ b/src/infrastructure/reporting/templates/HatsuneMiku/user_title_item.html @@ -0,0 +1,29 @@ +{% if titles %} +
+
+
+
群友画像
+
+
+ {% for title in titles %} +
+
+
+ {% if title.avatar_data %}{% endif %} +
+
+
{{ title.name }}
+
+ {{ title.title }} + {{ title.mbti }} +
+
+
+
+ {{ title.reason }} +
+
+ {% endfor %} +
+
+{% endif %}