templates/partials/laptopHeader.html.twig line 1
{% block laptopHeader %}
<header
class=" bg-center bg-cover text-white dark:bg-transparent sticky-header-first-content"
style="
background-image: linear-gradient(
177.37deg,
#000000 2.19%,
rgba(75, 82, 93, 0) 77.2%
),
url('../img/bg-header.jpg');
"
>
<div class="w-full navbar h-20 flex items-center hero-sticky-header -top-20">
<nav
class="container-menu mx-auto lg:px-0 px-5 flex items-center justify-between transition-all"
>
<button type="button" class="lg:hidden block menu-btn">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M4 6h16M4 12h16M4 18h16"
/>
</svg>
</button>
<a href="/" class="flex items-center" id="logo">
<img class="w-auto h-12 mr-3" src="../img/bos_logo_white.png" alt="" />
</a>
<button
type="button"
class="text-white hover:text-blue-500 flex items-center lg:hidden"
>
{% set path = is_granted('ROLE_COMMERCE') ? path('admin') : path('app_login') %}
<a href="{{ path }}">
<span class="lg:mr-3 mr-0 relative">
<img
class="w-8 h-8 rounded-full border border-white"
src="{{ '../images/user/' ~ app.user.imageNameUser ?? 'default.jpg'}}"
alt="{{ app.user.imageNameUser ?? 'image par défaut' }}"
/>
{% if app.user %}
<span class="w-2 h-2 bg-green-500 rounded-full border absolute bottom-0 left-0"></span>
{% else %}
<span class="w-2 h-2 red-button rounded-full border absolute bottom-0 left-0"></span>
{% endif %}
</span>
</a>
</button>
<div class="hidden lg:flex items-center">
<ul class="flex items-center">
<li class="">
<div
class="relative [&>div] [&>div]:hover:visible [&>div]:hover:transition-all [&>div]:hover:pt-3 [&>div]:hover:h-full [&>div]:hover:opacity-100 [&>div]:hover:top-auto [&>div]:hover:z-10 pr-9"
>
<button class="link hover:text-blue-500 flex items-center">
<a href="{{ path('app_home_list') }}">Accéder à la carte</a>
</button>
<li class="">
<div
class="relative [&>div] [&>div]:hover:visible [&>div]:hover:transition-all [&>div]:hover:pt-3 [&>div]:hover:h-full [&>div]:hover:opacity-100 [&>div]:hover:top-auto [&>div]:hover:z-10 pr-9"
>
<button class="link hover:text-blue-500 flex items-center">
Categories
<svg
data-dropdown-button
class="w-3 h-auto ml-2"
width="10"
height="6"
viewBox="0 0 10 6"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M4.99982 6.00001C4.79513 6.00001 4.59034 5.92467 4.43435 5.774L0.434558 1.91686C0.122074 1.61552 0.122074 1.12735 0.434558 0.826011C0.747042 0.524671 1.25327 0.524671 1.56575 0.826011L4.99982 4.13893L8.43464 0.826613C8.74712 0.525274 9.25335 0.525274 9.56583 0.826613C9.87831 1.12795 9.87831 1.61612 9.56583 1.91746L5.56604 5.7746C5.4098 5.92527 5.20481 6.00001 4.99982 6.00001Z"
fill="currentColor"
/>
</svg>
</button>
<div class="absolute top-9 invisible opacity-0 whitespace-nowrap pt-0">
<div
class="rounded-lg whitespace-nowrap shadow-front-3 bg-white dark:bg-foreground dark:text-gray-300 text-gray-700"
>
<ul
class="h-full rounded-lg relative bg-white dark:bg-foreground dark:text-gray-300 text-gray-700"
>
<!-- ALL CATEGORIES IN MENU START -->
{% for category in categorieNavbar() %}
<li
class="flex rounded-t-lg [&>a_h6]:hover:text-blue-500 [&>a:first-child]:hover:border-blue-200 [&>a:first-child]:hover:rounded-t-lg [&>a:first-child]:hover:bg-blue-50 [&>a:last-child]:hover:block bg-white dark:bg-foreground"
>
<a
href="{{ path('app_home_list_category', {id:category.id}) }}"
class="link px-3 py-2 border-b text-sm border-grey-200 dark:border-gray-800 w-full"
>
<h6 class="font-medium text-gray-600 dark:text-gray-200">
{{category.name}}
</h6>
<p class="font-normal text-gray-500 dark:text-gray-400 text-xs">
{{category.subtitle}}
</p>
</a>
</li>
{% endfor %}
<!-- ALL CATEGORIES IN MENU END -->
</li>
</ul>
</div>
</div>
</div>
</li>
<li class="">
<div
class="dropdown relative [&>div]:hover:visible [&>div]:hover:transition-all [&>div]:hover:pt-3 [&>div]:hover:h-full [&>div]:hover:block [&>div]:hover:opacity-100 [&>div]:hover:top-auto [&>div]:hover:z-10 pr-9"
>
<button class="link hover:text-blue-500 flex items-center">
Blog
</svg>
</button>
</li>
<li class="">
<div
class="dropdown relative [&>div]:hover:visible [&>div]:hover:transition-all [&>div]:hover:pt-3 [&>div]:hover:h-full [&>div]:hover:block [&>div]:hover:opacity-100 [&>div]:hover:top-auto [&>div]:hover:z-10 pr-9"
>
<button class="link hover:text-blue-500 flex items-center">
Nos valeurs
</svg>
</button>
</li>
<li class="mr-9">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5 text-gray-300 cursor-pointer darkMode"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"
/>
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5 text-yellow-500 cursor-pointer lightMode hidden"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
fill-rule="evenodd"
d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
clip-rule="evenodd"
/>
</svg>
</li>
<li class="mr-9">
<div class="dropdown" data-dropdown>
<button
class="link hover:text-blue-500 flex items-center"
data-dropdown-button
>
<img
class="w-8 h-8 rounded-full border border-white mr-3"
src="{{ '../images/user/' ~ app.user.imageNameUser ?? 'default.jpg'}}"
data-dropdown-button
alt="{{ app.user.imageNameUser ?? 'image par défaut' }}"
/>
{% if app.user %}
<span class="w-2 h-2 bg-green-500 rounded-full border absolute bottom-0 left-0"></span>
{% else %}
<span class="w-2 h-2 red-button rounded-full border absolute bottom-0 left-0"></span>
{% endif %}
Espace professionnel
<svg
class="w-3 h-auto ml-2"
width="10"
height="6"
data-dropdown-button
viewBox="0 0 10 6"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M4.99982 6.00001C4.79513 6.00001 4.59034 5.92467 4.43435 5.774L0.434558 1.91686C0.122074 1.61552 0.122074 1.12735 0.434558 0.826011C0.747042 0.524671 1.25327 0.524671 1.56575 0.826011L4.99982 4.13893L8.43464 0.826613C8.74712 0.525274 9.25335 0.525274 9.56583 0.826613C9.87831 1.12795 9.87831 1.61612 9.56583 1.91746L5.56604 5.7746C5.4098 5.92527 5.20481 6.00001 4.99982 6.00001Z"
fill="currentColor"
/>
</svg>
</button>
<div
class="dropdown-menu bg-white dark:bg-foreground dark:text-gray-300 text-gray-700"
>
<div>
<div class="dropdown-links max-w-xs w-48 rounded-md py-3">
{% set path = is_granted('ROLE_COMMERCE') or is_granted('ROLE_ADMIN') ? path('admin') : path('app_login') %}
<a
href="{{ path }}"
class="link hover:text-blue-500 px-4 py-1 flex items-center text-sm text-gray-700 dark:text-gray-300"
><svg
xmlns="http://www.w3.org/2000/svg"
class="w-4 h-4 mr-2"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"
/></svg
>Mon compte
</a>
<a
href="#"
class="link hover:text-blue-500 px-4 py-1 flex items-center text-sm text-gray-700 dark:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-4 w-4 mr-2"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"
/>
</svg>
Nos offres
</a>
{% if app.user %}
<a
href="{{ path('app_logout') }}"
class="link hover:text-blue-500 px-4 py-1 flex items-center text-sm text-gray-700 dark:text-gray-300"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="w-4 h-4 mr-2"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
/>
</svg>
Déconnexion
</a>
{% endif %}
</div>
</div>
</div>
</div>
</li>
</ul>
<a href="{{ path('app_shop_new') }}">
<button
type="button"
class="inline-flex hover:bg-blue-500 hover:text-white items-center px-3 py-[9px] rounded-lg border hover:border-blue-100"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-4 w-4 xl:mr-2 mr-0"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
fill-rule="evenodd"
d="M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z"
clip-rule="evenodd"
/>
</svg>
<span class="xl:block hidden">Ajouter un commerce</span>
</button>
</a>
</div>
</nav>
</div>
<div class="pt-32 lg:px-0 px-5 lg:pt-35 text-center">
<h1 class="text-4xl lg:text-6xl font-bold mb-4 uppercase">
Best of Sarlat
</h1>
<p class="text-sm lg:text-lg font-medium block pb-16">
Nous avons trouvé pour vous les bonnes adresses du Sarladais pour la vie de tous les jours ou pour visiter la Dordogne en toute simplicité.
</p>
<!-- header-search -->
{{ form_start(form, {'action': path('app_home_list')}) }}
<div
class="md:inline-flex py-3 bg-white dark:bg-background overflow-hidden rounded-2xl mb-6 text-gray-900"
>
<!-- Search bar Start-->
{{ form_row(form.q, { 'attr': {'class': 'px-7 pt-3 text-center md:text-left dark:bg-background dark:placeholder:text-gray-100 dark:text-gray-100 border-gray-200 focus:outline-none'} })}}
<!-- Search bar END-->
<!-- Category filter Start-->
<div class="hidden">
{% block _category_widget %}
{% for child in form.Category %}
{{ form_widget(child) }}
{{ form_label(child) }}
<br>
{% endfor %}
{% endblock %}
</div>
<!-- Category filter END-->
<!-- Vefified filter Start-->
<div class="hidden">
<label class="pl-7 py-2 border-r pr-4 dark:bg-background dark:placeholder:text-gray-100 dark:text-gray-100 border-gray-200 focus:outline-none">
{{ form_widget(form.verified) }}
<span class="ml-2 text-gray-700 text-[12px] dark:text-gray-300">
Vérifié par Best of Sarlat
</span>
</label>
</div>
<!-- Vefified filter END-->
<!-- Submit Start-->
<button
type="submit"
class="bg-blue-500 hover:bg-blue-600 rounded-2xl text-white px-8 py-3 mx-3"
>
Lancer la recherche
</button>
<!-- Submit END-->
</div>
{{ form_end(form) }}
<div class="text-base font-normal mb-3 lg:block">
ou consultez directement une catégorie :
</div>
<div class="md:flex justify-center flex-wrap pb-20">
{% for category in allCategory %}
<a
href="{{ path('app_home_list_category', {id:category.id}) }}"
class="inline-block bg-gray-100 hover:bg-gray-200 hover:text-gray-600 text-gray-500 text-xs font-medium items-center py-1 px-2 rounded mr-2"
>
{{ category.name }}
</a>
{% endfor %}
</div>
</div>
</header>
{% endblock %}
<script>
window.addEventListener('scroll', function() {
var logo = document.getElementById('logo');
if (window.pageYOffset > 0) {
logo.querySelector('img').src = '../img/bos_logo.png';
logo.style.backgroundColor = 'transparent';
} else {
logo.querySelector('img').src = '../img/bos_logo_white.png';
logo.style.backgroundColor = 'transparent';
}
});
</script>