_header.blade.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {{-- Шапка публичного сайта. Данные берутся из $siteSettings (View Composer). --}}
  2. @php
  3. $phone = $siteSettings['phone'] ?? '';
  4. $email = $siteSettings['email'] ?? '';
  5. $telegram = $siteSettings['telegram'] ?? '';
  6. $youtube = $siteSettings['youtube'] ?? '';
  7. $vk = $siteSettings['vk'] ?? '';
  8. $logoHeader = $siteSettings['logo_header'] ?? 'images/logos/logo_short_transparent.png';
  9. $hasTopbar = $phone || $email || $telegram || $youtube || $vk;
  10. @endphp
  11. @if($hasTopbar)
  12. <div class="topbar">
  13. <div class="container">
  14. <div class="topbar-l">
  15. @if($email)
  16. <span>&#128231; <a href="mailto:{{ $email }}">{{ $email }}</a></span>
  17. @endif
  18. @if($phone)
  19. <span>&#128222; <a href="tel:{{ preg_replace('/\D/', '', $phone) }}">{{ $phone }}</a></span>
  20. @endif
  21. </div>
  22. @if($telegram || $vk || $youtube)
  23. <div class="topbar-r">
  24. <div class="topbar-soc">
  25. @if($telegram)
  26. <a href="{{ $telegram }}" target="_blank" rel="noopener" title="Telegram">TG</a>
  27. @endif
  28. @if($vk)
  29. <a href="{{ $vk }}" target="_blank" rel="noopener" title="ВКонтакте">ВК</a>
  30. @endif
  31. @if($youtube)
  32. <a href="{{ $youtube }}" target="_blank" rel="noopener" title="YouTube">YT</a>
  33. @endif
  34. </div>
  35. </div>
  36. @endif
  37. </div>
  38. </div>
  39. @endif
  40. <nav class="navbar" id="navbar">
  41. <div class="container">
  42. <a href="{{ route('home') }}" class="logo">
  43. <img src="{{ asset($logoHeader) }}" alt="Логотип" class="logo-img"/>
  44. </a>
  45. <div class="nav-links" id="navLinks">
  46. <a href="{{ route('home') }}" class="{{ request()->routeIs('home') ? 'active' : '' }}">Главная</a>
  47. <a href="{{ route('catalog') }}" class="{{ request()->routeIs('catalog') ? 'active' : '' }}">Каталог</a>
  48. <a href="{{ route('services') }}" class="{{ request()->routeIs('services') ? 'active' : '' }}">Услуги</a>
  49. <a href="{{ route('contacts') }}" class="{{ request()->routeIs('contacts') ? 'active' : '' }}">Контакты</a>
  50. </div>
  51. <div class="nav-right">
  52. {{-- Избранное — иконка сердца с бейджем --}}
  53. <a href="{{ route('favorites') }}" class="nav-fav-btn{{ request()->routeIs('favorites') ? ' has-items' : '' }}" id="navFavBtn" title="Избранное">
  54. <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  55. <path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>
  56. </svg>
  57. <span class="nav-fav-count" id="favNavCount"></span>
  58. </a>
  59. {{-- Telegram — иконка --}}
  60. @if($telegram)
  61. <a href="{{ $telegram }}" target="_blank" rel="noopener" class="nav-icon-btn nav-icon-btn--tg" title="Написать в Telegram">
  62. <svg viewBox="0 0 24 24" fill="currentColor">
  63. <path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.96 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/>
  64. </svg>
  65. </a>
  66. @endif
  67. {{-- Позвонить — иконка трубки --}}
  68. @if($phone)
  69. <a href="tel:{{ preg_replace('/\D/', '', $phone) }}" class="nav-icon-btn nav-icon-btn--call" title="{{ $phone }}">
  70. <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
  71. <path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12 19.79 19.79 0 0 1 1.61 3.4 2 2 0 0 1 3.6 1.22h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L7.91 8.79a16 16 0 0 0 6.29 6.29l.96-.96a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z"/>
  72. </svg>
  73. </a>
  74. @endif
  75. <div class="burger" id="burger">
  76. <span></span><span></span><span></span>
  77. </div>
  78. </div>
  79. </div>
  80. </nav>