Add vertical drag positioning for gallery card labels
Extends the just-added horizontal drag to a second axis, per follow-up request. New app_settings.gallery_card_text_y (TINYINT UNSIGNED 0-100, default 100 = bottom, matching the original always-bottom position - no visual change until an admin drags it). galleryCardLabelStyle() now takes both x and y and combines `left/top` + a single `transform: translate(-X%, -Y%)` - same edge-to-edge interpolation trick as the horizontal axis, just on both axes at once. GalleryOverview.jsx/GalleryBrandPage.jsx drop the `bottom-0` class entirely now that vertical position is fully style-driven. WebsiteSettings.jsx's drag handlers compute both axes from one pointer position per move (one setForm call, not two) so a diagonal drag reads as one continuous motion. Added a vertical Oben/Mittig/Unten quick-jump row alongside the existing horizontal one. Note left as-is deliberately: the card's dark gradient overlay still only fades from opaque at the bottom to transparent at the top, so text dragged toward the top will have less contrast behind it - that's a real trade-off of allowing free vertical placement, and the live preview is exactly how an admin would notice and judge it rather than being blocked from trying. Verified against the local database directly via PHP CLI: defaults (0/100) and an arbitrary pair (30/15) both round-trip correctly through SiteSettingsController::show(), then reset back to defaults. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
e9f68d054c
commit
28fc9d76dd
13 changed files with 145 additions and 90 deletions
|
|
@ -45,6 +45,7 @@ const DEFAULT_SITE_SETTINGS = {
|
||||||
package_card_layout: 'strip',
|
package_card_layout: 'strip',
|
||||||
package_wheel_hint_interval: 8,
|
package_wheel_hint_interval: 8,
|
||||||
gallery_card_text_x: 0,
|
gallery_card_text_x: 0,
|
||||||
|
gallery_card_text_y: 100,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Das Impressum (und die anderen rechtlichen Pflichtseiten) müssen laut § 5 DDG
|
// Das Impressum (und die anderen rechtlichen Pflichtseiten) müssen laut § 5 DDG
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ const SiteSettingsContext = createContext({
|
||||||
hero_image_path: null,
|
hero_image_path: null,
|
||||||
ga_measurement_id: null,
|
ga_measurement_id: null,
|
||||||
gallery_card_text_x: 0,
|
gallery_card_text_x: 0,
|
||||||
|
gallery_card_text_y: 100,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const SiteSettingsProvider = SiteSettingsContext.Provider;
|
export const SiteSettingsProvider = SiteSettingsContext.Provider;
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ const emptyForm = {
|
||||||
package_card_layout: 'strip',
|
package_card_layout: 'strip',
|
||||||
package_wheel_hint_interval: 8,
|
package_wheel_hint_interval: 8,
|
||||||
gallery_card_text_x: 0,
|
gallery_card_text_x: 0,
|
||||||
|
gallery_card_text_y: 100,
|
||||||
};
|
};
|
||||||
|
|
||||||
const PACKAGE_CARD_THEMES = [
|
const PACKAGE_CARD_THEMES = [
|
||||||
|
|
@ -59,20 +60,30 @@ export default function WebsiteSettings() {
|
||||||
const galleryPreviewRef = useRef(null);
|
const galleryPreviewRef = useRef(null);
|
||||||
const [galleryDragging, setGalleryDragging] = useState(false);
|
const [galleryDragging, setGalleryDragging] = useState(false);
|
||||||
|
|
||||||
const galleryXFromPointer = (clientX) => {
|
// Beide Achsen aus einer Zeigerposition berechnen und in einem Schritt uebernehmen (statt
|
||||||
|
// zweimal ueber die generische update(field, value)-Hilfsfunktion), damit ein Drag sich wie
|
||||||
|
// eine einzige Bewegung anfuehlt statt wie zwei unabhaengige Werte.
|
||||||
|
const galleryPercentsFromPointer = (clientX, clientY) => {
|
||||||
const rect = galleryPreviewRef.current.getBoundingClientRect();
|
const rect = galleryPreviewRef.current.getBoundingClientRect();
|
||||||
const pct = ((clientX - rect.left) / rect.width) * 100;
|
return {
|
||||||
return Math.max(0, Math.min(100, Math.round(pct)));
|
x: Math.max(0, Math.min(100, Math.round(((clientX - rect.left) / rect.width) * 100))),
|
||||||
|
y: Math.max(0, Math.min(100, Math.round(((clientY - rect.top) / rect.height) * 100))),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
const setGalleryPosition = (clientX, clientY) => {
|
||||||
|
const { x, y } = galleryPercentsFromPointer(clientX, clientY);
|
||||||
|
setForm((f) => ({ ...f, gallery_card_text_x: x, gallery_card_text_y: y }));
|
||||||
|
setSaved(false);
|
||||||
};
|
};
|
||||||
const handleGalleryDragStart = (e) => {
|
const handleGalleryDragStart = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.currentTarget.setPointerCapture(e.pointerId);
|
e.currentTarget.setPointerCapture(e.pointerId);
|
||||||
setGalleryDragging(true);
|
setGalleryDragging(true);
|
||||||
update('gallery_card_text_x', galleryXFromPointer(e.clientX));
|
setGalleryPosition(e.clientX, e.clientY);
|
||||||
};
|
};
|
||||||
const handleGalleryDragMove = (e) => {
|
const handleGalleryDragMove = (e) => {
|
||||||
if (!galleryDragging) return;
|
if (!galleryDragging) return;
|
||||||
update('gallery_card_text_x', galleryXFromPointer(e.clientX));
|
setGalleryPosition(e.clientX, e.clientY);
|
||||||
};
|
};
|
||||||
const handleGalleryDragEnd = (e) => {
|
const handleGalleryDragEnd = (e) => {
|
||||||
setGalleryDragging(false);
|
setGalleryDragging(false);
|
||||||
|
|
@ -115,6 +126,7 @@ export default function WebsiteSettings() {
|
||||||
package_card_layout: res.package_card_layout || 'strip',
|
package_card_layout: res.package_card_layout || 'strip',
|
||||||
package_wheel_hint_interval: res.package_wheel_hint_interval || 8,
|
package_wheel_hint_interval: res.package_wheel_hint_interval || 8,
|
||||||
gallery_card_text_x: res.gallery_card_text_x ?? 0,
|
gallery_card_text_x: res.gallery_card_text_x ?? 0,
|
||||||
|
gallery_card_text_y: res.gallery_card_text_y ?? 100,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.finally(() => setLoading(false));
|
.finally(() => setLoading(false));
|
||||||
|
|
@ -450,7 +462,7 @@ export default function WebsiteSettings() {
|
||||||
<section className="rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900">
|
<section className="rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900">
|
||||||
<h2 className="mb-1 font-semibold text-neutral-900 dark:text-white">Bildergalerie-Kacheln</h2>
|
<h2 className="mb-1 font-semibold text-neutral-900 dark:text-white">Bildergalerie-Kacheln</h2>
|
||||||
<p className="mb-4 text-sm text-neutral-500 dark:text-neutral-400">
|
<p className="mb-4 text-sm text-neutral-500 dark:text-neutral-400">
|
||||||
Ausrichtung des Marken-/Projekt-Namens auf den Kacheln der Bildergalerie-Übersicht und der
|
Position des Marken-/Projekt-Namens auf den Kacheln der Bildergalerie-Übersicht und der
|
||||||
Marken-Detailseite.
|
Marken-Detailseite.
|
||||||
</p>
|
</p>
|
||||||
<div className="grid gap-4 sm:grid-cols-[16rem_1fr] sm:items-start">
|
<div className="grid gap-4 sm:grid-cols-[16rem_1fr] sm:items-start">
|
||||||
|
|
@ -474,8 +486,8 @@ export default function WebsiteSettings() {
|
||||||
onPointerDown={handleGalleryDragStart}
|
onPointerDown={handleGalleryDragStart}
|
||||||
onPointerMove={handleGalleryDragMove}
|
onPointerMove={handleGalleryDragMove}
|
||||||
onPointerUp={handleGalleryDragEnd}
|
onPointerUp={handleGalleryDragEnd}
|
||||||
style={{ ...galleryCardLabelStyle(form.gallery_card_text_x), touchAction: 'none' }}
|
style={{ ...galleryCardLabelStyle(form.gallery_card_text_x, form.gallery_card_text_y), touchAction: 'none' }}
|
||||||
className={`absolute bottom-0 select-none whitespace-nowrap rounded p-3 text-sm font-extrabold text-white transition-colors ${
|
className={`absolute select-none whitespace-nowrap rounded p-3 text-sm font-extrabold text-white transition-colors ${
|
||||||
galleryDragging ? 'cursor-grabbing bg-white/10 ring-2 ring-brand-400' : 'cursor-grab hover:bg-white/10'
|
galleryDragging ? 'cursor-grabbing bg-white/10 ring-2 ring-brand-400' : 'cursor-grab hover:bg-white/10'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
|
@ -488,11 +500,13 @@ export default function WebsiteSettings() {
|
||||||
<p className="text-sm text-neutral-500 dark:text-neutral-400">
|
<p className="text-sm text-neutral-500 dark:text-neutral-400">
|
||||||
Position:{' '}
|
Position:{' '}
|
||||||
<span className="font-mono font-semibold text-neutral-700 dark:text-neutral-200">
|
<span className="font-mono font-semibold text-neutral-700 dark:text-neutral-200">
|
||||||
{form.gallery_card_text_x}%
|
{form.gallery_card_text_x}% / {form.gallery_card_text_y}%
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
<p className="mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400">Schnellauswahl</p>
|
<p className="mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400">
|
||||||
|
Schnellauswahl waagerecht
|
||||||
|
</p>
|
||||||
<div className="flex flex-wrap gap-2">
|
<div className="flex flex-wrap gap-2">
|
||||||
<button type="button" onClick={() => update('gallery_card_text_x', 0)} className="rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800">
|
<button type="button" onClick={() => update('gallery_card_text_x', 0)} className="rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800">
|
||||||
Links
|
Links
|
||||||
|
|
@ -505,6 +519,22 @@ export default function WebsiteSettings() {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<p className="mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400">
|
||||||
|
Schnellauswahl senkrecht
|
||||||
|
</p>
|
||||||
|
<div className="flex flex-wrap gap-2">
|
||||||
|
<button type="button" onClick={() => update('gallery_card_text_y', 0)} className="rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800">
|
||||||
|
Oben
|
||||||
|
</button>
|
||||||
|
<button type="button" onClick={() => update('gallery_card_text_y', 50)} className="rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800">
|
||||||
|
Mittig
|
||||||
|
</button>
|
||||||
|
<button type="button" onClick={() => update('gallery_card_text_y', 100)} className="rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800">
|
||||||
|
Unten
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ export default function GalleryBrandPage() {
|
||||||
const [data, setData] = useState(null);
|
const [data, setData] = useState(null);
|
||||||
const [error, setError] = useState('');
|
const [error, setError] = useState('');
|
||||||
const { t } = useLanguage();
|
const { t } = useLanguage();
|
||||||
const { gallery_card_text_x: cardTextX } = useSiteSettings();
|
const { gallery_card_text_x: cardTextX, gallery_card_text_y: cardTextY } = useSiteSettings();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
api.get(`/gallery-brands/${brandSlug}/projects`).then(setData).catch((e) => setError(e.message));
|
api.get(`/gallery-brands/${brandSlug}/projects`).then(setData).catch((e) => setError(e.message));
|
||||||
|
|
@ -62,8 +62,8 @@ export default function GalleryBrandPage() {
|
||||||
)}
|
)}
|
||||||
<div className="absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95" />
|
<div className="absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95" />
|
||||||
<span
|
<span
|
||||||
className="absolute bottom-0 whitespace-nowrap p-4 text-lg font-extrabold text-white"
|
className="absolute whitespace-nowrap p-4 text-lg font-extrabold text-white"
|
||||||
style={galleryCardLabelStyle(cardTextX)}
|
style={galleryCardLabelStyle(cardTextX, cardTextY)}
|
||||||
>
|
>
|
||||||
{project.name}
|
{project.name}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export default function GalleryOverview() {
|
||||||
const [brands, setBrands] = useState(null);
|
const [brands, setBrands] = useState(null);
|
||||||
const [error, setError] = useState('');
|
const [error, setError] = useState('');
|
||||||
const { t } = useLanguage();
|
const { t } = useLanguage();
|
||||||
const { gallery_card_text_x: cardTextX } = useSiteSettings();
|
const { gallery_card_text_x: cardTextX, gallery_card_text_y: cardTextY } = useSiteSettings();
|
||||||
|
|
||||||
usePageMeta({
|
usePageMeta({
|
||||||
title: t('galleryOverview.metaTitle'),
|
title: t('galleryOverview.metaTitle'),
|
||||||
|
|
@ -53,8 +53,8 @@ export default function GalleryOverview() {
|
||||||
)}
|
)}
|
||||||
<div className="absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95" />
|
<div className="absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95" />
|
||||||
<span
|
<span
|
||||||
className="absolute bottom-0 whitespace-nowrap p-4 text-lg font-extrabold text-white"
|
className="absolute whitespace-nowrap p-4 text-lg font-extrabold text-white"
|
||||||
style={galleryCardLabelStyle(cardTextX)}
|
style={galleryCardLabelStyle(cardTextX, cardTextY)}
|
||||||
>
|
>
|
||||||
{brand.name}
|
{brand.name}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,22 @@
|
||||||
// Horizontale Position des Marken-/Projekt-Namens auf den Bildergalerie-Kacheln
|
// Position des Marken-/Projekt-Namens auf den Bildergalerie-Kacheln
|
||||||
// (app_settings.gallery_card_text_x, 0-100, siehe SiteSettingsController.php) - per Drag &
|
// (app_settings.gallery_card_text_x/_y, je 0-100, siehe SiteSettingsController.php) - per
|
||||||
// Drop in der Live-Vorschau gesetzt (WebsiteSettings.jsx), genutzt von GalleryOverview.jsx
|
// Drag & Drop in der Live-Vorschau gesetzt (WebsiteSettings.jsx), genutzt von
|
||||||
// und GalleryBrandPage.jsx.
|
// GalleryOverview.jsx und GalleryBrandPage.jsx.
|
||||||
//
|
//
|
||||||
// left: X% + transform: translateX(-X%) ist der Standard-CSS-Trick, um einen einzigen
|
// `left: X%` + `translateX(-X%)` (und analog `top`/`translateY` fuer die Y-Achse) ist der
|
||||||
// Prozentwert stufenlos zwischen linksbuendig (X=0, Element faengt bei 0% an) und
|
// Standard-CSS-Trick, um einen einzigen Prozentwert stufenlos zwischen einer Kante (0%,
|
||||||
// rechtsbuendig (X=100, Element endet bei 100%, da es um seine volle Breite zurueckgeschoben
|
// Element faengt dort an) und der gegenueberliegenden Kante (100%, Element endet dort, da es
|
||||||
// wird) zu interpolieren - bei X=50 landet die Textmitte in der Kachelmitte. Deshalb eine
|
// um seine volle Breite/Hoehe zurueckgeschoben wird) zu interpolieren - bei 50% landet die
|
||||||
// echte Inline-Style-Berechnung statt einer festen Tailwind-Klasse (anders als z.B. bei den
|
// Textmitte in der Kachelmitte. Deshalb eine echte Inline-Style-Berechnung statt einer festen
|
||||||
// Home.jsx-Abschnitten, wo drei feste Werte genuegen).
|
// Tailwind-Klasse (anders als z.B. bei den Home.jsx-Abschnitten, wo drei feste Werte genuegen).
|
||||||
export function galleryCardLabelStyle(xPercent) {
|
export function galleryCardLabelStyle(xPercent, yPercent) {
|
||||||
const x = Math.max(0, Math.min(100, Number(xPercent) || 0));
|
const x = Math.max(0, Math.min(100, Number(xPercent) || 0));
|
||||||
|
// Ohne expliziten Wert (aeltere/noch nicht geladene Einstellungen) faellt Y auf 100 (unten)
|
||||||
|
// zurueck - entspricht der urspruenglichen, immer unten fixierten Position.
|
||||||
|
const y = Math.max(0, Math.min(100, yPercent == null ? 100 : Number(yPercent) || 0));
|
||||||
return {
|
return {
|
||||||
left: `${x}%`,
|
left: `${x}%`,
|
||||||
transform: `translateX(-${x}%)`,
|
top: `${y}%`,
|
||||||
|
transform: `translate(-${x}%, -${y}%)`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
hifi/api/database/migration_gallery_card_y.sql
Normal file
11
hifi/api/database/migration_gallery_card_y.sql
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
USE hifi_shop;
|
||||||
|
|
||||||
|
-- Ergaenzt die horizontale Drag-Position (gallery_card_text_x, siehe
|
||||||
|
-- migration_gallery_card_drag.sql) um eine vertikale Achse - 0 = ganz oben,
|
||||||
|
-- 100 = ganz unten (Standard, entspricht der bisherigen "bottom-0"-Position, also
|
||||||
|
-- keine optische Aenderung, solange niemand daran zieht). 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 gallery_card_text_y TINYINT UNSIGNED NOT NULL DEFAULT 100 AFTER gallery_card_text_x;
|
||||||
|
|
@ -37,6 +37,7 @@ CREATE TABLE app_settings (
|
||||||
package_card_layout VARCHAR(20) NOT NULL DEFAULT 'strip',
|
package_card_layout VARCHAR(20) NOT NULL DEFAULT 'strip',
|
||||||
package_wheel_hint_interval INT NOT NULL DEFAULT 8,
|
package_wheel_hint_interval INT NOT NULL DEFAULT 8,
|
||||||
gallery_card_text_x TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
gallery_card_text_x TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
gallery_card_text_y TINYINT UNSIGNED NOT NULL DEFAULT 100,
|
||||||
mail_host VARCHAR(255) NULL,
|
mail_host VARCHAR(255) NULL,
|
||||||
mail_port INT NULL,
|
mail_port INT NULL,
|
||||||
mail_username VARCHAR(255) NULL,
|
mail_username VARCHAR(255) NULL,
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,8 @@ class SettingsController
|
||||||
'logo_path', 'logo_dark_path', 'business_hours',
|
'logo_path', 'logo_dark_path', 'business_hours',
|
||||||
'hero_image_path',
|
'hero_image_path',
|
||||||
'ga_measurement_id', 'ga_property_id', 'google_place_id',
|
'ga_measurement_id', 'ga_property_id', 'google_place_id',
|
||||||
'package_card_theme', 'package_card_layout', 'package_wheel_hint_interval', 'gallery_card_text_x',
|
'package_card_theme', 'package_card_layout', 'package_wheel_hint_interval',
|
||||||
|
'gallery_card_text_x', 'gallery_card_text_y',
|
||||||
'mail_host', 'mail_port', 'mail_username', 'mail_encryption',
|
'mail_host', 'mail_port', 'mail_username', 'mail_encryption',
|
||||||
'mail_from_email', 'mail_from_name', 'mail_notify_email',
|
'mail_from_email', 'mail_from_name', 'mail_notify_email',
|
||||||
'mail_customer_subject', 'mail_customer_body', 'mail_owner_subject', 'mail_owner_body',
|
'mail_customer_subject', 'mail_customer_body', 'mail_owner_subject', 'mail_owner_body',
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ class SiteSettingsController
|
||||||
'package_card_layout' => 'strip',
|
'package_card_layout' => 'strip',
|
||||||
'package_wheel_hint_interval' => 8,
|
'package_wheel_hint_interval' => 8,
|
||||||
'gallery_card_text_x' => 0,
|
'gallery_card_text_x' => 0,
|
||||||
|
'gallery_card_text_y' => 100,
|
||||||
];
|
];
|
||||||
|
|
||||||
// Entspricht dem, was zuvor hart in Footer.jsx (isOpenNow() + die drei separaten
|
// Entspricht dem, was zuvor hart in Footer.jsx (isOpenNow() + die drei separaten
|
||||||
|
|
@ -42,7 +43,8 @@ class SiteSettingsController
|
||||||
|
|
||||||
private const APP_SETTINGS_COLUMNS = 'phone, whatsapp, contact_email, address_street, address_zip, address_city,
|
private const APP_SETTINGS_COLUMNS = 'phone, whatsapp, contact_email, address_street, address_zip, address_city,
|
||||||
logo_path, logo_dark_path, business_hours, hero_image_path, ga_measurement_id,
|
logo_path, logo_dark_path, business_hours, hero_image_path, ga_measurement_id,
|
||||||
package_card_theme, package_card_layout, package_wheel_hint_interval, gallery_card_text_x';
|
package_card_theme, package_card_layout, package_wheel_hint_interval,
|
||||||
|
gallery_card_text_x, gallery_card_text_y';
|
||||||
|
|
||||||
public static function show(): void
|
public static function show(): void
|
||||||
{
|
{
|
||||||
|
|
@ -90,11 +92,12 @@ class SiteSettingsController
|
||||||
$wheelHintInterval = (int) ($body['package_wheel_hint_interval'] ?? 8);
|
$wheelHintInterval = (int) ($body['package_wheel_hint_interval'] ?? 8);
|
||||||
$wheelHintInterval = max(2, min(120, $wheelHintInterval ?: 8));
|
$wheelHintInterval = max(2, min(120, $wheelHintInterval ?: 8));
|
||||||
|
|
||||||
// Horizontale Position des Marken-/Projekt-Namens auf den Bildergalerie-Kacheln in
|
// Position des Marken-/Projekt-Namens auf den Bildergalerie-Kacheln in Prozent (X: 0 =
|
||||||
// Prozent (0 = ganz links, 100 = ganz rechts), per Drag & Drop in der Live-Vorschau
|
// ganz links, 100 = ganz rechts; Y: 0 = ganz oben, 100 = ganz unten), per Drag & Drop in
|
||||||
// gesetzt (siehe WebsiteSettings.jsx) - auf den gueltigen Bereich geklammert, damit ein
|
// der Live-Vorschau gesetzt (siehe WebsiteSettings.jsx) - auf den gueltigen Bereich
|
||||||
// fehlerhafter Client-Wert nicht ausserhalb der Kachel landet.
|
// geklammert, damit ein fehlerhafter Client-Wert nicht ausserhalb der Kachel landet.
|
||||||
$galleryCardTextX = max(0, min(100, (int) ($body['gallery_card_text_x'] ?? 0)));
|
$galleryCardTextX = max(0, min(100, (int) ($body['gallery_card_text_x'] ?? 0)));
|
||||||
|
$galleryCardTextY = max(0, min(100, (int) ($body['gallery_card_text_y'] ?? 100)));
|
||||||
|
|
||||||
$newHeroImagePath = trim($body['hero_image_path'] ?? '') ?: null;
|
$newHeroImagePath = trim($body['hero_image_path'] ?? '') ?: null;
|
||||||
$newLogoPath = trim($body['logo_path'] ?? '') ?: null;
|
$newLogoPath = trim($body['logo_path'] ?? '') ?: null;
|
||||||
|
|
@ -125,7 +128,7 @@ class SiteSettingsController
|
||||||
'UPDATE app_settings SET phone = ?, whatsapp = ?, contact_email = ?, address_street = ?, address_zip = ?,
|
'UPDATE app_settings SET phone = ?, whatsapp = ?, contact_email = ?, address_street = ?, address_zip = ?,
|
||||||
address_city = ?, logo_path = ?, logo_dark_path = ?, business_hours = ?, hero_image_path = ?,
|
address_city = ?, logo_path = ?, logo_dark_path = ?, business_hours = ?, hero_image_path = ?,
|
||||||
ga_measurement_id = ?, package_card_theme = ?, package_card_layout = ?, package_wheel_hint_interval = ?,
|
ga_measurement_id = ?, package_card_theme = ?, package_card_layout = ?, package_wheel_hint_interval = ?,
|
||||||
gallery_card_text_x = ?
|
gallery_card_text_x = ?, gallery_card_text_y = ?
|
||||||
WHERE id = 1'
|
WHERE id = 1'
|
||||||
);
|
);
|
||||||
$stmt->execute([
|
$stmt->execute([
|
||||||
|
|
@ -144,6 +147,7 @@ class SiteSettingsController
|
||||||
$packageCardLayout,
|
$packageCardLayout,
|
||||||
$wheelHintInterval,
|
$wheelHintInterval,
|
||||||
$galleryCardTextX,
|
$galleryCardTextX,
|
||||||
|
$galleryCardTextY,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Uploads::deleteIfOrphaned($old['hero_image_path'] ?? null, $newHeroImagePath);
|
Uploads::deleteIfOrphaned($old['hero_image_path'] ?? null, $newHeroImagePath);
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ class Schema
|
||||||
package_card_layout VARCHAR(20) NOT NULL DEFAULT 'strip',
|
package_card_layout VARCHAR(20) NOT NULL DEFAULT 'strip',
|
||||||
package_wheel_hint_interval INT NOT NULL DEFAULT 8,
|
package_wheel_hint_interval INT NOT NULL DEFAULT 8,
|
||||||
gallery_card_text_x TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
gallery_card_text_x TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
gallery_card_text_y TINYINT UNSIGNED NOT NULL DEFAULT 100,
|
||||||
mail_host VARCHAR(255) NULL,
|
mail_host VARCHAR(255) NULL,
|
||||||
mail_port INT NULL,
|
mail_port INT NULL,
|
||||||
mail_username VARCHAR(255) NULL,
|
mail_username VARCHAR(255) NULL,
|
||||||
|
|
@ -346,6 +347,7 @@ class Schema
|
||||||
'package_card_layout' => "VARCHAR(20) NOT NULL DEFAULT 'strip'",
|
'package_card_layout' => "VARCHAR(20) NOT NULL DEFAULT 'strip'",
|
||||||
'package_wheel_hint_interval' => 'INT NOT NULL DEFAULT 8',
|
'package_wheel_hint_interval' => 'INT NOT NULL DEFAULT 8',
|
||||||
'gallery_card_text_x' => 'TINYINT UNSIGNED NOT NULL DEFAULT 0',
|
'gallery_card_text_x' => 'TINYINT UNSIGNED NOT NULL DEFAULT 0',
|
||||||
|
'gallery_card_text_y' => 'TINYINT UNSIGNED NOT NULL DEFAULT 100',
|
||||||
'mail_host' => 'VARCHAR(255) NULL',
|
'mail_host' => 'VARCHAR(255) NULL',
|
||||||
'mail_port' => 'INT NULL',
|
'mail_port' => 'INT NULL',
|
||||||
'mail_username' => 'VARCHAR(255) NULL',
|
'mail_username' => 'VARCHAR(255) NULL',
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -43,7 +43,7 @@
|
||||||
"sameAs": ["https://www.youtube.com/@hifiplanet2812"]
|
"sameAs": ["https://www.youtube.com/@hifiplanet2812"]
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="module" crossorigin src="/assets/index-Ddoucb3i.js"></script>
|
<script type="module" crossorigin src="/assets/index-BPvbL8M7.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="/assets/lucide-icons-Cg2IxtAO.js">
|
<link rel="modulepreload" crossorigin href="/assets/lucide-icons-Cg2IxtAO.js">
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-CxsdIqOv.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-CxsdIqOv.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue