|
1 | | - <header id="header" class="skel-layers-fixed"> |
2 | | - <h1><span class="image header"><img src="{{ site.header.logo_image }}"/></span><a href="index.html">{{ site.header.title }}</a> {{ site.header.subtitle }}</h1> |
3 | | - <nav id="nav"> |
4 | | - <ul> |
| 1 | +<header class="sticky top-0 z-50 border-b border-brand-100/80 bg-white/80 backdrop-blur"> |
| 2 | + <div class="w-full px-6 lg:px-12"> |
| 3 | + <div class="flex items-center gap-4 py-4"> |
| 4 | + {% assign page_title = page.title | default: site.header.subtitle %} |
| 5 | + {% assign page_description = page.subtitle | default: page.description | default: site.description %} |
| 6 | + |
| 7 | + <div class="flex items-center gap-3"> |
| 8 | + <a href="index.html" class="flex items-center gap-3"> |
| 9 | + <span class="flex h-12 w-12 items-center justify-center rounded-2xl bg-brand-100 ring-1 ring-brand-200 shadow-inner"> |
| 10 | + <img src="{{ site.header.logo_image }}" alt="{{ site.title }} logo" class="h-9 w-9 object-contain" loading="lazy" /> |
| 11 | + </span> |
| 12 | + <div class="leading-tight"> |
| 13 | + <p class="text-xs font-semibold uppercase tracking-[0.18em] text-brand-700">{{ site.header.title }}</p> |
| 14 | + <p class="text-xl font-bold text-slate-900">{{ page_title }}</p> |
| 15 | + <p class="text-sm text-slate-600">{{ page_description }}</p> |
| 16 | + </div> |
| 17 | + </a> |
| 18 | + </div> |
| 19 | + |
| 20 | + <div class="flex items-center gap-3 ml-auto"> |
| 21 | + {% if site.common_links and site.common_links.size > 0 %} |
| 22 | + {% assign primary_link = site.common_links[0] %} |
| 23 | + <div class="hidden md:flex md:flex-col md:items-start md:gap-1"> |
| 24 | + <a href="{{ primary_link.link }}" class="rounded-full bg-brand-600 px-4 py-2 text-sm font-semibold text-white shadow-glow transition hover:bg-brand-700"> |
| 25 | + {{ primary_link.title }} |
| 26 | + </a> |
| 27 | + </div> |
| 28 | + {% endif %} |
| 29 | + |
| 30 | + <nav class="hidden md:flex items-center gap-3 ml-auto"> |
| 31 | + <ul class="flex items-center gap-3"> |
5 | 32 | {% for i in site.navigation_links %} |
6 | | - {% if i.link %} |
7 | | - <li><a href="{{ i.link }}">{{ i.title }}</a></li> |
8 | | - {% else if i.submenus %} |
9 | | - <li><a href="" class="icon fa-angle-down">{{ i.title }}</a> |
10 | | - <ul> |
11 | | - {% for sub in i.submenus %} |
12 | | - <li><a href="{{ sub.link }}">{{ sub.title }}</a></li> |
13 | | - {% endfor %} |
14 | | - </ul> |
15 | | - </li> |
16 | | - {% endif %} |
| 33 | + {% if i.link %} |
| 34 | + <li> |
| 35 | + <a href="{{ i.link }}" class="rounded-full bg-brand-600 px-4 py-2 text-sm font-semibold text-white shadow-glow transition hover:bg-brand-700"> |
| 36 | + {{ i.title }} |
| 37 | + </a> |
| 38 | + </li> |
| 39 | + {% elsif i.submenus %} |
| 40 | + <li class="relative group"> |
| 41 | + <div class="flex items-center gap-2 rounded-full bg-brand-600 px-4 py-2 text-sm font-semibold text-white shadow-glow transition hover:bg-brand-700"> |
| 42 | + <span>{{ i.title }}</span> |
| 43 | + <i class="fa-solid fa-chevron-down text-xs text-white/80"></i> |
| 44 | + </div> |
| 45 | + <div class="absolute right-0 mt-3 flex flex-col gap-1 rounded-xl border border-brand-100 bg-white p-3 shadow-lg opacity-0 pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100 group-hover:translate-y-0 transition transform translate-y-1"> |
| 46 | + {% for sub in i.submenus %} |
| 47 | + <a href="{{ sub.link }}" class="rounded-lg px-3 py-2 text-slate-700 transition hover:bg-brand-50 hover:text-brand-800 whitespace-nowrap">{{ sub.title }}</a> |
| 48 | + {% endfor %} |
| 49 | + </div> |
| 50 | + </li> |
| 51 | + {% endif %} |
17 | 52 | {% endfor %} |
18 | 53 | </ul> |
19 | 54 | </nav> |
20 | | - </header> |
| 55 | + |
| 56 | + <button id="menu-toggle" class="inline-flex h-11 w-11 items-center justify-center rounded-xl border border-brand-100 bg-white text-brand-700 shadow-sm transition hover:border-brand-200 hover:text-brand-900 md:hidden" aria-label="Apri o chiudi il menu di navigazione"> |
| 57 | + <span class="sr-only">Menu</span> |
| 58 | + <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> |
| 59 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 8h16M4 16h16" /> |
| 60 | + </svg> |
| 61 | + </button> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + |
| 65 | + <nav id="nav-links" class="hidden flex-col gap-2 rounded-2xl border border-brand-100 bg-white/95 p-4 text-sm font-semibold text-slate-800 shadow-glow md:hidden"> |
| 66 | + <ul class="flex flex-col gap-2 w-full"> |
| 67 | + {% for i in site.navigation_links %} |
| 68 | + {% if i.link %} |
| 69 | + <li> |
| 70 | + <a href="{{ i.link }}" class="flex items-center justify-between rounded-full bg-brand-600 px-4 py-2 text-sm font-semibold text-white shadow-glow transition hover:bg-brand-700"> |
| 71 | + <span>{{ i.title }}</span> |
| 72 | + <span class="text-brand-100 md:hidden">↗</span> |
| 73 | + </a> |
| 74 | + </li> |
| 75 | + {% elsif i.submenus %} |
| 76 | + <li class="relative group"> |
| 77 | + <div class="flex items-center justify-between rounded-full bg-brand-600 px-4 py-2 text-sm font-semibold text-white shadow-glow transition hover:bg-brand-700"> |
| 78 | + <span>{{ i.title }}</span> |
| 79 | + <i class="fa-solid fa-chevron-down text-xs text-white/80"></i> |
| 80 | + </div> |
| 81 | + <div class="mt-2 flex flex-col gap-1 rounded-xl border border-brand-100 bg-white/95 p-3 shadow-lg md:absolute md:left-1/2 md:top-11 md:w-56 md:-translate-x-1/2 md:translate-y-2 md:border-brand-100 md:opacity-0 md:pointer-events-none md:group-hover:pointer-events-auto md:group-hover:opacity-100 md:group-hover:translate-y-0 md:transition"> |
| 82 | + {% for sub in i.submenus %} |
| 83 | + <a href="{{ sub.link }}" class="rounded-lg px-3 py-2 text-slate-700 transition hover:bg-brand-50 hover:text-brand-800">{{ sub.title }}</a> |
| 84 | + {% endfor %} |
| 85 | + </div> |
| 86 | + </li> |
| 87 | + {% endif %} |
| 88 | + {% endfor %} |
| 89 | + </ul> |
| 90 | + </nav> |
| 91 | + </div> |
| 92 | +</header> |
0 commit comments