1
0
Fork 0
yinghong-massage.de/templates/partials/nav.tera.html

92 lines
4.1 KiB
HTML
Raw Normal View History

2022-10-24 23:11:48 +00:00
{% set image = resize_image(path="images/background/nav_background.jpg", height=750, op="fit_height") %}
<div
class="d-flex align-content-end flex-wrap"
style="
background-image: url('{{ image.url }}');
background-position: center;
height: 40vh;
background-size: cover;
"
>
<div class="container-fluid mb-3" style="background-color: rgba(0, 0, 0, 0.6);">
<div class="container-xxl text-white p-3">
<h1 style="font-weight: bold;">{{ config.title }}</h1>
<h5>{{ config.extra.address }}</h5>
</div>
</div>
</div>
<nav class="navbar navbar-expand-lg" style="background-image: linear-gradient(rgba(0, 0, 0, 0.6), 8%, {{ config.extra.primary_color }}, white);">
2022-10-24 14:35:18 +00:00
<div class="container-xxl">
2022-10-24 23:11:48 +00:00
<a class="navbar-brand grow-on-hover" href="/">
2022-10-24 14:35:18 +00:00
<!-- Use heigher resize_height for better resolution -->
{% set resize_height = 85 %}
{% set logo_meta = get_image_metadata(path=config.extra.logo_path) %}
{% set logo_width_to_height_ratio = logo_meta.width / logo_meta.height %}
{% set resize_width = logo_width_to_height_ratio * resize_height | int %}
{% set image = resize_image(path=config.extra.logo_path, width=resize_width, height=resize_height, op="fill") %}
<img
src="{{ image.url }}"
2022-10-24 23:11:48 +00:00
alt="Startseite"
2022-10-24 14:35:18 +00:00
{% set actual_height = 70 %}
{% set actual_width = logo_width_to_height_ratio * actual_height | int %}
width="{{ actual_width }}"
height="{{ actual_height }}"
/>
</a>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
{% for menu_item in config.extra.menu_items %}
{% if menu_item.url %}
<!-- Single item, not a category -->
<li class="nav-item">
<a
class="nav-link"
href="{{ menu_item.url }}"
>
2022-10-24 23:11:48 +00:00
<span class="underline-on-hover" style="color: {{ config.extra.secondary_color }}; font-size: 17px;">
2022-10-24 14:35:18 +00:00
{{ menu_item.name }}
2022-10-24 23:11:48 +00:00
</span>
2022-10-24 14:35:18 +00:00
</a>
</li>
{% else %}
<!-- Category with multiple subitems -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<font color="{{ config.extra.secondary_color }}">
{{ menu_item.name }}
</font>
</a>
<ul class="dropdown-menu">
{% for link in menu_item.links %}
<li>
<a
class="dropdown-item"
href="{{ link.url }}"
>
<font color="{{ config.extra.secondary_color }}">
{{ link.name }}
</font>
</a>
</li>
{% endfor %}
</ul>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
</nav>