favorites function

This commit is contained in:
Simon
2026-02-09 13:13:46 +00:00
parent 437d42ea3d
commit f06a7cd3d0
3 changed files with 349 additions and 0 deletions

View File

@@ -333,6 +333,60 @@ body.theme-light .sidebar {
margin-bottom: 0;
}
.setting-toggle .setting-label-row {
margin-bottom: 10px;
}
.toggle {
position: relative;
display: inline-flex;
align-items: center;
width: 46px;
height: 26px;
}
.toggle input {
opacity: 0;
width: 0;
height: 0;
}
.toggle-track {
position: absolute;
inset: 0;
border-radius: 999px;
background: var(--bg-tertiary);
border: 1px solid var(--border);
transition: all 0.2s ease;
}
.toggle-track::after {
content: '';
position: absolute;
top: 2px;
left: 2px;
width: 20px;
height: 20px;
border-radius: 50%;
background: var(--text-primary);
transition: transform 0.2s ease, background 0.2s ease;
box-shadow: 0 4px 10px var(--shadow);
}
.toggle input:checked + .toggle-track {
background: var(--accent);
border-color: var(--accent);
}
.toggle input:checked + .toggle-track::after {
transform: translateX(20px);
background: var(--bg-primary);
}
.toggle input:focus-visible + .toggle-track {
box-shadow: 0 0 0 4px var(--focus-ring);
}
.btn-link {
background: transparent;
border: none;
@@ -584,6 +638,102 @@ body.theme-light .setting-item select option {
cursor: not-allowed;
}
/* Favorites Bar */
.favorites-bar {
padding: 16px clamp(16px, 3vw, 36px) 4px;
max-width: var(--grid-max);
margin: 0 auto;
}
.favorites-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8px;
}
.favorites-header h3 {
font-size: 12px;
letter-spacing: 1px;
text-transform: uppercase;
color: var(--text-secondary);
font-family: var(--font-display);
}
.favorites-list {
display: flex;
gap: 12px;
overflow-x: auto;
padding-bottom: 12px;
scroll-snap-type: x mandatory;
-webkit-overflow-scrolling: touch;
}
.favorites-list::-webkit-scrollbar {
height: 8px;
}
.favorites-list::-webkit-scrollbar-thumb {
background: var(--bg-tertiary);
border-radius: 999px;
}
.favorites-list::-webkit-scrollbar-track {
background: transparent;
}
.favorite-card {
position: relative;
flex: 0 0 auto;
width: 220px;
border-radius: var(--radius-md);
border: 1px solid var(--border);
background: var(--bg-secondary);
overflow: hidden;
cursor: pointer;
box-shadow: 0 8px 18px var(--shadow);
transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
scroll-snap-align: start;
}
.favorite-card:hover {
transform: translateY(-4px);
box-shadow: 0 14px 24px var(--shadow);
border-color: var(--border-hover);
}
.favorite-card img {
width: 100%;
aspect-ratio: 16 / 9;
object-fit: cover;
background: var(--bg-tertiary);
}
.favorite-info {
padding: 10px 12px 12px 12px;
}
.favorite-info h4 {
font-size: 13px;
font-weight: 600;
margin: 0;
color: var(--text-primary);
font-family: var(--font-display);
line-height: 1.3;
}
.favorite-info p {
margin: 4px 0 0 0;
font-size: 12px;
color: var(--text-secondary);
}
.favorites-empty {
font-size: 13px;
color: var(--text-secondary);
padding: 4px 0 12px 0;
}
/* Grid Container */
.grid-container {
display: grid;
@@ -699,6 +849,7 @@ body.theme-light .setting-item select option {
height: 100%;
border: 1px solid var(--border);
box-shadow: 0 6px 16px var(--shadow);
position: relative;
}
.video-card:hover {
@@ -749,6 +900,41 @@ body.theme-light .setting-item select option {
font-weight: 500;
}
.favorite-btn {
position: absolute;
top: 10px;
left: 10px;
width: 32px;
height: 32px;
border-radius: 50%;
border: 1px solid var(--border);
background: rgba(0, 0, 0, 0.55);
color: var(--text-primary);
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
line-height: 1;
cursor: pointer;
z-index: 1;
transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
body.theme-light .favorite-btn {
background: rgba(255, 255, 255, 0.8);
}
.favorite-btn:hover {
transform: scale(1.05);
background: var(--bg-secondary);
}
.favorite-btn.is-favorite {
color: #ff3b30;
border-color: rgba(255, 59, 48, 0.6);
background: rgba(255, 59, 48, 0.12);
}
/* Modal */
.modal {
display: none;