HifiPlanet-Website/hifi/api/database/migration_tile_sizes.sql
Maaxxs 49e2700399 Make brand/model tile size and package card size admin-configurable
Adds four numeric app_settings fields (vehicle_tile_width/height,
package_card_width/height, all in px, clamped server-side to a sane
range but otherwise a free number as requested) with matching inputs
in WebsiteSettings.jsx.

Brand/model tiles (VehicleSelect.jsx, BrandPage.jsx) move from a
responsive CSS-grid with an implicit per-column width to a flex-wrap
layout where every tile has the admin's chosen fixed width/height -
applies to both the photo-background and plain-text card variants, so
mixed grids stay visually consistent.

Package cards (ModelPage.jsx) keep their three existing layout modes
(grid/strip/coverflow) but the actual card dimensions - previously
hardcoded Tailwind width/min-height classes with a separate mobile/sm
breakpoint value - are now driven by the same two settings. Grid mode's
column count is no longer fixed at 2/3 columns; it's now
repeat(auto-fill, minmax(width, 1fr)), so the chosen width determines how
many cards fit per row. Coverflow's center-scroll padding, previously
hardcoded against the old fixed 230px card width, now derives from the
configured width too.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 03:42:20 +02:00

12 lines
816 B
SQL

USE hifi_shop;
-- Einstellbare Kachelgroesse (Breite/Hoehe in px) fuer die Marken-/Modell-Auswahl und die
-- Paket-Kacheln auf der Modell-Detailseite. Additiv, nichts wird geloescht.
-- Hinweis: Auf der Live-Seite reicht stattdessen ein Klick auf "Datenbankstruktur aktualisieren"
-- unter Admin-Panel -> Einstellungen -> Datenbank.
ALTER TABLE app_settings
ADD COLUMN IF NOT EXISTS package_card_width SMALLINT UNSIGNED NOT NULL DEFAULT 210 AFTER package_wheel_hint_interval,
ADD COLUMN IF NOT EXISTS package_card_height SMALLINT UNSIGNED NOT NULL DEFAULT 480 AFTER package_card_width,
ADD COLUMN IF NOT EXISTS vehicle_tile_width SMALLINT UNSIGNED NOT NULL DEFAULT 240 AFTER package_card_height,
ADD COLUMN IF NOT EXISTS vehicle_tile_height SMALLINT UNSIGNED NOT NULL DEFAULT 180 AFTER vehicle_tile_width;