<div class="parallax-container z-depth-2 valign-wrapper">
  <div class="parallax">
    {% if section.image.type == "video" %}
    {% set format = settings.ffmpeg.extension %}
    {% set video = Video.get(link, section.image) %}
    {% set vid = video.reencode((1280, 720)) %}
    <img class="lazy" src="{{ video.thumbnail((None, 720)) }}">
    <video autoplay loop muted class="fillWidth">
      <source src="{{ vid }}" type="video/{{ format }}">
    </video>
    {% else %}
    {% set image = Image.get(link, section.image) %}
    <img class="responsive-img" src="{{ image.copy() }}">
    {% endif %}
  </div>

  {% if section.text %}
  <div class="parallax-tittle white-text">
    <h1>{{ section.text.title }}</h1>
    <h2>{{ section.text.sub_title }}</h2>

    {% if section.text.date_end %}
    <div class="datetime">{{ section.text.date|local_date("dd MMMM yyyy") }}  to {{ section.text.date_end|local_date("dd MMMM yyyy") }}</div>

    {% else %}
    {% if section.text.date %}
    <div class="datetime">{{ section.text.date|local_date("dd MMMM yyyy") }}</div>
    {% endif %}
    {% endif %}

  </div>
  {% endif %}
</div>
