From c58296e920e24149a1ad8fa9be2c709e134564f8 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Sun, 1 Feb 2026 11:28:08 +0100 Subject: [PATCH] new listing layout --- css/components.css | 2 +- js/components/pages/page-listing.js | 239 ++++++++++++++++------------ manifest.json | 12 +- 3 files changed, 147 insertions(+), 106 deletions(-) diff --git a/css/components.css b/css/components.css index ba94320..fe48497 100644 --- a/css/components.css +++ b/css/components.css @@ -158,7 +158,7 @@ /* Listings Grid - responsive columns */ .listings-grid { display: grid; - grid-template-columns: repeat(4, 1fr); + grid-template-columns: repeat(5, 1fr); gap: var(--space-md); } diff --git a/js/components/pages/page-listing.js b/js/components/pages/page-listing.js index e6a9f36..c81ffe7 100644 --- a/js/components/pages/page-listing.js +++ b/js/components/pages/page-listing.js @@ -129,28 +129,29 @@ class PageListing extends HTMLElement { this.innerHTML = /* html */`
- -
${this.renderContactDialog()} ` } + renderSidebar() { + return /* html */` + + + + + ` + } + renderListingCard(listing) { const imageId = listing.images?.[0]?.directus_files_id?.id || listing.images?.[0]?.directus_files_id const imageUrl = imageId ? directus.getThumbnailUrl(imageId, 300) : '' @@ -500,22 +526,43 @@ style.textContent = /* css */` object-fit: cover; } - /* Content Row */ - page-listing .listing-content { + /* Two Column Layout */ + page-listing .listing-layout { display: grid; grid-template-columns: 1fr 320px; gap: var(--space-xl); align-items: start; } + page-listing .listing-main { + min-width: 0; + } + + /* Mobile: Hide desktop sidebar, show mobile elements */ + page-listing .sidebar-mobile { + display: none; + } + + page-listing .location-mobile { + display: none; + } + @media (max-width: 768px) { - page-listing .listing-content { + page-listing .listing-layout { grid-template-columns: 1fr; } - - page-listing .listing-sidebar { - position: static; - order: -1; + + page-listing .listing-sidebar.sidebar-desktop { + display: none; + } + + page-listing .sidebar-mobile { + display: flex; + margin-bottom: var(--space-xl); + } + + page-listing .location-mobile { + display: block; } page-listing .sidebar-card { @@ -523,11 +570,6 @@ style.textContent = /* css */` } } - /* Main Info */ - page-listing .listing-info { - min-width: 0; - } - page-listing .listing-header { margin-bottom: var(--space-xl); } @@ -581,17 +623,16 @@ style.textContent = /* css */` /* Sidebar */ page-listing .listing-sidebar { - position: sticky; - top: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-md); + position: sticky; + top: var(--space-lg); } - @media (max-width: 768px) { - page-listing .listing-sidebar { - position: static; - } + page-listing .sidebar-mobile { + flex-direction: column; + gap: var(--space-md); } page-listing .sidebar-card { diff --git a/manifest.json b/manifest.json index f63827d..e3d4787 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { - "name": "dgray.io - Marktplatz", + "name": "dgray.io - marketplace", "short_name": "dgray.io", - "description": "Anonymer Marktplatz mit Monero-Bezahlung", + "description": "Anonymous marketplace with Monero payment", "start_url": "/", "display": "standalone", "background_color": "#FAFAFA", @@ -56,14 +56,14 @@ "categories": ["shopping", "lifestyle"], "shortcuts": [ { - "name": "Anzeige erstellen", - "short_name": "Erstellen", + "name": "create ad", + "short_name": "create", "url": "/#/create", "icons": [{ "src": "assets/icons/icon-96.png", "sizes": "96x96" }] }, { - "name": "Suchen", - "short_name": "Suche", + "name": "search", + "short_name": "search", "url": "/#/search", "icons": [{ "src": "assets/icons/icon-96.png", "sizes": "96x96" }] }