diff --git a/resources/views/chat/partials/scripts.blade.php b/resources/views/chat/partials/scripts.blade.php index b59035c..83ad890 100644 --- a/resources/views/chat/partials/scripts.blade.php +++ b/resources/views/chat/partials/scripts.blade.php @@ -151,8 +151,16 @@ const menu = document.getElementById('welcome-menu'); if (menu) { menu.style.display = 'none'; } + // 临时把 action 设为「欢迎」,让消息在聊天窗口以瓦蓝边框样式显示 + const actionSel = document.getElementById('action'); + const prevAction = actionSel?.value || ''; + if (actionSel) { actionSel.value = '欢迎'; } + // 自动触发发送 - sendMessage(null); + sendMessage(null).finally(() => { + // 发完后恢复原来的 action + if (actionSel) { actionSel.value = prevAction; } + }); } // 点击页面任意位置,关闭欢迎语浮层 @@ -492,6 +500,19 @@ html = `${iconImg} ${parsedContent}`; } + // 贾妖语 —— 蓝色左边框渐变样式,比 系统公告 低调 + else if (msg.action === '欢迎') { + div.style.cssText = + 'background: linear-gradient(135deg, #eff6ff, #f0f9ff); border: 1.5px solid #3b82f6; border-radius: 5px; padding: 5px 10px; margin: 3px 0; box-shadow: 0 1px 3px rgba(59,130,246,0.12);'; + + let parsedContent = msg.content; + parsedContent = parsedContent.replace(/【([^】]+)】/g, function(match, uName) { + return '【' + clickableUser(uName, '#1d4ed8') + '】'; + }); + + html = `