HifiPlanet-Website/hifi/api/database
Maaxxs 1b60b71ecd Add live-preview positioning to all homepage sections
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 <select> with an actual
  rendered live preview (title/eyebrow/body snippet in a mock card)
  instead of leaving these four with zero visual feedback.

Renamed the shared positioning helper from galleryCardAlign.js /
galleryCardLabelStyle() to dragAnchorPosition.js / dragAnchorStyle()
(now takes a per-caller default so gallery cards keep their bottom-
anchored default while Home.jsx sections default to centered) since
it's no longer gallery-specific - three call sites updated.

Restructured Hero and the YouTube section in Home.jsx so the drag-set
static position doesn't fight with existing animation: Hero already
composes a scroll-linked parallax transform (framer-motion) and an
entrance fade-in on nested motion.div elements, both of which manage
their own `transform` internally - inserting a new plain (non-motion)
div between them for the percentage-based positioning keeps the static
placement and the two animations from touching the same CSS property.

Verified against the local database directly via PHP CLI: hero/youtube
default to 50/50 (centered, no visual change from before), and an
arbitrary pair (25/80) written to hero round-trips correctly through
HomeSectionController::index(), then removed the test row.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-09 03:42:17 +02:00
..
migration_2fa.sql Initial commit: HifiPlanet Car-Hifi Shop (Frontend + Backend) 2026-07-05 13:37:06 +02:00
migration_analytics.sql Add Google Analytics integration with consent-gated loading 2026-07-07 01:32:44 +02:00
migration_analytics_dashboard.sql Add Google Analytics dashboard widget (GA4 Data API integration) 2026-07-07 01:57:32 +02:00
migration_brand_model_images.sql Add image support for car brands and models 2026-09-09 01:42:40 +02:00
migration_business_stammdaten.sql Add CMS v1: editable business identity and legal pages 2026-09-09 02:03:59 +02:00
migration_faqs.sql Move FAQ management into the admin panel and cover it plus the gallery in export/import 2026-07-07 19:25:06 +02:00
migration_gallery_card_align.sql Make gallery card name label alignment configurable with a live preview 2026-09-09 03:13:58 +02:00
migration_gallery_card_drag.sql Replace left/center/right buttons with real drag-and-drop positioning 2026-09-09 03:23:37 +02:00
migration_gallery_card_y.sql Add vertical drag positioning for gallery card labels 2026-09-09 03:29:55 +02:00
migration_home_sections.sql Make the homepage's main marketing text blocks editable 2026-09-09 02:51:00 +02:00
migration_home_sections_position.sql Add live-preview positioning to all homepage sections 2026-09-09 03:42:17 +02:00
migration_last_active.sql Track when each admin user was last active 2026-08-29 22:14:06 +02:00
migration_mail_settings.sql Add configurable SMTP email settings and contact-form email notifications 2026-07-07 00:54:17 +02:00
migration_maintenance.sql Initial commit: HifiPlanet Car-Hifi Shop (Frontend + Backend) 2026-07-05 13:37:06 +02:00
migration_package_card_layout.sql Redesign package tiles as a dark, credit-card-style scroll strip with hue-sweeping tiers 2026-07-08 23:41:59 +02:00
migration_package_card_theme.sql Add selectable package card color themes and refine the feature list styling 2026-07-08 10:28:05 +02:00
migration_package_design.sql Make package cards configurable and give them a proper tiered design 2026-07-07 21:13:55 +02:00
migration_package_price_text.sql Implement client feedback: calmer cursor, price override text, 3D coverflow layout 2026-07-12 15:13:08 +02:00
migration_package_wheel_hint_interval.sql Repeat the wheel-scroll hint on an admin-configurable interval 2026-08-01 00:39:23 +02:00
migration_permissions.sql Initial commit: HifiPlanet Car-Hifi Shop (Frontend + Backend) 2026-07-05 13:37:06 +02:00
migration_services.sql Initial commit: HifiPlanet Car-Hifi Shop (Frontend + Backend) 2026-07-05 13:37:06 +02:00
migration_site_settings.sql Add admin-configurable website settings and VIN field to contact form 2026-07-06 15:28:11 +02:00
migration_upgrades.sql Initial commit: HifiPlanet Car-Hifi Shop (Frontend + Backend) 2026-07-05 13:37:06 +02:00
schema.sql Add live-preview positioning to all homepage sections 2026-09-09 03:42:17 +02:00