Shootoff as svg & center oversized targets

This commit is contained in:
bogo
2024-10-04 14:07:39 +02:00
parent d8e9eb7ba8
commit f92496b83a
4 changed files with 51 additions and 54 deletions

View File

@@ -66,6 +66,7 @@
border-top: solid 1px black;
width: 100%;
height: 75mm;
text-align: center;
}
.preview-post {
@@ -82,31 +83,18 @@
<div class="preview">
{% for i in range(target_count) %}
{% if i == target_count-1 %}
<div class="post preview-post"
style="width: {{ preview_scale * 150}}mm; height: {{ preview_scale * 550 }}mm; left: {{i * preview_scale * 1000}}mm">
<div class="target circle" style="
width: {{ preview_scale * 300 }}mm;
height: {{ preview_scale * 300 }}mm;
bottom: {{ (preview_scale * 550) - ((preview_scale * 300)/2) }}mm;
right: {{ (preview_scale * (300/2)) - (preview_scale * 150 * 1.5) }}mm;
">
</div>
<div style="margin: 20mm {{preview_scale*25}}cm 0 {{preview_scale*25}}cm; display: inline-block;">
{% if i == target_count-1 %}
{% with target_width=preview_scale * 30, target_height=preview_scale * 85 %}
{% include 'popper_svg.html' %}
{% endwith %}
{% else %}
{% with target_width=preview_scale * 20, target_height=preview_scale * 56 %}
{% include 'popper_svg.html' %}
{% endwith %}
{% endif %}
</div>
{% else %}
<div class="post preview-post"
style="width: {{ preview_scale * 100}}mm; height: {{ preview_scale * 360 }}mm; left: {{i * preview_scale * 1000}}mm">
<div class="target circle" style="
width: {{ preview_scale * 200 }}mm;
height: {{ preview_scale * 200 }}mm;
bottom: {{ (preview_scale * 360) - ((preview_scale * 200)/2) }}mm;
right: {{ (preview_scale * (200/2)) - (preview_scale * 100 * 1.5) }}mm;
">
</div>
</div>
{% endif %}
{% endfor %}
</div>
<p>{%trans%}Wall length required{%endtrans%}: {{ wall_length|round(1,'ceil') }}cm</p>
@@ -124,32 +112,13 @@
<div class="page-break">
<div class="content">
{% if i == target_count-1 %}
<div class="post"
style="width: {{ scale * 150}}mm; height: {{ scale * 550 }}mm;">
<div class="target circle" style="
width: {{ scale * 300 }}mm;
height: {{ scale * 300 }}mm;
bottom: {{ (scale * 550) - ((scale * 300)/2) }}mm;
right: {{ (scale * (300/2)) - (scale * 150 * 1.5) }}mm;
">
</div>
</div>
{% with target_width=scale * 30, target_height=scale * 85 %}
{% include 'popper_svg.html' %}
{% endwith %}
{% else %}
<div class="post"
style="width: {{ scale * 100}}mm; height: {{ scale * 360 }}mm;">
<div class="target circle" style="
width: {{ scale * 200 }}mm;
height: {{ scale * 200 }}mm;
bottom: {{ (scale * 360) - ((scale * 200)/2) }}mm;
right: {{ (scale * (200/2)) - (scale * 100 * 1.5) }}mm;
">
</div>
</div>
{% with target_width=scale * 20, target_height=scale * 56 %}
{% include 'popper_svg.html' %}
{% endwith %}
{% endif %}
{% if i==0 %}
<div class="mounting-info">{%trans%}ZERO point{%endtrans%} (Shootoff)</div>