diff --git a/Makefile b/Makefile index 5a3f292..c9b6bf9 100644 --- a/Makefile +++ b/Makefile @@ -44,15 +44,15 @@ with open(sys.argv[2], "w") as f: endef export PYTHON_MAKE_JINJA2_RENDERED_CARD -build/test_card_rendered.html: test_card.yaml style.html.j2 templates/card_header.html.j2 +build/test_card_rendered.html: test_card.yaml style.html.j2 build/style.css templates/card_header.html.j2 python3 -c "$$PYTHON_MAKE_JINJA2_RENDERED_CARD" "test_card.yaml" "build/test_card_rendered.html" export PYTHON_MAKE_JINJA2_RENDERED_CARD -cards/build/%.html: cards/%.yaml style.html.j2 templates/card_header.html.j2 +cards/build/%.html: cards/%.yaml style.html.j2 build/style.css templates/card_header.html.j2 python3 -c "$$PYTHON_MAKE_JINJA2_RENDERED_CARD" $< $@ export PYTHON_MAKE_JINJA2_RENDERED_CARD -cards/build/all.html: $(CARDS) style.html.j2 templates/card_header.html.j2 +cards/build/all.html: $(CARDS) style.html.j2 build/style.css templates/card_header.html.j2 python3 -c "$$PYTHON_MAKE_JINJA2_RENDERED_CARD" ALL $@ diff --git a/style.html.j2 b/style.html.j2 index 7af6d1e..31c4c37 100644 --- a/style.html.j2 +++ b/style.html.j2 @@ -29,28 +29,27 @@ {% elif figure.type == "svg" %} {# /cards/svg #} - {% if figure.color %} - {% if figure.color == true %} - - {% else %} - - {% endif %} + {% if figure.color == true %} + + {% elif figure.color %} + {% else %} - + {% endif %} {% elif figure.type == "img" %} {# /cards/img #} - {% if figure.color %} - + {% if figure.color == true %} + + {% elif figure.color %} + {% else %} - + {% endif %} - {% endif %} {% endmacro %} -
+
{{ card.title }}
{% for figure in card.figures %} diff --git a/style.scss b/style.scss index 77867ae..b89daf0 100644 --- a/style.scss +++ b/style.scss @@ -54,8 +54,9 @@ height: 100%; } img { - max-width: calc(var(--figure-size) * 0.9); - max-height: calc(var(--figure-size) * 0.9); + width: calc(var(--figure-size) * 0.9); + height: calc(var(--figure-size) * 0.9); + object-fit: contain; } img.colored { transform: translateY(-10000px); @@ -128,7 +129,7 @@ background-color: #fff; grid-template-rows: 1.6em var(--figure-size) 2.1em auto; header { - margin-top: none; + margin-top: 0; background-color: #ddd; color: #333; } @@ -152,3 +153,17 @@ background-color: #ddd; } } + +.fjomp_card.item { + --figure-size: 1.35in; + --figure-size: 1.5in; + grid-template-columns: 1fr; + grid-template-areas: + "title" + "figure" + "costbar" + "description"; + aside { + display: none; + } +} diff --git a/sync.py b/sync.py index ff012ca..f7b62f2 100755 --- a/sync.py +++ b/sync.py @@ -87,7 +87,7 @@ def push_all(): fname = f"cards/{card_id}.yaml" with open(fname) as f: yaml_data = f.read() - xml_data = f"\n{yaml_data.strip()}\n\n\n\n" + xml_data = f"\n{yaml_data.strip()}\n" elif os.path.isfile(f"cards/{card_id}.xml"): fname = f"cards/{card_id}.xml" with open(fname) as f: diff --git a/templates/card_header.html.j2 b/templates/card_header.html.j2 index e08a434..82000b9 100644 --- a/templates/card_header.html.j2 +++ b/templates/card_header.html.j2 @@ -1,8 +1,10 @@ {% set async = "media=\"none\" onload=\"if(media!='all')media='all'\"" -%} {% if is_local %} + +{# -{##} +#} {% endif %}