feat: add select item and improve settings

This commit is contained in:
2025-06-16 17:33:52 -03:00
parent c9f5984039
commit 9e66744a5e
7 changed files with 445 additions and 156 deletions
+147 -26
View File
@@ -5,18 +5,19 @@
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #f5f5f5;
min-height: 100vh;
padding: 20px;
padding: 12px;
color: #333;
line-height: 1.6;
}
.container {
max-width: 1200px;
margin: 0 auto;
background: rgba(255, 255, 255, 0.95);
border-radius: 20px;
border-radius: 6px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
padding: 40px;
backdrop-filter: blur(10px);
@@ -34,8 +35,8 @@ h1 {
text-align: center;
background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
color: white;
padding: 60px 40px;
border-radius: 15px;
padding: 30px 20px;
border-radius: 6px;
margin-bottom: 30px;
box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
transition: transform 0.3s ease;
@@ -59,16 +60,131 @@ h1 {
.date-display {
text-align: center;
font-size: 1.5rem;
font-size: 1.1rem;
margin-bottom: 30px;
color: #4a5568;
font-weight: 500;
}
.food-search-container {
position: relative;
z-index: 1001; /* Higher than other elements */
}
.food-search-input {
width: 100%;
padding: 15px 20px;
border: 2px solid #e0e0e0;
border-radius: 6px;
font-size: 16px;
transition: all 0.3s ease;
background: white;
outline: none;
}
.food-search-input:focus {
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.food-search-input::placeholder {
color: #999;
}
/* Loading indicator */
.search-loading {
position: absolute;
right: 15px;
top: 30%;
transform: translateY(-50%);
width: 20px;
height: 20px;
border: 2px solid #e0e0e0;
border-top: 2px solid #667eea;
border-radius: 50%;
animation: spin 1s linear infinite;
display: none;
}
.search-loading.show {
display: block;
}
@keyframes spin {
0% { transform: translateY(-50%) rotate(0deg); }
100% { transform: translateY(-50%) rotate(360deg); }
}
/* Search Results Overlay */
.search-results {
position: absolute;
top: 100%;
left: 0;
right: 0;
background: white;
border: 1px solid #e0e0e0;
border-radius: 12px;
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
z-index: 1002;
max-height: 300px;
overflow-y: auto;
display: none;
margin-top: 5px;
}
.search-results.show {
display: block;
}
.search-result-item {
padding: 15px 20px;
border-bottom: 1px solid #f0f0f0;
cursor: pointer;
transition: background-color 0.2s ease;
display: flex;
justify-content: space-between;
align-items: center;
background: white;
}
.search-result-item:last-child {
border-bottom: none;
}
.search-result-item:hover,
.search-result-item.highlighted {
background-color: #f8f9ff;
}
.food-name {
font-weight: 600;
color: #333;
margin-bottom: 2px;
}
.food-details {
font-size: 13px;
color: #666;
}
.food-calories {
font-weight: 600;
color: #667eea;
font-size: 14px;
}
.no-results {
padding: 20px;
text-align: center;
color: #666;
font-style: italic;
}
.add-food-section {
background: white;
padding: 30px;
border-radius: 15px;
border-radius: 6px;
margin-bottom: 30px;
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}
@@ -85,7 +201,6 @@ h1 {
grid-template-columns: 2fr 1fr auto;
gap: 15px;
align-items: end;
overflow: hidden;
}
.display-none {
@@ -108,28 +223,34 @@ label {
color: #4a5568;
}
select, input {
padding: 12px;
border: 2px solid #e2e8f0;
border-radius: 8px;
font-size: 1rem;
transition: border-color 0.3s ease;
#gramAmount {
width: 100%;
padding: 15px 20px;
border: 2px solid #e0e0e0;
border-radius: 6px;
font-size: 1rem;
transition: all 0.3s ease;
background: white;
min-width: 0;
box-sizing: border-box;
outline: none;
}
select:focus, input:focus {
outline: none;
#gramAmount:focus {
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
#gramAmount::placeholder {
color: #999;
}
.add-btn {
padding: 12px 25px;
padding: 17px 25px;
background: linear-gradient(135deg, #4CAF50, #45a049);
color: white;
border: none;
border-radius: 8px;
border-radius: 6px;
cursor: pointer;
font-size: 1rem;
font-weight: 600;
@@ -144,7 +265,7 @@ select:focus, input:focus {
.food-table-section {
background: white;
border-radius: 15px;
border-radius: 6px;
margin-bottom: 30px;
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
overflow: hidden;
@@ -194,7 +315,7 @@ select:focus, input:focus {
color: white;
border: none;
padding: 5px 10px;
border-radius: 5px;
border-radius: 6px;
cursor: pointer;
font-size: 0.8rem;
transition: background 0.3s ease;
@@ -206,7 +327,7 @@ select:focus, input:focus {
.calendar-section {
background: white;
border-radius: 15px;
border-radius: 6px;
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
@@ -225,7 +346,7 @@ select:focus, input:focus {
border: none;
color: white;
padding: 10px 15px;
border-radius: 8px;
border-radius: 6px;
cursor: pointer;
font-size: 1.1rem;
transition: background 0.3s ease;
@@ -314,14 +435,14 @@ select:focus, input:focus {
margin-top: 20px;
padding: 20px;
background: #f8fafc;
border-radius: 10px;
border-radius: 6px;
}
.nutrition-item {
text-align: center;
padding: 10px;
background: white;
border-radius: 8px;
border-radius: 6px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
@@ -390,4 +511,4 @@ select:focus, input:focus {
h1 {
font-size: 2rem;
}
}
}