first commit
This commit is contained in:
559
static/style.css
Normal file
559
static/style.css
Normal file
@@ -0,0 +1,559 @@
|
||||
:root {
|
||||
--bg: #f8f9fa;
|
||||
--card-bg: #ffffff;
|
||||
--text: #2d3436;
|
||||
--text-secondary: #636e72;
|
||||
--border: #e0e4e8;
|
||||
--accent: #6c5ce7;
|
||||
--accent-light: #a29bfe;
|
||||
--success: #00b894;
|
||||
--danger: #e17055;
|
||||
--warning: #fdcb6e;
|
||||
--streak-bg: #fff3e0;
|
||||
--habit-1: #6c5ce7;
|
||||
--habit-2: #00b894;
|
||||
--habit-3: #e17055;
|
||||
--habit-4: #0984e3;
|
||||
--habit-5: #fdcb6e;
|
||||
--habit-6: #e84393;
|
||||
--habit-7: #00cec9;
|
||||
--habit-8: #6ab04c;
|
||||
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
|
||||
--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
|
||||
--shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
|
||||
--radius-sm: 8px;
|
||||
--radius-md: 12px;
|
||||
--radius-lg: 16px;
|
||||
--radius-xl: 20px;
|
||||
--transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.dark {
|
||||
--bg: #1a1a2e;
|
||||
--card-bg: #222244;
|
||||
--text: #e0e0e0;
|
||||
--text-secondary: #a0a0b8;
|
||||
--border: #2e2e52;
|
||||
--streak-bg: #2a1f3d;
|
||||
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
|
||||
--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
|
||||
--shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
|
||||
background-color: var(--bg);
|
||||
color: var(--text);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 24px 16px 60px;
|
||||
transition: background-color 0.3s ease, color 0.3s ease;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
max-width: 680px;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 28px;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.header-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.logo-icon {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
background: linear-gradient(135deg, var(--accent), var(--accent-light));
|
||||
border-radius: var(--radius-md);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
|
||||
}
|
||||
|
||||
.header-title h1 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.3px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.header-title .date-display {
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.header-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.btn {
|
||||
padding: 10px 18px;
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
font-family: inherit;
|
||||
transition: all var(--transition);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
|
||||
}
|
||||
.btn-primary:hover {
|
||||
background: #5a4bd1;
|
||||
box-shadow: 0 4px 14px rgba(108, 92, 231, 0.4);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.btn-outline {
|
||||
background: transparent;
|
||||
color: var(--text);
|
||||
border: 2px solid var(--border);
|
||||
}
|
||||
.btn-outline:hover {
|
||||
border-color: var(--accent);
|
||||
color: var(--accent);
|
||||
background: rgba(108, 92, 231, 0.05);
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
padding: 0;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1.2rem;
|
||||
background: var(--card-bg);
|
||||
border: 2px solid var(--border);
|
||||
color: var(--text);
|
||||
cursor: pointer;
|
||||
transition: all var(--transition);
|
||||
}
|
||||
.btn-icon:hover {
|
||||
border-color: var(--accent);
|
||||
color: var(--accent);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.btn-sm {
|
||||
padding: 6px 12px;
|
||||
font-size: 0.78rem;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.btn-danger-sm {
|
||||
background: transparent;
|
||||
border: 1.5px solid var(--danger);
|
||||
color: var(--danger);
|
||||
padding: 6px 12px;
|
||||
font-size: 0.78rem;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
font-family: inherit;
|
||||
transition: all var(--transition);
|
||||
}
|
||||
.btn-danger-sm:hover {
|
||||
background: var(--danger);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Stats Cards */
|
||||
.stats-row {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
||||
gap: 14px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
background: var(--card-bg);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: 18px 16px;
|
||||
box-shadow: var(--shadow-sm);
|
||||
text-align: center;
|
||||
border: 1px solid var(--border);
|
||||
transition: all var(--transition);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.stat-card:hover {
|
||||
box-shadow: var(--shadow-md);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.stat-card .stat-value {
|
||||
font-size: 2rem;
|
||||
font-weight: 800;
|
||||
letter-spacing: -1px;
|
||||
line-height: 1;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.stat-card .stat-label {
|
||||
font-size: 0.78rem;
|
||||
color: var(--text-secondary);
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.stat-card.accent .stat-value {
|
||||
color: var(--accent);
|
||||
}
|
||||
.stat-card.success .stat-value {
|
||||
color: var(--success);
|
||||
}
|
||||
.stat-card.warning .stat-value {
|
||||
color: #e17055;
|
||||
}
|
||||
|
||||
.stat-card .stat-icon {
|
||||
position: absolute;
|
||||
bottom: -8px;
|
||||
right: -8px;
|
||||
font-size: 3rem;
|
||||
opacity: 0.08;
|
||||
}
|
||||
|
||||
/* Habit list */
|
||||
.habit-list-title {
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.6px;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.habit-list-title::after {
|
||||
content: '';
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
background: var(--border);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.habit-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.habit-item {
|
||||
background: var(--card-bg);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: 16px 18px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
box-shadow: var(--shadow-sm);
|
||||
border: 1px solid var(--border);
|
||||
transition: all var(--transition);
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
.habit-item:hover {
|
||||
box-shadow: var(--shadow-md);
|
||||
border-color: #ccc;
|
||||
}
|
||||
.dark .habit-item:hover {
|
||||
border-color: #444;
|
||||
}
|
||||
.habit-item.completed {
|
||||
opacity: 0.7;
|
||||
background: #f0faf5;
|
||||
border-color: #c8e6d0;
|
||||
}
|
||||
.dark .habit-item.completed {
|
||||
background: #1a2e24;
|
||||
border-color: #2a4a34;
|
||||
}
|
||||
|
||||
/* Custom checkbox */
|
||||
.habit-checkbox {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
min-width: 26px;
|
||||
border-radius: 50%;
|
||||
border: 2.5px solid var(--border);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.25s ease;
|
||||
font-size: 14px;
|
||||
color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
.habit-item.completed .habit-checkbox {
|
||||
background: var(--success);
|
||||
border-color: var(--success);
|
||||
color: #fff;
|
||||
box-shadow: 0 3px 8px rgba(0, 184, 148, 0.3);
|
||||
}
|
||||
|
||||
.habit-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.habit-name {
|
||||
font-weight: 700;
|
||||
font-size: 1rem;
|
||||
letter-spacing: -0.2px;
|
||||
}
|
||||
.habit-details {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
margin-top: 4px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.habit-streak {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
background: var(--streak-bg);
|
||||
padding: 3px 10px;
|
||||
border-radius: 20px;
|
||||
color: #e17055;
|
||||
}
|
||||
.habit-streak .streak-flame {
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.habit-category {
|
||||
font-size: 0.7rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
padding: 3px 8px;
|
||||
border-radius: 4px;
|
||||
background: rgba(108, 92, 231, 0.08);
|
||||
color: var(--accent);
|
||||
}
|
||||
.habit-progress-bar-wrap {
|
||||
flex: 1;
|
||||
min-width: 60px;
|
||||
max-width: 100px;
|
||||
height: 5px;
|
||||
background: var(--border);
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
margin-top: 3px;
|
||||
}
|
||||
.habit-progress-bar-fill {
|
||||
height: 100%;
|
||||
border-radius: 10px;
|
||||
transition: width 0.5s ease;
|
||||
background: var(--success);
|
||||
}
|
||||
|
||||
.habit-delete {
|
||||
opacity: 0;
|
||||
transition: opacity var(--transition);
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-size: 1.1rem;
|
||||
color: var(--danger);
|
||||
padding: 4px 8px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
.habit-item:hover .habit-delete {
|
||||
opacity: 1;
|
||||
}
|
||||
.habit-delete:hover {
|
||||
background: rgba(225, 112, 85, 0.1);
|
||||
}
|
||||
|
||||
/* Add habit form */
|
||||
.add-habit-section {
|
||||
margin-top: 20px;
|
||||
background: var(--card-bg);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: 20px;
|
||||
box-shadow: var(--shadow-md);
|
||||
border: 2px dashed var(--border);
|
||||
display: none;
|
||||
animation: slideDown 0.3s ease;
|
||||
}
|
||||
.add-habit-section.visible {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@keyframes slideDown {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-12px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.form-row {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-end;
|
||||
}
|
||||
.form-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
flex: 1;
|
||||
min-width: 120px;
|
||||
}
|
||||
.form-group label {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
.form-group input,
|
||||
.form-group select {
|
||||
padding: 10px 14px;
|
||||
border: 2px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 0.9rem;
|
||||
font-family: inherit;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
transition: border-color var(--transition);
|
||||
width: 100%;
|
||||
}
|
||||
.form-group input:focus,
|
||||
.form-group select:focus {
|
||||
outline: none;
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
|
||||
}
|
||||
|
||||
/* Empty state */
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: 40px 20px;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
.empty-state .empty-icon {
|
||||
font-size: 3rem;
|
||||
margin-bottom: 12px;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.empty-state p {
|
||||
font-weight: 500;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.empty-state .sub {
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/* Footer / reset */
|
||||
.footer-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 24px;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
/* Toast */
|
||||
.toast {
|
||||
position: fixed;
|
||||
bottom: 24px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%) translateY(100px);
|
||||
background: #2d3436;
|
||||
color: #fff;
|
||||
padding: 12px 24px;
|
||||
border-radius: 30px;
|
||||
font-weight: 600;
|
||||
font-size: 0.85rem;
|
||||
z-index: 999;
|
||||
opacity: 0;
|
||||
transition: all 0.35s ease;
|
||||
pointer-events: none;
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
.dark .toast {
|
||||
background: #e0e0e0;
|
||||
color: #1a1a2e;
|
||||
}
|
||||
.toast.show {
|
||||
opacity: 1;
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 480px) {
|
||||
.header {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.header-actions {
|
||||
width: 100%;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.stats-row {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 8px;
|
||||
}
|
||||
.stat-card {
|
||||
padding: 14px 10px;
|
||||
}
|
||||
.stat-card .stat-value {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
.stat-card .stat-label {
|
||||
font-size: 0.68rem;
|
||||
}
|
||||
.form-row {
|
||||
flex-direction: column;
|
||||
}
|
||||
.habit-item {
|
||||
padding: 12px 14px;
|
||||
gap: 10px;
|
||||
}
|
||||
.habit-delete {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user