43 lines
2.8 KiB
HTML
43 lines
2.8 KiB
HTML
{% set align_map = {'left': 'flex-start', 'center': 'center', 'right': 'flex-end'} %}
|
|
{% set justify = align_map.get(text_align, 'flex-end') %}
|
|
{% set flex_direction = 'column' if label_position in ['top', 'bottom'] else 'row' %}
|
|
{% set label_font_size = label_font_size|default(14) %}
|
|
{% set label_color = label_color|default('#333333') %}
|
|
{% set label_font_weight = label_font_weight|default('normal') %}
|
|
{% set is_float = position_mode|default('inline') == 'float' %}
|
|
{% set float_style = 'position: absolute; left: %spx; top: %spx; z-index: %s;'|format(float_x|default(0), float_y|default(0), float_z_index|default(100)) if is_float else 'display: flex; justify-content: %s; margin: 10px 0; width: 100%%; box-sizing: border-box;'|format(justify) %}
|
|
{% if seal_image_data %}
|
|
<div class="seal-container" style="{{ float_style }}">
|
|
<div style="display: flex; flex-direction: {{ flex_direction }}; align-items: center; gap: 8px;">
|
|
{% if label and label_position in ['top', 'left'] %}
|
|
<span class="seal-label" style="font-size: {{ label_font_size }}px; color: {{ label_color }}; font-weight: {{ label_font_weight }}; white-space: nowrap;">{{ label }}</span>
|
|
{% endif %}
|
|
<img class="seal-image"
|
|
src="{{ seal_image_data }}"
|
|
data-seal-id="{{ seal_id }}"
|
|
data-seal-image-id="{{ seal_image_id }}"
|
|
style="width: {{ width }}px; height: {{ height }}px; object-fit: contain; flex-shrink: 0;"
|
|
alt="{{ seal_name }}" />
|
|
{% if label and label_position in ['bottom', 'right'] %}
|
|
<span class="seal-label" style="font-size: {{ label_font_size }}px; color: {{ label_color }}; font-weight: {{ label_font_weight }}; white-space: nowrap;">{{ label }}</span>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<div class="seal-placeholder" data-seal-type="{{ seal_type }}"
|
|
style="{{ float_style }}">
|
|
<div style="display: flex; flex-direction: {{ flex_direction }}; align-items: center; gap: 8px;">
|
|
{% if label and label_position in ['top', 'left'] %}
|
|
<span class="seal-label" style="font-size: {{ label_font_size }}px; color: {{ label_color }}; font-weight: {{ label_font_weight }}; white-space: nowrap;">{{ label }}</span>
|
|
{% endif %}
|
|
<div style="width: {{ width }}px; height: {{ height }}px; border: 2px dashed #ccc; border-radius: 50%;
|
|
display: flex; align-items: center; justify-content: center; color: #999; flex-shrink: 0;">
|
|
签章
|
|
</div>
|
|
{% if label and label_position in ['bottom', 'right'] %}
|
|
<span class="seal-label" style="font-size: {{ label_font_size }}px; color: {{ label_color }}; font-weight: {{ label_font_weight }}; white-space: nowrap;">{{ label }}</span>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|