{% set id = field("id") %} {% set class = field('class') %} {% set link_type = field('link_type') %} {# Youtube options #} {% set youtube_id = field('youtube_link') %} {% set autoplay = field('autoplay') %} {% set related_video = field('related_video') %} {% set player_control = field('player_control') %} {% set title_actions = field('title_actions') %} {% set mute = field('mute') %} {% set privacy_mode = field('privacy_mode') %} {# Vimeo options #} {% set vimeo_id = field('vimeo_link') %} {% set autoplay_vimeo = field('autoplay_vimeo') %} {% set loop_vimeo = field('loop_vimeo') %} {% set intro_title_vimeo = field('intro_title_vimeo') %} {% set intro_portrait_vimeo = field('intro_portrait_vimeo') %} {% set intro_byline_vimeo = field('intro_byline_vimeo') %} {% set link_iframe = field('link_iframe') %} {% set classes = classNames('qx-element qx-element-video-v2', class) %} {% set animation = "" %} {% if field('animation') != 'none' %} {% if field('animation')is not empty %} {% set animation = "cls:" ~ field('animation') ~ ";" %} {% endif %} {# repeat #} {% if field('animation_repeat') %} {% set animation = animation ~ "repeat:ture;" %} {% endif %} {# delay #} {% if field('animation_delay').value %} {% set animation = animation ~ "delay:" ~ field('animation_delay').value %} {% endif %} {% endif %}
{# Youtube iframe #} {% if link_type == 'youtube' and youtube_id %} {# Vimeo iframe #} {% elseif link_type == 'vimeo' and vimeo_id %} {% endif %}
var style = Object.assign({}, Assets), id = "#{{ field("id") }}", css = ""; // margin style.margin(id, {{ field("margin") | json_encode() }}) // padding style.padding(id, {{ field("padding") | json_encode() }}) // Z-Index style.css(id, 'z-index', {{ field("zindex") | json_encode() }}) // background style.background (id, {{ field("background") | json_encode() }}) // border + box shadow style.border (id, {{ field("border") | json_encode() }}) // custom css style.raw ("{{ field("custom_css").code }}") {% include 'global.twig' %} var id = "#{{ field("id") }}"; style.load(id)