base feature

This commit is contained in:
2025-10-25 15:40:28 +02:00
commit 72c50549d7
15 changed files with 2104 additions and 0 deletions

446
static/styles.css Normal file
View File

@@ -0,0 +1,446 @@
* {
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;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
header {
background-color: #2c3e50;
color: white;
padding: 20px 0;
margin-bottom: 30px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
header h1 {
text-align: center;
font-size: 2em;
}
.tabs {
display: flex;
gap: 10px;
margin-bottom: 30px;
border-bottom: 2px solid #ddd;
flex-wrap: wrap;
}
.tab {
padding: 12px 24px;
background-color: transparent;
border: none;
cursor: pointer;
font-size: 16px;
color: #666;
border-bottom: 3px solid transparent;
transition: all 0.3s ease;
}
.tab:hover {
color: #2c3e50;
background-color: #f0f0f0;
}
.tab.active {
color: #2c3e50;
border-bottom-color: #3498db;
font-weight: 600;
}
.content {
background-color: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
h2 {
color: #2c3e50;
margin-bottom: 20px;
font-size: 1.8em;
}
h3 {
color: #34495e;
margin-bottom: 10px;
font-size: 1.2em;
}
h4 {
color: #34495e;
margin-bottom: 10px;
margin-top: 15px;
}
/* Forms */
.add-form,
.add-ingredient-form,
.add-meal-to-day {
display: flex;
gap: 10px;
margin-bottom: 20px;
padding: 15px;
background-color: #f8f9fa;
border-radius: 6px;
flex-wrap: wrap;
}
input[type="text"],
input[type="number"],
input[type="date"],
select {
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
flex: 1;
min-width: 150px;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
outline: none;
border-color: #3498db;
box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}
button {
padding: 10px 20px;
background-color: #3498db;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #2980b9;
}
.delete-btn {
background-color: #e74c3c;
}
.delete-btn:hover {
background-color: #c0392b;
}
.view-btn {
background-color: #95a5a6;
}
.view-btn:hover {
background-color: #7f8c8d;
}
.delete-btn.small {
padding: 5px 10px;
font-size: 12px;
}
/* Lists */
.items-list {
display: flex;
flex-direction: column;
gap: 10px;
}
.item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
background-color: #f8f9fa;
border-radius: 6px;
border-left: 4px solid #3498db;
}
.item-name {
font-weight: 600;
color: #2c3e50;
font-size: 16px;
}
.item-unit {
color: #7f8c8d;
margin-left: 8px;
}
.item-description {
color: #7f8c8d;
font-size: 14px;
margin-left: 10px;
}
/* Meals */
.meal-item {
margin-bottom: 20px;
border: 1px solid #e0e0e0;
border-radius: 8px;
overflow: hidden;
}
.meal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
background-color: #f8f9fa;
gap: 10px;
flex-wrap: wrap;
}
.meal-header > div {
display: flex;
gap: 10px;
align-items: center;
flex-wrap: wrap;
}
.meal-ingredients {
padding: 0;
}
.ingredients-section {
padding: 15px;
background-color: white;
}
.sub-items-list {
display: flex;
flex-direction: column;
gap: 8px;
margin-top: 10px;
}
.sub-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
background-color: #e8f4f8;
border-radius: 4px;
font-size: 14px;
}
/* Week Plan */
.week-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
}
.day-card {
background-color: #f8f9fa;
border-radius: 8px;
padding: 15px;
border: 2px solid #e0e0e0;
}
.day-card h3 {
color: #2c3e50;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 2px solid #3498db;
}
.day-meals {
min-height: 100px;
margin-bottom: 10px;
}
.planned-meal {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 10px;
background-color: white;
border-radius: 4px;
margin-bottom: 6px;
border-left: 3px solid #2ecc71;
font-size: 14px;
}
.meal-type-section {
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 1px solid #e0e0e0;
}
.meal-type-section:last-child {
border-bottom: none;
}
.meal-type-header {
font-size: 13px;
font-weight: 600;
color: #7f8c8d;
margin-bottom: 8px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.meal-type-tag {
display: inline-block;
padding: 3px 8px;
border-radius: 3px;
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
margin-left: 8px;
letter-spacing: 0.5px;
}
.tag-breakfast {
background-color: #f39c12;
color: white;
}
.tag-lunch {
background-color: #3498db;
color: white;
}
.tag-snack {
background-color: #9b59b6;
color: white;
}
.add-meal-to-day {
padding: 8px;
margin: 0;
background-color: #f8f9fa;
}
.add-meal-to-day select {
flex: 1;
min-width: 100px;
font-size: 13px;
}
.add-meal-to-day button {
padding: 8px 12px;
flex: 0;
}
.day-meals {
min-height: 40px;
margin-bottom: 8px;
}
/* Grocery List */
.grocery-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 15px;
}
.grocery-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
background-color: #f8f9fa;
border-radius: 6px;
border-left: 4px solid #2ecc71;
}
.grocery-name {
font-weight: 600;
color: #2c3e50;
}
.grocery-quantity {
color: #7f8c8d;
font-size: 14px;
}
.info {
color: #7f8c8d;
font-style: italic;
margin-bottom: 20px;
}
.empty-state {
text-align: center;
color: #95a5a6;
padding: 40px;
font-style: italic;
}
/* Responsive */
@media (max-width: 768px) {
.container {
padding: 10px;
}
.content {
padding: 15px;
}
.add-form,
.add-ingredient-form {
flex-direction: column;
}
.meal-header {
flex-direction: column;
align-items: flex-start;
}
.week-container {
grid-template-columns: 1fr;
}
.tabs {
overflow-x: auto;
}
.tab {
white-space: nowrap;
}
}
/* Loading states */
.htmx-request {
opacity: 0.7;
pointer-events: none;
}
/* Animation */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.item,
.meal-item,
.planned-meal,
.grocery-item {
animation: fadeIn 0.3s ease;
}