RPGs3_card_insanity/style.html.j2

91 lines
3.4 KiB
Plaintext
Raw Normal View History

2019-09-11 05:09:42 +02:00
{% macro figure_layer(figure) %}
{% set figure_style %}{% filter cull_whitespace %}
2019-09-10 00:52:30 +02:00
{% if figure.opacity!=1 %}opacity: {{ figure.opacity }};{% endif %}
{% if figure.color!=1 %}color: {{ figure.color }};{% endif %}
transform:
{% if 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!=1 %}scale({{ figure.scale }}){% endif %}
;
2019-09-11 05:09:42 +02:00
{% endfilter %}{% endset %}
2019-09-09 18:48:15 +02:00
2019-09-10 00:52:30 +02:00
<div style="{{ figure_style }}">
2019-09-11 05:09:42 +02:00
{% if figure.type == "material-icons" %}
{# https://material.io/icons/ #}
2019-09-10 00:52:30 +02:00
<i class="material-icons figure">{{ figure.name }}</i>
2019-09-11 05:09:42 +02:00
{% elif figure.type == "mdi" %}
{# https://materialdesignicons.com/ #}
2019-09-10 00:52:30 +02:00
<i class="mdi mdi-{{ figure.name }}"></i>
2019-09-11 05:09:42 +02:00
{% elif figure.type == "fa" %}
{# http://fontawesome.io/icons/ #}
2019-09-10 00:52:30 +02:00
<i class="fa fa-{{ figure.name }}"></i>
2019-09-11 05:09:42 +02:00
{% elif figure.type == "lnr" %}
{# https://linearicons.com/free #}
2019-09-10 00:52:30 +02:00
<span class="lnr lnr-{{ figure.name }}"></span>
2019-09-11 05:09:42 +02:00
{% elif figure.type == "oi" %}
{# https://useiconic.com/open #}
<span class="oi" data-glyph="{{ figure.name }}"></span>
{% elif figure.type == "svg" %}
{# /cards/svg #}
2019-09-18 22:46:23 +02:00
{% if figure.color %}
{% if figure.color == true %}
<img src="https://pvv.ntnu.no/~pederbs/cards/svg/data/{{ figure.name }}">
2019-09-11 05:09:42 +02:00
{% else %}
2019-09-18 22:46:23 +02:00
<img src="https://pvv.ntnu.no/~pederbs/cards/svg/data/{{ figure.name }}" class="colored" style="--figure-color:{{ figure.color }}">
2019-09-11 05:09:42 +02:00
{% endif %}
{% else %}
2019-09-18 22:46:23 +02:00
<img src="https://pvv.ntnu.no/~pederbs/cards/svg/data/{{ figure.name }}" class="colored">
2019-09-11 05:09:42 +02:00
{% endif %}
{% elif figure.type == "img" %}
{# /cards/img #}
{% if figure.color %}
<img src="https://pvv.ntnu.no/~pederbs/cards/img/data/{{ figure.name }}" class="colored" style="--figure-color:{{ figure.color }}">
{% else %}
<img src="https://pvv.ntnu.no/~pederbs/cards/img/data/{{ figure.name }}">
{% endif %}
{% endif %}
2019-09-10 00:52:30 +02:00
</div>
2019-09-11 05:09:42 +02:00
{% endmacro %}
2019-09-10 00:52:30 +02:00
2019-09-10 17:54:18 +02:00
<div class="fjomp_card">
2019-09-10 00:52:30 +02:00
<header>{{ card.title }}</header>
<figure>
2019-09-11 05:09:42 +02:00
{% for figure in card.figures %}
{{ figure_layer(figure) }}
{% endfor %}
2019-09-10 00:52:30 +02:00
</figure>
<aside><ul>
2019-09-11 05:09:42 +02:00
{% for property in card.properties %}
<li>{{ property }}</li>
{% endfor %}
2019-09-10 00:52:30 +02:00
</ul></aside>
<summary>
2019-09-11 05:09:42 +02:00
{% for cost in card.costs %}
<section>
{% if cost.split() | length == 2 and cost.split()[0].isnumeric() %}
<big>{{ cost.split()[0] }}</big><br>
<small>{{ cost.split()[1] }}</small>
{% else %}
{{ cost }}
{% endif %}
</section>
{% endfor %}
2019-09-10 00:52:30 +02:00
</summary>
<article>
<center><i>"{{ card.flavor }}"</i></center>
<center>{{ card.description | markdown | safe }}</center>
2019-09-11 05:09:42 +02:00
{% if card.steps %}
2019-09-10 00:52:30 +02:00
<ul>
2019-09-11 05:09:42 +02:00
{% for step in card.steps %}
<li>{{ step }}</li>
{% endfor %}
2019-09-10 00:52:30 +02:00
</ul>
2019-09-11 05:09:42 +02:00
{% endif %}
2019-09-10 00:52:30 +02:00
</article>
</div>
2019-09-11 05:09:42 +02:00
{# <br><pre>{{ card }}</pre> #}