HifiPlanet-Website/hifi-src/src/pages/admin
Maaxxs e9f68d054c Replace left/center/right buttons with real drag-and-drop positioning
Follow-up to the previous commit per explicit feedback: three preset
buttons weren't what was asked for - the ask was to grab the label in
the live preview and drag it directly.

Swaps app_settings.gallery_card_text_align (ENUM left/center/right,
one commit old) for gallery_card_text_x (TINYINT UNSIGNED 0-100, same
default position as before at 0). A discrete enum can't represent a
free-dragged position, so this is a real column replacement via
migration_gallery_card_drag.sql (drops the old column outright rather
than keeping both, since the old one is a single commit old and
unlikely to hold any real per-site customization yet).

The label is now positioned with `left: X%; transform: translateX(-X%)`
instead of a text-align class - the standard CSS trick for interpolating
a single percentage continuously between flush-left (X=0) and
flush-right (X=100, shifted back by its own width) with X=50 centering
it, so dragging feels continuous rather than snapping between three
fixed states. hifi-src/src/utils/galleryCardAlign.js now exports a
style-computing function instead of a class lookup table.

WebsiteSettings.jsx's preview label is draggable via Pointer Events
(setPointerCapture on pointerdown, so tracking keeps working even if
the cursor leaves the element mid-drag) with the card's own
getBoundingClientRect() converting cursor position to a 0-100 percent.
Kept small Links/Mittig/Rechts buttons as a secondary quick-jump
alongside the drag, not instead of it.

Verified against the local database directly via PHP CLI: default
comes back as 0, and an arbitrary value (73) written directly to the
column round-trips correctly through SiteSettingsController::show().

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-09 03:23:37 +02:00
..
settings Replace left/center/right buttons with real drag-and-drop positioning 2026-09-09 03:23:37 +02:00
AccountSettings.jsx Redesign navbar mobile menu and rework site color palette 2026-07-06 16:21:48 +02:00
AdminUsers.jsx Protect the first-created admin account from being demoted or deleted 2026-08-29 22:25:31 +02:00
Brands.jsx Add image support for car brands and models 2026-09-09 01:42:40 +02:00
ContactRequests.jsx Redesign navbar mobile menu and rework site color palette 2026-07-06 16:21:48 +02:00
Dashboard.jsx Add Google Analytics dashboard widget (GA4 Data API integration) 2026-07-07 01:57:32 +02:00
Faqs.jsx Move FAQ management into the admin panel and cover it plus the gallery in export/import 2026-07-07 19:25:06 +02:00
GalleryBrands.jsx Add photo gallery feature (brand -> project -> photos drill-down) 2026-07-06 17:04:46 +02:00
GalleryPhotos.jsx Add photo gallery feature (brand -> project -> photos drill-down) 2026-07-06 17:04:46 +02:00
GalleryProjects.jsx Add photo gallery feature (brand -> project -> photos drill-down) 2026-07-06 17:04:46 +02:00
HomeSections.jsx Make the homepage's main marketing text blocks editable 2026-09-09 02:51:00 +02:00
Login.jsx Address second round of client feedback 2026-07-18 12:51:10 +02:00
Models.jsx Add image support for car brands and models 2026-09-09 01:42:40 +02:00
PackageProducts.jsx Redesign navbar mobile menu and rework site color palette 2026-07-06 16:21:48 +02:00
Packages.jsx Drop icon/slogan config from the package editor and unclip the featured badge 2026-07-20 06:43:49 +02:00
PackageUpgrades.jsx Redesign navbar mobile menu and rework site color palette 2026-07-06 16:21:48 +02:00
PermissionGroups.jsx Redesign navbar mobile menu and rework site color palette 2026-07-06 16:21:48 +02:00
Services.jsx Redesign navbar mobile menu and rework site color palette 2026-07-06 16:21:48 +02:00