Music Creation Page: - Vinyl 3D flip to view lyrics, tonearm animation, glow rotation effect - Circular SVG progress ring, speech bubble feedback, confirm dialog - Playlist modal, free creation input, lyrics formatting optimization - MiniMax API real music generation with SSE streaming progress Backend: - FastAPI proxy server.py for MiniMax API calls - Music + lyrics file persistence to Capybara music/ directory - GET /api/playlist endpoint for auto-building playlist from files UI/UX Refinements: - frontend-design skill compliance across all pages - Glassmorphism effects, modal interactions, scroll tap prevention - iPhone 12 Pro responsive layout (390x844) Flutter Development Preparation: - Installed flutter-expert skill with 6 reference docs - Added 5 Cursor Rules: official Flutter, clean architecture, UI performance, testing, Dart standards Assets: - 9 Capybara music MP3 files + lyrics TXT files - MiniMax API documentation Co-authored-by: Cursor <cursoragent@cursor.com>
365 lines
12 KiB
HTML
365 lines
12 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport"
|
|
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
|
|
<title>Airhub - 角色记忆</title>
|
|
<link rel="stylesheet" href="styles.css">
|
|
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=DM+Sans:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
.page-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 16px 20px;
|
|
padding-top: calc(env(safe-area-inset-top, 20px) + 48px);
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
position: absolute;
|
|
top: 0;
|
|
z-index: 10;
|
|
}
|
|
|
|
.back-btn {
|
|
background: rgba(255, 255, 255, 0.25);
|
|
backdrop-filter: blur(8px);
|
|
border: 1px solid rgba(255, 255, 255, 0.4);
|
|
width: 44px;
|
|
height: 44px;
|
|
border-radius: 22px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: #1F2937;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.back-btn:active {
|
|
transform: scale(0.92);
|
|
}
|
|
|
|
.page-title {
|
|
font-size: 18px;
|
|
font-weight: 600;
|
|
color: #1F2937;
|
|
}
|
|
|
|
.help-btn {
|
|
background: rgba(255, 255, 255, 0.25);
|
|
backdrop-filter: blur(8px);
|
|
border: 1px solid rgba(255, 255, 255, 0.4);
|
|
width: 44px;
|
|
height: 44px;
|
|
border-radius: 22px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: #6B7280;
|
|
cursor: pointer;
|
|
font-size: 18px;
|
|
}
|
|
|
|
.agent-content {
|
|
padding: calc(env(safe-area-inset-top, 20px) + 100px) 20px 40px;
|
|
overflow-y: auto;
|
|
height: 100%;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
/* 角色卡片 - 使用 Capybara 卡片样式 */
|
|
.agent-card {
|
|
/* Capybara 渐变 */
|
|
background: linear-gradient(90deg, #E6B98D 0%, #E8C9A8 35%, #D4A373 70%, #B07D5A 100%);
|
|
border-radius: 20px;
|
|
padding: 20px;
|
|
margin-bottom: 16px;
|
|
box-shadow:
|
|
0 0 20px rgba(201, 160, 122, 0.25),
|
|
0 8px 24px rgba(166, 124, 82, 0.2),
|
|
inset 0 1px 1px rgba(255, 255, 255, 0.35);
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* 卡片高光层 */
|
|
.agent-card::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 50%;
|
|
background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 100%);
|
|
border-radius: 20px 20px 50% 50%;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.agent-header {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 12px;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.agent-icon {
|
|
width: 48px;
|
|
height: 48px;
|
|
background: rgba(255, 255, 255, 0.25);
|
|
backdrop-filter: blur(8px);
|
|
border-radius: 12px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 24px;
|
|
}
|
|
|
|
.agent-info {
|
|
flex: 1;
|
|
}
|
|
|
|
.agent-id {
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
color: #FFFFFF;
|
|
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.agent-date {
|
|
font-size: 12px;
|
|
color: rgba(255, 255, 255, 0.85);
|
|
position: absolute;
|
|
top: 20px;
|
|
right: 20px;
|
|
}
|
|
|
|
.agent-detail {
|
|
font-size: 14px;
|
|
color: rgba(255, 255, 255, 0.85);
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.agent-detail span {
|
|
color: #FFFFFF;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.agent-footer {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
margin-top: 12px;
|
|
padding-top: 12px;
|
|
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
|
}
|
|
|
|
/* 通用动作按钮 (毛玻璃胶囊) */
|
|
.action-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
background: rgba(255, 255, 255, 0.2);
|
|
/* 恢复低透明度 */
|
|
backdrop-filter: blur(8px);
|
|
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
padding: 6px 14px;
|
|
border-radius: 20px;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.action-btn:active {
|
|
transform: scale(0.95);
|
|
background: rgba(255, 255, 255, 0.3);
|
|
}
|
|
|
|
.action-btn:hover {
|
|
background: rgba(255, 255, 255, 0.25);
|
|
border-color: rgba(255, 255, 255, 0.4);
|
|
}
|
|
|
|
.action-btn svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
|
|
/* 解绑 (红色警示 - 带白色光晕垫底,包含图标和文字) */
|
|
.unbind-link:not(.inject-link) {
|
|
color: #EF4444;
|
|
/* 使用 drop-shadow 滤镜可以同时给 SVG 图标和文字添加光晕 */
|
|
filter: drop-shadow(0 0 2px #FFFFFF) drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
|
|
}
|
|
|
|
/* 注入 (主题棕色 - 带白色光晕) */
|
|
.inject-link {
|
|
color: #B07D5A !important;
|
|
filter: drop-shadow(0 0 2px #FFFFFF) drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
|
|
}
|
|
|
|
/* 空状态 */
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 60px 20px;
|
|
color: #9CA3AF;
|
|
}
|
|
|
|
.empty-state-icon {
|
|
font-size: 64px;
|
|
margin-bottom: 16px;
|
|
opacity: 0.5;
|
|
}
|
|
|
|
.empty-state-text {
|
|
font-size: 16px;
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
.add-btn {
|
|
background: linear-gradient(135deg, #ECCFA8 0%, #C99672 100%);
|
|
border: none;
|
|
padding: 14px 32px;
|
|
border-radius: 25px;
|
|
color: white;
|
|
font-weight: 600;
|
|
font-size: 16px;
|
|
cursor: pointer;
|
|
box-shadow: 0 4px 15px rgba(201, 150, 114, 0.3);
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.add-btn:active {
|
|
transform: scale(0.95);
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="app-container">
|
|
<div class="gradient-bg">
|
|
<div class="gradient-layer layer-1"></div>
|
|
</div>
|
|
|
|
<header class="page-header">
|
|
<button class="back-btn" onclick="history.back()">
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path d="M15 18l-6-6 6-6"></path>
|
|
</svg>
|
|
</button>
|
|
<span class="page-title">角色记忆</span>
|
|
<button class="help-btn" onclick="showHelp()">?</button>
|
|
</header>
|
|
|
|
<main class="agent-content">
|
|
<!-- 角色卡片示例 -->
|
|
<div class="agent-card">
|
|
<div class="agent-date">2025/01/15</div>
|
|
<div class="agent-header">
|
|
<div class="agent-icon">🧠</div>
|
|
<div class="agent-info">
|
|
<div class="agent-id">Airhub_Mem_01</div>
|
|
</div>
|
|
</div>
|
|
<div class="agent-detail">已绑定:<span>Airhub_5G</span></div>
|
|
<div class="agent-detail">角色昵称:<span>小毛球</span></div>
|
|
<div class="agent-footer">
|
|
<div class="unbind-link action-btn" onclick="unbindAgent('Airhub_Mem_01')">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path d="M18 6L6 18M6 6l12 12"></path>
|
|
</svg>
|
|
解绑
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 第二个角色卡片 -->
|
|
<div class="agent-card">
|
|
<div class="agent-date">2024/08/22</div>
|
|
<div class="agent-header">
|
|
<div class="agent-icon">🐾</div>
|
|
<div class="agent-info">
|
|
<div class="agent-id">Airhub_Mem_02</div>
|
|
</div>
|
|
</div>
|
|
<div class="agent-detail">已绑定:<span>未绑定设备</span></div>
|
|
<div class="agent-detail">角色昵称:<span>豆豆</span></div>
|
|
<div class="agent-footer">
|
|
<div class="unbind-link inject-link action-btn" onclick="injectAgent('Airhub_Mem_02')">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path d="M12 5v14M5 12h14"></path>
|
|
</svg>
|
|
注入设备
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<!-- 解绑确认弹窗 -->
|
|
<div class="modal-overlay" id="unbind-modal">
|
|
<div class="glass-modal">
|
|
<div class="modal-title">确认解绑角色记忆?</div>
|
|
<div class="modal-desc" id="unbind-desc">解绑后,该角色记忆将与当前设备断开连接,但数据会保留在云端。</div>
|
|
<div class="modal-actions">
|
|
<button class="modal-btn cancel" onclick="closeUnbindModal()">取消</button>
|
|
<button class="modal-btn confirm" style="background: #EF4444;" onclick="confirmUnbind()">确认解绑</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 通用提示弹窗 -->
|
|
<div class="modal-overlay" id="message-modal">
|
|
<div class="glass-modal">
|
|
<div class="modal-title" id="msg-title">提示</div>
|
|
<div class="modal-desc" id="msg-desc">内容</div>
|
|
<div class="modal-actions">
|
|
<button class="modal-btn confirm" onclick="closeMessageModal()">确定</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
let currentAgentId = '';
|
|
|
|
// 通用 Modal
|
|
function showMessage(title, desc) {
|
|
document.getElementById('msg-title').innerText = title;
|
|
document.getElementById('msg-desc').innerText = desc;
|
|
document.getElementById('message-modal').classList.add('active');
|
|
}
|
|
|
|
function closeMessageModal() {
|
|
document.getElementById('message-modal').classList.remove('active');
|
|
}
|
|
|
|
function showHelp() {
|
|
showMessage('什么是角色记忆?', '角色记忆是您与 AI 互动产生的人格数据,它是独立的数字资产,可以在不同设备间迁移,或分享给好友。');
|
|
}
|
|
|
|
function unbindAgent(agentId) {
|
|
currentAgentId = agentId;
|
|
document.getElementById('unbind-modal').classList.add('active');
|
|
}
|
|
|
|
function closeUnbindModal() {
|
|
document.getElementById('unbind-modal').classList.remove('active');
|
|
}
|
|
|
|
function confirmUnbind() {
|
|
closeUnbindModal();
|
|
showMessage('解绑成功', `已解绑角色记忆: ${currentAgentId}\n您可以随时在其他设备上重新注入。`);
|
|
// 实际应用中这里会刷新列表
|
|
}
|
|
|
|
function injectAgent(agentId) {
|
|
// 跳转到设备选择页面
|
|
showMessage('准备注入', `正在查找附近的可用设备以注入: ${agentId}\n(模拟功能)`);
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html> |