diff --git a/app/Http/Requests/Admin/ValidatesPreregistrationPageInput.php b/app/Http/Requests/Admin/ValidatesPreregistrationPageInput.php index 6dceb65..2d28d69 100644 --- a/app/Http/Requests/Admin/ValidatesPreregistrationPageInput.php +++ b/app/Http/Requests/Admin/ValidatesPreregistrationPageInput.php @@ -23,6 +23,7 @@ trait ValidatesPreregistrationPageInput 'post_submit_redirect_url' => ['nullable', 'string', 'url:http,https', 'max:500'], 'background_overlay_color' => ['nullable', 'string', 'regex:/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/'], 'background_overlay_opacity' => ['nullable', 'integer', 'min:0', 'max:100'], + 'background_fixed' => ['sometimes', 'boolean'], 'page_background' => ['nullable', 'file', 'image', 'mimes:jpeg,png,jpg,webp', 'max:5120'], 'remove_page_background' => ['sometimes', 'boolean'], 'start_date' => ['required', 'date'], @@ -69,6 +70,7 @@ trait ValidatesPreregistrationPageInput $this->merge([ 'is_active' => $this->boolean('is_active'), + 'background_fixed' => $this->boolean('background_fixed'), 'remove_page_background' => $this->boolean('remove_page_background'), 'ticketshop_url' => $ticketshopNormalized, 'post_submit_redirect_url' => $redirectNormalized, diff --git a/app/Models/PreregistrationPage.php b/app/Models/PreregistrationPage.php index f307e96..e045e9f 100644 --- a/app/Models/PreregistrationPage.php +++ b/app/Models/PreregistrationPage.php @@ -32,6 +32,7 @@ class PreregistrationPage extends Model 'background_image', 'background_overlay_color', 'background_overlay_opacity', + 'background_fixed', 'logo_image', 'is_active', ]; @@ -42,6 +43,7 @@ class PreregistrationPage extends Model 'start_date' => 'datetime', 'end_date' => 'datetime', 'phone_enabled' => 'boolean', + 'background_fixed' => 'boolean', 'is_active' => 'boolean', ]; } diff --git a/database/migrations/2026_04_04_200000_add_background_fixed_to_preregistration_pages.php b/database/migrations/2026_04_04_200000_add_background_fixed_to_preregistration_pages.php new file mode 100644 index 0000000..6a16527 --- /dev/null +++ b/database/migrations/2026_04_04_200000_add_background_fixed_to_preregistration_pages.php @@ -0,0 +1,24 @@ +boolean('background_fixed')->default(false)->after('background_overlay_opacity'); + }); + } + + public function down(): void + { + Schema::table('preregistration_pages', function (Blueprint $table): void { + $table->dropColumn('background_fixed'); + }); + } +}; diff --git a/lang/nl.json b/lang/nl.json index 54c9fb0..560fb2f 100644 --- a/lang/nl.json +++ b/lang/nl.json @@ -22,5 +22,7 @@ "Subscriber removed.": "Abonnee verwijderd.", "Delete this subscriber? This cannot be undone.": "Deze abonnee verwijderen? Dit kan niet ongedaan worden gemaakt.", "Remove": "Verwijderen", - "Actions": "Acties" + "Actions": "Acties", + "Fix background to viewport": "Achtergrond vastzetten op het scherm", + "When enabled, the background image and overlay stay fixed while visitors scroll long content.": "Als dit aan staat, blijven de achtergrondafbeelding en de overlay stilstaan terwijl bezoekers door lange inhoud scrollen." } diff --git a/resources/views/admin/pages/_form.blade.php b/resources/views/admin/pages/_form.blade.php index 004dab1..99b7a98 100644 --- a/resources/views/admin/pages/_form.blade.php +++ b/resources/views/admin/pages/_form.blade.php @@ -98,6 +98,19 @@ @enderror +
{{ __('When enabled, the background image and overlay stay fixed while visitors scroll long content.') }}
+