Переглянути джерело

Вынесение кнопки сохранения
реализация отключения анимации

Stas 4 тижнів тому
батько
коміт
69909de71b

+ 1 - 1
config/database.php

@@ -35,7 +35,7 @@ return [
         'sqlite' => [
             'driver' => 'sqlite',
             'url' => env('DB_URL'),
-            'database' => env('DB_DATABASE', database_path('database.sqlite')),
+            'database' => env('DB_SQLITE_DATABASE', database_path('database.sqlite')),
             'prefix' => '',
             'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
             'busy_timeout' => null,

+ 17 - 0
public/css/site.css

@@ -823,3 +823,20 @@ ul{list-style:none}
 .car-img-fav.fav-active:hover{background:var(--red2)}
 /* #favNavCount перенесён в .nav-fav-count выше */
 
+/* ===== NO-ANIMATIONS: отключение всех эффектов появления ===== */
+/* Применяется когда в настройках включён переключатель «Отключить анимации» */
+body.no-animations .reveal,
+body.no-animations .reveal-up,
+body.no-animations .stagger>*{
+  opacity:1!important;transform:none!important;
+  animation:none!important;transition:none!important}
+
+/* Hero: CSS-анимации на @keyframes fin / sup */
+body.no-animations .hero-eyebrow,
+body.no-animations .hero-sub,
+body.no-animations .hero-btns,
+body.no-animations .hero-stats{
+  opacity:1!important;animation:none!important}
+body.no-animations .hero-title .ln span{
+  transform:none!important;animation:none!important}
+

Різницю між файлами не показано, бо вона завелика
+ 3 - 0
public/fonts-manifest.dev.json


+ 6 - 1
public/js/site.js

@@ -107,7 +107,12 @@
     });
 
     /* ── scroll reveal (IntersectionObserver) ── */
-    if ('IntersectionObserver' in window) {
+    /* Пропускаем когда анимации отключены в настройках сайта */
+    if (document.body.classList.contains('no-animations')) {
+      document.querySelectorAll('.reveal, .reveal-up, .stagger').forEach(function (el) {
+        el.classList.add('in');
+      });
+    } else if ('IntersectionObserver' in window) {
       var io = new IntersectionObserver(function (entries) {
         entries.forEach(function (entry) {
           if (entry.isIntersecting) {

+ 8 - 3
resources/views/admin/settings/index.blade.php

@@ -3,7 +3,7 @@
     Partials (в admin/settings/partials/):
       _card_analytics — Яндекс.Метрика и Google Analytics
       _card_og        — Open Graph метатеги
-      _card_logos     — Логотипы шапки и подвала + кнопка сохранения
+      _card_logos     — Логотипы шапки и подвала
       _card_site_mode — Режим сайта (обслуживание + noindex)
 --}}
 @extends('admin.layout')
@@ -11,7 +11,12 @@
 @section('title', 'Настройки сайта')
 
 @section('content_header')
-    <h1 class="m-0">Настройки сайта</h1>
+    <div class="d-flex justify-content-between align-items-center">
+        <h1 class="m-0">Настройки сайта</h1>
+        <button type="submit" form="settings-form" class="btn btn-primary">
+            <i class="fas fa-save"></i> Сохранить настройки
+        </button>
+    </div>
 @stop
 
 @section('breadcrumb')
@@ -27,7 +32,7 @@
         </div>
     @endif
 
-    <form action="{{ route('admin.settings.update') }}" method="POST" enctype="multipart/form-data">
+    <form id="settings-form" action="{{ route('admin.settings.update') }}" method="POST" enctype="multipart/form-data">
         @csrf
 
         <div class="row">

+ 0 - 5
resources/views/admin/settings/partials/_card_logos.blade.php

@@ -52,9 +52,4 @@
 
         </div>
     </div>
-    <div class="card-footer">
-        <button type="submit" class="btn btn-primary">
-            <i class="fas fa-save"></i> Сохранить настройки
-        </button>
-    </div>
 </div>

+ 4 - 3
resources/views/blocks/steps_section.blade.php

@@ -47,7 +47,7 @@
         {{-- Все панели шагов — рендерит сервер, JS только скрывает/показывает --}}
         <div id="step-panel" style="transition:opacity .25s ease">
             @foreach($steps as $i => $step)
-                <div class="step-content" data-step-panel="{{ $i }}"{{ $i !== 0 ? ' style="display:none"' : '' }}>
+                <div class="step-content" data-step-panel="{{ $i }}" @if($i !== 0) style="display:none" @endif>
                     <div class="step-left">
                         <div class="step-badge">{{ $i + 1 }}</div>
                         <div class="step-title">{{ $step['title'] ?? '' }}</div>
@@ -79,9 +79,10 @@
             current = idx;
             panels[current].style.display = '';
             wrapper.style.opacity = '1';
+            /* dots/lines обновляем после current = idx, иначе подсветка отстаёт на шаг */
+            dots.forEach(function (d, i)  { d.classList.toggle('active', i === current); });
+            lines.forEach(function (l, i) { l.classList.toggle('done',   i < current); });
         }, 150);
-        dots.forEach(function (d, i)  { d.classList.toggle('active', i === current); });
-        lines.forEach(function (l, i) { l.classList.toggle('done',   i < current); });
     }
 
     document.addEventListener('DOMContentLoaded', function () {

+ 1 - 1
resources/views/layouts/app.blade.php

@@ -24,7 +24,7 @@
 
     @stack('styles')
 </head>
-<body>
+<body @class(['no-animations' => \App\Models\Setting::get('disable_animations') === '1'])>
 
 {{-- Шапка --}}
 @include('layouts.partials._header')

Деякі файли не було показано, через те що забагато файлів було змінено