feat: 新增收藏功能 - 图/表/合并图一键收藏,按原始大小保存到收藏区,可查看原图/下载/删除,点击编辑在新标签页加载配置再次制作

This commit is contained in:
2026-08-19 17:55:18 +08:00
parent 7a03ecc063
commit 606610f8d3
5 changed files with 704 additions and 2 deletions
+205
View File
@@ -775,3 +775,208 @@ input[type="range"]::-moz-range-thumb {
font-size: 0.74rem;
white-space: nowrap;
}
/* ===== 收藏功能 ===== */
.header-actions {
margin-top: 10px;
}
.btn-fav-outline {
background: #fff7ed;
color: #b45309;
border: 1px solid #fcd34d;
font-size: 0.88rem;
}
.btn-fav-outline:hover {
background: #ffedd5;
border-color: #f59e0b;
}
.btn-fav {
background: #f59e0b;
color: #fff;
}
.btn-fav:hover {
background: #d97706;
}
.btn-fav:disabled {
background: #fcd34d;
cursor: wait;
transform: none;
}
/* 收藏区弹窗 */
.fav-modal {
display: none;
position: fixed;
inset: 0;
z-index: 9999;
background: rgba(15, 23, 42, 0.55);
backdrop-filter: blur(3px);
align-items: center;
justify-content: center;
padding: 24px;
}
.fav-modal-box {
width: min(1080px, 96vw);
max-height: 88vh;
background: #fff;
border-radius: 16px;
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
display: flex;
flex-direction: column;
overflow: hidden;
}
.fav-modal-head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 22px;
border-bottom: 1px solid var(--border);
background: #fffbeb;
}
.fav-modal-head h2 {
margin: 0;
font-size: 1.1rem;
color: #92400e;
}
.fav-modal-tip {
padding: 8px 22px;
font-size: 0.8rem;
color: var(--text-light);
background: #f8fafc;
border-bottom: 1px solid var(--border);
}
.fav-modal-tip #favCount {
font-weight: 700;
color: #b45309;
}
.fav-list {
padding: 18px 22px;
overflow-y: auto;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 16px;
align-content: start;
}
.fav-empty {
grid-column: 1 / -1;
text-align: center;
padding: 60px 20px;
color: var(--text-light);
font-size: 0.95rem;
}
.fav-card {
border: 1px solid var(--border);
border-radius: 12px;
overflow: hidden;
background: #fff;
box-shadow: var(--shadow);
transition: box-shadow 0.2s, transform 0.2s;
}
.fav-card:hover {
box-shadow: var(--shadow-lg);
transform: translateY(-2px);
}
.fav-card-img {
position: relative;
height: 200px;
background: repeating-conic-gradient(#f1f5f9 0% 25%, #ffffff 0% 50%) 0 0 / 20px 20px;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
cursor: zoom-in;
}
.fav-card-img img {
max-width: 100%;
max-height: 100%;
object-fit: contain;
}
.fav-badge {
position: absolute;
top: 8px;
left: 8px;
background: rgba(79, 70, 229, 0.9);
color: #fff;
font-size: 0.72rem;
padding: 2px 8px;
border-radius: 10px;
font-weight: 600;
}
.fav-card-body {
padding: 10px 12px 12px;
}
.fav-card-title {
font-size: 0.9rem;
font-weight: 600;
color: var(--text);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 4px;
}
.fav-card-meta {
font-size: 0.74rem;
color: var(--text-light);
margin-bottom: 8px;
}
.fav-card-actions {
display: flex;
gap: 6px;
align-items: center;
}
.fav-card-actions .btn-sm {
padding: 3px 10px;
font-size: 0.75rem;
flex: 0 0 auto;
}
.fav-card-actions .btn-remove {
margin-left: auto;
}
/* Toast 提示 */
#appToast {
position: fixed;
bottom: 28px;
left: 50%;
transform: translateX(-50%) translateY(20px);
background: rgba(17, 24, 39, 0.92);
color: #fff;
padding: 10px 20px;
border-radius: 10px;
font-size: 0.88rem;
z-index: 10000;
opacity: 0;
pointer-events: none;
transition: opacity 0.25s, transform 0.25s;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
max-width: 80vw;
text-align: center;
}
#appToast.show {
opacity: 1;
transform: translateX(-50%) translateY(0);
}