438 lines
9.6 KiB
CSS
438 lines
9.6 KiB
CSS
:root {
|
|
--bg-mid: #EDF2F7;
|
|
--text: #2D3748;
|
|
--accent: #3182CE;
|
|
--card-bg: #ffffff;
|
|
--border-radius: 6px;
|
|
--spacing: 12px;
|
|
--font-size: 0.9rem;
|
|
--faint-text: #718096;
|
|
--subtle-text: #4A5568;
|
|
}
|
|
|
|
[data-theme="dark"] {
|
|
--bg: #1F2C3C;
|
|
--bg-mid: #2E3C4F;
|
|
--text: #E0E6ED;
|
|
--accent: #3182CE;
|
|
--card-bg: #2A3A48;
|
|
--faint-text: #A0AAB5;
|
|
--subtle-text: #D0DCE4;
|
|
}
|
|
[data-theme="dark"] h1,
|
|
[data-theme="dark"] .day-header {
|
|
color: #cef8fe; /* Ljusare blå för bättre kontrast */
|
|
font-weight: 700;
|
|
}
|
|
[data-theme="dark"] .menu-header h1 {
|
|
color: #cef8fe; /* ljuslila i mörkt läge */
|
|
}
|
|
body {
|
|
margin: 0;
|
|
font-family: "Segoe UI", sans-serif;
|
|
background-color: var(--bg);
|
|
color: var(--text);
|
|
}
|
|
.fade-out {
|
|
opacity: 0;
|
|
transition: opacity 0.1s ease-out;
|
|
}
|
|
|
|
.meal-menu-page {
|
|
position: relative;
|
|
padding: var(--spacing);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
background: radial-gradient(circle at center, var(--bg-mid), var(--bg) 80%);
|
|
}
|
|
|
|
.meal-menu-page > * {
|
|
position: relative;
|
|
z-index: 1;
|
|
width: 100%;
|
|
max-width: 960px;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 1.5rem;
|
|
margin-bottom: var(--spacing);
|
|
text-align: center;
|
|
color: var(--accent);
|
|
}
|
|
|
|
.date-picker {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
margin-bottom: var(--spacing);
|
|
font-size: var(--font-size);
|
|
color: var(--subtle-text);
|
|
}
|
|
|
|
.date-picker button {
|
|
background: var(--accent);
|
|
border: none;
|
|
padding: 0.3rem 0.8rem;
|
|
border-radius: var(--border-radius);
|
|
cursor: pointer;
|
|
font-weight: bold;
|
|
color: #ffffff;
|
|
transition: background 0.2s ease;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.date-picker button:hover {
|
|
background: #2B6CB0;
|
|
}
|
|
|
|
.view-selector {
|
|
position: absolute;
|
|
top: var(--spacing);
|
|
right: var(--spacing);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
|
|
.view-selector select {
|
|
display: none;
|
|
}
|
|
|
|
.view-selector .toggle-view-btn,
|
|
.view-selector .theme-toggle-btn {
|
|
background: none;
|
|
border: none;
|
|
color: var(--text);
|
|
font-size: 1rem;
|
|
padding: 4px;
|
|
cursor: pointer;
|
|
border-radius: 4px;
|
|
transition: background-color 0.2s;
|
|
}
|
|
|
|
.view-selector .toggle-view-btn:hover,
|
|
.view-selector .theme-toggle-btn:hover {
|
|
background-color: rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.list-view .day-item {
|
|
background: var(--card-bg);
|
|
margin-bottom: 10px;
|
|
padding: 10px;
|
|
border-radius: var(--border-radius);
|
|
text-align: center;
|
|
}
|
|
|
|
.day-header {
|
|
font-size: 1.1rem;
|
|
color: var(--accent);
|
|
margin-bottom: 4px;
|
|
position: relative;
|
|
text-align: center;
|
|
}
|
|
|
|
.day-header::after {
|
|
content: '';
|
|
position: absolute;
|
|
bottom: -4px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
width: 40px;
|
|
height: 3px;
|
|
background: var(--accent);
|
|
border-radius: 2px;
|
|
}
|
|
|
|
.meal-selection {
|
|
margin: 2px 0;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.meal-selection a {
|
|
color: var(--text);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.meal-selection a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.not-assigned {
|
|
color: var(--faint-text);
|
|
font-style: italic;
|
|
font-size: 0.85rem;
|
|
}
|
|
|
|
.card-view .card-container {
|
|
display: grid;
|
|
grid-template-columns: repeat(7, 1fr); /* exakt 7 kolumner */
|
|
gap: var(--spacing);
|
|
width: 100%;
|
|
max-width: 100%;
|
|
}
|
|
@media (max-width: 1024px) {
|
|
.card-view .card-container {
|
|
grid-template-columns: repeat(3, 1fr);
|
|
}
|
|
}
|
|
@media (max-width: 640px) {
|
|
.card-view .card-container {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
}
|
|
}
|
|
.meal-card {
|
|
position: relative;
|
|
height: 160px;
|
|
width: 100%;
|
|
color: #fff;
|
|
max-height: 200px;
|
|
background-color: #4A5568; /* fallback-bakgrund */
|
|
background-size: cover;
|
|
background-position: center;
|
|
border-radius: var(--border-radius);
|
|
overflow: hidden;
|
|
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
|
|
cursor: pointer;
|
|
transition: transform 0.2s ease;
|
|
display: flex;
|
|
align-items: stretch;
|
|
}
|
|
|
|
.meal-card:hover {
|
|
transform: scale(1.02);
|
|
}
|
|
|
|
.meal-card::before {
|
|
content: '';
|
|
position: absolute;
|
|
inset: 0;
|
|
pointer-events: none;
|
|
transition: opacity 0.3s ease;
|
|
opacity: 1;
|
|
}
|
|
|
|
.meal-card[data-has-image="true"]::before {
|
|
opacity: 0;
|
|
}
|
|
|
|
.card-content {
|
|
position: relative;
|
|
z-index: 1;
|
|
width: 100%;
|
|
padding: 12px 10px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: flex-start;
|
|
align-items: center;
|
|
background: rgba(0, 0, 0, 0.3); /* ev. öka från 0.4 till 0.5 */
|
|
text-align: center;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.card-content .day {
|
|
font-size: 1.3rem;
|
|
font-weight: bold;
|
|
text-shadow: 0 1px 7px rgba(0, 0, 0, 1);
|
|
margin-bottom: 6px;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.card-content .meal {
|
|
font-size: 1rem;
|
|
line-height: 1.3;
|
|
margin-bottom: 2px;
|
|
text-shadow:
|
|
0 0 4px rgba(0, 0, 0, 0.9),
|
|
0 0 8px rgba(0, 0, 0, 0.7),
|
|
0 1px 10px rgba(0, 0, 0, 1);
|
|
|
|
word-break: break-word;
|
|
}
|
|
.menu-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
width: 100%;
|
|
max-width: 960px;
|
|
margin-bottom: var(--spacing);
|
|
}
|
|
|
|
.menu-header h1 {
|
|
font-size: 1.5rem;
|
|
color: var(--accent);
|
|
margin: 0;
|
|
}
|
|
|
|
.top-buttons {
|
|
display: flex;
|
|
gap: 8px;
|
|
}
|
|
|
|
.top-buttons button {
|
|
background: none;
|
|
border: none;
|
|
color: var(--text);
|
|
font-size: 1.2rem;
|
|
padding: 6px;
|
|
cursor: pointer;
|
|
border-radius: 4px;
|
|
transition: background-color 0.2s;
|
|
}
|
|
|
|
.top-buttons button:hover {
|
|
background-color: rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
|
|
.school-meal-card-content {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: flex-start;
|
|
align-items: center;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.school-meal-card-content .day {
|
|
font-size: 1rem;
|
|
font-weight: bold;
|
|
margin-bottom: 4px;
|
|
flex-shrink: 0; /* Förhindrar att tryckas bort */
|
|
}
|
|
|
|
.school-meal-card-content .meal {
|
|
font-size: clamp(0.55rem, 1.0vw, 0.8rem);
|
|
line-height: 1.2;
|
|
text-align: center;
|
|
word-break: break-word;
|
|
overflow-y: auto;
|
|
max-height: 100%; /* Begränsa höjden */
|
|
}
|
|
.school-meal-title .chevron {
|
|
display: inline-block;
|
|
transition: transform 0.3s ease;
|
|
transform: rotate(-90deg);
|
|
}
|
|
|
|
.school-meal-title .chevron.rotated {
|
|
transform: rotate(0deg);
|
|
}
|
|
|
|
/* Flyout popup */
|
|
.wish-flyout {
|
|
position: fixed;
|
|
bottom: 80px; /* ovanför plustecknet */
|
|
right: 20px;
|
|
width: 300px;
|
|
max-width: 90%;
|
|
background-color: var(--card-bg);
|
|
border-radius: var(--border-radius);
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.3);
|
|
padding: 12px;
|
|
z-index: 1001;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
/* Responsiv på mobil */
|
|
@media (max-width: 480px) {
|
|
.wish-flyout {
|
|
right: 10px;
|
|
width: calc(100% - 20px);
|
|
bottom: 70px;
|
|
}
|
|
}
|
|
|
|
.wish-flyout label {
|
|
font-weight: bold;
|
|
margin-top: 8px;
|
|
}
|
|
|
|
.wish-flyout input,
|
|
.wish-flyout textarea {
|
|
width: 100%;
|
|
margin-top: 4px;
|
|
padding: 6px;
|
|
border-radius: var(--border-radius);
|
|
border: 1px solid #ccc;
|
|
font-size: 0.9rem;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.wish-flyout textarea {
|
|
resize: vertical;
|
|
min-height: 60px;
|
|
}
|
|
|
|
.flyout-buttons {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
gap: 6px;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.flyout-buttons button {
|
|
padding: 6px 12px;
|
|
border-radius: var(--border-radius);
|
|
border: none;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.flyout-buttons button[type="submit"] {
|
|
background-color: var(--accent);
|
|
color: #fff;
|
|
}
|
|
|
|
.flyout-buttons button[type="button"] {
|
|
background-color: #ccc;
|
|
color: var(--text);
|
|
}
|
|
/* Floating button fixed i nedre högra hörnet */
|
|
.floating-btn {
|
|
position: fixed; /* fixed istället för relative/absolute */
|
|
bottom: 20px; /* avstånd från botten */
|
|
right: 20px; /* avstånd från höger */
|
|
width: 50px;
|
|
height: 50px;
|
|
border-radius: 50%;
|
|
background-color: var(--accent);
|
|
color: #fff;
|
|
font-size: 28px;
|
|
border: none;
|
|
cursor: pointer;
|
|
box-shadow: 0 4px 8px rgba(0,0,0,0.3);
|
|
z-index: 1000; /* högre än andra element så den ligger ovanpå */
|
|
}
|
|
|
|
.floating-btn:hover {
|
|
background-color: #2B6CB0;
|
|
}
|
|
.autocomplete-list {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 4px 0 0 0;
|
|
border: 1px solid #ccc;
|
|
border-radius: 4px;
|
|
max-height: 150px;
|
|
overflow-y: auto;
|
|
background: var(--card-bg);
|
|
position: absolute;
|
|
width: 90%; /* Anpassa efter input */
|
|
z-index: 1000;
|
|
}
|
|
|
|
.autocomplete-list li {
|
|
padding: 6px 10px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.autocomplete-list li:hover {
|
|
background-color: var(--accent);
|
|
color: #fff;
|
|
}
|