feat: refine douyu active user display
This commit is contained in:
@@ -1464,7 +1464,7 @@ class DouyuPlugin(MessagePluginInterface):
|
|||||||
else:
|
else:
|
||||||
tags.append(fans_name)
|
tags.append(fans_name)
|
||||||
if room_level > 0:
|
if room_level > 0:
|
||||||
tags.append(f"房间 Lv{room_level}")
|
tags.append(f"平台 Lv{room_level}")
|
||||||
tags.append(f"{msg_count}条")
|
tags.append(f"{msg_count}条")
|
||||||
core_parts.append(f"{nickname}({','.join(tags)})")
|
core_parts.append(f"{nickname}({','.join(tags)})")
|
||||||
if core_parts:
|
if core_parts:
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ def _render_active_users(top_active_users: List[Dict[str, Any]]) -> str:
|
|||||||
fans_label = f"{fans_name} Lv{fans_level}" if fans_level > 0 else fans_name
|
fans_label = f"{fans_name} Lv{fans_level}" if fans_level > 0 else fans_name
|
||||||
chips.append(f'<span class="user-chip fans">{_escape(fans_label)}</span>')
|
chips.append(f'<span class="user-chip fans">{_escape(fans_label)}</span>')
|
||||||
if room_level > 0:
|
if room_level > 0:
|
||||||
chips.append(f'<span class="user-chip room">{_escape(f"房间 Lv{room_level}")}</span>')
|
chips.append(f'<span class="user-chip room">{_escape(f"平台 Lv{room_level}")}</span>')
|
||||||
meta_html = "".join(chips) if chips else '<span class="user-chip plain">普通观众</span>'
|
meta_html = "".join(chips) if chips else '<span class="user-chip plain">普通观众</span>'
|
||||||
|
|
||||||
blocks.append(
|
blocks.append(
|
||||||
@@ -474,12 +474,12 @@ def render_daily_report_html(
|
|||||||
}}
|
}}
|
||||||
.active-user-grid {{
|
.active-user-grid {{
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||||
gap: 12px;
|
gap: 10px;
|
||||||
}}
|
}}
|
||||||
.active-user-card {{
|
.active-user-card {{
|
||||||
padding: 14px 15px;
|
padding: 12px 12px 11px;
|
||||||
border-radius: 18px;
|
border-radius: 16px;
|
||||||
background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(244,247,255,0.92));
|
background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(244,247,255,0.92));
|
||||||
border: 1px solid rgba(129,147,181,0.18);
|
border: 1px solid rgba(129,147,181,0.18);
|
||||||
box-shadow: 0 10px 24px rgba(25, 38, 66, 0.05);
|
box-shadow: 0 10px 24px rgba(25, 38, 66, 0.05);
|
||||||
@@ -488,42 +488,42 @@ def render_daily_report_html(
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 12px;
|
gap: 8px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 8px;
|
||||||
}}
|
}}
|
||||||
.active-user-name {{
|
.active-user-name {{
|
||||||
font-size: 16px;
|
font-size: 14px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: var(--navy);
|
color: var(--navy);
|
||||||
line-height: 1.35;
|
line-height: 1.3;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}}
|
}}
|
||||||
.active-user-count {{
|
.active-user-count {{
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
min-width: 58px;
|
min-width: 44px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 24px;
|
font-size: 19px;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
color: var(--blue);
|
color: var(--blue);
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
}}
|
}}
|
||||||
.active-user-count span {{
|
.active-user-count span {{
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
font-size: 12px;
|
font-size: 11px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #64748b;
|
color: #64748b;
|
||||||
}}
|
}}
|
||||||
.active-user-meta {{
|
.active-user-meta {{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 8px;
|
gap: 6px;
|
||||||
}}
|
}}
|
||||||
.user-chip {{
|
.user-chip {{
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 5px 10px;
|
padding: 4px 8px;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
font-size: 12px;
|
font-size: 11px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
}}
|
}}
|
||||||
@@ -578,6 +578,11 @@ def render_daily_report_html(
|
|||||||
letter-spacing: .04em;
|
letter-spacing: .04em;
|
||||||
}}
|
}}
|
||||||
@media (max-width: 900px) {{
|
@media (max-width: 900px) {{
|
||||||
|
.active-user-grid {{
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
}}
|
||||||
|
}}
|
||||||
|
@media (max-width: 640px) {{
|
||||||
.active-user-grid {{
|
.active-user-grid {{
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user