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

53 lines
2.4 KiB
HTML

{% 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 pb-2 pt-2 ps-4 pe-4">
<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({{ config.extra.primary_color }}, 25%, white)">
<div class="container-xxl">
<a class="navbar-brand grow-on-hover" href="{{ get_url(path='/') }}">
<!-- 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 }}"
{% 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 %}
<li class="nav-item">
<a class="nav-link" href="{{ menu_item.url }}">
<button class="btn btn-outline-success" type="button">{{ menu_item.name }}</button>
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</nav>