-
-
- -
- -
- -
- -
- -
- -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
+ });
+ function createSnowflake(top, left) {
+ const snowflake = document.createElement('div');
+ snowflake.className = 'snowflake0';
+ snowflake.style.top = `${top}vh`;
+ snowflake.style.left = `${left}vw`;
+ // 设置雪花的随机大小
+ const size = Math.random() * 20 + 10; // 随机大小在 10 到 30 之间
+ snowflake.style.width = `${size}px`;
+ snowflake.style.height = `${size}px`;
+ document.body.appendChild(snowflake);
+ }
+
+
+
diff --git a/app/web_ui/web.py b/app/web_ui/web.py
index b2ff1cf..7262e13 100644
--- a/app/web_ui/web.py
+++ b/app/web_ui/web.py
@@ -22,6 +22,7 @@ time_range = (start_time, end_time)
html: str = ''
api_url = 'http://api.lc044.love/upload'
+
def get_contact(wxid):
contact_info_list = micro_msg_db.get_contact_by_username(wxid)
contact_info = {
@@ -36,10 +37,19 @@ def get_contact(wxid):
contact = Contact(contact_info)
return contact
+
@app.route("/")
def index():
- # 渲染模板,并传递图表的 HTML 到模板中
- return "index.html"
+ contact_topN_num = msg_db.get_chatted_top_contacts(time_range=time_range, top_n=6)
+ contact_topN = []
+ for wxid,num in contact_topN_num:
+ contact = get_contact(wxid)
+ contact_topN.append([contact,num])
+ data = {
+ 'avatar': Me().smallHeadImgUrl,
+ 'contact_topN':contact_topN,
+ }
+ return render_template('index.html', **data)
@app.route("/christmas/
+
+
+
+ 微信年度聊天报告
+统计、分析、回顾,记录一年的聊天时光
+ +
+
+
+ 我的年度好友
+聊天榜单
+-
+ {% for contact,msg_num in contact_topN:%}
+
-
+
+ ++
{{contact.remark}}
++
{{msg_num}}条消息+ +
000字
+ {% endfor %}
+