{% set xml_image_note_done = [1] %}{# why must nunjucks suck so much? #} {% 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 == "xml" %} {% set figure_name = xml.image if xml.image | startswith("http") else xml.image | split(":") | tail | join(":") %} {% set figure_source = "url" if xml.image | startswith("http") else xml.image | split(":") | first %} {% if xml_image_note_done.clear() %}{% endif %} {% else %} {% set figure_name = figure.name %} {% set figure_source = figure.source %} {% endif %}
{% 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 and xml_image_note_done %} {{ 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 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(" ") }}
{% elif playcost | trim | split(" ") | length == 1 %}
{{ 1 }}
{{ playcost }}
{% endif %} {% endfor %} {% endif %} {% endfor %} {% for label, data in [ ["Artistic Value", xml.artistic_value], ["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 %}
{% for part in data | split("+") %} {% if "death" not in part %} {{"+" if not loop.first }} {{ part }} {% endif %} {% endfor %}
{# {{ data }}
#} {{ label }}
{% 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 %} #}