优化游戏 通知样式
This commit is contained in:
@@ -2558,16 +2558,35 @@
|
|||||||
`<div style="font-size: 18px; line-height: 1.75; font-weight: 800; color: #dc2626;">${parsedContent} <span style="color: #999; font-size: 14px; font-weight: 500;">(${timeStr})</span></div>`;
|
`<div style="font-size: 18px; line-height: 1.75; font-weight: 800; color: #dc2626;">${parsedContent} <span style="color: #999; font-size: 14px; font-weight: 500;">(${timeStr})</span></div>`;
|
||||||
timeStrOverride = true;
|
timeStrOverride = true;
|
||||||
} else if (msg.from_user === '系统传音') {
|
} else if (msg.from_user === '系统传音') {
|
||||||
// 自动升级播报 / 赠礼通知 / 彩票购买广播:金色左边框,轻量提示样式,不喧宾夺主
|
// 游戏播报(百家乐/赛马/神秘箱子/双色球/五子棋/老虎机):参照钓鱼播报的普通样式,无背景色
|
||||||
// 解析内容中 【用户名】 片段,使其支持单击(切换发言对象)和双击(查看名片)
|
const content = msg.content || '';
|
||||||
div.style.cssText =
|
const isGameNotification =
|
||||||
'background: #fffbeb; border-left: 3px solid #d97706; border-radius: 4px; padding: 4px 10px; margin: 2px 0;';
|
content.includes('【百家乐】') ||
|
||||||
let sysTranContent = msg.content;
|
content.includes('【赛马】') ||
|
||||||
sysTranContent = sysTranContent.replace(/【([^】]+)】/g, function(match, uName) {
|
content.includes('神秘箱子') ||
|
||||||
return '【' + clickableUser(uName, '#000099') + '】';
|
content.includes('【双色球') ||
|
||||||
});
|
content.includes('【五子棋】') ||
|
||||||
html =
|
content.includes('【老虎机】');
|
||||||
`<span style="color: #b45309;">🌟 ${sysTranContent}</span>`;
|
|
||||||
|
if (isGameNotification) {
|
||||||
|
// 游戏播报:普通样式(参照钓鱼播报),无背景色无边框
|
||||||
|
let parsedContent = msg.content;
|
||||||
|
parsedContent = parsedContent.replace(/【([^】]+)】/g, function(match, uName) {
|
||||||
|
return '【' + clickableUser(uName, '#000099') + '】';
|
||||||
|
});
|
||||||
|
html =
|
||||||
|
`${headImg}<span style="font-weight: bold;">${clickableUser(msg.from_user, fontColor, nameClass)}:</span><span class="msg-content" style="color: ${fontColor}">${parsedContent}</span>`;
|
||||||
|
} else {
|
||||||
|
// 自动升级播报 / 赠礼通知 / 婚恋广播 等非游戏系统传音:金色左边框,轻量提示样式,不喧宾夺主
|
||||||
|
div.style.cssText =
|
||||||
|
'background: #fffbeb; border-left: 3px solid #d97706; border-radius: 4px; padding: 4px 10px; margin: 2px 0;';
|
||||||
|
let sysTranContent = msg.content;
|
||||||
|
sysTranContent = sysTranContent.replace(/【([^】]+)】/g, function(match, uName) {
|
||||||
|
return '【' + clickableUser(uName, '#000099') + '】';
|
||||||
|
});
|
||||||
|
html =
|
||||||
|
`<span style="color: #b45309;">🌟 ${sysTranContent}</span>`;
|
||||||
|
}
|
||||||
} else if (msg.from_user === '系统' && msg.to_user && msg.to_user !== '大家') {
|
} else if (msg.from_user === '系统' && msg.to_user && msg.to_user !== '大家') {
|
||||||
// 系统私人通知(自动存点等):无头像,绿色左边框简洁条形样式
|
// 系统私人通知(自动存点等):无头像,绿色左边框简洁条形样式
|
||||||
div.style.cssText =
|
div.style.cssText =
|
||||||
|
|||||||
Reference in New Issue
Block a user