{% import "../components/button.html" %} {% import "../components/image-icon.html" %} {% import "../components/text.html" %} {% macro blurbComponent(data) %} {% set args = { "layout" : { "media_type" : "none", "blurb_bg" : false, "border_color" : false, "add_hover" : false, "add_shadow" : false, "full_height" : false }, "icon" : { "icon_type" : "fa", "fa_code" : "", "fa_color" : "", "image" : {} }, "image" : {}, "animated_number" : { "prefix" : "", "number" : "", "suffix" : "", "subtitle" : "" }, "text" : { "heading" : "", "description" : "" }, "buttons" : [], "class" : '' } %} {% do args.update(data) %} {% set item_class = ['blurb-item','w-100'] %} {% do args.class ? item_class.append(args.class) : '' %} {% do args.layout.full_height ? item_class.append('d-md-flex h-100') : '' %} {% do args.layout.add_hover ? item_class.append('has-hover-effect') : '' %}
{# check if we have blurb background #} {% set item_inner_class = ['item-inner','d-inline-block','flex-grow-1'] %} {% do args.layout.blurb_bg ? item_inner_class.append('p-3 swatch-'+args.layout.blurb_bg) : '' %} {% do args.layout.border_color ? item_inner_class.append('border border-2 border-'+args.layout.border_color) : '' %} {% do args.layout.add_shadow ? item_inner_class.append('shadow-sm') : '' %}
{% if args.layout.media_type == 'icon' %} {{ iconComponent({ "icon_type" : args.icon.icon_type, "fa_code" : args.icon.fa_code, "fa_color" : args.icon.fa_color, "image" : args.icon.image, "class" : 'mb-2', }) }} {% endif %}
{% if args.layout.media_type == 'image' %} {% if args.image.image.src %}
{% set context = args.image %} {{ imageComponent(context) }}
{% endif %} {% endif %} {% if args.layout.media_type == 'animation' %}
{{ !!args.animated_number.prefix ? '' + args.animated_number.prefix +'' : '' }} {{args.animated_number.number}} {{ !!args.animated_number.suffix ? '' + args.animated_number.suffix +'' : '' }}
{{ args.animated_number.subtitle}}
{% endif %}
{{ headingComponent({ "tag" : "h4" ,"text" : args.text.heading, "class" : "mb-1 heading-inherit" }) }} {{ textComponent({ "text" : args.text.description, "class" : "item-description mb-2" }) }} {% set buttons = type(args.buttons) == 'list' ? args.buttons : [] %} {{ buttonSet({ "show" : !!buttons|length , "buttons" : buttons}) }}
{% endmacro %}