This commit is contained in:
35
resources/views/components/chat-widget.blade.php
Normal file
35
resources/views/components/chat-widget.blade.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<div
|
||||
class="pc-chat-widget"
|
||||
data-chat-widget="true"
|
||||
data-fetch-url="{{ route('chat.messages') }}"
|
||||
data-send-url="{{ route('chat.send') }}"
|
||||
data-csrf="{{ csrf_token() }}"
|
||||
>
|
||||
<button class="pc-chat-toggle" type="button" data-chat-toggle>
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M4 5h16v10H8l-4 4V5zm2 2v7.17L7.17 13H18V7H6z"></path>
|
||||
</svg>
|
||||
<span>Чат</span>
|
||||
</button>
|
||||
|
||||
<section class="pc-chat-panel" data-chat-panel hidden>
|
||||
<header class="pc-chat-header">
|
||||
<h3>Онлайн-чат</h3>
|
||||
<button class="pc-chat-close" type="button" data-chat-close aria-label="Свернуть чат">×</button>
|
||||
</header>
|
||||
<p class="pc-chat-note" data-chat-note>Задайте вопрос — администратор ответит в этом окне.</p>
|
||||
|
||||
<div class="pc-chat-messages" data-chat-messages></div>
|
||||
|
||||
<form class="pc-chat-form" data-chat-form>
|
||||
<textarea
|
||||
name="message"
|
||||
placeholder="Введите сообщение..."
|
||||
maxlength="2000"
|
||||
rows="3"
|
||||
required
|
||||
></textarea>
|
||||
<button class="pc-btn primary" type="submit">Отправить</button>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
75
resources/views/components/footer.blade.php
Normal file
75
resources/views/components/footer.blade.php
Normal file
@@ -0,0 +1,75 @@
|
||||
@php
|
||||
$companyName = config('shop.company_name', config('app.name'));
|
||||
$companyDescription = config('shop.company_description');
|
||||
$contactPhone = trim((string) config('shop.contact_phone'));
|
||||
$contactEmail = trim((string) config('shop.contact_email'));
|
||||
$contactTelegram = trim((string) config('shop.contact_telegram'));
|
||||
$contactHours = trim((string) config('shop.contact_hours'));
|
||||
$telegramUrl = '';
|
||||
$phoneUrl = '';
|
||||
$emailUrl = '';
|
||||
|
||||
if ($contactPhone !== '') {
|
||||
$phoneUrl = 'tel:' . preg_replace('/[^\d+]/', '', $contactPhone);
|
||||
}
|
||||
|
||||
if ($contactEmail !== '') {
|
||||
$emailUrl = 'mailto:' . $contactEmail;
|
||||
}
|
||||
|
||||
if ($contactTelegram !== '') {
|
||||
$telegramUrl = str_starts_with($contactTelegram, 'http://') || str_starts_with($contactTelegram, 'https://')
|
||||
? $contactTelegram
|
||||
: 'https://t.me/' . ltrim($contactTelegram, '@/');
|
||||
}
|
||||
@endphp
|
||||
|
||||
<footer class="pc-footer">
|
||||
<div class="pc-footer-top">
|
||||
<div class="pc-footer-brand">
|
||||
<h3>{{ $companyName }}</h3>
|
||||
<p>{{ $companyDescription }}</p>
|
||||
</div>
|
||||
<div class="pc-footer-columns">
|
||||
<div class="pc-footer-col">
|
||||
<h4>Каталог</h4>
|
||||
<ul class="pc-footer-list">
|
||||
<li><a href="{{ route('catalog.index') }}">Все категории</a></li>
|
||||
<li><a href="{{ route('catalog.category', 'processors') }}">Процессоры</a></li>
|
||||
<li><a href="{{ route('catalog.category', 'graphics-cards') }}">Видеокарты</a></li>
|
||||
<li><a href="{{ route('catalog.category', 'laptops') }}">Ноутбуки</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pc-footer-col">
|
||||
<h4>Покупателю</h4>
|
||||
<ul class="pc-footer-list">
|
||||
<li><a href="{{ route('cart.index') }}">Корзина</a></li>
|
||||
<li><a href="{{ route('favorites.index') }}">Избранное</a></li>
|
||||
<li><a href="{{ route('compare.index') }}">Сравнение</a></li>
|
||||
<li><a href="{{ route('pages.shipping-payment') }}">Доставка и оплата</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pc-footer-col">
|
||||
<h4>Контакты</h4>
|
||||
<div class="pc-footer-contact">
|
||||
@if ($phoneUrl !== '')
|
||||
<span>Телефон: <a href="{{ $phoneUrl }}">{{ $contactPhone }}</a></span>
|
||||
@endif
|
||||
@if ($emailUrl !== '')
|
||||
<span>Email: <a href="{{ $emailUrl }}">{{ $contactEmail }}</a></span>
|
||||
@endif
|
||||
@if ($telegramUrl !== '')
|
||||
<span>Telegram: <a href="{{ $telegramUrl }}" target="_blank" rel="noopener noreferrer">{{ $contactTelegram }}</a></span>
|
||||
@endif
|
||||
@if ($contactHours !== '')
|
||||
<span>{{ $contactHours }}</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pc-footer-bottom">
|
||||
<span>(c) {{ date('Y') }} {{ $companyName }}. Все права защищены.</span>
|
||||
<span><a href="{{ route('pages.about') }}">О компании</a> / <a href="{{ route('pages.contacts') }}">Контакты</a></span>
|
||||
</div>
|
||||
</footer>
|
||||
100
resources/views/components/header.blade.php
Normal file
100
resources/views/components/header.blade.php
Normal file
@@ -0,0 +1,100 @@
|
||||
@php
|
||||
$favoritesCount = count((array) session('favorites', []));
|
||||
$compareCount = count((array) session('compare', []));
|
||||
$cartCount = collect((array) session('cart', []))->sum(fn ($quantity) => (int) $quantity);
|
||||
$companyName = config('shop.company_name', config('app.name'));
|
||||
$navItems = [
|
||||
['label' => 'Главная', 'route' => route('home'), 'active' => request()->routeIs('home')],
|
||||
[
|
||||
'label' => 'Каталог',
|
||||
'route' => route('catalog.index'),
|
||||
'active' => request()->routeIs('catalog.*') || request()->routeIs('products.show') || request()->routeIs('search.index'),
|
||||
],
|
||||
['label' => 'О нас', 'route' => route('pages.about'), 'active' => request()->routeIs('pages.about')],
|
||||
[
|
||||
'label' => 'Доставка и оплата',
|
||||
'route' => route('pages.shipping-payment'),
|
||||
'active' => request()->routeIs('pages.shipping-payment'),
|
||||
],
|
||||
['label' => 'Контакты', 'route' => route('pages.contacts'), 'active' => request()->routeIs('pages.contacts')],
|
||||
];
|
||||
@endphp
|
||||
|
||||
<header class="pc-header pc-animate" style="--delay: 0s">
|
||||
<input type="checkbox" id="pc-mobile-menu-toggle" class="pc-mobile-menu-toggle">
|
||||
<label for="pc-mobile-menu-toggle" class="pc-hamburger" aria-label="Меню">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</label>
|
||||
<div class="pc-mobile-menu-head">
|
||||
<label for="pc-mobile-menu-toggle" class="pc-mobile-menu-close" aria-label="Закрыть меню">×</label>
|
||||
</div>
|
||||
<div class="pc-header-left">
|
||||
<a class="pc-logo" href="{{ route('home') }}">
|
||||
<span class="pc-logo-mark"></span>
|
||||
{{ $companyName }}
|
||||
</a>
|
||||
<a class="pc-btn pc-catalog-btn" href="{{ route('catalog.index') }}">Каталог</a>
|
||||
</div>
|
||||
<div class="pc-header-center">
|
||||
<form class="pc-search" action="{{ route('search.index') }}" method="get">
|
||||
<input type="text" name="q" placeholder="Поиск товаров по наименованию" value="{{ request('q') }}" />
|
||||
<button class="pc-search-submit" type="submit" aria-label="Искать">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M15.5 14h-.79l-.28-.27a6 6 0 1 0-.71.71l.27.28v.79L20 20.5 21.5 19 15.5 14zm-5.5 0A4.5 4.5 0 1 1 10 5a4.5 4.5 0 0 1 0 9z"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="pc-header-icons">
|
||||
<a class="pc-icon-link" href="{{ route('favorites.index') }}" aria-label="Избранное">
|
||||
<span class="pc-icon">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M12 20s-7-4.5-9-9c-1.2-2.7.7-6 4.2-6 2 0 3.2 1 3.8 2 0.6-1 1.8-2 3.8-2 3.5 0 5.4 3.3 4.2 6-2 4.5-9 9-9 9z"></path>
|
||||
</svg>
|
||||
@if ($favoritesCount > 0)
|
||||
<span class="pc-icon-count">{{ $favoritesCount }}</span>
|
||||
@endif
|
||||
</span>
|
||||
<span class="pc-icon-label">Избранное</span>
|
||||
</a>
|
||||
<a class="pc-icon-link" href="{{ route('compare.index') }}" aria-label="Сравнение">
|
||||
<span class="pc-icon">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M5 4h3v16H5zM16 4h3v16h-3zM10.5 8h3v12h-3z"></path>
|
||||
</svg>
|
||||
@if ($compareCount > 0)
|
||||
<span class="pc-icon-count">{{ $compareCount }}</span>
|
||||
@endif
|
||||
</span>
|
||||
<span class="pc-icon-label">Сравнение</span>
|
||||
</a>
|
||||
<a class="pc-icon-link" href="{{ route('cart.index') }}" aria-label="Корзина">
|
||||
<span class="pc-icon">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M6 6h14l-2 9H8L6 6zm-2-2h3l1 2h-4zM9 20a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm8 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
|
||||
</svg>
|
||||
@if ($cartCount > 0)
|
||||
<span class="pc-icon-count">{{ $cartCount }}</span>
|
||||
@endif
|
||||
</span>
|
||||
<span class="pc-icon-label">Корзина</span>
|
||||
</a>
|
||||
<a class="pc-icon-link" href="{{ auth()->check() ? route('account') : route('login') }}" aria-label="Личный кабинет">
|
||||
<span class="pc-icon">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M12 12a4 4 0 1 0-4-4 4 4 0 0 0 4 4zm0 2c-4.4 0-8 2.2-8 5v1h16v-1c0-2.8-3.6-5-8-5z"></path>
|
||||
</svg>
|
||||
</span>
|
||||
<span class="pc-icon-label">{{ auth()->check() ? 'Кабинет' : 'Войти' }}</span>
|
||||
</a>
|
||||
</div>
|
||||
<nav class="pc-header-nav" aria-label="Разделы сайта">
|
||||
@foreach ($navItems as $item)
|
||||
<a class="pc-header-nav-link {{ $item['active'] ? 'is-active' : '' }}" href="{{ $item['route'] }}">
|
||||
{{ $item['label'] }}
|
||||
</a>
|
||||
@endforeach
|
||||
</nav>
|
||||
</header>
|
||||
Reference in New Issue
Block a user