feat: 收藏夹系统 + Studio 趋势图 + 通知偏好设置
- 新增收藏夹系统 (Folder/FolderItem 模型、CRUD API、前端管理页) - 新增文章详情页收藏按钮 (书签图标、ToggleFavorite 一键收藏) - 新增 Studio 趋势图 (赋能值/评论/点赞/收藏 4 线图, 7d/30d/90d) - 新增通知偏好设置页 (评论/回复/点赞/关注 4 类开关) - 后端通知列表支持按偏好过滤 (排除已关闭的通知类型) - 下载 Chart.js 到本地静态资源 (static/js/chart.umd.min.js) - 补充收藏夹卡片、开关滑块、趋势图网格等 CSS 样式
This commit is contained in:
@ -255,6 +255,17 @@
|
||||
stroke: #f87171;
|
||||
}
|
||||
|
||||
.reaction-btn.active.reaction-fav-btn {
|
||||
border-color: #f59e0b;
|
||||
color: #f59e0b;
|
||||
background: #fffbeb;
|
||||
}
|
||||
|
||||
.reaction-btn.active.reaction-fav-btn svg {
|
||||
fill: #f59e0b;
|
||||
stroke: #f59e0b;
|
||||
}
|
||||
|
||||
.reaction-like-count {
|
||||
font-weight: 600;
|
||||
min-width: 12px;
|
||||
|
||||
@ -877,3 +877,139 @@ body {
|
||||
.energy-log-minus .energy-log-amount {
|
||||
color: #e74c3c;
|
||||
}
|
||||
|
||||
/* ---------- 收藏夹 Tab ---------- */
|
||||
.fav-toolbar {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.fav-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.fav-folder-card {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 1rem 0;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.fav-folder-card:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.fav-folder-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: .25rem;
|
||||
}
|
||||
|
||||
.fav-folder-name {
|
||||
font-size: .95rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.fav-folder-meta {
|
||||
font-size: .8rem;
|
||||
color: var(--color-text-light);
|
||||
}
|
||||
|
||||
.fav-folder-actions {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.fav-folder-del {
|
||||
padding: .35rem .75rem;
|
||||
font-size: .78rem;
|
||||
font-weight: 500;
|
||||
font-family: inherit;
|
||||
color: #e74c3c;
|
||||
background: #fff5f5;
|
||||
border: 1px solid #fecaca;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
transition: all .15s ease;
|
||||
}
|
||||
|
||||
.fav-folder-del:hover {
|
||||
background: #fee2e2;
|
||||
border-color: #e74c3c;
|
||||
}
|
||||
|
||||
/* ---------- 通知偏好 Tab ---------- */
|
||||
.notify-pref-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 1rem 0;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.notify-pref-row:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.notify-pref-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: .2rem;
|
||||
}
|
||||
|
||||
.notify-pref-label {
|
||||
font-size: .92rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.notify-pref-desc {
|
||||
font-size: .8rem;
|
||||
color: var(--color-text-light);
|
||||
}
|
||||
|
||||
.notify-pref-toggle {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 44px;
|
||||
height: 24px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.notify-pref-toggle input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.notify-pref-slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
inset: 0;
|
||||
background: #d1d5db;
|
||||
border-radius: 24px;
|
||||
transition: background .2s ease;
|
||||
}
|
||||
|
||||
.notify-pref-slider::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
height: 18px;
|
||||
width: 18px;
|
||||
left: 3px;
|
||||
bottom: 3px;
|
||||
background: #fff;
|
||||
border-radius: 50%;
|
||||
transition: transform .2s ease;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,.15);
|
||||
}
|
||||
|
||||
.notify-pref-toggle input:checked + .notify-pref-slider {
|
||||
background: var(--color-accent);
|
||||
}
|
||||
|
||||
.notify-pref-toggle input:checked + .notify-pref-slider::before {
|
||||
transform: translateX(20px);
|
||||
}
|
||||
|
||||
@ -621,6 +621,90 @@
|
||||
padding: 8px 24px;
|
||||
}
|
||||
|
||||
/* ---------- 趋势图 ---------- */
|
||||
.trends-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.trends-period {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
background: #f3f4f6;
|
||||
border-radius: 8px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.trends-period-btn {
|
||||
padding: 6px 14px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #6b7280;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-family: inherit;
|
||||
transition: all .15s ease;
|
||||
}
|
||||
|
||||
.trends-period-btn.active {
|
||||
background: #fff;
|
||||
color: #111827;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,.08);
|
||||
}
|
||||
|
||||
.trends-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.trends-card {
|
||||
background: var(--color-surface);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow);
|
||||
border: 1px solid var(--color-border);
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.trends-card-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--color-text);
|
||||
margin: 0 0 12px 0;
|
||||
}
|
||||
|
||||
.trends-chart-wrap {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 220px;
|
||||
}
|
||||
|
||||
.trends-chart-wrap canvas {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.trends-loading {
|
||||
display: none;
|
||||
text-align: center;
|
||||
padding: 60px 0;
|
||||
color: #9ca3af;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.trends-no-data {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 220px;
|
||||
color: #9ca3af;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* ---------- 响应式 ---------- */
|
||||
@media (max-width: 768px) {
|
||||
.studio-wrapper {
|
||||
|
||||
Reference in New Issue
Block a user