diff options
| author | Vik Fearing | 2024-09-02 15:46:09 +0000 |
|---|---|---|
| committer | Vik Fearing | 2024-09-02 15:46:50 +0000 |
| commit | c2cbaa2182cc4ecfe4aab14c0e87a11fd7b84e9d (patch) | |
| tree | 4198394c4bbec7c50ff65c4537c145aac2f8f09c | |
| parent | 820b602c397e17dc80876a5d2d13343982fc5b4f (diff) | |
Add badge.json from 2023
| -rw-r--r-- | templates/badge.json | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/templates/badge.json b/templates/badge.json new file mode 100644 index 0000000..8585b4e --- /dev/null +++ b/templates/badge.json @@ -0,0 +1,69 @@ +{ + {% set badgewidth = 105 %} + {% set badgeheight = 140 %} + {% set badgex = 24 %} + {% set badgey = 30 %} + {% set bleed = 2 %} + {% set cutmarklength = 8 %} + {% set cutmarkspace = 3 %} + + "forcebreaks": 1, + "fontname": "FiraSans", + "width": {{ 105 + (bleed * 2) }}, + "height": 140, + "elements": [ + {################} + {### Cutmarks ###} + {################} + + {# Upper left horizontal #} + {"type": "line", "x": {{ badgex - bleed - cutmarklength - cutmarkspace }}, "y": {{ badgey }}, "x2": {{ badgex - bleed - cutmarkspace }}, "y2": {{ badgey }}}, + {# Upper left vertical #} + {"type": "line", "x": {{ badgex }}, "y": {{ badgey - bleed - cutmarklength - cutmarkspace }}, "x2": {{ badgex }}, "y2": {{ badgey - bleed - cutmarkspace }}}, + + {# Upper right horizontal #} + {"type": "line", "x": {{ badgex + bleed + badgewidth + cutmarkspace }}, "y": {{ badgey }}, "x2": {{ badgex + bleed + badgewidth + cutmarkspace + cutmarklength }}, "y2": {{ badgey }}}, + {# Upper right vertical #} + {"type": "line", "x": {{ badgex + badgewidth }}, "y": {{ badgey - bleed - cutmarklength - cutmarkspace }}, "x2": {{ badgex + badgewidth }}, "y2": {{ badgey - bleed - cutmarkspace }}}, + + {# Lower left horizontal #} + {"type": "line", "x": {{ badgex - bleed - cutmarklength - cutmarkspace }}, "y": {{ badgey + badgeheight }}, "x2": {{ badgex - bleed - cutmarkspace }}, "y2": {{ badgey + badgeheight }}}, + {# Lower left vertical #} + {"type": "line", "x": {{ badgex }}, "y": {{ badgey + badgeheight + bleed + cutmarklength + cutmarkspace }}, "x2": {{ badgex }}, "y2": {{ badgey + badgeheight + bleed + cutmarkspace }}}, + + {# Lower right horizontal #} + {"type": "line", "x": {{ badgex + bleed + badgewidth + cutmarkspace }}, "y": {{ badgey + badgeheight }}, "x2": {{ badgex + bleed + badgewidth + cutmarkspace + cutmarklength }}, "y2": {{ badgey + badgeheight }}}, + {# Lower right vertical #} + {"type": "line", "x": {{ badgex + badgewidth }}, "y": {{ badgey + badgeheight + bleed + cutmarklength + cutmarkspace }}, "x2": {{ badgex + badgewidth }}, "y2": {{ badgey + badgeheight + bleed + cutmarkspace }}}, + + {"type": "box", "x": {{ badgex - bleed }}, "y": {{ badgey - bleed }}, "width": {{ badgewidth + (bleed * 2) }}, "height": {{ badgeheight + (bleed * 2) }}, "fill": [255, 255, 255], "stroke": false}, + + {########################} + {### Background image ###} + {########################} + + {"type": "image", "src": "img/badge_background_{% if reg.regtype.regclass.regclass == "Attendee" %}attendee{% elif reg.regtype.regclass.regclass == "Speaker" %}speaker{% else %}staff{% endif %}.png", "x": {{ badgex - bleed }}, "y": {{ badgey - bleed }}, "width": {{ badgewidth + (bleed * 2) }}, "height": {{ badgeheight + (bleed * 2) }}, "mask": "auto"}, + + {############} + {### Name ###} + {############} + + {"type": "paragraph", "fontname": "FiraSans", "text": "{{ reg.firstname|escapejson }} {{ reg.lastname|escapejson }}", "x": {{ badgex + 4 }}, "y": {{ badgey + 107 }}, "width": {{ badgewidth - 8 - 18 }}, "height": 10, "bold": true} + + {###############} + {### Company ###} + {###############} + + {% if reg.company %} + ,{"type": "paragraph", "text": "{{ reg.company|escapejson }}", "x": {{ badgex + 4 }}, "y": {{ badgey + 119 }}, "width": {{ badgewidth - 8 }}, "height": 8, "maxsize": 14} + {% endif %} + + {###############} + {### QR code ###} + {###############} + + {% if reg.id != 0 %} + ,{"type": "qrimage", "fill": "red", "x": {{ badgex + 86 }}, "y": {{ badgey + 107 }}, "width": 18, "height": 18, "qrcontent": "{{ reg.fullpublictoken }}"} + {% endif %} + ] +} |
