UI: 修复AI小班长头像的白色背景,使用 mix-blend-mode 使其透明化

This commit is contained in:
2026-02-27 11:04:46 +08:00
parent d7b52f8419
commit 53e357418e

View File

@@ -96,7 +96,7 @@
let botDiv = document.createElement('div');
botDiv.className = 'user-item';
botDiv.innerHTML = `
<img class="user-head" src="/images/ai_bot.png" onerror="this.src='/images/headface/1.gif'">
<img class="user-head" src="/images/ai_bot.png" style="mix-blend-mode: multiply;" onerror="this.src='/images/headface/1.gif'">
<span class="user-name">AI小班长</span><span style="font-size:12px; margin-left:2px;" title="聊天机器人">🤖</span>
`;
botDiv.onclick = () => {
@@ -230,11 +230,13 @@
const senderInfo = onlineUsers[msg.from_user];
const senderHead = ((senderInfo && senderInfo.headface) || '1.gif').toLowerCase();
let headImgSrc = `/images/headface/${senderHead}`;
let extraStyle = '';
if (msg.from_user === 'AI小班长') {
headImgSrc = '/images/ai_bot.png';
extraStyle = ' mix-blend-mode: multiply;';
}
const headImg =
`<img src="${headImgSrc}" style="display:inline;width:16px;height:16px;vertical-align:middle;margin-right:2px;" onerror="this.src='/images/headface/1.gif'">`;
`<img src="${headImgSrc}" style="display:inline;width:16px;height:16px;vertical-align:middle;margin-right:2px;${extraStyle}" onerror="this.src='/images/headface/1.gif'">`;
let html = '';