feat: 新增消息文字颜色特效装扮(七彩/流光/霓虹/火焰/冰蓝)
- 新增 msg_text_color 商品类型,扩展 shop_items.type ENUM
- DecorationService 支持 text_color 槽位,自动注入消息广播
- CSS 动画:rainbow(彩虹流动)、shimmer(金属流光)、neon(霓虹脉动)、flame(火焰跃动)、ice(冰蓝流转)
- ShopItemSeeder 新增 5 款文字颜色特效商品
- 商店前端新增「🌈 文字颜色」装扮分组
- 消息渲染 appendMessage/buildChatMessageContent 支持文字特效 class
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
* - bubble : 消息气泡边框样式
|
||||
* - name_color : 昵称颜色效果
|
||||
* - avatar_frame: 头像装饰边框
|
||||
* - text_color : 消息文字颜色特效
|
||||
*
|
||||
* @author ChatRoom Laravel
|
||||
*
|
||||
@@ -37,6 +38,7 @@ class DecorationService
|
||||
'msg_bubble' => 'bubble',
|
||||
'msg_name_color' => 'name_color',
|
||||
'avatar_frame' => 'avatar_frame',
|
||||
'msg_text_color' => 'text_color',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -173,11 +175,11 @@ class DecorationService
|
||||
/**
|
||||
* 获取消息广播 payload 需要携带的装扮字段。
|
||||
*
|
||||
* 消息广播只需要气泡样式(msg_bubble)和昵称颜色(msg_name_color),
|
||||
* 消息广播只需要气泡样式(msg_bubble)、昵称颜色(msg_name_color)和文字颜色特效(msg_text_color),
|
||||
* 头像框不需要在消息中展示。
|
||||
*
|
||||
* @param User $user 消息发送者
|
||||
* @return array{msg_bubble?:string, msg_name_color?:string}
|
||||
* @return array{msg_bubble?:string, msg_name_color?:string, msg_text_color?:string}
|
||||
*/
|
||||
public function getDecorationsForMessage(User $user): array
|
||||
{
|
||||
@@ -190,6 +192,9 @@ class DecorationService
|
||||
if (! empty($decorations['name_color']['style'])) {
|
||||
$result['msg_name_color'] = $decorations['name_color']['style'];
|
||||
}
|
||||
if (! empty($decorations['text_color']['style'])) {
|
||||
$result['msg_text_color'] = $decorations['text_color']['style'];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user