Compare commits

...

7 Commits

5 changed files with 320 additions and 187 deletions
Submodule Web/pwa-app deleted from da45c25039
+64 -33
View File
@@ -21,6 +21,28 @@
--ui-radius: 12px;
}
@media (prefers-color-scheme: dark) {
:root {
--ui-bg: #0f172a;
--ui-bg-accent: #1e293b;
--ui-surface: #1e293b;
--ui-surface-soft: #25314a;
--ui-border: #334155;
--ui-text: #f1f5f9;
--ui-text-muted: #94a3b8;
--ui-title: #ffffff;
--ui-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
--ui-shadow-md: 0 10px 24px rgba(0, 0, 0, 0.5);
}
/* Make inputs visible in dark mode */
input, select, textarea {
background-color: var(--ui-surface-soft) !important;
color: var(--ui-text) !important;
border-color: var(--ui-border) !important;
}
}
body {
font-family: "Manrope", "Segoe UI", "Noto Sans", sans-serif;
color: var(--ui-text);
@@ -92,7 +114,7 @@ span {
.card-header,
.modal-header,
thead th {
background: linear-gradient(180deg, #f7fafd, #edf3f8) !important;
background: var(--ui-surface-soft) !important;
border-bottom: 1px solid var(--ui-border) !important;
color: var(--ui-title) !important;
}
@@ -107,10 +129,10 @@ input[type="email"],
input[type="date"],
select {
border-radius: 10px !important;
border: 1px solid #cad5e0 !important;
border: 1px solid var(--ui-border) !important;
min-height: 40px;
color: var(--ui-text) !important;
background-color: #fff !important;
background-color: var(--ui-surface) !important;
transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
@@ -131,11 +153,13 @@ select:focus {
.table th,
.table td {
vertical-align: middle;
border-color: #dee6ee !important;
border-color: var(--ui-border) !important;
background-color: var(--ui-surface) !important;
color: var(--ui-text) !important;
}
.table-striped > tbody > tr:nth-of-type(odd) {
background-color: #f8fbff;
background-color: var(--ui-surface-soft) !important;
}
.alert {
@@ -144,8 +168,10 @@ select:focus {
}
.navbar {
border-bottom: 1px solid #273341;
border-bottom: 1px solid var(--ui-border);
box-shadow: none;
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
}
.navbar-brand {
@@ -164,21 +190,13 @@ select:focus {
}
}
/* Edit and generate buttons with black text for better visibility */
.edit-button {
color: black !important; /* Override any existing color */
}
.duplicate-button {
color: black !important; /* Override any existing color */
}
.generate-qr-button {
color: black !important; /* Override any existing color */
/* Edit and generate buttons with theme-aware text for better visibility */
.edit-button, .duplicate-button, .generate-qr-button {
color: var(--ui-text) !important; /* Override any existing color */
}
.ausleihen {
color: black !important; /* Override any existing color */
/* Color handled securely below */
}
/* Modal image display fix */
@@ -245,12 +263,12 @@ select:focus {
.view-toggle-btn {
width: 38px;
height: 38px;
border: 1px solid #c7ced6;
border: 1px solid var(--ui-border);
border-radius: 50%;
background: #ffffff;
background: var(--ui-surface);
font-size: 1.15rem;
cursor: pointer;
color: #2f3e4e;
color: var(--ui-text);
display: inline-flex;
align-items: center;
justify-content: center;
@@ -259,8 +277,8 @@ select:focus {
.view-toggle-btn:hover {
transform: translateY(-1px);
border-color: #8fa2b7;
background: #f8fbff;
border-color: var(--ui-border);
background: var(--ui-surface-soft);
box-shadow: 0 3px 8px rgba(33, 37, 41, 0.12);
}
@@ -269,9 +287,9 @@ select:focus {
}
.view-toggle-btn[aria-pressed='true'] {
background: #e9f2ff;
border-color: #7ea1c8;
color: #1f4f7a;
background: var(--module-primary-color);
border-color: var(--module-primary-color);
color: white;
}
.table-view-header {
@@ -288,7 +306,7 @@ body.table-view .table-view-header {
border: 0;
border-radius: 10px;
background: transparent;
color: #3f4e5d;
color: var(--ui-text-muted);
font-size: 0.82rem;
font-weight: 700;
text-transform: uppercase;
@@ -307,9 +325,9 @@ body.table-view .item-card {
max-width: none;
margin: 0 0 10px 0;
padding: 12px 14px;
border: 1px solid #e1e6ed;
border: 1px solid var(--ui-border);
border-radius: 10px;
background: #ffffff;
background: var(--ui-surface);
box-shadow: none;
scroll-snap-align: none;
}
@@ -335,7 +353,7 @@ body.table-view .item-card .card-content .item-name-cell,
body.table-view .item-card .card-content .item-col-name {
font-size: 0.98rem;
font-weight: 700;
color: #1f2d3d;
color: var(--ui-title);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@@ -352,7 +370,7 @@ body.table-view .item-card .card-content .item-col-filter3,
body.table-view .item-card .card-content .item-code-cell,
body.table-view .item-card .card-content .item-col-code,
body.table-view .item-card .card-content .item-col-count {
color: #445465;
color: var(--ui-text-muted);
font-size: 0.9rem;
white-space: nowrap;
overflow: hidden;
@@ -369,7 +387,7 @@ body.table-view .item-card .damage-badge {
body.table-view .item-card .actions {
margin-top: 10px;
padding-top: 10px;
border-top: 1px dashed #d9e0e8;
border-top: 1px dashed var(--ui-border);
}
@media (max-width: 900px) {
@@ -805,4 +823,17 @@ body.table-view .item-card .actions {
padding: 7px 12px !important;
font-size: 0.84rem !important;
}
}
}
/* iOS and Mobile optimization fixes */
html, body {
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
}
.scrollable-container, .items-container {
-webkit-overflow-scrolling: touch;
}
@supports (padding-bottom: env(safe-area-inset-bottom)) {
.fixed-bottom, .modal-footer {
padding-bottom: env(safe-area-inset-bottom);
}
}
+93 -24
View File
@@ -10,10 +10,12 @@
<html lang="de" data-module="{{ CURRENT_MODULE }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes, viewport-fit=cover">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="theme-color" content="#2c3e50" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#1a252f" media="(prefers-color-scheme: dark)">
<meta name="csrf-token" content="{{ csrf_token }}">
<title>{% block title %}Inventarsystem{% endblock %}</title>
{% block head %}
@@ -102,6 +104,9 @@
--module-accent-color: #3498db;
--module-accent-light: rgba(52, 152, 219, 0.1);
--module-brand-icon: "📦";
--page-bg-gradient: linear-gradient(180deg, #f2f5f8, #e7edf4);
--page-bg-overlay1: rgba(86, 145, 200, 0.08);
--page-bg-overlay2: rgba(52, 98, 150, 0.09);
}
html[data-module="library"] {
@@ -112,17 +117,35 @@
--module-brand-icon: "📚";
}
@media (prefers-color-scheme: dark) {
:root {
--module-primary-color: #1a252f;
--module-primary-light: #2c3e50;
--module-accent-color: #2980b9;
--module-brand-icon: "📦";
--page-bg-gradient: linear-gradient(180deg, #0f172a, #1e293b);
--page-bg-overlay1: rgba(56, 189, 248, 0.05);
--page-bg-overlay2: rgba(59, 130, 246, 0.06);
}
html[data-module="library"] {
--module-primary-color: #4a354d;
--module-primary-light: #614666;
--module-accent-color: #8e44ad;
}
}
/* Global styles */
body {
font-family: "Manrope", "Segoe UI", "Noto Sans", sans-serif;
background:
radial-gradient(1200px 500px at 10% -10%, rgba(86, 145, 200, 0.08), transparent 55%),
radial-gradient(900px 420px at 95% 0%, rgba(52, 98, 150, 0.09), transparent 52%),
linear-gradient(180deg, #f2f5f8, #e7edf4);
radial-gradient(1200px 500px at 10% -10%, var(--page-bg-overlay1), transparent 55%),
radial-gradient(900px 420px at 95% 0%, var(--page-bg-overlay2), transparent 52%),
var(--page-bg-gradient);
margin: 0;
padding: 0;
padding-bottom: 30px;
color: #1f2d3d;
padding-bottom: auto; /* Fallback for dynamic calculation */
padding-bottom: env(safe-area-inset-bottom, 30px);
color: var(--ui-text, #1f2d3d);
}
.container {
@@ -135,11 +158,13 @@
background-color: var(--module-primary-color) !important;
position: sticky;
top: 0;
padding-top: env(safe-area-inset-top, 0); /* iOS Safe Area */
z-index: 1900;
}
.navbar .container-fluid {
gap: 10px;
padding-bottom: env(safe-area-inset-bottom, 0); /* Fallback */
}
.navbar-brand {
@@ -351,18 +376,19 @@
/* Dropdown menus - consistent with system design */
.dropdown-menu {
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
border: 1px solid #dee2e6;
box-shadow: var(--ui-shadow-md);
border: 1px solid var(--ui-border);
border-radius: 8px;
padding: 8px 0;
min-width: 200px;
margin-top: 5px;
background-color: var(--ui-surface);
}
.dropdown-item {
padding: 10px 16px;
font-size: 0.9rem;
color: #495057;
color: var(--ui-text);
transition: all 0.2s ease;
border: none;
background: none;
@@ -370,8 +396,8 @@
.dropdown-item:hover,
.dropdown-item:focus {
background-color: #f8f9fa;
color: #007bff;
background-color: var(--ui-surface-soft);
color: var(--module-accent-color);
transform: translateX(2px);
}
@@ -434,12 +460,16 @@
}
.nav-item.dropdown .dropdown-toggle {
padding: 8px 12px;
padding: 12px 12px;
min-height: 48px;
}
.navbar-toggler {
padding: 0.5rem 0.65rem;
padding: 0.6rem 0.8rem;
border-width: 2px;
min-height: 48px;
min-width: 48px;
margin-top: 4px;
}
.function-search-wrap {
@@ -573,17 +603,38 @@
margin-left: auto;
flex: 0 0 auto;
align-self: flex-start;
min-width: 48px;
min-height: 48px;
border: none;
background: rgba(255, 255, 255, 0.1);
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.2s ease;
}
.navbar-toggler:active,
.navbar-toggler:focus {
background: rgba(255, 255, 255, 0.2);
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}
.navbar-collapse {
order: 4;
width: 100%;
margin-top: 8px;
padding: 10px 10px 6px;
border-radius: 14px;
background: rgba(15, 23, 42, 0.18);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
margin-top: 12px;
padding: 12px;
border-radius: 16px;
background: rgba(15, 23, 42, 0.85);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
border: 1px solid rgba(255, 255, 255, 0.1);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
max-height: calc(100vh - 90px); /* fallback */
max-height: calc(100dvh - 90px);
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.navbar-collapse.show,
@@ -595,7 +646,7 @@
width: 100%;
align-items: stretch;
gap: 8px;
padding-top: 2px;
padding-top: 4px;
}
.navbar-nav .nav-item {
@@ -605,11 +656,12 @@
.navbar-nav .nav-link {
width: 100%;
justify-content: flex-start;
min-height: 46px;
padding: 0.8rem 0.95rem;
min-height: 48px;
padding: 0.9rem 1.1rem;
margin-bottom: 2px;
border-radius: 12px;
background: rgba(255, 255, 255, 0.08);
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
background: rgba(255, 255, 255, 0.06);
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.navbar-nav .nav-link.nav-active,
@@ -632,6 +684,23 @@
margin-left: 0;
margin-top: 6px;
border-radius: 12px;
background: rgba(255, 255, 255, 0.08); /* Match nav-link slightly */
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: none;
}
.navbar-nav .dropdown-item {
color: rgba(255, 255, 255, 0.9);
padding: 12px 16px;
border-radius: 8px;
margin: 2px 8px;
width: calc(100% - 16px);
}
.navbar-nav .dropdown-item:hover,
.navbar-nav .dropdown-item:focus {
background: rgba(255, 255, 255, 0.15);
color: #fff;
}
.module-selector-bar {
+99 -74
View File
@@ -6,7 +6,7 @@
/* Calendar styles for detailed view */
.calendar-wrapper {
background: #fff;
background: var(--ui-surface);
border: 1px solid #dbe3ee;
border-radius: 12px;
overflow: hidden;
@@ -19,7 +19,7 @@
align-items: center;
gap: 12px;
padding: 12px;
border-bottom: 1px solid #e7edf5;
border-bottom: 1px solid var(--ui-border);
background: #f8fafc;
}
@@ -28,8 +28,8 @@
height: 34px;
border: 1px solid #dbe3ee;
border-radius: 8px;
background: #fff;
color: #334155;
background: var(--ui-surface);
color: var(--ui-text);
font-weight: 700;
line-height: 1;
cursor: pointer;
@@ -60,7 +60,7 @@
align-items: center;
justify-content: center;
border-radius: 8px;
color: #334155;
color: var(--ui-text);
font-size: 0.95rem;
font-weight: 600;
line-height: 1;
@@ -109,7 +109,7 @@
}
.cal-cell.selected.has-booking::after {
background: #fff;
background: var(--ui-surface);
}
.calendar-day-details {
@@ -138,7 +138,7 @@
}
.cal-booking-item {
background: #fff;
background: var(--ui-surface);
border: 1px solid #dbe3ee;
border-left: 3px solid #2563eb;
border-radius: 10px;
@@ -173,7 +173,7 @@
.cal-booking-period {
margin-left: 8px;
color: #475569;
color: var(--ui-text);
font-size: 0.85rem;
font-weight: 600;
}
@@ -225,14 +225,14 @@
.filter-option-group {
margin-bottom: 12px;
border-bottom: 1px solid #eee;
border-bottom: 1px solid var(--ui-border);
padding-bottom: 8px;
}
.filter-group-header {
font-weight: bold;
margin-bottom: 5px;
color: #495057;
color: var(--ui-text-muted);
font-size: 0.9rem;
}
@@ -253,7 +253,7 @@
}
.filter-tag-group {
color: #6c757d;
color: var(--ui-text-muted);
font-size: 0.8em;
font-style: italic;
margin-right: 2px;
@@ -262,7 +262,7 @@
.filter-tag-remove {
background: none;
border: none;
color: #6c757d;
color: var(--ui-text-muted);
margin-left: 5px;
cursor: pointer;
font-size: 1rem;
@@ -296,7 +296,7 @@
#code-search {
flex: 1;
padding: 8px;
border: 1px solid #ddd;
border: 1px solid var(--ui-border);
border-radius: 4px;
}
@@ -724,7 +724,9 @@
// Add this line to define allItems globally
let allItems = [];
const MAIN_ITEMS_PAGE_SIZE = 120;
// Dynamic page size: scan viewport/screen size to only load the exact amount needed.
const isMobileDevice = window.matchMedia('(max-width: 768px)').matches;
const MAIN_ITEMS_PAGE_SIZE = isMobileDevice ? 20 : 120;
let mainItemsNextOffset = 0;
let mainItemsHasMore = false;
let mainItemsLoadingMore = false;
@@ -781,10 +783,10 @@
styles.flexDirection === 'column';
const distanceToEnd = isMobileLayout
? itemsContainer.scrollHeight - (itemsContainer.scrollTop + itemsContainer.clientHeight)
? Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) - (window.scrollY + window.innerHeight)
: itemsContainer.scrollWidth - (itemsContainer.scrollLeft + itemsContainer.clientWidth);
const prefetchThreshold = isMobileLayout
? Math.max(220, itemsContainer.clientHeight * 0.9)
? window.innerHeight * 1.5
: Math.max(260, itemsContainer.clientWidth * 1.4);
if (distanceToEnd > prefetchThreshold) {
return;
@@ -1167,6 +1169,7 @@
if (!mainItemsScrollPrefetchBound) {
itemsContainer.addEventListener('scroll', maybePrefetchMainItems, { passive: true });
window.addEventListener('scroll', maybePrefetchMainItems, { passive: true });
mainItemsScrollPrefetchBound = true;
}
@@ -1188,7 +1191,7 @@
updateMainItemsLoadingIndicator();
});
}, {
root: itemsContainer,
root: isMobileLayout ? null : itemsContainer,
threshold: 0.15,
rootMargin: isMobileLayout ? '0px 0px 900px 0px' : '0px 900px 0px 0px'
});
@@ -1466,7 +1469,7 @@
const badgeText = entry.type === 'repair' ? 'Repariert' : 'Schaden';
const metaLine = entry.meta ? `<div style="font-size:0.84rem;color:#4b5563;">${escapeHtml(entry.meta)}</div>` : '';
return `
<div style="border:1px solid #dbe3ee;border-radius:8px;padding:10px;background:#fff;display:grid;gap:6px;">
<div style="border:1px solid var(--ui-border);border-radius:8px;padding:10px;background:var(--ui-surface);display:grid;gap:6px;">
<div style="display:flex;flex-wrap:wrap;gap:8px;align-items:center;">
<span style="display:inline-block;padding:2px 8px;border-radius:999px;font-size:0.75rem;font-weight:700;${badgeStyle}">${badgeText}</span>
<span style="font-size:0.84rem;color:#475569;">${entry.dateLabel}</span>
@@ -1716,7 +1719,7 @@
: `<button class="ausleihen disabled-button" disabled>${item.BlockedNow ? 'Reserviert' : 'Ausgeliehen'}</button>`
}
${canScheduleItem ? `<button class="schedule-button" onclick="openScheduleModal('${item._id}')">Termin planen</button>` : ''}
<button type="button" class="close-modal secondary-close" onclick="document.getElementById('item-modal').style.display='none';">Schließen</button>
<button type="button" class="details-button" onclick="document.getElementById('item-modal').style.display='none';">Schließen</button>
</div>
`;
@@ -2805,7 +2808,7 @@
}
.container {
background-color: #fff;
background-color: var(--ui-surface);
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
@@ -2830,8 +2833,8 @@
.filter-group {
position: relative;
min-width: 200px;
background-color: #fff;
border: 1px solid #ddd;
background-color: var(--ui-surface);
border: 1px solid var(--ui-border);
border-radius: 5px;
padding: 10px;
}
@@ -2853,7 +2856,7 @@
.clear-filter {
font-size: 0.8rem;
color: #6c757d;
color: var(--ui-text-muted);
}
.filter-dropdown {
@@ -2865,7 +2868,7 @@
max-height: 300px;
overflow-y: auto;
background-color: white;
border: 1px solid #ddd;
border: 1px solid var(--ui-border);
border-radius: 5px;
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
z-index: 100;
@@ -2900,14 +2903,14 @@
.filter-option-group {
margin-bottom: 12px;
border-bottom: 1px solid #eee;
border-bottom: 1px solid var(--ui-border);
padding-bottom: 8px;
}
.filter-group-header {
font-weight: bold;
margin-bottom: 5px;
color: #495057;
color: var(--ui-text-muted);
font-size: 0.9rem;
}
@@ -2928,7 +2931,7 @@
}
.filter-tag-group {
color: #6c757d;
color: var(--ui-text-muted);
font-size: 0.8em;
font-style: italic;
margin-right: 2px;
@@ -2937,7 +2940,7 @@
.filter-tag-remove {
background: none;
border: none;
color: #6c757d;
color: var(--ui-text-muted);
margin-left: 5px;
cursor: pointer;
font-size: 1rem;
@@ -2954,7 +2957,7 @@
#code-search {
flex: 1;
padding: 8px;
border: 1px solid #ddd;
border: 1px solid var(--ui-border);
border-radius: 4px;
}
@@ -3026,7 +3029,7 @@
border: 1px solid #dbe3ee;
border-radius: 10px;
background: #f8fafc;
color: #334155;
color: var(--ui-text);
justify-content: center;
align-items: center;
flex-direction: column;
@@ -3083,19 +3086,19 @@
}
.item-card {
background-color: #fff;
border: 1px solid #ddd;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
background-color: var(--ui-surface);
border: 1px solid var(--ui-border);
border-radius: var(--ui-radius);
box-shadow: var(--ui-shadow-sm);
padding: 20px;
max-width: 300px;
flex-shrink: 0;
width: 100%;
max-width: 340px;
flex: 1 1 300px;
scroll-snap-align: center;
cursor: pointer;
transition: transform 0.2s;
position: relative;
transition: transform 0.2s, box-shadow 0.2s;
position: relative;
}
.item-card:hover {
transform: translateY(-5px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
@@ -3140,7 +3143,7 @@
.item-modal {
display: none;
position: fixed;
z-index: 1000;
z-index: 2500;
left: 0;
top: 0;
width: 100%;
@@ -3191,7 +3194,7 @@
.form-group textarea {
width: 100%;
padding: 8px;
border: 1px solid #ddd;
border: 1px solid var(--ui-border);
border-radius: 4px;
box-sizing: border-box;
}
@@ -3235,7 +3238,7 @@
}
.cancel-button {
background-color: #6c757d;
background-color: var(--ui-text-muted);
color: white;
}
@@ -3467,6 +3470,19 @@
/* Responsive adjustments */
@media (max-width: 768px) {
/* Mobile viewport and scrolling improvements */
html, body {
overflow-x: hidden !important;
-webkit-overflow-scrolling: touch !important;
touch-action: pan-y !important;
height: 100% !important;
}
body {
padding: 0 !important;
margin: 0 !important;
}
.filter-container {
flex-direction: column;
}
@@ -3552,8 +3568,9 @@
display: grid !important;
grid-template-columns: 1fr !important;
gap: 15px !important;
padding: 10px 0 0 !important;
padding: 10px 0 !important;
overflow-x: visible !important;
scroll-snap-type: none !important;
}
.item-card {
@@ -3561,6 +3578,9 @@
margin: 0 !important;
padding: 15px !important;
scroll-snap-align: none !important;
/* Only render when user looks at it (content-visibility virtualizes the DOM) */
content-visibility: auto;
contain-intrinsic-size: auto 300px;
}
.item-card:hover {
@@ -3634,7 +3654,7 @@
display: block !important;
margin-bottom: 8px !important;
font-weight: 600 !important;
color: #333 !important;
color: var(--ui-title) !important;
}
.form-group input, .form-group select, .form-group textarea {
@@ -3705,8 +3725,8 @@
}
/* Element text colors for better visibility */
.edit-button, .duplicate-button, .generate-qr-button, .ausleihen {
color: black !important;
.edit-button, .duplicate-button, .generate-qr-button {
color: var(--ui-title) !important;
}
/* Standardized button styles across the application */
@@ -3867,7 +3887,7 @@
.modal-details { margin: 20px 0; }
.detail-group { display: flex; margin-bottom: 10px; align-items: flex-start; }
.detail-group.full-width { flex-direction: column; margin-bottom: 15px; }
.detail-label { font-weight: bold; color: #495057; min-width: 150px; margin-right: 10px; }
.detail-label { font-weight: bold; color: var(--ui-text-muted); min-width: 150px; margin-right: 10px; }
.detail-value { color: #212529; flex: 1; word-wrap: break-word; }
.detail-group.full-width .detail-label { margin-bottom: 5px; }
.detail-group.full-width .detail-value {
@@ -3935,7 +3955,7 @@
/* Calendar Styles - Optimized & Mobile Friendly */
.calendar-wrapper {
background: #fff;
background: var(--ui-surface);
border-radius: 12px;
overflow: hidden;
border: 1px solid #e5e7eb;
@@ -3948,8 +3968,8 @@
justify-content: space-between;
align-items: center;
padding: 15px;
background-color: #fff;
border-bottom: 1px solid #f3f4f6;
background-color: var(--ui-surface);
border-bottom: 1px solid var(--ui-border);
}
.calendar-header button {
@@ -3973,7 +3993,7 @@
.calendar-grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
background-color: #fff;
background-color: var(--ui-surface);
padding: 10px;
gap: 5px;
}
@@ -4035,7 +4055,7 @@
}
.cal-cell.selected.has-booking::after {
background-color: #fff;
background-color: var(--ui-surface);
}
.calendar-day-details {
@@ -4063,7 +4083,7 @@
.cal-booking-item {
padding: 10px;
background: #fff;
background: var(--ui-surface);
border: 1px solid #e5e7eb;
border-radius: 8px;
margin-bottom: 8px;
@@ -4094,6 +4114,7 @@
border: none !important;
border-radius: 0 !important;
box-shadow: none !important;
box-sizing: border-box !important;
}
.filter-group {
@@ -4115,7 +4136,7 @@
font-size: 0.95rem !important;
font-weight: 600 !important;
line-height: 1.35 !important;
color: #212529 !important;
color: var(--ui-title) !important;
word-break: break-word !important;
overflow-wrap: anywhere !important;
}
@@ -4193,7 +4214,7 @@
display: block !important;
margin-right: 0 !important;
margin-bottom: 2px !important;
color: #6c757d !important;
color: var(--ui-text-muted) !important;
font-size: 0.8rem !important;
}
@@ -4213,8 +4234,12 @@
}
.items-container {
padding: 6px 0 !important;
gap: 10px !important;
display: grid !important;
grid-template-columns: 1fr !important;
gap: 15px !important;
padding: 10px 0 !important;
overflow-x: visible !important;
scroll-snap-type: none !important;
}
body.table-view .table-view-header {
@@ -4231,16 +4256,17 @@
}
.item-card {
border: none !important;
border-radius: 0 !important;
box-shadow: none !important;
border-bottom: 1px solid #e5e7eb !important;
padding: 12px 0 !important;
max-width: 100% !important;
margin: 0 !important;
padding: 15px !important;
scroll-snap-align: none !important;
content-visibility: auto;
contain-intrinsic-size: auto 300px;
}
.item-card:hover {
transform: none !important;
box-shadow: none !important;
transform: translateY(-2px) !important;
box-shadow: var(--ui-shadow-md) !important;
}
.item-card .image-container {
@@ -4305,13 +4331,12 @@
}
.modal-content {
width: 100% !important;
max-width: 100% !important;
height: 100vh !important;
max-height: 100vh !important;
margin: 0 !important;
border: none !important;
border-radius: 0 !important;
width: calc(100vw - 16px) !important;
max-width: none !important;
margin: 80px auto 10px !important;
max-height: 85vh !important;
overflow-y: auto !important;
border-radius: 8px !important;
padding: 16px !important;
}
@@ -4430,7 +4455,7 @@ function openItemQuick(id){
}
.filter-group {
background: #ffffff;
background: var(--ui-surface);
border: 1px solid #cfd8e3;
border-radius: 12px;
padding: 12px;
@@ -4478,7 +4503,7 @@ function openItemQuick(id){
}
.clear-filter {
background: #fff;
background: var(--ui-surface);
color: #495868;
}
@@ -4487,7 +4512,7 @@ function openItemQuick(id){
border: 1px solid #cfd8e3;
border-radius: 12px;
box-shadow: 0 8px 20px rgba(20, 35, 60, 0.12);
background: #ffffff;
background: var(--ui-surface);
padding: 10px;
}
+64 -55
View File
@@ -21,7 +21,7 @@
.items-indicator {
text-align: center;
font-size: 0.9rem;
color: #495057;
color: var(--ui-text-muted);
margin: 6px 0 16px;
font-weight: 600;
}
@@ -55,7 +55,7 @@
max-width: 980px;
margin: 0 auto 18px;
border: 1px solid #dbe3ee;
background: #ffffff;
background: var(--ui-surface);
border-radius: 10px;
padding: 14px;
box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
@@ -78,7 +78,7 @@
}
.bulk-delete-summary {
color: #334155;
color: var(--ui-text);
font-size: 0.92rem;
margin-top: 4px;
}
@@ -105,7 +105,7 @@
padding: 9px 12px;
cursor: pointer;
background: #f8fafc;
color: #1e293b;
color: var(--ui-title);
font-weight: 600;
text-align: center;
}
@@ -138,8 +138,8 @@
.filter-group {
position: relative;
min-width: 200px;
background-color: #fff;
border: 1px solid #ddd;
background-color: var(--ui-surface);
border: 1px solid var(--ui-border);
border-radius: 5px;
padding: 10px;
}
@@ -161,7 +161,7 @@
.clear-filter {
font-size: 0.8rem;
color: #6c757d;
color: var(--ui-text-muted);
}
.filter-dropdown {
@@ -173,7 +173,7 @@
max-height: 300px;
overflow-y: auto;
background-color: white;
border: 1px solid #ddd;
border: 1px solid var(--ui-border);
border-radius: 5px;
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
z-index: 100;
@@ -208,14 +208,14 @@
.filter-option-group {
margin-bottom: 12px;
border-bottom: 1px solid #eee;
border-bottom: 1px solid var(--ui-border);
padding-bottom: 8px;
}
.filter-group-header {
font-weight: bold;
margin-bottom: 5px;
color: #495057;
color: var(--ui-text-muted);
font-size: 0.9rem;
}
@@ -236,7 +236,7 @@
}
.filter-tag-group {
color: #6c757d;
color: var(--ui-text-muted);
font-size: 0.8em;
font-style: italic;
margin-right: 2px;
@@ -245,7 +245,7 @@
.filter-tag-remove {
background: none;
border: none;
color: #6c757d;
color: var(--ui-text-muted);
margin-left: 5px;
cursor: pointer;
font-size: 1rem;
@@ -262,7 +262,7 @@
#code-search {
flex: 1;
padding: 8px;
border: 1px solid #ddd;
border: 1px solid var(--ui-border);
border-radius: 4px;
}
@@ -334,7 +334,7 @@
border: 1px solid #dbe3ee;
border-radius: 10px;
background: #f8fafc;
color: #334155;
color: var(--ui-text);
justify-content: center;
align-items: center;
flex-direction: column;
@@ -391,16 +391,17 @@
}
.item-card {
background-color: #fff;
border: 1px solid #ddd;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
background-color: var(--ui-surface);
border: 1px solid var(--ui-border);
border-radius: var(--ui-radius);
box-shadow: var(--ui-shadow-sm);
padding: 20px;
max-width: 300px;
flex-shrink: 0;
width: 100%;
max-width: 340px;
flex: 1 1 300px;
scroll-snap-align: center;
cursor: pointer;
transition: transform 0.2s;
transition: transform 0.2s, box-shadow 0.2s;
position: relative;
}
@@ -447,7 +448,7 @@
align-items: center;
gap: 6px;
font-size: 0.9rem;
color: #475569;
color: var(--ui-text);
cursor: pointer;
user-select: none;
}
@@ -581,7 +582,7 @@
.item-modal {
display: none;
position: fixed;
z-index: 1000;
z-index: 2500;
left: 0;
top: 0;
width: 100%;
@@ -632,7 +633,7 @@
.form-group textarea {
width: 100%;
padding: 8px;
border: 1px solid #ddd;
border: 1px solid var(--ui-border);
border-radius: 4px;
box-sizing: border-box;
}
@@ -676,7 +677,7 @@
}
.cancel-button {
background-color: #6c757d;
background-color: var(--ui-text-muted);
color: white;
}
@@ -703,7 +704,7 @@
.filter-inputs {
margin: 20px 0;
padding: 15px;
border: 1px solid #ddd;
border: 1px solid var(--ui-border);
border-radius: 5px;
background-color: #f8f9fa;
}
@@ -711,7 +712,7 @@
.filter-inputs h3 {
margin-top: 0;
margin-bottom: 15px;
color: #495057;
color: var(--ui-text-muted);
}
.multi-filter {
@@ -723,7 +724,7 @@
.filter-dropdown-select {
width: 100%;
padding: 8px;
border: 1px solid #ddd;
border: 1px solid var(--ui-border);
border-radius: 4px;
background-color: white;
}
@@ -1000,16 +1001,16 @@
/* Disabled Button */
.disabled-button {
background-color: #6c757d !important;
border-color: #6c757d !important;
background-color: var(--ui-text-muted) !important;
border-color: var(--ui-text-muted) !important;
color: #fff !important;
cursor: not-allowed !important;
opacity: 0.6;
}
.disabled-button:hover {
background-color: #6c757d !important;
border-color: #6c757d !important;
background-color: var(--ui-text-muted) !important;
border-color: var(--ui-text-muted) !important;
transform: none !important;
box-shadow: none !important;
}
@@ -1032,7 +1033,7 @@
.detail-label {
font-weight: bold;
color: #495057;
color: var(--ui-text-muted);
min-width: 150px;
margin-right: 10px;
}
@@ -1351,7 +1352,7 @@
display: block !important;
margin-bottom: 8px !important;
font-weight: 600 !important;
color: #333 !important;
color: var(--ui-title) !important;
}
.form-group input, .form-group select, .form-group textarea {
@@ -1389,7 +1390,7 @@
/* Tab navigation improvements */
.nav-tabs {
flex-wrap: wrap !important;
border-bottom: 1px solid #dee2e6 !important;
border-bottom: 1px solid var(--ui-border) !important;
}
.nav-tabs .nav-link {
@@ -1605,6 +1606,7 @@
gap: 15px !important;
padding: 10px 0 !important;
overflow-x: visible !important;
scroll-snap-type: none !important;
}
.item-card {
@@ -1612,6 +1614,9 @@
margin: 0 !important;
padding: 15px !important;
scroll-snap-align: none !important;
/* Only render when user looks at it (content-visibility virtualizes the DOM) */
content-visibility: auto;
contain-intrinsic-size: auto 300px;
}
.item-card:hover {
@@ -1685,7 +1690,7 @@
display: block !important;
margin-bottom: 8px !important;
font-weight: 600 !important;
color: #333 !important;
color: var(--ui-title) !important;
}
.form-group input, .form-group select, .form-group textarea {
@@ -1959,8 +1964,8 @@
}
/* Element text colors for better visibility */
.edit-button, .duplicate-button, .generate-qr-button, .ausleihen {
color: black !important;
.edit-button, .duplicate-button, .generate-qr-button {
color: var(--ui-title) !important;
}
/* Standardized button styles across the application */
@@ -2003,7 +2008,7 @@
}
/* Calendar styles for detailed view */
.calendar-wrapper {
background: #fff;
background: var(--ui-surface);
border: 1px solid #dbe3ee;
border-radius: 12px;
overflow: hidden;
@@ -2016,7 +2021,7 @@
align-items: center;
gap: 12px;
padding: 12px;
border-bottom: 1px solid #e7edf5;
border-bottom: 1px solid var(--ui-border);
background: #f8fafc;
}
@@ -2025,8 +2030,8 @@
height: 34px;
border: 1px solid #dbe3ee;
border-radius: 8px;
background: #fff;
color: #334155;
background: var(--ui-surface);
color: var(--ui-text);
font-weight: 700;
line-height: 1;
cursor: pointer;
@@ -2057,7 +2062,7 @@
align-items: center;
justify-content: center;
border-radius: 8px;
color: #334155;
color: var(--ui-text);
font-size: 0.95rem;
font-weight: 600;
line-height: 1;
@@ -2106,7 +2111,7 @@
}
.cal-cell.selected.has-booking::after {
background: #fff;
background: var(--ui-surface);
}
.calendar-day-details {
@@ -2135,7 +2140,7 @@
}
.cal-booking-item {
background: #fff;
background: var(--ui-surface);
border: 1px solid #dbe3ee;
border-left: 3px solid #2563eb;
border-radius: 10px;
@@ -2170,7 +2175,7 @@
.cal-booking-period {
margin-left: 8px;
color: #475569;
color: var(--ui-text);
font-size: 0.85rem;
font-weight: 600;
}
@@ -3339,7 +3344,9 @@ document.addEventListener('DOMContentLoaded', ()=>{
});
// Function to load items from server
const MAIN_ADMIN_ITEMS_PAGE_SIZE = 120;
// Dynamic page size: scan viewport/screen size to only load the exact amount needed.
const isMobileDevice = window.matchMedia('(max-width: 768px)').matches;
const MAIN_ADMIN_ITEMS_PAGE_SIZE = isMobileDevice ? 20 : 120;
let mainAdminItemsNextOffset = 0;
let mainAdminItemsHasMore = false;
let mainAdminItemsLoadingMore = false;
@@ -3397,10 +3404,10 @@ document.addEventListener('DOMContentLoaded', ()=>{
styles.flexDirection === 'column';
const distanceToEnd = isMobileLayout
? itemsContainer.scrollHeight - (itemsContainer.scrollTop + itemsContainer.clientHeight)
? Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) - (window.scrollY + window.innerHeight)
: itemsContainer.scrollWidth - (itemsContainer.scrollLeft + itemsContainer.clientWidth);
const prefetchThreshold = isMobileLayout
? Math.max(220, itemsContainer.clientHeight * 0.9)
? window.innerHeight * 1.5
: Math.max(260, itemsContainer.clientWidth * 1.4);
if (distanceToEnd > prefetchThreshold) {
return;
@@ -3772,6 +3779,7 @@ document.addEventListener('DOMContentLoaded', ()=>{
if (!mainAdminItemsScrollPrefetchBound) {
itemsContainer.addEventListener('scroll', maybePrefetchMainAdminItems, { passive: true });
window.addEventListener('scroll', maybePrefetchMainAdminItems, { passive: true });
mainAdminItemsScrollPrefetchBound = true;
}
@@ -3793,7 +3801,7 @@ document.addEventListener('DOMContentLoaded', ()=>{
updateMainAdminItemsLoadingIndicator();
});
}, {
root: itemsContainer,
root: isMobileLayout ? null : itemsContainer,
threshold: 0.15,
rootMargin: isMobileLayout ? '0px 0px 900px 0px' : '0px 900px 0px 0px'
});
@@ -4355,7 +4363,7 @@ document.addEventListener('DOMContentLoaded', ()=>{
const badgeText = entry.type === 'repair' ? 'Repariert' : 'Schaden';
const metaLine = entry.meta ? `<div style="font-size:0.84rem;color:#4b5563;">${escapeHtml(entry.meta)}</div>` : '';
return `
<div style="border:1px solid #dbe3ee;border-radius:8px;padding:10px;background:#fff;display:grid;gap:6px;">
<div style="border:1px solid var(--ui-border);border-radius:8px;padding:10px;background:var(--ui-surface);display:grid;gap:6px;">
<div style="display:flex;flex-wrap:wrap;gap:8px;align-items:center;">
<span style="display:inline-block;padding:2px 8px;border-radius:999px;font-size:0.75rem;font-weight:700;${badgeStyle}">${badgeText}</span>
<span style="font-size:0.84rem;color:#475569;">${entry.dateLabel}</span>
@@ -4527,6 +4535,7 @@ document.addEventListener('DOMContentLoaded', ()=>{
<form method="POST" action="/delete_item/${item._id}" style="display:inline;" onsubmit="return confirm('Sind Sie sicher?')">
<button class="delete-button" type="submit">Löschen</button>
</form>
<button type="button" class="details-button" onclick="document.getElementById('item-modal').style.display='none';">Schließen</button>
</div>
`;
@@ -5494,7 +5503,7 @@ document.addEventListener('DOMContentLoaded', ()=>{
}
.filter-group {
background: #ffffff;
background: var(--ui-surface);
border: 1px solid #cfd8e3;
border-radius: 12px;
padding: 12px;
@@ -5542,7 +5551,7 @@ document.addEventListener('DOMContentLoaded', ()=>{
}
.clear-filter {
background: #fff;
background: var(--ui-surface);
color: #495868;
}
@@ -5551,7 +5560,7 @@ document.addEventListener('DOMContentLoaded', ()=>{
border: 1px solid #cfd8e3;
border-radius: 12px;
box-shadow: 0 8px 20px rgba(20, 35, 60, 0.12);
background: #ffffff;
background: var(--ui-surface);
padding: 10px;
}
@@ -5661,7 +5670,7 @@ document.addEventListener('DOMContentLoaded', ()=>{
display: block !important;
margin-right: 0 !important;
margin-bottom: 2px !important;
color: #6c757d !important;
color: var(--ui-text-muted) !important;
font-size: 0.8rem !important;
}