Yuyao Huang 6b05ba3e2c Improve tasks UI: scroll-to-focus picker, landscape layout, height alignment
- Complete tasks now displayed in scroll view alongside unfinished tasks
- Priority order: completed tasks first (by finished_time desc), then unfinished (by order asc)
- Time picker-style scroll: wheel scroll snaps per task, center item gets visual focus
- Landscape mode (>=1024px): scroll view + edit panel side by side, panel always visible
- Portrait mode: edit panel slides in from right on tap
- Fixed flex layout so scroll view and edit panel align perfectly in height
2026-05-08 15:47:25 +08:00

286 lines
4.7 KiB
CSS

.tasks-page {
padding: 1rem;
}
.tasks-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
flex-wrap: wrap;
gap: 1rem;
}
.tasks-header h1 {
color: #2c3e50;
}
.goal-selector-container {
display: flex;
align-items: center;
gap: 0.5rem;
}
.goal-selector-container label {
font-weight: 500;
color: #555;
}
.goal-selector-container select {
padding: 0.5rem;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 1rem;
min-width: 200px;
}
.tasks-container {
display: flex;
gap: 2rem;
margin-bottom: 2rem;
}
.scroll-view {
flex: 1;
height: 600px;
overflow-y: auto;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.tasks-list {
padding: 45vh 2rem;
}
.task-item {
padding: 0.75rem 1rem;
border-radius: 6px;
cursor: pointer;
transition: all 0.15s ease;
border: 2px solid transparent;
background: #f8f9fa;
min-height: 60px;
margin-bottom: 0.5rem;
opacity: 0.5;
transform: scale(0.95);
}
.task-item:last-child {
margin-bottom: 0;
}
.task-item.in-focus {
opacity: 1;
transform: scale(1.05);
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.task-item.in-focus.doing {
background: #fff3cd;
border-color: #ffc107;
}
.task-item.in-focus.todo {
background: #f8f9fa;
border-color: #667eea;
}
.task-item.in-focus.pending {
background: #e7f3ff;
border-color: #2196F3;
}
.task-item.in-focus.done {
background: #d4edda;
border-color: #28a745;
}
.task-item:hover {
background: #e9ecef;
}
.task-item.doing {
background: #fff3cd;
border-color: #ffc107;
transform: scale(1.02);
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.task-item.todo {
background: #f8f9fa;
}
.task-item.pending {
background: #e7f3ff;
border-color: #2196F3;
}
.task-item.done {
background: #d4edda;
border-color: #28a745;
opacity: 0.7;
}
.task-title {
font-weight: 600;
margin-bottom: 0.25rem;
}
.task-status-badge {
display: inline-block;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 500;
text-transform: uppercase;
}
.task-status-badge.todo {
background: #6c757d;
color: white;
}
.task-status-badge.doing {
background: #ffc107;
color: #333;
}
.task-status-badge.pending {
background: #2196F3;
color: white;
}
.task-status-badge.done {
background: #28a745;
color: white;
}
.task-item.sortable-ghost {
opacity: 0.4;
}
.task-item.sortable-chosen {
box-shadow: 0 8px 16px rgba(0,0,0,0.2);
opacity: 1;
}
.side-panel-header {
padding: 1rem;
border-bottom: 1px solid #ddd;
display: flex;
justify-content: space-between;
align-items: center;
}
.side-panel-header h2 {
color: #2c3e50;
font-size: 1.2rem;
}
.side-panel-close {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
color: #666;
}
.side-panel-content {
padding: 1rem;
flex: 1;
overflow-y: auto;
}
.side-panel-actions {
display: flex;
gap: 1rem;
margin-top: 1rem;
}
#create-task-btn {
margin-top: 1rem;
}
@media (orientation: portrait), (max-width: 1023px) {
.side-panel {
position: fixed;
top: 0;
right: -400px;
width: 400px;
height: 100%;
background: white;
box-shadow: -2px 0 8px rgba(0,0,0,0.1);
transition: right 0.3s ease;
z-index: 1000;
display: flex;
flex-direction: column;
}
.side-panel.active {
right: 0;
}
}
@media (orientation: landscape) and (min-width: 1024px) {
.tasks-page {
display: flex;
flex-direction: column;
gap: 1rem;
height: calc(100vh - 2rem);
}
.tasks-header {
flex-direction: row;
align-items: center;
justify-content: space-between;
flex-shrink: 0;
}
.tasks-main {
display: flex;
gap: 1rem;
flex: 1;
min-height: 0;
}
.tasks-container {
flex: 1;
display: flex;
margin-bottom: 0;
overflow: hidden;
}
.scroll-view {
height: auto;
flex: 1;
}
.side-panel {
position: relative;
right: 0;
width: 350px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
border-radius: 8px;
z-index: 1;
flex-shrink: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
.side-panel-close {
display: none;
}
.create-task-container {
flex-shrink: 0;
}
}
.empty-state {
text-align: center;
padding: 3rem;
color: #7f8c8d;
}