diff --git a/src/articles.php b/src/articles.php
index b2b4cd5..8ae263c 100644
--- a/src/articles.php
+++ b/src/articles.php
@@ -229,7 +229,7 @@ $conn->close();
border: 1px solid #eee; border-radius: 8px; padding: 6px;
text-align: center; background: #fff; display: flex; flex-direction: column;
transition: transform 0.1s, box-shadow 0.1s;
- height: 200px;
+ height: 250px;
position: relative;
}
.lager-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
@@ -361,7 +361,7 @@ document.addEventListener('DOMContentLoaded', function () {
if (sortedCategories.length === 0) {
tableHTML = '
Keine Artikel gefunden.
';
+ gridHTML = 'Keine Artikel gefunden.
';
} else {
sortedCategories.forEach(catName => {
const items = groupedArticles[catName];
@@ -369,12 +369,16 @@ document.addEventListener('DOMContentLoaded', function () {
const isCollapsed = collapsedCategories.has(catName) && !isSearching;
const count = items.reduce((acc, item) => acc + 1 + item.children.length, 0);
- tableHTML += ``;
+
+ gridHTML += ``;
if (!isCollapsed) {
items.forEach(article => {
@@ -395,6 +399,15 @@ document.addEventListener('DOMContentLoaded', function () {
initializeInteractivity();
}
+ function getColorForCategory(categoryName) {
+ let hash = 0;
+ for (let i = 0; i < categoryName.length; i++) {
+ hash = categoryName.charCodeAt(i) + ((hash << 5) - hash);
+ }
+ const hue = Math.abs(hash % 360);
+ return `hsl(${hue}, 60%, 85%)`;
+ }
+
function generateCardHTML(article) {
const imagePath = article.image_url ? article.image_url : 'assets/images/keinbild.png';
const productLink = article.product_url ? `
@@ -425,7 +440,7 @@ document.addEventListener('DOMContentLoaded', function () {
${article.name}
${metaText}
${new Intl.NumberFormat('de-DE').format(article.weight_grams)} g | ${quantityBadge}
-
${article.category_name || 'Ohne Kat.'}
+
${catName}
${productLink}
${actionButtons}