{%- comment -%} Alisin ang nangunguna at sumusunod na whitespace mula sa `tag_name`. {%- endcomment -%} {%- assign tag_name = tag_name | strip -%} {%- comment -%} Pangasiwaan ang `tag_name: ''` case. {%- endcomment -%} {%- if tag_name at tag_name.size < 1 -%} {%- assign tag_name = false -%} {%- endif -%} {%- if tag_name -%} <{{ tag_name }} {{- attrs | to_attrs -}} {{- additional_attrs -}} {%- if self_closing == true -%} {{- ' /' -}} {%- endif -%} > {%- endif -%} {%- maliban kung self_closing == true -%} {%- ifslot -%} {%- slot -%} {%- else -%} {{- inner_html -}} {%- endifslot -%} {%- if tag_name -%} {%- endif -%} {%- endunless -%}{%- comment -%} Ang component na ito ay maaaring makabuo ng `img` tag o isang `div style="background-..."`.
{%- endcomment -%} {%- assign is_global_asset = is_global_asset | default: false -%} {%- if bg -%} {%- comment -%} Background image {%- endcomment -%} {%- assign tag_name = tag_name | default: 'div' -%} {%- assign self_closing = self_closing | default: false -%} {%- comment -%} Nag-render kami ng attrs sa aming sarili at sinasala ang `style`. {%- endcomment -%} {%- assign attr_list = attrs | to_attrs: list: true -%} {%- capture additional_attrs -%} {%- comment -%} Isama ang mga attribute mula sa konteksto. {%- endcomment -%} {%- para sa attr sa attr_list -%} {%- maliban kung attr[0] == 'style' -%} {{- ' ' -}} {{- attr[0] -} } {%- if attr[1].size > 0 -%} ="{{- attr[1] -}}" {%- endif -%} {%- endunless -%} {%- endfor -%} {{- ' ' -}} style=" {%- comment -%} Mag-render ng mga bg style. Gumamit ng src kung hindi kami nakakuha ng imahe. {%- endcomment -%} {%- assign has_bg_image = false -%} {%- assign has_bg_size = false -%} {%- assign has_bg_position_x = false -%} {%- assign has_bg_position_y = false -%} {%- assign has_bg_repeat = false -%} {%- para sa prop sa bg -%} {%- case prop[0] -%} {%- kapag 'image' -%} {%- assign has_bg_image = true -%} {% - kapag 'size' -%} {%- assign has_bg_size = true -%} {%- kapag 'position' -%} {%- assign has_bg_position_x = true -%} {%- assign has_bg_position_y = true -%} {% - kapag 'position-x' -%} {%- assign has_bg_position_x = true -%} {%- kapag 'position-y' -%} {%- assign has_bg_position_y = true -%} {%- kapag 'repeat' - %} {%- assign has_bg_repeat = true -%} {%- endcase -%} background-{{- prop[0] -}}: {{- prop[1] -}}; {%- endfor -%} {%- unless has_bg_image -%} background-image: url('{{- src | asset_url: global: is_global_asset -}}'); {%- endunless -%} {%- unless has_bg_size -%} background-size: cover; {%- endunless -%} {%- unless has_bg_position_x -%} background-position-x: center; {%- endunless -%} {%- unless has_bg_position_y -%} background-position-y: center; {%- endunless -%} {%- unless has_bg_repeat -%} background-repeat: no-repeat; {%- endunless -%} {%- comment -%} Magdagdag ng anumang mga estilo mula sa attribute ng style. {%- endcomment -%} {{- attrs.style -}} " {%- endcapture -%} {%- comment -%} Alisin ang mga attr upang hindi namin i-render ang mga ito nang dalawang beses. {%- assign group_attrs = group.attrs | merge_props: class: 'listcard__group' -%} {%- assign tag_name = 'div' -%} {%- if collapsible -%} {%- assign tag_name = 'details' -%} {%- endif -%} < {{ tag_name }} {{ group_attrs | to_attrs }}> {% maliban kung headline == false o group.headline == nil o group.headline.size == 0 %} {% if collapsible %} {% endif %} {{ group.headline }} {% kung na-collapsible %} {% endif %} {% endunless %} {% para sa item sa group.cards %} {%- isama ang 'cardlist/listcard/item' -%} {% endfor %} {% maliban kung group.group_button_link == nil o group.cards.size < 2 %} {{ group.group_button_label }} {% endunless %}{% assign card_count = forloop.index %}
{%- capture curr_class -%}
listcard__card
{%- unless item.id == nil -%}
{{- ' ' -}} listcard__card--{{ item.id }}
{%- endunless -%}
{%- unless card_class == nil or card_class.size == 0 -%}
{{- ' ' -}} listcard__card--{{ card_class }}
{%- endunless -%}
{%- endcapture -%}
{%- assign card_attrs = item.attrs | merge_props: class: curr_class -%}
{% if singlelink %}
{%- assign card_attrs = card_attrs | merge_props: href: item.ctas[0].link -%}
{% endif %}
{% if linkcard %}<a {{ card_attrs | to_attrs }}>{% elsif singlelink %}<a {{ card_attrs | to_attrs }}>{% else %}<div {{ card_attrs | to_attrs }}>{% endif %}
{%- unless headline == false or item.headline == nil or item.headline.size == 0 -%}
<h2 class="listcard__card-headline">{{ item.headline }}</h2>
{%- endunless -%}
{% unless subheadline == false or item.subheadline == nil or item.subheadline.size == 0 %}
<h3 class="listcard__card-subheadline">{{ item.subheadline }}</h3>
{% endunless %}
{% unless images == false or item.images == nil or item.images.size == 0 %}
{% if compare == true %}
<div class="listcard__card-images">
<div class="listcard__comparison comparison comparison--popup">
<figure style="background-image: url('{{ item.compare_img_1 | asset_url }}')">
<a class="listcard__card-image-link listcard__card-image-link--before" href="#view-{{ item.id }}">Before</a>
<div
class="divisor"
style="
background-image: url('{{ item.compare_img_2 | asset_url }}');
clip-path: inset(0 0 0 50%);
">
<a class="listcard__card-image-link listcard__card-image-link--after" href="#view-{{ item.id }}">After</a>
</div>
</figure>
<input type="range" min="0" max="100" value="50" class="slider">
</div>
<div id="view-{{ item.id }}" class="modal-window comparison">
<a href="#" class="modal-close">Close</a>
<div class="modal-window__wrapper">
<figure style="background-image: url('{{ item.compare_img_1 | asset_url }}')">
<span class="listcard__card-image-link listcard__card-image-link--before">Before</span>
<div
class="divisor"
style="
background-image: url('{{ item.compare_img_2 | asset_url }}');
clip-path: inset(0 0 0 50%);
">
<span class="listcard__card-image-link listcard__card-image-link--after">After</span>
</div>
</figure>
<input type="range" min="0" max="100" value="50" class="slider">
</div>
</div>
</div>
{% else %}
{% if legacy %}
<div class="listcard__card-images">
{% for image in item.images %}
{% using image %}
{%- comment -%}
We're adding a class list to the `image` data before `atom/img`.
Kung umiiral na ang `attrs.class`, idaragdag ang aming listahan ng klase pagkatapos.
Kailangan ang `capture` dahil gumagamit kami ng data mula sa `forloop.index`.
Kung gusto naming gumamit ng palaging listahan ng klase nang walang dynamic na data, magagawa namin ito inline tulad ng: `{%- assign attrs = attrs | merge_props: class: "my-static class-list" -%}` {%- endcomment -%} {%- capture class -%} {% if image_link -%} listcard__card-image-linkable listcard__card-image-linkable-- {{ forloop.index }} {%- else -%} listcard__card-image listcard__card-image--{{ forloop.index }} {%- endif %} {%- endcapture %} {% if image_link %} {%- assign tag_name = 'a' -%} {%- assign attrs = attrs | merge_props: href: image_link -%} {% endif %} {%- assign attrs = attrs | merge_props: class: class -%} {% isama ang "atom/img" %} {% endusing %} {% if image.modal_img %} Isara ang {% gamit ang larawan %} {%- komento -%} Nagdaragdag kami ng listahan ng klase sa data ng `image` bago ang `atom/img`.
Kung umiiral na ang `attrs.class`, idaragdag ang aming listahan ng klase pagkatapos.
Kailangan ang `capture` dahil gumagamit kami ng data mula sa `forloop.index`.
Kung gusto naming gumamit ng palaging listahan ng klase nang walang dynamic na data, magagawa namin ito inline tulad ng: `{%- assign attrs = attrs | merge_props: class: "my-static class-list" -%}` {%- endcomment -%} {%- capture class -%} listcard__modal-image listcard__modal-image--{{ forloop.index }} {%- endcapture -%} {%- assign attrs = attrs | merge_props: class: class -%} {% isama ang "atom/img" %} {% endusing %} {% endif %} {% endfor %} {% kung image.image_text %} {{image.image_text}} {% endif %} {% else %} {% para sa larawan sa item.images %} {% using image %} {%- comment -%} Nagdaragdag kami ng listahan ng klase sa data ng `image` bago ang `atom/img`.
Kung umiiral na ang `attrs.class`, idaragdag ang aming listahan ng klase pagkatapos.
Kailangan ang `capture` dahil gumagamit kami ng data mula sa `forloop.index`.
Kung gusto naming gumamit ng palaging listahan ng klase nang walang dynamic na data, magagawa namin ito inline tulad ng: `{%- assign attrs = attrs | merge_props: class: "my-static class-list" -%}` {%- endcomment -%} {%- capture class -%} {% if image_link -%} listcard__card-image-linkable listcard__card-image-linkable-- {{ forloop.index }} {%- else -%} listcard__card-image listcard__card-image--{{ forloop.index }} {%- endif %} {%- endcapture %} {% if image_link %} {%- assign tag_name = 'a' -%} {%- assign attrs = attrs | merge_props: href: image_link -%} {% endif %} {%- assign attrs = attrs | merge_props: class: class -%} {% isama ang "atom/img" %} {% endusing %} {% if image.image_text %} {{image.image_text}} {% endif %} {% endfor %} {%- if item.images[0].modal_img -%} > < Isara {% para sa larawan sa item.images %} {% using image.modal_img %} {%- comment -%} Nagdaragdag kami ng listahan ng klase sa data ng `image` bago ang `atom/img`.
Kung umiiral na ang `attrs.class`, idaragdag ang aming listahan ng klase pagkatapos.
Kailangan ang `capture` dahil gumagamit kami ng data mula sa `forloop.index`.
* Hindi ginagarantiyahan ang mga indibidwal na mga resulta at maaaring mag-iba mula sa bawat tao. Ang mga imahe ay maaaring maglaman ng mga modelo.