Compare commits

...

9 Commits

Author SHA1 Message Date
dbd1853e6e feat: 智能体发现和收藏功能
- 智能体界面顶部右侧添加搜索按钮(发现智能体)
- 点击进入发现页面,显示所有系统智能体
- 每个智能体显示简介、热度、类别
- 支持添加和收藏按钮
- 添加的智能体自动归类到对应类别
- 智能体界面顶部右侧添加收藏按钮(☆)
- 点击进入收藏夹页面,点击智能体进入对话
- 智能体长按弹出操作菜单(置顶、收藏、删除)
- 置顶、收藏、用户智能体配置持久化存储
2026-04-27 10:45:30 +08:00
213b11c707 feat: 智能体历史改为显示每次对话记录而非合并统计 2026-04-27 00:26:51 +08:00
0303ccabc0 fix: 智能体使用记录改为发送第一条消息时才记录 2026-04-26 23:52:14 +08:00
e6b3465aa7 fix: 最近使用改为标题右侧显示更多>>链接 2026-04-26 23:48:42 +08:00
b6455e4720 feat: 智能体历史使用列表 - 显示最近使用的智能体(最多5个)+ 使用次数和时间 + 查看全部历史页面 2026-04-26 23:24:58 +08:00
05d1b60671 fix: 智能体和我的页面头部统一为紫色渐变风格 2026-04-26 23:14:39 +08:00
484bdf07fe fix: 恢复对话页面头部样式 - 紫色渐变背景 + 搜索按钮 + 新建对话按钮 2026-04-26 23:06:42 +08:00
05ead34c64 feat: 首页重构 - 底部导航栏(对话/智能体/我的)+ 智能体分类列表 + 智能体对话界面 2026-04-26 22:59:25 +08:00
9098e6b4f7 feat: AI生成时智能滚动 - 用户可自由滚动查看,只在底部时自动滚动 2026-04-26 22:48:57 +08:00
3 changed files with 2382 additions and 8 deletions

1460
www/app.js

File diff suppressed because it is too large Load Diff

View File

@@ -8,12 +8,12 @@
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>AI助手</title>
<link rel="stylesheet" href="style.css?v=2.7.7">
<link rel="stylesheet" href="style.css?v=3.0.0">
<link rel="manifest" href="manifest.json">
</head>
<body>
<div id="app"></div>
<script src="marked.min.js?v=2.7.7"></script>
<script src="app.js?v=2.7.7"></script>
<script src="marked.min.js?v=3.0.0"></script>
<script src="app.js?v=3.0.0"></script>
</body>
</html>

View File

@@ -29,6 +29,930 @@ body {
min-height: 100dvh;
}
/* ==================== 主页布局 ==================== */
.main-page {
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
background: #f5f5f5;
}
.main-content {
flex: 1;
overflow-y: auto;
}
/* 底部导航栏 */
.bottom-nav {
display: flex;
justify-content: space-around;
align-items: center;
padding: 8px 0;
background: white;
border-top: 1px solid var(--border-color);
position: sticky;
bottom: 0;
}
.nav-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
padding: 8px 16px;
color: var(--text-light);
cursor: pointer;
transition: all 0.2s;
}
.nav-item svg {
flex-shrink: 0;
}
.nav-item span {
font-size: 12px;
}
.nav-item:hover {
color: var(--primary);
}
.nav-item.active {
color: var(--primary);
}
/* ==================== 页面通用头部(紫色渐变) ==================== */
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
}
.page-header h1 {
font-size: 18px;
font-weight: 600;
}
/* ==================== 对话页面 ==================== */
.chats-page {
display: flex;
flex-direction: column;
height: 100%;
}
.chats-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
}
.chats-header h1 {
font-size: 18px;
font-weight: 600;
}
.chats-header-actions {
display: flex;
align-items: center;
gap: 8px;
}
.chats-header-btn {
display: flex;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
background: rgba(255,255,255,0.95);
border: none;
border-radius: 50%;
color: var(--primary);
cursor: pointer;
transition: all 0.25s ease;
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.chats-header-btn:hover {
transform: scale(1.08);
box-shadow: 0 4px 16px rgba(102,126,234,0.4);
color: #5a67d8;
}
.chats-header-btn:active {
transform: scale(0.95);
}
.chats-content {
flex: 1;
padding: 16px;
overflow-y: auto;
background: #f5f5f5;
}
/* ==================== 智能体页面 ==================== */
.agents-page {
display: flex;
flex-direction: column;
height: 100%;
}
.agents-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
}
.agents-header h1 {
font-size: 18px;
font-weight: 600;
}
.agents-header-actions {
display: flex;
align-items: center;
gap: 8px;
}
.agents-header-btn {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
background: rgba(255,255,255,0.95);
border: none;
border-radius: 50%;
color: var(--primary);
cursor: pointer;
transition: all 0.25s ease;
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
font-size: 18px;
}
.agents-header-btn:hover {
transform: scale(1.08);
box-shadow: 0 4px 16px rgba(102,126,234,0.4);
color: #5a67d8;
}
.agents-header-btn.favorite-btn {
font-size: 20px;
font-weight: bold;
}
.agents-header-btn.favorite-btn.has-favorites {
color: #f59e0b;
}
.agents-content {
flex: 1;
padding: 16px;
overflow-y: auto;
background: #f5f5f5;
}
.agents-section {
margin-bottom: 24px;
}
.section-title {
font-size: 16px;
font-weight: 600;
color: var(--text-color);
margin-bottom: 12px;
}
.section-title-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.section-title-row .section-title {
margin-bottom: 0;
}
.section-more {
font-size: 14px;
color: var(--primary);
cursor: pointer;
transition: color 0.2s;
}
.section-more:hover {
color: #5a67d8;
}
.agents-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 12px;
}
.agent-card {
display: flex;
flex-direction: column;
align-items: center;
padding: 16px;
background: white;
border: 1px solid var(--border-color);
border-radius: 12px;
cursor: pointer;
transition: all 0.2s;
position: relative;
}
.agent-card:hover {
border-color: var(--primary);
background: rgba(102, 126, 234, 0.05);
transform: translateY(-2px);
}
.agent-card.pinned {
border-color: var(--primary);
background: rgba(102, 126, 234, 0.08);
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}
.agent-card.favorite {
border-color: #f59e0b;
box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}
.agent-pin-icon {
position: absolute;
top: 8px;
left: 8px;
font-size: 14px;
}
.agent-fav-icon {
position: absolute;
top: 8px;
right: 8px;
font-size: 14px;
}
.agent-avatar {
font-size: 32px;
margin-bottom: 8px;
}
.agent-name {
font-size: 14px;
font-weight: 600;
color: var(--text-color);
margin-bottom: 4px;
}
.agent-desc {
font-size: 12px;
color: var(--text-light);
text-align: center;
}
/* 智能体操作菜单 */
.agent-action-menu {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: transparent;
display: none;
z-index: 1000;
}
.agent-action-menu.show {
display: block;
}
.agent-action-menu-content {
background: white;
border-radius: 16px 16px 0 0;
padding: 16px;
box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
animation: slideUp 0.2s ease;
}
.agent-action-item {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 16px;
border-radius: 10px;
cursor: pointer;
transition: all 0.2s;
}
.agent-action-item:hover {
background: rgba(102, 126, 234, 0.1);
}
.agent-action-item svg {
color: var(--primary);
}
.agent-action-item span {
font-size: 16px;
color: var(--text-color);
}
.agent-action-item.delete-action svg,
.agent-action-item.delete-action span {
color: #e53e3e;
}
.agent-action-item.delete-action:hover {
background: rgba(229, 62, 62, 0.1);
}
/* ==================== 智能体发现页面 ==================== */
.agent-discover-page {
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
background: #f5f5f5;
}
.discover-header {
display: flex;
align-items: center;
padding: 12px 16px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
}
.discover-header h1 {
font-size: 18px;
font-weight: 600;
margin-left: 12px;
}
.back-btn-white {
background: transparent;
border: none;
color: white;
padding: 8px;
cursor: pointer;
display: flex;
align-items: center;
}
.discover-content {
flex: 1;
padding: 16px;
overflow-y: auto;
}
.discover-search {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
background: white;
border: 1px solid var(--border-color);
border-radius: 12px;
margin-bottom: 16px;
}
.discover-search svg {
color: var(--text-light);
}
.discover-search input {
flex: 1;
font-size: 16px;
border: none;
outline: none;
background: transparent;
}
.discover-section {
margin-bottom: 24px;
}
.discover-section-title {
font-size: 16px;
font-weight: 600;
color: var(--text-color);
margin-bottom: 12px;
}
.discover-grid {
display: flex;
flex-direction: column;
gap: 12px;
}
.discover-card {
display: flex;
flex-direction: column;
padding: 16px;
background: white;
border: 1px solid var(--border-color);
border-radius: 12px;
transition: all 0.2s;
}
.discover-card:hover {
border-color: var(--primary);
background: rgba(102, 126, 234, 0.05);
}
.discover-card-header {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 8px;
}
.discover-avatar {
font-size: 32px;
}
.discover-card-info {
flex: 1;
}
.discover-name {
font-size: 16px;
font-weight: 600;
color: var(--text-color);
}
.discover-meta {
display: flex;
align-items: center;
gap: 8px;
margin-top: 4px;
}
.discover-category {
font-size: 12px;
color: var(--primary);
background: rgba(102, 126, 234, 0.1);
padding: 2px 8px;
border-radius: 4px;
}
.discover-heat {
font-size: 12px;
color: #f59e0b;
}
.discover-desc {
font-size: 14px;
color: var(--text-light);
margin-bottom: 12px;
}
.discover-actions {
display: flex;
gap: 8px;
}
.discover-action-btn {
flex: 1;
padding: 8px 12px;
border: 1px solid var(--border-color);
border-radius: 8px;
font-size: 14px;
color: var(--text-light);
background: white;
cursor: pointer;
transition: all 0.2s;
}
.discover-action-btn:hover {
border-color: var(--primary);
color: var(--primary);
}
.discover-action-btn.add-btn {
border-color: var(--primary);
color: var(--primary);
}
.discover-action-btn.add-btn:hover {
background: var(--primary);
color: white;
}
.discover-action-btn.add-btn.added {
background: rgba(102, 126, 234, 0.1);
color: var(--primary);
border-color: var(--primary);
}
.discover-action-btn.favorite-btn {
border-color: #f59e0b;
color: #f59e0b;
}
.discover-action-btn.favorite-btn:hover {
background: #f59e0b;
color: white;
}
.discover-action-btn.favorite-btn.favorited {
background: #f59e0b;
color: white;
}
/* ==================== 智能体收藏夹页面 ==================== */
.agent-favorite-page {
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
background: #f5f5f5;
}
.favorite-header {
display: flex;
align-items: center;
padding: 12px 16px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
}
.favorite-header h1 {
font-size: 18px;
font-weight: 600;
margin-left: 12px;
}
.favorite-content {
flex: 1;
padding: 16px;
overflow-y: auto;
}
.empty-favorites {
text-align: center;
padding: 60px 20px;
}
.empty-icon {
font-size: 48px;
margin-bottom: 16px;
color: #f59e0b;
}
.empty-favorites p {
color: var(--text-light);
margin: 8px 0;
}
.empty-favorites .empty-tip {
font-size: 14px;
color: var(--primary);
}
.favorite-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 12px;
}
.favorite-agent-card {
display: flex;
flex-direction: column;
align-items: center;
padding: 16px;
background: white;
border: 1px solid #f59e0b;
border-radius: 12px;
cursor: pointer;
transition: all 0.2s;
position: relative;
box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}
.favorite-agent-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}
.favorite-agent-avatar {
font-size: 32px;
margin-bottom: 8px;
}
.favorite-agent-name {
font-size: 14px;
font-weight: 600;
color: var(--text-color);
margin-bottom: 4px;
}
.favorite-agent-desc {
font-size: 12px;
color: var(--text-light);
text-align: center;
}
.favorite-agent-unfav {
position: absolute;
top: 8px;
right: 8px;
width: 24px;
height: 24px;
background: transparent;
border: none;
color: #f59e0b;
font-size: 16px;
cursor: pointer;
opacity: 0.6;
transition: opacity 0.2s;
}
.favorite-agent-unfav:hover {
opacity: 1;
}
/* 最近使用的智能体列表 */
.recent-agents-list {
display: flex;
flex-direction: column;
gap: 8px;
}
.recent-agent-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background: white;
border: 1px solid var(--border-color);
border-radius: 10px;
cursor: pointer;
transition: all 0.2s;
}
.recent-agent-item:hover {
border-color: var(--primary);
background: rgba(102, 126, 234, 0.05);
}
.recent-agent-left {
display: flex;
align-items: center;
gap: 12px;
}
.recent-agent-avatar {
font-size: 20px;
}
.recent-agent-name {
font-size: 14px;
font-weight: 500;
color: var(--text-color);
}
.recent-agent-right {
display: flex;
align-items: center;
gap: 12px;
font-size: 12px;
color: var(--text-light);
}
.recent-agent-usage {
color: var(--primary);
}
.recent-agent-agent-name {
font-size: 12px;
color: var(--primary);
background: rgba(102, 126, 234, 0.1);
padding: 2px 8px;
border-radius: 4px;
}
/* 智能体历史页面 */
.agent-history-page {
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
}
.back-btn-white {
background: transparent;
border: none;
color: white;
padding: 8px;
cursor: pointer;
}
.agent-history-content {
flex: 1;
padding: 16px;
overflow-y: auto;
background: #f5f5f5;
}
.agent-history-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 16px;
background: white;
border: 1px solid var(--border-color);
border-radius: 10px;
margin-bottom: 8px;
cursor: pointer;
transition: all 0.2s;
}
.agent-history-item:hover {
border-color: var(--primary);
background: rgba(102, 126, 234, 0.05);
}
.agent-history-left {
display: flex;
align-items: center;
gap: 12px;
}
.agent-history-avatar {
font-size: 24px;
}
.agent-history-name {
font-size: 15px;
font-weight: 500;
color: var(--text-color);
}
.agent-history-right {
display: flex;
align-items: center;
gap: 12px;
font-size: 13px;
color: var(--text-light);
}
.agent-history-usage {
color: var(--primary);
}
.agent-history-agent {
font-size: 12px;
color: var(--primary);
background: rgba(102, 126, 234, 0.1);
padding: 2px 8px;
border-radius: 4px;
}
/* ==================== 我的页面 ==================== */
.profile-page {
display: flex;
flex-direction: column;
height: 100%;
}
.profile-content {
flex: 1;
padding: 16px;
background: #f5f5f5;
}
.profile-card {
display: flex;
flex-direction: column;
align-items: center;
padding: 32px;
background: white;
border-radius: 12px;
margin-bottom: 16px;
}
.profile-avatar {
font-size: 48px;
margin-bottom: 12px;
}
.profile-name {
font-size: 18px;
font-weight: 600;
color: var(--text-color);
}
.profile-section {
background: white;
border-radius: 12px;
overflow: hidden;
}
.profile-item {
display: flex;
align-items: center;
gap: 12px;
padding: 16px;
border-bottom: 1px solid var(--border-color);
cursor: pointer;
transition: all 0.2s;
}
.profile-item:last-child {
border-bottom: none;
}
.profile-item:hover {
background: rgba(102, 126, 234, 0.05);
}
.profile-item svg {
color: var(--primary);
}
.profile-item span {
font-size: 16px;
color: var(--text-color);
}
.profile-footer {
margin-top: 32px;
text-align: center;
color: var(--text-light);
font-size: 14px;
}
.profile-footer p {
margin: 4px 0;
}
/* ==================== 智能体对话界面 ==================== */
.chat-page {
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
}
.chat-header {
display: flex;
align-items: center;
padding: 12px 16px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
}
.back-btn {
background: transparent;
border: none;
color: white;
padding: 8px;
cursor: pointer;
}
.header-info {
display: flex;
align-items: center;
gap: 12px;
flex: 1;
}
.agent-avatar-header {
font-size: 28px;
}
.header-text h1 {
font-size: 16px;
font-weight: 600;
margin: 0;
}
.agent-desc-header {
font-size: 12px;
opacity: 0.8;
margin: 0;
}
/* ==================== 对话列表页面 ==================== */
.conversation-list-page {