No description
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> |
||
|---|---|---|
| hifi | ||
| hifi-src | ||
| .gitignore | ||
| DEPLOY.md | ||