Files
steel-training/templates/pdf_template_custom.html
2024-10-04 14:07:39 +02:00

107 lines
3.0 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Steel Training | {%trans%}Target{%endtrans%}: {{ target_type|upper }} | {%trans%}Simulated distance{%endtrans%}: {{ simulated_distance }}m | {%trans%}Place target on{%endtrans%}: {{distance}}m</title>
<style>
@page {
size: {{size}};
margin: 5mm;
}
body {
font-family: sans-serif;
}
.target {
margin: auto;
text-align: center;
}
.page-break {
page-break-after: always;
}
.content {
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
.content-oversized {
position: relative;
height: {{target_height}}cm; /* Paper height */
overflow: hidden; /* Hide overflow on both sides */
}
.content-oversized svg {
position: absolute;
left: 50%; /* Move to the center */
transform: translateX(-50%); /* Center the SVG horizontally */
}
.mounting-point {
height: 10mm;
width: 0.5mm;
background-color: #ccc;
margin: auto;
}
.mounting-info {
font-size: xx-small;
color: #ccc;
text-align: center;
}
.mounting-info-oversized {
font-size: xx-small;
color: #ccc;
text-align: center;
position: absolute;
z-index: 111;
bottom: 1.5cm;
left: 50%;
transform: translateX(-50%);
}
.preview {
display: block;
border-bottom: solid 1px black;
border-top: solid 1px black;
width: 100%;
height: 75mm;
position: relative;
}
.preview-target {
position: absolute;
bottom: 30%;
}
</style>
</head>
<body>
<div class="page-break">
<div class="content{% if oversized %}-oversized{% endif %}">
{% with target_width=target_width, target_height=target_height %}
{% if target_type == 'ipsc' %}
{%include 'ipsc_svg.html'%}
{% elif target_type == 'idpa' %}
{%include 'idpa_svg.html'%}
{% elif target_type == 'ts2' %}
{%include 'ts2_svg.html'%}
{% else %}
{% include 'popper_svg.html'%}
{% endif%}
{% endwith %}
<br>
<div class="mounting-info{% if oversized %}-oversized{% endif %}">
{%trans%}Target{%endtrans%}: {{ target_type|upper }} | {%trans%}Simulated distance{%endtrans%}: {{ simulated_distance }}m | {%trans%}Place target on{%endtrans%}: {{distance}}m
<br>
Steel Training
</div>
</div>
</div>
</body>
</html