![]()
🎭 角色简介
角色名:
中文名: 祁曜 (Qí Yào)
表字:映雪
年龄: 18
性别: 男
身高: 186cm
身份:
– 表面身份:祁家三公子
– 多重伪装身份:云游道士(号梦身)/雀翎阁阁主(人称阁主不知姓名)
– 隐藏身份:“…
💬 开场白
“`html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>祁曜 | 序幕</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500&display=swap');:root {
–bg-color: #050505;
–container-bg: rgba(18, 18, 18, 0.6);
–border-color: rgba(255, 255, 255, 0.15);
–primary-text: #EAEAEA;
–secondary-text: #888888;
–accent-color: #DCDCDC; /* 银白色 */
–hover-bg: rgba(255, 255, 255, 0.07);
–hover-border: rgba(220, 220, 220, 0.5);
}body {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: var(–bg-color);
background-image:
radial-gradient(ellipse at top left, rgba(192, 192, 192, 0.08), transparent 50%),
radial-gradient(ellipse at bottom right, rgba(192, 192, 192, 0.08), transparent 50%);
font-family: 'Noto Sans SC', sans-serif;
color: var(–primary-text);
padding: 20px;
box-sizing: border-box;
}.main-container {
width: 100%;
max-width: 550px;
background: var(–container-bg);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid var(–border-color);
border-radius: 20px;
padding: 35px 40px;
box-shadow: 0 10px 60px rgba(0, 0, 0, 0.8);
animation: fadeIn 1.2s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}.header {
text-align: center;
margin-bottom: 30px;
user-select: none;
}.header h1 {
font-size: 2rem;
font-weight: 500;
letter-spacing: 0.4em;
color: var(–accent-color);
margin: 0 0 10px 0;
text-shadow: 0 0 15px rgba(220, 220, 220, 0.4), 0 0 5px rgba(255, 255, 255, 0.5);
}.header p {
font-size: 0.95rem;
color: var(–secondary-text);
margin: 0;
font-weight: 300;
}.scene-list {
display: flex;
flex-direction: column;
gap: 12px;
}.scene-btn {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
padding: 18px 20px;
background-color: transparent;
border: 1px solid var(–border-color);
border-radius: 10px;
cursor: pointer;
text-align: left;
color: var(–primary-text);
transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
box-sizing: border-box;
}.scene-btn:hover {
background-color: var(–hover-bg);
border-color: var(–hover-border);
transform: translateY(-2px);
}.scene-title {
font-size: 1rem;
font-weight: 400;
}.scene-tag {
font-size: 0.8rem;
color: var(–secondary-text);
border: 1px solid var(–secondary-text);
padding: 4px 10px;
border-radius: 7px;
white-space: nowrap;
transition: color 0.3s ease, border-color 0.3s ease;
}.scene-btn:hover .scene-tag {
color: var(–accent-color);
border-color: var(–accent-color);
}</style>
</head>
<body><div class="main-container">
<div class="header">
<h1>快哉快哉</h1>
<p>作者蜗蜗蜗</p>
<p> 此卡免费发布在dc旅程社区<p>
</div><div class="scene-list">
<button class="scene-btn" onclick="switchToOpening(1)">
<span class="scene-title">茶馆∶隔壁桌有个嘴欠道士</span>
<span class="scene-tag">梦身</span>
</button>
<button class="scene-btn" onclick="switchToOpening(2)">
<span class="scene-title">卧槽天降孽缘</span>
<span class="scene-tag">雀翎</span>
</button>
<button class="scene-btn" onclick="switchToOpening(3)">
<span class="scene-title">养父教我当花魁养父好</span>
<span class="scene-tag">收养线</span>
</button>
<button class="scene-btn" onclick="switchToOpening(4)">
<span class="scene-title">家里怎么好像进小偷啊?哦长这么帅那算了</span>
<span class="scene-tag">鹫</span>
</button>
<button class="scene-btn" onclick="switchToOpening(5)">
<span class="scene-title">愿逆风如解意——</span>
<span class="scene-tag">进宫线</span>
</button>
<button class="scene-btn" onclick="switchToOpening(6)">
<span class="scene-title">七幺幺变狐狸啦</span>
<span class="scene-tag">查案线</span>
</button>
<button class="scene-btn" onclick="switchToOpening(7)">
<span class="scene-title">祁曜死遁后大摇大摆带着user送的玉佩摆摊算卦</span>
<span class="scene-tag">死遁线</span>
</button>
</div>
</div>
<script>
// 用于在切换后显示提示的小函数
function showTip(message) {
// 移除旧的提示
const oldTip = document.getElementById('scene-switch-tip');
if (oldTip) oldTip.remove();const tip = document.createElement('div');
tip.id = 'scene-switch-tip';
tip.style.cssText = `
position: fixed;
top: 25px;
left: 50%;
transform: translateX(-50%);
background: rgba(30, 30, 30, 0.85);
color: #EAEAEA;
padding: 10px 22px;
border-radius: 8px;
font-size: 14px;
font-family: 'Noto Sans SC', sans-serif;
z-index: 10000;
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 4px 15px rgba(0,0,0,0.5);
backdrop-filter: blur(10px);
opacity: 0;
transition: opacity 0.4s ease, transform 0.4s ease;
`;
tip.textContent = message;
document.body.appendChild(tip);// 入场动画
setTimeout(() => {
tip.style.opacity = '1';
tip.style.transform = 'translate(-50%, 10px)';
}, 50);// 离场动画
setTimeout(() => {
tip.style.opacity = '0';
tip.style.transform = 'translateX(-50%)';
setTimeout(() => tip.remove(), 400);
}, 2500);
}// 切换开场白的核心函数
async function switchToOpening(openingId) {
// 这里使用了 try…catch 来捕获可能发生的错误
try {
// 检查平台提供的函数是否存在
if (typeof getChatMessages === 'function' && typeof setChatMessage === 'function') {
// 这是一个异步操作,用于获取当前聊天的所有消息(包括滑动的卡片)
// 传入 0 表示获取第一条消息,{ include_swipe: true } 表示需要包含所有滑动卡片
const messages = await getChatMessages(0, { include_swipe: true });// 检查是否成功获取到消息,并且第一条消息有可滑动的卡片
// swipes[openingId] 检查我们想切换的卡片是否存在
if (messages && messages.length > 0 && messages[0].swipes && messages[0].swipes[openingId] !== undefined) {
// 获取我们想切换到的那张卡片的内容
const content = messages[0].swipes[openingId];// 调用平台的函数来设置聊天内容
// setChatMessage(内容, 消息索引, { 卡片ID, 刷新方式 })
// refresh: 'display_and_render_current' 表示立即显示并渲染切换后的内容
setChatMessage(content, 0, { swipe_id: openingId, refresh: 'display_and_render_current' });// 显示成功提示
showTip('序幕切换成功');
} else {
// 如果找不到对应的卡片,给出错误提示
showTip('错误:找不到序号 ' + openingId + ' 对应的序幕。');
}
} else {
// 如果是在本地预览,没有平台的函数,就只显示一个预览提示
showTip('预览模式:准备切换至序幕 ' + openingId);
}
} catch (error) {
// 如果在执行过程中发生任何错误,打印到控制台并显示失败提示
console.error('切换序幕时发生错误:', error);
showTip(`切换失败: ${error.message}`);
}
}
</script></body>
</html>
“`