{% macro figure_layer(figure) %} {% set figure_style %}{% filter cull_whitespace %} {% if figure.opacity!=1 %} opacity: {{ figure.opacity }}; {% endif %} {% if figure.color!=1 %} color: {{ figure.color }}; {% endif %} transform: {% if figure.offset and figure.offset|any %} translate({{ figure.offset[0]*100 }}%, {{ figure.offset[1]*100 }}%) {% endif %} {% if figure.rotation %} rotate({{ figure.rotation }}deg) {% endif %} {% if figure.flip_x %} scaleX(-1) {% endif %} {% if figure.flip_y %} scaleY(-1) {% endif %} {% if figure.scale and figure.scale!=1 %} scale({{figure.scale | string | replace("[", "") | replace("]", "") }}) {% endif %} ; {% endfilter %}{% endset %}
{% if figure.source == "material-icons" %} {# https://material.io/icons/ #} {{ figure.name }} {% elif figure.source == "mdi" %} {# https://materialdesignicons.com/ #} {% elif figure.source == "fa" %} {# http://fontawesome.io/icons/ #} {% elif figure.source == "lnr" %} {# https://linearicons.com/free #} {% elif figure.source == "oi" %} {# https://useiconic.com/open #} {% elif figure.source == "svg" %} {# pvv.ntnu.no/~pederbs/cards/svg #} {% if figure.color == true %} {% elif figure.color %} {% else %} {% endif %} {% elif figure.source in ["img", "emoji"] %} {# pvv.ntnu.no/~pederbs/cards/img #} {# /cards/emoji #} {% if figure.color == true %} {% elif figure.color %} {% else %} {% endif %} {% elif figure.source == "url" %} {% if figure.color == true %} {% elif figure.color %} {% else %} {% endif %} {% endif %}
{% endmacro %}
{{ yaml.name or xml.name }}
{% if xml.symbol %}
{{ xml.symbol }}
{% endif %}
{% for figure in yaml.figures or [] %} {{ figure_layer(figure) }} {% endfor %} {% if xml.image %} {{ figure_layer({ 'name': xml.image if xml.image | startswith("http") else xml.image | split(":") | tail | join(":"), 'source': "url" if xml.image | startswith("http") else xml.image | split(":") | first }) }} {% endif %}
{% for label, data in [ ["Difficulty", xml.difficulty or yaml.difficulty], ["Power", xml.power or yaml.power], ["Range", xml.range or yaml.range], ["Duration", xml.duration or yaml.duration], ["CP", xml.cp or yaml.cp] ] %} {% if data %}
{{ data }}
{{ label }}
{% endif %} {% endfor %} {% for playcosts in [xml.playcost, yaml.playcost] %} {% if playcosts %} {% for playcost in (playcosts.split(",") if playcosts | is_string else playcosts ) %} {% if playcost | trim | split(" ") | first | is_number %}
{{ playcost | trim | split(" ") | first }}
{{ playcost | trim | split(" ") | tail | join(" ") }}
{% endif %} {% endfor %} {% endif %} {% endfor %}
{% if yaml.flavor %}
"{{ yaml.flavor }}"
{% endif %} {% if yaml.description %}
{{ yaml.description | markdown | safe }}
{% endif %} {% if xml.description %}
{{ xml.description | markdown | safe }}
{% endif %} {% if yaml.steps %} {% endif %}
{# {% for item in xml.components %} {{item["@x"]}}, {{item["@y"]}}, {{item["@db_entry"]}}
{% endfor %} #}