Initial commit: GoalsBreakDown web app

- Flask backend with TinyDB database
- Multi-user auth with bcrypt password hashing
- Goal CRUD with activation/deactivation and per-user limits
- Task CRUD with status tracking (todo/doing/pending/done)
- Focus rule: one doing task per goal
- Time picker-style scroll view with drag-and-drop reordering
- Admin panel for user management
- uv environment management
This commit is contained in:
Yuyao Huang
2026-05-08 12:41:19 +08:00
commit f3bffa40cd
20 changed files with 2374 additions and 0 deletions
+130
View File
@@ -0,0 +1,130 @@
.goals-page {
padding: 1rem;
}
.goals-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
}
.goals-header h1 {
color: #2c3e50;
}
.goals-list {
display: grid;
gap: 1rem;
}
.goal-card {
background: white;
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
display: flex;
justify-content: space-between;
align-items: center;
transition: transform 0.2s, box-shadow 0.2s;
}
.goal-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.goal-info {
flex: 1;
}
.goal-title {
font-size: 1.2rem;
font-weight: 600;
color: #2c3e50;
margin-bottom: 0.5rem;
}
.goal-status {
font-size: 0.9rem;
color: #7f8c8d;
}
.goal-status.active {
color: #27ae60;
}
.goal-status.inactive {
color: #e74c3c;
}
.goal-actions {
display: flex;
gap: 0.5rem;
align-items: center;
}
.toggle-btn {
padding: 0.5rem 1rem;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 0.9rem;
transition: background-color 0.2s;
}
.toggle-btn.activate {
background-color: #27ae60;
color: white;
}
.toggle-btn.activate:hover {
background-color: #229954;
}
.toggle-btn.deactivate {
background-color: #f39c12;
color: white;
}
.toggle-btn.deactivate:hover {
background-color: #e67e22;
}
.edit-btn {
padding: 0.5rem 1rem;
background-color: #3498db;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.2s;
}
.edit-btn:hover {
background-color: #2980b9;
}
.delete-btn {
padding: 0.5rem 1rem;
background-color: #e74c3c;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.2s;
}
.delete-btn:hover {
background-color: #c0392b;
}
.empty-state {
text-align: center;
padding: 3rem;
color: #7f8c8d;
}
.empty-state h3 {
margin-bottom: 1rem;
}
+253
View File
@@ -0,0 +1,253 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
background-color: #f5f5f5;
color: #333;
line-height: 1.6;
}
.navbar {
background-color: #2c3e50;
color: white;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.nav-brand {
font-size: 1.5rem;
font-weight: bold;
}
.nav-links {
display: flex;
align-items: center;
gap: 1rem;
}
.nav-link {
color: white;
text-decoration: none;
padding: 0.5rem 1rem;
border-radius: 4px;
transition: background-color 0.2s;
}
.nav-link:hover {
background-color: #34495e;
}
.nav-user {
color: #bdc3c7;
font-size: 0.9rem;
}
.nav-btn {
background-color: #e74c3c;
color: white;
border: none;
padding: 0.5rem 1rem;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.2s;
}
.nav-btn:hover {
background-color: #c0392b;
}
.container {
max-width: 1200px;
margin: 2rem auto;
padding: 0 1rem;
}
.auth-page {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.auth-container {
background: white;
padding: 2rem;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
width: 100%;
max-width: 400px;
}
.auth-container h1 {
text-align: center;
margin-bottom: 1.5rem;
color: #2c3e50;
}
.form-group {
margin-bottom: 1rem;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
font-weight: 500;
color: #555;
}
.form-group input,
.form-group textarea,
.form-group select {
width: 100%;
padding: 0.75rem;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 1rem;
transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
outline: none;
border-color: #667eea;
}
.btn-primary {
width: 100%;
padding: 0.75rem;
background-color: #667eea;
color: white;
border: none;
border-radius: 4px;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.2s;
}
.btn-primary:hover {
background-color: #5568d3;
}
.btn-secondary {
padding: 0.5rem 1rem;
background-color: #95a5a6;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.2s;
}
.btn-secondary:hover {
background-color: #7f8c8d;
}
.btn-danger {
padding: 0.5rem 1rem;
background-color: #e74c3c;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.2s;
}
.btn-danger:hover {
background-color: #c0392b;
}
.btn-success {
padding: 0.5rem 1rem;
background-color: #27ae60;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.2s;
}
.btn-success:hover {
background-color: #229954;
}
.error-message {
color: #e74c3c;
margin-bottom: 1rem;
font-size: 0.9rem;
}
.auth-link {
text-align: center;
margin-top: 1rem;
color: #666;
}
.auth-link a {
color: #667eea;
text-decoration: none;
}
.auth-link a:hover {
text-decoration: underline;
}
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
justify-content: center;
align-items: center;
z-index: 1000;
}
.modal.active {
display: flex;
}
.modal-content {
background: white;
padding: 2rem;
border-radius: 8px;
width: 100%;
max-width: 500px;
max-height: 90vh;
overflow-y: auto;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
.modal-header h2 {
color: #2c3e50;
}
.modal-close {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
color: #666;
}
.modal-actions {
display: flex;
gap: 1rem;
margin-top: 1rem;
}
+266
View File
@@ -0,0 +1,266 @@
.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: 300px;
overflow-y: auto;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.tasks-list {
padding: 120px 1rem;
}
.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;
}
.finished-section {
flex: 0 0 300px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
padding: 1rem;
max-height: 600px;
overflow-y: auto;
}
.finished-section h2 {
color: #2c3e50;
margin-bottom: 1rem;
font-size: 1.2rem;
}
.finished-list {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.finished-item {
padding: 0.75rem;
background: #f8f9fa;
border-radius: 4px;
border-left: 3px solid #28a745;
}
.finished-item-title {
font-weight: 500;
margin-bottom: 0.25rem;
}
.finished-item-time {
font-size: 0.8rem;
color: #6c757d;
}
.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;
}
.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;
}
.empty-state {
text-align: center;
padding: 3rem;
color: #7f8c8d;
}