From 1b60b71ecd45bf4e1d5d477cf3344e6f24519762 Mon Sep 17 00:00:00 2001 From: Maaxxs <61059039+MaaxxsDev@users.noreply.github.com> Date: Wed, 9 Sep 2026 03:42:17 +0200 Subject: [PATCH] Add live-preview positioning to all homepage sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to "mach das bitte auch für alle Startseiten-Sektionen" - the request was for the same drag experience across all six homepage text sections, but they split into two structurally different groups and got two different (both live-preview-driven) treatments rather than forcing one interaction model onto both: - Hero and the YouTube section have a real background (image, video) behind the text, structurally identical to the gallery cards - these get full continuous 2D drag positioning, reusing the same "left/top + translate(-x%,-y%)" technique. New home_sections.text_align_x/_y (TINYINT UNSIGNED 0-100, default 50/50 = centered, matching current behavior) sit alongside the existing text_align column rather than replacing it, since the other four sections still need it. - Craft, Advice, Insights, and "More than car-hifi" are normal paragraph text next to a separate image column, with no background to drag over - text-align (left/center/right) is the actually correct tool for how wrapped paragraph lines align, the same way word processors use alignment buttons rather than a position slider for body text. These keep the existing text_align enum, but the admin page (HomeSections.jsx) replaces the old bare update('text_align', e.target.value)} - className="rounded-md border border-neutral-300 bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900" +
+ {[ + ['de', 'Deutsch'], + ['en', 'English'], + ].map(([lang, label]) => ( +
+ {label} + + ))} + {isPositionable ? ( +
+
+
+ {activeSlug === 'hero' && heroImagePath ? ( + + ) : ( +
+ {activeSlug === 'youtube' ? 'Video-Hintergrund' : 'Hero-Bild'} +
+ )} +
+
+ {previewEyebrow && ( +

+ {previewEyebrow} +

+ )} +

{previewTitle}

+
+
+

Zum Verschieben ziehen

+
+
+

+ Position:{' '} + + {active.text_align_x}% / {active.text_align_y}% + +

+
+

+ Schnellauswahl waagerecht +

+
+ + + +
+
+
+

+ Schnellauswahl senkrecht +

+
+ + + +
+
+
+
+ ) : ( +
+
+
+
+ {previewEyebrow && ( +

+ {previewEyebrow} +

+ )} +

{previewTitle}

+

+ {previewBody || 'Text erscheint hier…'} +

+
+
+ {ALIGN_OPTIONS.map((opt) => ( + + ))} +
+
+
+ )} +