From 6f4cfa8ee9b1a7b48435a7177b421abbb8a496d7 Mon Sep 17 00:00:00 2001 From: sebastjan Date: Sat, 15 Aug 2026 16:09:07 +0200 Subject: [PATCH] Naslovnica: mobilni mozaik (2 mali + 1 siroka, nato 1 velika + 2 mali), desktop nespremenjen --- client/src/pages/home.tsx | 80 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx index 4e24acd..229804c 100644 --- a/client/src/pages/home.tsx +++ b/client/src/pages/home.tsx @@ -148,6 +148,77 @@ function getObjectPosition(coverImage: string | null, focalPoints?: Record; tall?: boolean }) { + const objPos = getObjectPosition(article.coverImage, focalPoints); + return ( + +
+ {article.title} +
+ + {article.category || "News"} + +

+ {article.title} +

+
+ + ); +} + +function MosaicHeading({ children }: { children: React.ReactNode }) { + return ( +
+

{children}

+
+
+
+ ); +} + +function MobileMosaic({ latest, popular, focalPoints }: { latest: Article[]; popular?: Article[]; focalPoints?: Record }) { + const l = (latest || []).slice(0, 3); + if (l.length === 0) return null; + const p = (popular || []).filter((a) => !l.some((x) => x.id === a.id)).slice(0, 3); + return ( +
+
+ Neueste Artikel +
+ {l.slice(0, 2).map((a) => ( + + ))} +
+ {l[2] && ( +
+ +
+ )} +
+ + {p.length > 0 && ( +
+ Beliebt + + {p.length > 1 && ( +
+ {p.slice(1, 3).map((a) => ( + + ))} +
+ )} +
+ )} +
+ ); +} + function MediumCard({ article, focalPoints }: { article: Article; focalPoints?: Record }) { const isVideo = article.category === "Video"; const objPos = getObjectPosition(article.coverImage, focalPoints); @@ -707,7 +778,14 @@ export default function Home() {
- a.featured)} popular={popular} galleryImages={galleryImages} focalPoints={focalPoints} /> +
+ a.featured)} popular={popular} galleryImages={galleryImages} focalPoints={focalPoints} /> +
+ new Date(b.publishedAt).getTime() - new Date(a.publishedAt).getTime())} + popular={popular} + focalPoints={focalPoints} + />