Add support for icons and add python requirements

This commit is contained in:
Peder Bergebakken Sundt 2019-10-06 13:27:33 +02:00
parent a20a0c4b62
commit 1263c5aac2
3 changed files with 64 additions and 15 deletions

4
requirements.txt Normal file
View File

@ -0,0 +1,4 @@
Jinja2
libsass
Markdown
PyYAML

View File

@ -57,18 +57,53 @@
</div> </div>
{% endmacro %} {% endmacro %}
{% macro named_icon_to_emoji(name) %}
{% if "AIR" in name | upper %} 🌪
{% elif "ALCHEMY" in name | upper %} ⚗️
{% elif "ANIMAL" in name | upper %} 🐾
{% elif "COMBAT" in name | upper %} ⚔️
{% elif "CRAFTING" in name | upper %} ⚒
{% elif "DARK" in name | upper %} 💀
{% elif "DEFENCE" in name | upper %} 🛡
{% elif "EARTH" in name | upper %} 🌱
{% elif "FIRE" in name | upper %} 🔥
{% elif "HOLY" in name | upper %} ☀️
{% elif "INNATE" in name | upper %} 🧙
{% elif "MAGIC" in name | upper %} 🔮
{% elif "MARKSMANSHIP" in name | upper %} 🎯
{% elif "MARTIAL" in name | upper %} 🥊
{% elif "META" in name | upper %} 🧩
{% elif "PERFORMANCE" in name | upper %} 🎺
{% elif "SHAPESHIFTING" in name | upper %} 🐻
{% elif "SKULLDUGGERY" in name | upper %} ⚰️
{% elif "TECHNIQUE" in name | upper %} 🎲
{% elif "WATER" in name | upper %} 🌊
{% elif "WEAPONMASTER" in name | upper %} 🤺
{% else %} {{name}}
{% endif %}
{% endmacro %}
<div class="fjomp_card{{" " + card.style if card.style}}"> <div class="fjomp_card{{" " + card.style if card.style}}">
<header>{{ card.title }}</header> <header>
{{ card.title }}
</header>
{% if card.icon %}
<div class="icon">
{{ named_icon_to_emoji(card.icon) }}
</div>
{% endif %}
<figure> <figure>
{% for figure in card.figures %} {% for figure in card.figures %}
{{ figure_layer(figure) }} {{ figure_layer(figure) }}
{% endfor %} {% endfor %}
</figure> </figure>
<aside><ul> <aside>
<ul>
{% for property in card.properties %} {% for property in card.properties %}
<li>{{ property }}</li> <li>{{ property }}</li>
{% endfor %} {% endfor %}
</ul></aside> </ul>
</aside>
<div class="costbar"> <div class="costbar">
{% for cost in card.costs %} {% for cost in card.costs %}
<section> <section>

View File

@ -13,13 +13,13 @@
font-family: sans-serif; font-family: sans-serif;
display: grid; display: grid;
grid-template-columns: 5fr 3fr; grid-template-columns: 5fr 3fr auto;
grid-template-rows: 1.5em var(--figure-size) 2.1em auto; grid-template-rows: 1.5em var(--figure-size) 2.1em auto;
grid-template-areas: grid-template-areas:
"title title" "title title icon"
"figure properties" "figure properties properties"
"costbar costbar" "costbar costbar costbar"
"description description"; "description description description";
header { header {
grid-area: title; grid-area: title;
@ -32,6 +32,11 @@
border-radius: 0; border-radius: 0;
color: white; color: white;
} }
.icon {
grid-area: icon;
background-color: #222;
color: white;
}
figure { figure {
grid-area: figure; grid-area: figure;
background-color: #333; background-color: #333;
@ -133,6 +138,11 @@
background-color: #ddd; background-color: #ddd;
color: #333; color: #333;
} }
.icon {
grid-area: icon;
background-color: #ddd;
color: #333;
}
figure { figure {
background-color: #fff; background-color: #fff;
div { div {
@ -159,10 +169,10 @@
--figure-size: 1.5in; --figure-size: 1.5in;
grid-template-columns: 1fr; grid-template-columns: 1fr;
grid-template-areas: grid-template-areas:
"title" "title icon"
"figure" "figure figure"
"costbar" "costbar costbar"
"description"; "description description";
aside { aside {
display: none; display: none;
} }