Files
Learning-Tracker/public/styles.css
T

944 lines
20 KiB
CSS

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--card-bg: rgba(255, 255, 255, 0.55);
--card-border: rgba(255, 255, 255, 0.45);
--card-hover: rgba(255, 255, 255, 0.7);
--card-shadow: 0 2px 12px rgba(60, 60, 120, 0.1);
--subtask-bg: rgba(255, 255, 255, 0.25);
--subtask-border: rgba(255, 255, 255, 0.2);
--text-primary: #1e293b;
--text-secondary: #475569;
--text-muted: #64748b;
--accent: #6366f1;
--accent-hover: #4f46e5;
--accent-soft: rgba(99, 102, 241, 0.15);
--green: #059669;
--green-hover: #047857;
--green-soft: rgba(5, 150, 105, 0.18);
--amber: #f59e0b;
--amber-soft: rgba(245, 158, 11, 0.15);
--rose: #e11d48;
--rose-soft: rgba(225, 29, 72, 0.12);
--purple: #7c3aed;
--purple-soft: rgba(124, 58, 237, 0.15);
--sky: #0284c7;
--sky-soft: rgba(2, 132, 199, 0.15);
--input-bg: rgba(255, 255, 255, 0.7);
--input-border: rgba(148, 163, 184, 0.4);
--input-focus: #6366f1;
--radius: 12px;
--radius-sm: 8px;
--blur: 18px;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
min-height: 100vh;
padding: 16px;
color: var(--text-primary);
background:
linear-gradient(
135deg,
rgba(165, 180, 252, 0.45) 0%,
rgba(196, 181, 253, 0.35) 30%,
rgba(165, 243, 252, 0.3) 60%,
rgba(167, 243, 208, 0.35) 100%
),
url('img/background.jpg') center / cover no-repeat fixed;
background-color: #c7d2fe;
}
.container {
max-width: 900px;
margin: 0 auto;
}
/* ─── Greeting Banner ─── */
.greeting-banner {
padding: 10px 0 2px;
margin-bottom: 6px;
}
.greeting-banner .greeting-text {
font-size: 1.15em;
font-weight: 600;
color: var(--text-primary);
text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}
.greeting-banner .greeting-sub {
font-size: 0.82em;
color: var(--text-secondary);
margin-top: 2px;
}
/* ─── Header ─── */
header {
margin-bottom: 20px;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 12px;
}
h1 {
font-size: 1.4em;
color: var(--text-primary);
font-weight: 700;
letter-spacing: -0.3px;
text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}
.header-actions {
display: flex;
align-items: center;
gap: 10px;
}
/* ─── View Toggle ─── */
.view-toggle {
display: flex;
background: rgba(255, 255, 255, 0.45);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-radius: var(--radius-sm);
border: 1px solid var(--card-border);
overflow: hidden;
}
.toggle-btn {
padding: 7px 16px;
font-size: 0.85em;
background: transparent;
color: var(--text-secondary);
border: none;
cursor: pointer;
transition: all 0.2s;
font-weight: 500;
display: flex;
align-items: center;
gap: 6px;
}
.toggle-btn:hover {
color: var(--text-primary);
background: rgba(255, 255, 255, 0.3);
}
.toggle-btn.active {
background: var(--accent);
color: white;
box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.archive-count {
background: rgba(255, 255, 255, 0.25);
padding: 1px 7px;
border-radius: 10px;
font-size: 0.8em;
font-weight: 600;
min-width: 20px;
text-align: center;
}
.toggle-btn:not(.active) .archive-count {
background: var(--accent-soft);
color: var(--accent);
}
/* ─── Context Menu ─── */
.context-menu {
position: fixed;
background: rgba(255, 255, 255, 0.92);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
border: 1px solid rgba(255, 255, 255, 0.6);
border-radius: var(--radius);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
z-index: 2000;
min-width: 170px;
display: none;
overflow: hidden;
}
.context-menu.show { display: block; }
.context-menu-item {
padding: 9px 14px;
cursor: pointer;
transition: background 0.15s;
font-size: 0.85em;
border-bottom: 1px solid rgba(0, 0, 0, 0.04);
display: flex;
align-items: center;
gap: 8px;
color: var(--text-primary);
}
.context-menu-item:last-child { border-bottom: none; }
.context-menu-item:hover { background: var(--accent-soft); color: var(--accent); }
.context-menu-item.danger:hover { background: var(--rose-soft); color: var(--rose); }
/* ─── Modal ─── */
.modal {
display: none;
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
background: rgba(15, 23, 42, 0.3);
backdrop-filter: blur(4px);
z-index: 1000;
align-items: center;
justify-content: center;
}
.modal.open { display: flex; }
.modal-content {
background: rgba(255, 255, 255, 0.88);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
border-radius: 16px;
width: 90%;
max-width: 500px;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
border: 1px solid rgba(255, 255, 255, 0.6);
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 20px;
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.modal-header h2 {
font-size: 1.1em;
font-weight: 600;
color: var(--text-primary);
}
.close-btn {
background: none;
border: none;
font-size: 1.5em;
color: var(--text-muted);
cursor: pointer;
width: 28px; height: 28px;
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--radius-sm);
transition: all 0.2s;
line-height: 1;
}
.close-btn:hover { background: var(--rose-soft); color: var(--rose); }
.modal-content form { padding: 16px 20px; }
/* ─── Form ─── */
.form-group { margin-bottom: 12px; }
.form-row {
display: grid;
gap: 10px;
}
.form-row-2 { grid-template-columns: 1fr 1fr; }
label {
display: block;
margin-bottom: 4px;
font-weight: 500;
color: var(--text-secondary);
font-size: 0.82em;
}
input[type="text"],
input[type="date"],
select,
textarea {
width: 100%;
padding: 8px 10px;
border: 1px solid var(--input-border);
border-radius: var(--radius-sm);
font-size: 0.9em;
font-family: inherit;
transition: all 0.2s;
background: var(--input-bg);
color: var(--text-primary);
}
input[type="text"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
outline: none;
border-color: var(--input-focus);
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
textarea { resize: vertical; }
.checkbox-label {
display: flex;
align-items: center;
gap: 6px;
margin-top: 6px;
cursor: pointer;
font-size: 0.82em;
color: var(--text-secondary);
font-weight: 400;
}
.checkbox-label input[type="checkbox"] {
width: 14px; height: 14px;
cursor: pointer;
accent-color: var(--accent);
}
/* ─── Color Picker ─── */
.color-picker-row {
display: flex;
align-items: center;
gap: 8px;
}
.color-input {
width: 32px !important;
height: 32px;
padding: 1px !important;
border: 2px solid var(--input-border) !important;
border-radius: 6px !important;
cursor: pointer;
background: none !important;
flex-shrink: 0;
}
.color-input::-webkit-color-swatch-wrapper { padding: 1px; }
.color-input::-webkit-color-swatch { border: none; border-radius: 3px; }
.color-presets {
display: flex;
gap: 4px;
flex-wrap: wrap;
}
.color-dot {
width: 18px;
height: 18px;
border-radius: 50%;
cursor: pointer;
border: 2px solid transparent;
transition: all 0.15s;
flex-shrink: 0;
}
.color-dot:hover {
transform: scale(1.2);
border-color: rgba(0, 0, 0, 0.15);
}
.color-dot.active {
border-color: var(--text-primary);
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}
/* ─── Buttons ─── */
button {
font-family: inherit;
cursor: pointer;
border: none;
border-radius: var(--radius-sm);
font-weight: 500;
transition: all 0.2s;
}
.btn-primary {
width: 100%;
padding: 10px;
font-size: 0.95em;
background: var(--accent);
color: white;
box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover {
background: var(--accent-hover);
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.btn-add {
padding: 7px 16px;
font-size: 0.85em;
background: var(--accent);
color: white;
box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.btn-add:hover { background: var(--accent-hover); }
.btn-small {
padding: 4px 10px;
font-size: 0.78em;
font-weight: 600;
}
.btn-complete {
background: var(--green);
color: white;
box-shadow: 0 1px 4px rgba(5, 150, 105, 0.25);
}
.btn-complete:hover {
background: var(--green-hover);
box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}
.btn-archive {
background: var(--purple);
color: white;
box-shadow: 0 1px 4px rgba(124, 58, 237, 0.25);
}
.btn-archive:hover {
background: #6d28d9;
box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}
.btn-restore {
background: var(--sky-soft);
color: var(--sky);
}
.btn-restore:hover { background: var(--sky); color: white; }
.btn-delete {
background: var(--rose-soft);
color: var(--rose);
}
.btn-delete:hover { background: var(--rose); color: white; }
/* ─── Overall Progress ─── */
.overall-progress {
background: var(--card-bg);
backdrop-filter: blur(var(--blur));
-webkit-backdrop-filter: blur(var(--blur));
padding: 14px 18px;
border-radius: var(--radius);
margin-bottom: 16px;
box-shadow: var(--card-shadow);
border: 1px solid var(--card-border);
}
.overall-progress.hidden { display: none; }
.overall-header {
display: flex;
justify-content: space-between;
margin-bottom: 8px;
font-weight: 600;
font-size: 0.9em;
}
#overall-percentage {
color: var(--accent);
font-weight: 700;
}
.task-counter {
margin-top: 8px;
text-align: center;
color: var(--text-muted);
font-size: 0.82em;
}
.task-counter span {
font-weight: 600;
color: var(--text-primary);
}
/* ─── Tasks ─── */
.tasks-container {
display: grid;
gap: 8px;
}
/* ─── Card ─── */
.task-card {
background: var(--card-bg);
backdrop-filter: blur(var(--blur));
-webkit-backdrop-filter: blur(var(--blur));
border-radius: var(--radius);
padding: 12px 14px;
box-shadow: var(--card-shadow);
cursor: grab;
transition: all 0.2s;
border: 1px solid var(--card-border);
border-left: 4px solid var(--accent);
position: relative;
animation: cardIn 0.25s ease;
}
.task-card:hover {
background: var(--card-hover);
box-shadow: 0 4px 20px rgba(60, 60, 120, 0.14);
border-color: rgba(255, 255, 255, 0.6);
}
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: 0.4; }
.task-card.drag-over {
border-color: var(--accent);
background: rgba(99, 102, 241, 0.08);
}
.task-card.archived-card {
cursor: default;
}
.task-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 6px;
gap: 8px;
}
.task-title {
font-size: 0.95em;
font-weight: 600;
color: var(--text-primary);
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.task-meta {
display: flex;
align-items: center;
gap: 6px;
flex-shrink: 0;
}
.task-size-badge {
padding: 2px 8px;
border-radius: 10px;
font-size: 0.7em;
font-weight: 600;
white-space: nowrap;
text-transform: uppercase;
letter-spacing: 0.3px;
}
.task-size-badge.small { background: var(--sky-soft); color: #0369a1; }
.task-size-badge.medium { background: var(--amber-soft); color: #b45309; }
.task-size-badge.large { background: var(--rose-soft); color: #be123c; }
.task-description {
color: var(--text-secondary);
margin-bottom: 8px;
font-size: 0.82em;
line-height: 1.4;
white-space: pre-wrap;
word-wrap: break-word;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.task-description.expanded {
-webkit-line-clamp: unset;
display: block;
overflow: visible;
}
/* ─── Due Date Badge ─── */
.due-badge {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 2px 8px;
border-radius: 10px;
font-size: 0.72em;
font-weight: 600;
white-space: nowrap;
}
.due-badge.due-ok { background: var(--green-soft); color: #047857; }
.due-badge.due-soon { background: var(--amber-soft); color: #b45309; }
.due-badge.due-overdue { background: var(--rose-soft); color: #be123c; }
.due-badge.due-done {
background: rgba(148, 163, 184, 0.12);
color: var(--text-muted);
text-decoration: line-through;
}
/* ─── Progress ─── */
.progress-row {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 6px;
}
.progress-bar {
flex: 1;
height: 6px;
background: rgba(0, 0, 0, 0.08);
border-radius: 3px;
overflow: hidden;
}
.progress-fill {
height: 100%;
background: linear-gradient(90deg, var(--accent), #a78bfa, var(--green));
transition: width 0.5s ease;
border-radius: 3px;
}
.progress-text {
font-size: 0.78em;
font-weight: 600;
color: var(--text-muted);
min-width: 32px;
text-align: right;
}
.overall-progress .progress-bar { height: 16px; border-radius: 8px; }
.overall-progress .progress-fill {
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: 600;
font-size: 0.72em;
border-radius: 8px;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
/* ─── Reward ─── */
.reward-section {
background: rgba(16, 185, 129, 0.08);
padding: 5px 10px;
border-radius: var(--radius-sm);
margin-bottom: 6px;
font-size: 0.82em;
border: 1px solid rgba(16, 185, 129, 0.15);
display: flex;
align-items: center;
gap: 6px;
}
.reward-hidden { color: var(--text-muted); font-style: italic; }
.reward-revealed {
color: #047857;
font-weight: 600;
animation: rewardPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* ─── Task Actions ─── */
.task-actions {
display: flex;
gap: 6px;
margin-top: 6px;
}
/* ─── Subtask Collapse Toggle ─── */
.subtask-toggle {
display: flex;
align-items: center;
gap: 5px;
margin-top: 8px;
padding: 4px 8px;
cursor: pointer;
border: none;
background: rgba(99, 102, 241, 0.08);
border-radius: var(--radius-sm);
color: var(--accent);
font-size: 0.78em;
font-weight: 600;
transition: all 0.15s;
}
.subtask-toggle:hover {
background: var(--accent-soft);
}
.subtask-toggle .toggle-arrow {
display: inline-block;
transition: transform 0.2s;
font-size: 0.8em;
}
.subtask-toggle.collapsed .toggle-arrow {
transform: rotate(-90deg);
}
/* ─── Subtasks ─── */
.subtasks-container {
margin-top: 6px;
padding-left: 12px;
border-left: 2px solid rgba(99, 102, 241, 0.25);
overflow: hidden;
transition: max-height 0.3s ease, opacity 0.2s ease;
}
.subtasks-container.collapsed {
max-height: 0 !important;
opacity: 0;
margin-top: 0;
}
.subtask {
background: var(--subtask-bg);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
padding: 8px 10px;
border-radius: var(--radius-sm);
margin-bottom: 4px;
cursor: grab;
font-size: 0.85em;
border: 1px solid var(--subtask-border);
position: relative;
transition: all 0.15s;
}
.subtask:last-child { margin-bottom: 0; }
.subtask:hover {
background: rgba(255, 255, 255, 0.4);
border-color: rgba(99, 102, 241, 0.25);
}
.subtask:active { cursor: grabbing; }
.subtask.dragging { opacity: 0.4; }
.subtask-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 4px;
gap: 6px;
}
.subtask-title {
font-weight: 600;
color: var(--text-primary);
font-size: 0.92em;
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.subtask-progress-row {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 4px;
}
.subtask-progress {
flex: 1;
height: 4px;
background: rgba(0, 0, 0, 0.08);
border-radius: 2px;
overflow: hidden;
}
.subtask-progress-fill {
height: 100%;
background: var(--green);
transition: width 0.3s ease;
border-radius: 2px;
}
.subtask-actions {
display: flex;
gap: 4px;
margin-top: 4px;
}
/* ─── Drop Zone ─── */
.drop-zone {
border: 2px dashed rgba(99, 102, 241, 0.3);
border-radius: var(--radius-sm);
text-align: center;
color: var(--text-muted);
font-size: 0.8em;
transition: all 0.2s;
opacity: 0;
max-height: 0;
overflow: hidden;
padding: 0;
margin-top: 0;
}
.drop-zone.visible {
opacity: 1;
max-height: 60px;
padding: 10px;
margin-top: 8px;
}
.drop-zone.drag-over {
border-color: var(--accent);
background: var(--accent-soft);
color: var(--accent);
}
/* ─── Completed ─── */
.completed .task-title,
.completed .subtask-title {
text-decoration: line-through;
color: var(--text-muted);
}
.completed { opacity: 0.75; }
/* ─── Empty / Loading ─── */
.empty-state {
text-align: center;
padding: 50px 20px;
color: var(--text-muted);
}
.empty-state h2 {
font-size: 1.2em;
margin-bottom: 6px;
color: var(--text-secondary);
}
.empty-state p { font-size: 0.9em; }
.loading {
text-align: center;
padding: 50px 20px;
color: var(--text-muted);
}
.spinner {
border: 3px solid rgba(0, 0, 0, 0.08);
border-top: 3px solid var(--accent);
border-radius: 50%;
width: 32px; height: 32px;
animation: spin 1s linear infinite;
margin: 0 auto 12px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* ─── Animations ─── */
@keyframes cardIn {
from { opacity: 0; transform: translateY(6px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes rewardPop {
0% { transform: scale(0.8); opacity: 0; }
60% { transform: scale(1.08); }
100% { transform: scale(1); opacity: 1; }
}
.confetti-canvas {
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
pointer-events: none;
z-index: 9999;
}
.celebration-overlay {
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
pointer-events: none;
z-index: 9998;
display: flex;
align-items: center;
justify-content: center;
animation: celebFade 3s ease forwards;
}
.celebration-text {
font-size: 3em;
font-weight: 800;
background: linear-gradient(135deg, #6366f1, #a78bfa, #f59e0b, #10b981);
background-size: 300% 300%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
animation: celebPulse 2s ease, celebGradient 2s ease infinite;
filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3));
}
@keyframes celebFade {
0% { opacity: 0; }
15% { opacity: 1; }
70% { opacity: 1; }
100% { opacity: 0; }
}
@keyframes celebPulse {
0% { transform: scale(0.3); }
50% { transform: scale(1.1); }
100% { transform: scale(1); }
}
@keyframes celebGradient {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
.task-card.just-completed {
animation: completeFlash 0.6s ease;
}
@keyframes completeFlash {
0% { box-shadow: var(--card-shadow); }
40% { box-shadow: 0 0 20px rgba(5, 150, 105, 0.35), 0 0 40px rgba(5, 150, 105, 0.15); }
100% { box-shadow: var(--card-shadow); }
}
/* ─── Responsive ─── */
@media (max-width: 640px) {
h1 { font-size: 1.2em; }
header {
flex-direction: column;
align-items: stretch;
}
.header-actions { justify-content: space-between; }
.form-row-2 { grid-template-columns: 1fr; }
.task-card { padding: 10px 12px; }
.greeting-banner .greeting-text { font-size: 1em; }
.celebration-text { font-size: 2em; }
}