From 181bb95014f6fa8d8dd2150fe904ad4877192336 Mon Sep 17 00:00:00 2001 From: Maaxxs <61059039+MaaxxsDev@users.noreply.github.com> Date: Tue, 7 Jul 2026 21:47:03 +0200 Subject: [PATCH] Auto-escalate package card styling by price tier for a more premium look MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Package cards for every brand/model now scale their visual weight with price rank within that model: cheapest stays plain, mid-tier packages get a green-accented card, and the priciest gets a dark "premium" treatment with a glowing border — no extra admin config needed. Also fixes an invalid brand-950 Tailwind class (the palette only goes to 900) that was silently dropping the intended dark-mode colors. Co-Authored-By: Claude Sonnet 5 --- hifi-src/src/pages/public/ModelPage.jsx | 144 ++++++++++++++++-------- 1 file changed, 95 insertions(+), 49 deletions(-) diff --git a/hifi-src/src/pages/public/ModelPage.jsx b/hifi-src/src/pages/public/ModelPage.jsx index eb8a72e..2dbdf96 100644 --- a/hifi-src/src/pages/public/ModelPage.jsx +++ b/hifi-src/src/pages/public/ModelPage.jsx @@ -45,6 +45,21 @@ export default function ModelPage() { const { model, packages } = data; + // Preis-Rang innerhalb dieses Modells bestimmt die optische Wucht der Kachel: + // die guenstigste Option bleibt schlicht/hell, dazwischen liegende Pakete + // bekommen einen Akzent-Rahmen, das teuerste Paket eine dunkle "Premium"-Karte. + // Das braucht keine zusaetzliche Admin-Einstellung und passt sich automatisch an. + const rankById = new Map( + [...packages].sort((a, b) => a.total_price - b.total_price).map((p, i) => [p.id, i]) + ); + const tierOf = (pkg) => { + if (packages.length <= 1) return 'plain'; + const rank = rankById.get(pkg.id); + if (rank === 0) return 'plain'; + if (rank === packages.length - 1) return 'premium'; + return 'accent'; + }; + const contactUrl = (pkg) => { const params = new URLSearchParams({ brand: model.brand_name, @@ -72,58 +87,89 @@ export default function ModelPage() { )}
- {packages.map((pkg) => ( -
- {pkg.is_featured && ( - - {t('modelPage.featuredBadge')} - - )} + {packages.map((pkg) => { + const tier = tierOf(pkg); + const isPremium = tier === 'premium'; - {pkg.icon_name && ( -
- -
- )} - -

{pkg.name}

- {pkg.tagline &&

{pkg.tagline}

} - -
-

{t('modelPage.totalPrice')}

-

{formatPrice(pkg.total_price)}

-
- -
    - {pkg.products.map((product) => ( -
  • - {product.name_override || product.scraped_name || t('modelPage.productLoading')} -
  • - ))} - {pkg.description - ?.split('\n') - .map((line) => line.trim()) - .filter(Boolean) - .map((line, i) =>
  • {line}
  • )} -
- - - {t('modelPage.requestContact')} - -
- ))} + {pkg.is_featured && ( + + {t('modelPage.featuredBadge')} + + )} + + {pkg.icon_name && ( +
+ +
+ )} + +

+ {pkg.name} +

+ {pkg.tagline && ( +

+ {pkg.tagline} +

+ )} + +
+

+ {t('modelPage.totalPrice')} +

+

+ {formatPrice(pkg.total_price)} +

+
+ + + + + {t('modelPage.requestContact')} + +
+ ); + })} );