asBackground:
type: input.checkbox
label: As Background
description: Globally enable video as background.
default: false
overlayColor:
type: input.colorpicker
label: Overlay color
description: Sets the overlay color for the background video
Added a stylesheets block...
{% block stylesheets %}
{% if particle.enabled %}
{% if particle.asBackground %}
{{ parent() }}
<link rel="stylesheet" href="{{ url(gantry.theme.css('backgroundvideo')) }}" type="text/css"/>
{% endif %}
{% endif %}
{% endblock %}
...Modified the particle div to add a class
{% block particle %}
<div class="{{ particle.class|e }} g-owlcarousel-video-carousel {% if particle.asBackground %}bgvideo{% endif %}">
.. Modified Vimeo section
{# Begin Vimeo #}
{% if item.source == 'vimeo' %}
<iframe width="100%" height="auto" src="https://player.vimeo.com/video/{{ item.video|replace({'https://vimeo.com/': '', 'https://vimeo.com/ondemand/': ''}) }}?autoplay={% if particle.autoplay == 'enabled' %}1{% else %}0{% endif %}&loop={% if item.loop == 'enabled' %}1{% else %}0{% endif %}{% if particle.asBackground %}&background=1&autopause=0{% endif %}" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
{% endif %}
{# End Vimeo #}
... Add the following after End Caption comment inside div.g-video-carousel-inner
{# Begin Overlay #}
{% if particle.overlayColor %} <div class="g-video-carousel-video-overlay" style="z-index: 5; background: {{ particle.overlayColor }}"/>{% endif %}
{# End Overlay #}
/* Background video carousel */
.g-owlcarousel-video-carousel.bgvideo{
position: relative;
.g-owlcarousel-video-carousel-header{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 10;
text-align: center;
}
.owl-stage{
.owl-item.active{
.g-video-carousel-video-overlay{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.g-video-carousel-video{
pointer-events: none;
overflow: hidden;
margin: 0;
padding: 0;
z-index: 4;
top: 0;
left: 0;
/* If you need to constrain the height
max-height: 50.75rem;
*/
iframe{
border: 0;
width: 100vw;
height: 56.25vw;
min-height: 100vh;
min-width: 177.77vh;
}
}
}
}
}
The following users have thanked you: Matt
Time to create page: 0.065 seconds