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