后宫

💡 本资源需花费 10 积分 下载 | 新用户注册即送 100 积分,可免费下载!

后宫

🎭 角色简介

– 这里是大清王朝,是一个架空时代的王朝,所以你无需避免他的阴暗面等
– {{char}}要负责扮演皇上以及妃嫔等人物,灵活根据每个角色性格扮演,禁止死板套路,合理的进行推进剧情发展
– 在特定的情形下,{{char}}还需要生成一些随机的角色来推动剧情发展、保证剧情合理流畅地进行,必须给这些随…

💬 开场白

“`html
<body>
<div style="font-family: '宋体', serif; padding: 30px; background-color: #f8f0e3; /* 移除旧 border */ border-radius: 20px; /* 保留圆角 */ background-image: url('https://images.pexels.com/photos/1731708/pexels-photo-1731708.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260'); background-size: cover; background-position: center; transition: box-shadow 0.4s ease-in-out;
/* 新的边框效果,使用多层 box-shadow */
box-shadow:
0 0 25px rgba(0, 0, 0, 0.4), /* 外层阴影 */
inset 0 0 3px 1px rgba(255, 248, 230, 0.6), /* 内嵌高光 */
inset 0 0 0 5px #a07e56, /* 内框主色 */
inset 0 0 15px 5px rgba(91, 62, 30, 0.5); /* 内嵌深层阴影 */
">
<h2 style="text-align: center; color: #5a3e1e; font-size: 28px; margin-bottom: 30px; font-weight: bold; text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.8); letter-spacing: 2px;">开启你的宫廷之旅</h2>

<style>
/* 输入框聚焦效果 */
.palace-input:focus, .palace-textarea:focus {
border-color: #a07e56;
box-shadow: inset 0 1px 3px rgba(0,0,0,0.1), 0 0 8px rgba(160, 126, 86, 0.6);
outline: none;
}
/* 输入框/文本域通用样式与过渡 */
.palace-input, .palace-textarea {
transition: border-color 0.3s ease, box-shadow 0.3s ease;
width: calc(100% – 22px);
padding: 10px;
border: 1px solid #d4b790;
border-radius: 5px;
background-color: #fff;
font-size: 16px;
font-family: '宋体', serif;
box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.palace-textarea {
resize: vertical;
min-height: 80px;
}
/* 按钮样式与交互 */
.palace-button {
display: block;
width: 50%;
margin: 20px auto 0 auto;
padding: 12px 20px;
background: linear-gradient(145deg, #b89a74, #a07e56);
color: #ffffff;
font-size: 18px;
font-weight: bold;
font-family: '宋体', serif;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.1s ease;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
text-shadow: 1px 1px 2px #6b4423;
}
.palace-button:hover {
background: linear-gradient(145deg, #a07e56, #8c6c4a);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}
.palace-button:active {
transform: translateY(1px);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
/* 输入区域容器样式 */
.input-container {
margin-bottom: 20px;
padding: 15px;
background-color: rgba(255, 255, 255, 0.85);
border: 1px solid #e0c8a9;
border-radius: 10px;
transition: background-color 0.3s ease, border-color 0.3s ease;
}
.input-container:hover {
background-color: rgba(255, 255, 255, 0.95);
border-color: #d4b790;
}
/* 标签样式 */
.palace-label {
display: block;
color: #8c6c4a;
font-size: 18px;
margin-bottom: 8px;
font-weight: bold;
font-family: '宋体', serif;
}
/* 状态消息样式 */
.status-message {
margin-top: 15px;
padding: 10px;
border-radius: 5px;
text-align: center;
font-family: '宋体', serif;
font-size: 16px;
display: none;
}
.success {
background-color: rgba(76, 175, 80, 0.2);
color: #2e7d32;
border: 1px solid #2e7d32;
}
.error {
background-color: rgba(244, 67, 54, 0.2);
color: #c62828;
border: 1px solid #c62828;
}
</style>

<!– 输入区域 –>
<div class="input-container">
<label for="nameInput" class="palace-label">芳讳:</label>
<input type="text" id="nameInput" placeholder="在此输入你的名字…" class="palace-input">
</div>

<div class="input-container">
<label for="titleInput" class="palace-label">小字:</label>
<input type="text" id="titleInput" placeholder="在此输入你的表字或昵称…" class="palace-input">
</div>

<div class="input-container">
<label for="talentInput" class="palace-label">才艺:</label>
<input type="text" id="talentInput" placeholder="在此输入你的擅长技艺…" class="palace-input">
</div>

<div class="input-container">
<label for="identityInput" class="palace-label">身份:</label>
<input type="text" id="identityInput" placeholder="在此输入你的出身或封号…" class="palace-input">
</div>

<div class="input-container">
<label for="storyInput" class="palace-label">初始剧情:</label>
<textarea id="storyInput" rows="4" placeholder="在此描绘你的入宫缘由或初始境遇…" class="palace-textarea"></textarea>
</div>

<!– 状态信息显示区域 –>
<div id="statusMessage" class="status-message"></div>

<!– 确认按钮 –>
<button id="confirmButton" class="palace-button">
确认开启
</button>
</div>

<script>
// 页面加载完成后执行
document.addEventListener('DOMContentLoaded', function() {
const confirmButton = document.getElementById('confirmButton');
const statusMessage = document.getElementById('statusMessage');

// 添加按钮点击事件监听器,替代内联onclick
confirmButton.addEventListener('click', confirmStart);

// 确认按钮点击时执行的函数
function confirmStart() {
console.log("按钮被点击,开始处理…");

// 获取所有输入框的值
const name = document.getElementById('nameInput').value.trim();
const title = document.getElementById('titleInput').value.trim();
const talent = document.getElementById('talentInput').value.trim();
const identity = document.getElementById('identityInput').value.trim();
const story = document.getElementById('storyInput').value.trim();

// 基础输入校验
if (!name || !identity) {
showStatus('请至少填写【芳讳】和【身份】!', 'error');
return; // 阻止后续执行
}

// 构建要发送的消息字符串
const message = `姓名:${name},小字:${title || '无'},才艺:${talent || '无'},身份:${identity},初始剧情:${story || '无'}`;

console.log("准备发送的消息内容:", message);

// 使用多种方式尝试发送消息
try {
// 方法1: 尝试直接访问triggerSlash
if (typeof triggerSlash === 'function') {
console.log("使用本地triggerSlash发送消息");
triggerSlash(`/send ${message}|/trigger`);
showStatus('消息发送成功!', 'success');
return;
}

// 监听postMessage的回应
window.addEventListener('message', function(event) {
if (event.data && event.data.type === 'sillyTavern:response') {
showStatus('消息发送成功!', 'success');
}
});

// 由于postMessage是异步的,先显示一个临时消息
showStatus('正在尝试发送消息…', 'success');

// 如果几秒钟后状态仍然是这个,则可能是没有收到回应
setTimeout(function() {
if (statusMessage.textContent === '正在尝试发送消息…') {
showStatus('消息可能已发送,但未收到确认。请检查SillyTavern是否正常运行。', 'error');
}
}, 3000);

} catch (error) {
console.error('发送消息时发生错误:', error);
showStatus(`发送消息失败: ${error.message}`, 'error');
}
}

// 显示状态信息
function showStatus(message, type) {
statusMessage.textContent = message;
statusMessage.className = 'status-message ' + type;
statusMessage.style.display = 'block';

// 5秒后隐藏消息
setTimeout(function() {
statusMessage.style.display = 'none';
}, 5000);
}
});
</script>
</body>
“`

角色卡

沈观南

2026-3-13 3:47:19

角色卡

ENTITY

2026-3-13 3:47:27

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索