From 1263c5aac220d6918912033e5b2a044cd20ecc62 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sun, 6 Oct 2019 13:27:33 +0200 Subject: [PATCH] Add support for icons and add python requirements --- requirements.txt | 4 ++++ style.html.j2 | 47 +++++++++++++++++++++++++++++++++++++++++------ style.scss | 28 +++++++++++++++++++--------- 3 files changed, 64 insertions(+), 15 deletions(-) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f5b26ed --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +Jinja2 +libsass +Markdown +PyYAML diff --git a/style.html.j2 b/style.html.j2 index dc4ef84..c637131 100644 --- a/style.html.j2 +++ b/style.html.j2 @@ -57,18 +57,53 @@ {% 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 %} +
-
{{ card.title }}
+
+ {{ card.title }} +
+ {% if card.icon %} +
+ {{ named_icon_to_emoji(card.icon) }} +
+ {% endif %}
{% for figure in card.figures %} {{ figure_layer(figure) }} {% endfor %}
- +
{% for cost in card.costs %}
diff --git a/style.scss b/style.scss index ce84960..6335e49 100644 --- a/style.scss +++ b/style.scss @@ -13,13 +13,13 @@ font-family: sans-serif; 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-areas: - "title title" - "figure properties" - "costbar costbar" - "description description"; + "title title icon" + "figure properties properties" + "costbar costbar costbar" + "description description description"; header { grid-area: title; @@ -32,6 +32,11 @@ border-radius: 0; color: white; } + .icon { + grid-area: icon; + background-color: #222; + color: white; + } figure { grid-area: figure; background-color: #333; @@ -133,6 +138,11 @@ background-color: #ddd; color: #333; } + .icon { + grid-area: icon; + background-color: #ddd; + color: #333; + } figure { background-color: #fff; div { @@ -159,10 +169,10 @@ --figure-size: 1.5in; grid-template-columns: 1fr; grid-template-areas: - "title" - "figure" - "costbar" - "description"; + "title icon" + "figure figure" + "costbar costbar" + "description description"; aside { display: none; }