From d13867d660cf6dc94b98f86d8f1f037fde421f9d Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Sat, 7 Mar 2026 07:24:54 +0000 Subject: [PATCH] Improve article page readability and appearance on desktop Adjust article page layout on desktop, reducing image size, title font size, and text size while narrowing content width for better readability and visual balance. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 23852c00-4779-460a-9e0c-d09fee4b6c92 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: a2ee97c2-94c0-42af-9ffb-1551048efa6a Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/23852c00-4779-460a-9e0c-d09fee4b6c92/BvOHMz7 Replit-Helium-Checkpoint-Created: true --- client/src/pages/article.tsx | 187 ++++++++++++++++++----------------- replit.md | 8 ++ 2 files changed, 103 insertions(+), 92 deletions(-) diff --git a/client/src/pages/article.tsx b/client/src/pages/article.tsx index a0ce10b..e38e388 100644 --- a/client/src/pages/article.tsx +++ b/client/src/pages/article.tsx @@ -221,110 +221,113 @@ export default function ArticlePage() {
- - - +
+ + + - {article.coverImage && ( -
- {article.title} -
-
- )} + {article.coverImage && ( +
+ {article.title} +
+
+ )} -
-

- {article.title} -

+
+

+ {article.title} +

-
- - - {article.author} - - - - {format(new Date(article.publishedAt), "d. MMMM yyyy", { locale: de })} - - - - {article.views.toLocaleString()} Aufrufe - +
+ + + {article.author} + + + + {format(new Date(article.publishedAt), "d. MMMM yyyy", { locale: de })} + + + + {article.views.toLocaleString()} Aufrufe + +
+ +
+ +
-
+ {(() => { + const sanitized = sanitizeContent(article.content); + const blocks = sanitized.split(/(?=<(?:p|h[2-4]|div)[\s>])/i).filter(Boolean); + const midPoint = Math.max(2, Math.floor(blocks.length / 2)); + const firstHalf = blocks.slice(0, midPoint).join(""); + const secondHalf = blocks.slice(midPoint).join(""); + const proseClasses = `prose prose-base dark:prose-invert max-w-none + prose-headings:text-foreground prose-headings:font-semibold prose-headings:text-lg + prose-p:text-foreground/85 prose-p:leading-relaxed prose-p:text-[15px] + prose-a:text-primary prose-a:no-underline hover:prose-a:underline + prose-strong:text-foreground + prose-img:rounded-md prose-img:w-full prose-img:object-cover + [&_iframe]:rounded-md [&_iframe]:my-5 [&_iframe]:max-w-full + [&_div[style]]:flex [&_div[style]]:justify-center + [&_blockquote:not(.instagram-media)]:border-l-primary [&_blockquote:not(.instagram-media)]:bg-accent/50 [&_blockquote:not(.instagram-media)]:rounded-r-md [&_blockquote:not(.instagram-media)]:py-1 + [&_.instagram-media]:!bg-transparent [&_.instagram-media]:!border-0 [&_.instagram-media]:!shadow-none [&_.instagram-media]:!p-0 [&_.instagram-media]:mx-auto`; + return ( +
{ + if (!el) return; + el.querySelectorAll("a[href]").forEach((a) => { + const href = a.getAttribute("href") || ""; + const isBunny = href.includes("mediadelivery.net") || href.includes("bunny.net") || href.includes("b-cdn.net"); + const isInternal = href.startsWith("/") || href.includes("folx.tv"); + if (!isBunny && !isInternal && href.startsWith("http")) { + a.setAttribute("target", "_blank"); + a.setAttribute("rel", "noopener noreferrer"); + } + }); + }}> +
+ +
+
+ ); + })()} + +
+ +
- - {(() => { - const sanitized = sanitizeContent(article.content); - const blocks = sanitized.split(/(?=<(?:p|h[2-4]|div)[\s>])/i).filter(Boolean); - const midPoint = Math.max(2, Math.floor(blocks.length / 2)); - const firstHalf = blocks.slice(0, midPoint).join(""); - const secondHalf = blocks.slice(midPoint).join(""); - const proseClasses = `prose prose-lg dark:prose-invert max-w-none - prose-headings:text-foreground prose-headings:font-semibold - prose-p:text-foreground/85 prose-p:leading-relaxed - prose-a:text-primary prose-a:no-underline hover:prose-a:underline - prose-strong:text-foreground - prose-img:rounded-md prose-img:w-full prose-img:object-cover - [&_iframe]:rounded-md [&_iframe]:my-6 [&_iframe]:max-w-full - [&_div[style]]:flex [&_div[style]]:justify-center - [&_blockquote:not(.instagram-media)]:border-l-primary [&_blockquote:not(.instagram-media)]:bg-accent/50 [&_blockquote:not(.instagram-media)]:rounded-r-md [&_blockquote:not(.instagram-media)]:py-1 - [&_.instagram-media]:!bg-transparent [&_.instagram-media]:!border-0 [&_.instagram-media]:!shadow-none [&_.instagram-media]:!p-0 [&_.instagram-media]:mx-auto`; - return ( -
{ - if (!el) return; - el.querySelectorAll("a[href]").forEach((a) => { - const href = a.getAttribute("href") || ""; - const isBunny = href.includes("mediadelivery.net") || href.includes("bunny.net") || href.includes("b-cdn.net"); - const isInternal = href.startsWith("/") || href.includes("folx.tv"); - if (!isBunny && !isInternal && href.startsWith("http")) { - a.setAttribute("target", "_blank"); - a.setAttribute("rel", "noopener noreferrer"); - } - }); - }}> -
- -
-
- ); - })()} - -
- -
- -