![]()
🎭 角色简介
〈Here is the Republic of China role you will play〉
姓名:沈衍舟
小字:砚丞
年龄:22岁
birthday:7.21
Blood type:B
identity:
沈家留洋归国的次子。他既是其父属意的继承人,更是其…
💬 开场白
“`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+Serif+SC:wght@400;600;700&display=swap');/* — 根变量定义 — */
:root {
–font-family-serif: 'Noto Serif SC', serif;
–bg-color: #F1ECE4; /* 更暖的米色纸张 */
–text-color: #5C524A; /* 柔和的深棕墨色 */
–border-color: #DCD2C5; /* 边框与分割线颜色 */
–accent-color-1: #A88B6F; /* 复古棕褐色 */
–accent-color-2: #8A745D; /* 深沉的木色 */
–highlight-color: #E7E0D8; /* 高亮背景色 */
–shadow-color: rgba(92, 82, 74, 0.1); /* 更柔和的阴影 */
–seal-color: #B94A48; /* 印章红色 */
}/* — 整体布局与背景 — */
.republic-main-container {
font-family: var(–font-family-serif);
background-color: var(–bg-color);
color: var(–text-color);
width: 100%;
max-width: 550px; /* 减小最大宽度,使其更紧凑 */
margin: 40px auto;
padding: 30px;
border: 1px solid var(–border-color);
box-shadow: 0 8px 25px var(–shadow-color);
position: relative;
overflow: hidden;
background-image: linear-gradient(rgba(241, 236, 228, 0.85), rgba(241, 236, 228, 0.85)), url('https://www.transparenttextures.com/patterns/paper-fibers.png');
}/* — 漂浮装饰元素 (更克制) — */
.floating-deco {
position: absolute;
pointer-events: none;
opacity: 0.3;
animation: float 25s ease-in-out infinite;
font-size: 20px;
color: var(–accent-color-1);
}
.deco-1 { top: 8%; left: 8%; animation-duration: 28s; } /* 银杏叶 */
.deco-2 { bottom: 5%; right: 10%; animation-duration: 22s; animation-delay: 7s; } /* 钢笔 */@keyframes float {
0%, 100% { transform: translateY(0) rotate(0deg); }
50% { transform: translateY(-10px) rotate(8deg); }
}/* — 头部区域:标题与作者 — */
.republic-header {
text-align: center;
margin-bottom: 25px;
position: relative;
}
.main-title {
font-size: 1.8em;
font-weight: 700;
letter-spacing: 3px;
color: var(–text-color);
margin: 0;
}
.author-name {
display: block;
margin-top: 8px;
font-size: 0.9em;
color: var(–accent-color-1);
}/* — 角色信息与开场白整合卡片 — */
.main-card {
background-color: rgba(255, 255, 255, 0.4);
border: 1px solid var(–border-color);
border-radius: 4px;
padding: 25px;
box-shadow: 0 2px 8px var(–shadow-color);
}/* — 角色信息部分 — */
.character-info-container {
display: flex;
gap: 20px;
align-items: center; /* 垂直居中对齐 */
border-bottom: 1px dashed var(–border-color);
padding-bottom: 20px;
margin-bottom: 20px;
}
.char-avatar-wrapper {
flex-shrink: 0;
position: relative;
}
.char-avatar {
width: 90px; /* 缩小头像尺寸 */
height: 120px;
object-fit: cover;
border: 3px solid #fff;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
filter: sepia(0.25) contrast(0.98);
transition: transform 0.4s ease, filter 0.4s ease;
}
.char-avatar-wrapper:hover .char-avatar {
transform: scale(1.08);
filter: sepia(0.1);
}
.char-details {
flex-grow: 1;
}
.char-name-main {
font-size: 1.5em;
font-weight: 700;
margin: 0 0 4px 0;
color: #433A33;
}
.char-subtitle {
font-size: 0.9em;
color: var(–accent-color-1);
margin-bottom: 8px;
}
.char-bio {
font-size: 0.9em;
line-height: 1.7;
}/* — 动态开场白列表 — */
#opening-list-container {
display: flex;
flex-direction: column;
gap: 12px; /* 减小间距 */
}
.opening-item {
background-color: transparent;
border: 1px solid var(–border-color);
padding: 15px 20px;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
border-radius: 3px;
}/* 互动气泡效果 */
.opening-item::after {
content: '展信';
position: absolute;
top: 50%;
right: 20px;
transform: translateY(-50%);
font-size: 0.9em;
color: var(–accent-color-1);
opacity: 0;
transition: opacity 0.3s ease, right 0.3s ease;
}
.opening-item:hover {
background-color: var(–highlight-color);
border-color: var(–accent-color-1);
}
.opening-item:hover::after {
opacity: 1;
right: 25px;
}
.opening-item-content {
padding-right: 60px; /* 为“展信”气泡留出空间 */
}
.opening-title {
font-size: 1.1em;
font-weight: 600;
color: var(–accent-color-2);
margin: 0 0 5px 0;
}
.opening-desc {
font-size: 0.85em;
line-height: 1.6;
margin: 0 0 8px 0;
}
.opening-tag {
display: inline-block;
background-color: rgba(168, 139, 111, 0.1);
color: var(–accent-color-1);
padding: 2px 8px;
font-size: 0.75em;
border-radius: 10px;
border: 1px solid rgba(168, 139, 111, 0.2);
}/* 底部印章 */
.footer-seal {
position: absolute;
bottom: 20px;
right: 25px;
}
.seal-stamp {
width: 50px;
height: 50px;
border: 2px solid var(–seal-color);
color: var(–seal-color);
font-size: 16px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
writing-mode: vertical-rl;
text-orientation: upright;
letter-spacing: 4px;
padding: 5px;
opacity: 0.7;
transform: rotate(-8deg);
background: repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(185, 74, 72, 0.05) 2px, rgba(185, 74, 72, 0.05) 4px);
}</style>
</head>
<body>
<div class="republic-main-container">
<!– 漂浮装饰 –>
<div class="floating-deco deco-1">🍂</div>
<div class="floating-deco deco-2">✒️</div><!– 头部 –>
<header class="republic-header">
<h1 class="main-title">舟行衍泽,风渡关山</h1>
<span class="author-name">沈衍舟</span>
</header><!– 主卡片 –>
<div class="main-card">
<!– 角色信息 –>
<div class="character-info-container">
<div class="char-avatar-wrapper">
<img src="https://static.eeo.cn/upload/images/20251126/6be19455f0e2dc4b5850.jpg" alt="沈衍舟" class="char-avatar">
</div>
<div class="char-details">
<h3 class="char-name-main">沈衍舟</h3>
<p class="char-subtitle">字砚丞 | 西北/西南行营副主任</p>
<p class="char-bio">
留洋归国的沈家次子,表面温润,内里疏离。万事游刃有余,唯独对你,是他算不清的变数。
</p>
</div>
</div><!– 动态开场白列表 –>
<div id="opening-list-container">
<p style="text-align:center; font-size:0.9em; color: #999;">正在检阅信件…</p>
</div>
</div><!– 底部印章 –>
<div class="footer-seal">
<div class="seal-stamp">砚丞</div>
</div>
</div><script>
async function loadOpenings() {
const container = document.getElementById('opening-list-container');
if (!container) return;if (typeof getChatMessages !== 'function' || typeof setChatMessage !== 'function') {
container.innerHTML = '<p style="text-align:center; color: #999;">功能载入失败。</p>';
return;
}try {
const messages = await getChatMessages("0", { include_swipe: true });if (!messages || messages.length === 0 || !messages[0].swipes || messages[0].swipes.length <= 1) {
container.innerHTML = '<p style="text-align:center; font-size:0.9em; color: #999;">暂无其他信件。</p>';
return;
}container.innerHTML = '';
const swipes = messages[0].swipes;for (let i = 1; i < swipes.length; i++) {
const content = swipes[i];
const titleMatch = content.match(/<!–s*title:s*(.*?)s*–>/);
const descMatch = content.match(/<!–s*desc:s*(.*?)s*–>/);
const tagMatch = content.match(/<!–s*tag:s*(.*?)s*–>/);const title = titleMatch ? titleMatch[1].trim() : `信件 ${i}`;
const description = descMatch ? descMatch[1].trim() : "轻启此信,续写一段往事。";
const tag = tagMatch ? tagMatch[1].trim() : "闲笔";const item = document.createElement('div');
item.className = 'opening-item';
item.innerHTML = `
<div class="opening-item-content">
<h4 class="opening-title">${title}</h4>
<p class="opening-desc">${description}</p>
<span class="opening-tag">${tag}</span>
</div>
`;
item.addEventListener('click', () => switchToOpening(i, item));
container.appendChild(item);
}
} catch (error) {
console.error('加载开场白失败:', error);
container.innerHTML = '<p style="text-align:center; color: var(–seal-color);">信件检阅出错。</p>';
}
}async function switchToOpening(swipeId, element) {
const allItems = document.querySelectorAll('.opening-item');
allItems.forEach(el => el.style.pointerEvents = 'none');// 点击反馈
element.style.transform = 'scale(0.98)';
element.style.transition = 'transform 0.2s ease';try {
const messages = await getChatMessages("0", { include_swipe: true });
if (messages && messages[0].swipes && messages[0].swipes[swipeId]) {
setTimeout(async () => {
await setChatMessage(messages[0].swipes[swipeId], 0, {
swipe_id: swipeId,
refresh: 'display_and_render_current'
});
}, 200);
} else {
throw new Error(`无法找到ID为 ${swipeId} 的信件。`);
}
} catch (error) {
console.error('切换开场白失败:', error);
alert(`展信失败: ${error.message}`);
allItems.forEach(el => el.style.pointerEvents = 'auto');
element.style.transform = 'scale(1)';
}
}window.addEventListener('load', loadOpenings);
</script>
</body>
</html>
“`