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:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 文件功能:为店铺商品类型加入消息文字颜色特效装扮(msg_text_color)。
|
||||
*
|
||||
* 用户在商店购买文字颜色特效后,消息正文呈现动态色彩效果(七彩、流光、霓虹等)。
|
||||
*
|
||||
* @author ChatRoom Laravel
|
||||
*
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* 扩展 shop_items.type ENUM,加入 msg_text_color 类型。
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if (DB::getDriverName() === 'mysql') {
|
||||
DB::statement("ALTER TABLE `shop_items` MODIFY `type` ENUM('instant','duration','one_time','ring','auto_fishing','sign_repair','msg_bubble','msg_name_color','avatar_frame','msg_text_color') NOT NULL COMMENT '道具类型'");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 回滚:移除 msg_text_color,将已有该类型商品标记为 one_time。
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if (DB::getDriverName() === 'mysql') {
|
||||
DB::statement("UPDATE `shop_items` SET `type` = 'one_time' WHERE `type` = 'msg_text_color'");
|
||||
DB::statement("ALTER TABLE `shop_items` MODIFY `type` ENUM('instant','duration','one_time','ring','auto_fishing','sign_repair','msg_bubble','msg_name_color','avatar_frame') NOT NULL COMMENT '道具类型'");
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -93,19 +93,19 @@ class ShopItemSeeder extends Seeder
|
||||
// ── 消息气泡装扮 ──────────────────────────
|
||||
['name' => '鎏金流光气泡', 'slug' => 'msg_bubble_golden', 'icon' => '🟡',
|
||||
'description' => '浅金底纹、左侧金线和流光扫过,发言更醒目但不刺眼。',
|
||||
'price' => 300, 'type' => 'msg_bubble', 'duration_days' => 1, 'sort_order' => 50],
|
||||
'price' => 3000, 'type' => 'msg_bubble', 'duration_days' => 1, 'sort_order' => 50],
|
||||
['name' => '樱语花笺气泡', 'slug' => 'msg_bubble_sakura', 'icon' => '🌸',
|
||||
'description' => '粉白信笺底色配花点纹理,适合温柔、浪漫的发言氛围。',
|
||||
'price' => 500, 'type' => 'msg_bubble', 'duration_days' => 3, 'sort_order' => 51],
|
||||
'price' => 3000, 'type' => 'msg_bubble', 'duration_days' => 1, 'sort_order' => 51],
|
||||
['name' => '星河微光气泡', 'slug' => 'msg_bubble_star', 'icon' => '🌌',
|
||||
'description' => '淡蓝星河底纹和微光星点,保留清爽阅读感。',
|
||||
'price' => 800, 'type' => 'msg_bubble', 'duration_days' => 7, 'sort_order' => 52],
|
||||
'price' => 5000, 'type' => 'msg_bubble', 'duration_days' => 1, 'sort_order' => 52],
|
||||
['name' => '霓虹彩带气泡', 'slug' => 'msg_bubble_rainbow', 'icon' => '🌈',
|
||||
'description' => '顶部流动彩带和浅色底框,发言有动态高光。',
|
||||
'price' => 1500, 'type' => 'msg_bubble', 'duration_days' => 7, 'sort_order' => 53],
|
||||
'price' => 8000, 'type' => 'msg_bubble', 'duration_days' => 1, 'sort_order' => 53],
|
||||
['name' => '皇冠礼赞气泡', 'slug' => 'msg_bubble_crown', 'icon' => '👑',
|
||||
'description' => '金色礼赞底纹、皇冠角标和侧边金线,突出尊贵发言。',
|
||||
'price' => 3000, 'type' => 'msg_bubble', 'duration_days' => 30, 'sort_order' => 54],
|
||||
'price' => 8000, 'type' => 'msg_bubble', 'duration_days' => 1, 'sort_order' => 54],
|
||||
|
||||
// ── 昵称颜色装扮 ──────────────────────────
|
||||
['name' => '金色昵称', 'slug' => 'msg_name_golden', 'icon' => '🥇',
|
||||
@@ -113,27 +113,44 @@ class ShopItemSeeder extends Seeder
|
||||
'price' => 200, 'type' => 'msg_name_color', 'duration_days' => 1, 'sort_order' => 60],
|
||||
['name' => '渐变昵称', 'slug' => 'msg_name_rainbow', 'icon' => '🎨',
|
||||
'description' => '彩虹渐变色昵称,五彩斑斓。',
|
||||
'price' => 500, 'type' => 'msg_name_color', 'duration_days' => 3, 'sort_order' => 61],
|
||||
'price' => 500, 'type' => 'msg_name_color', 'duration_days' => 1, 'sort_order' => 61],
|
||||
['name' => '发光昵称', 'slug' => 'msg_name_glow', 'icon' => '✨',
|
||||
'description' => '昵称带柔和发光效果,暗夜中最亮的星。',
|
||||
'price' => 800, 'type' => 'msg_name_color', 'duration_days' => 7, 'sort_order' => 62],
|
||||
'price' => 800, 'type' => 'msg_name_color', 'duration_days' => 1, 'sort_order' => 62],
|
||||
['name' => '火焰昵称', 'slug' => 'msg_name_flame', 'icon' => '🔥',
|
||||
'description' => '火焰色脉动昵称,热情似火。',
|
||||
'price' => 1500, 'type' => 'msg_name_color', 'duration_days' => 7, 'sort_order' => 63],
|
||||
'price' => 1500, 'type' => 'msg_name_color', 'duration_days' => 1, 'sort_order' => 63],
|
||||
|
||||
// ── 消息文字颜色特效装扮 ─────────────────
|
||||
['name' => '七彩文字', 'slug' => 'msg_text_rainbow', 'icon' => '🌈',
|
||||
'description' => '文字色彩在彩虹七色间平滑流动,发言自带虹光特效。',
|
||||
'price' => 5000, 'type' => 'msg_text_color', 'duration_days' => 1, 'sort_order' => 65],
|
||||
['name' => '流光文字', 'slug' => 'msg_text_shimmer', 'icon' => '💫',
|
||||
'description' => '一道流光从左到右扫过文字表面,如金属般闪亮。',
|
||||
'price' => 5000, 'type' => 'msg_text_color', 'duration_days' => 1, 'sort_order' => 66],
|
||||
['name' => '霓虹文字', 'slug' => 'msg_text_neon', 'icon' => '💜',
|
||||
'description' => '紫蓝霓虹光晕在文字周围脉动呼吸,像灯牌一样醒目。',
|
||||
'price' => 8000, 'type' => 'msg_text_color', 'duration_days' => 1, 'sort_order' => 67],
|
||||
['name' => '火焰文字', 'slug' => 'msg_text_flame', 'icon' => '🔥',
|
||||
'description' => '橙红烈火在文字中上下跃动,热情燃烧般的视觉冲击。',
|
||||
'price' => 8000, 'type' => 'msg_text_color', 'duration_days' => 1, 'sort_order' => 68],
|
||||
['name' => '冰蓝文字', 'slug' => 'msg_text_ice', 'icon' => '❄️',
|
||||
'description' => '冰蓝晶光在文字表面流转,如同冰晶折射出的冷艳光泽。',
|
||||
'price' => 8000, 'type' => 'msg_text_color', 'duration_days' => 1, 'sort_order' => 69],
|
||||
|
||||
// ── 头像框装扮 ────────────────────────────
|
||||
['name' => '月银守护头像框', 'slug' => 'avatar_frame_silver', 'icon' => '🥈',
|
||||
'description' => '银白金属光泽外框,低调但比普通头像更精致。',
|
||||
'price' => 500, 'type' => 'avatar_frame', 'duration_days' => 7, 'sort_order' => 70],
|
||||
'price' => 5000, 'type' => 'avatar_frame', 'duration_days' => 1, 'sort_order' => 70],
|
||||
['name' => '金辉勋章头像框', 'slug' => 'avatar_frame_gold', 'icon' => '🥇',
|
||||
'description' => '金色勋章质感外框,带柔和光晕。',
|
||||
'price' => 1000, 'type' => 'avatar_frame', 'duration_days' => 7, 'sort_order' => 71],
|
||||
'price' => 5000, 'type' => 'avatar_frame', 'duration_days' => 1, 'sort_order' => 71],
|
||||
['name' => '星轨环绕头像框', 'slug' => 'avatar_frame_star', 'icon' => '⭐',
|
||||
'description' => '星轨渐变环绕头像旋转,适合高调展示。',
|
||||
'price' => 2000, 'type' => 'avatar_frame', 'duration_days' => 14, 'sort_order' => 72],
|
||||
'price' => 8000, 'type' => 'avatar_frame', 'duration_days' => 1, 'sort_order' => 72],
|
||||
['name' => '龙焰御守头像框', 'slug' => 'avatar_frame_dragon', 'icon' => '🐉',
|
||||
'description' => '红金御守质感外框,带虚线纹理和强烈光晕。',
|
||||
'price' => 5000, 'type' => 'avatar_frame', 'duration_days' => 30, 'sort_order' => 73],
|
||||
'price' => 8000, 'type' => 'avatar_frame', 'duration_days' => 1, 'sort_order' => 73],
|
||||
];
|
||||
|
||||
foreach ($items as $item) {
|
||||
|
||||
Reference in New Issue
Block a user