21 lines
1.3 KiB
XML
21 lines
1.3 KiB
XML
<!-- SVG to show the current stock with an traffic light food labeling system -->
|
|
<!-- Used functions -->
|
|
<!-- process_radius ANZAHL MAXANZAHL RADIUS -->
|
|
<!-- procent ANZAHL MAXANZAHL -->
|
|
<!-- ex. {procent .Count 10}%-->
|
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
|
<g class="arcs">
|
|
{{if lt .Count 4}}
|
|
<circle cx="50" cy="50" r="40" fill="#fff" stroke="#aaa" stroke-width="5"/>
|
|
<circle cx="50" cy="50" r="40" fill="none" stroke="#b02" stroke-width="5" stroke-dasharray="251.33" stroke-dashoffset="{{process_radius .Count 10 40}}"/>
|
|
{{ else if and (lt .Count 7) (gt .Count 3)}}
|
|
<circle cx="50" cy="50" r="40" fill="#fff" stroke="#aaa" stroke-width="5"/>
|
|
<circle cx="50" cy="50" r="40" fill="none" stroke="#e72" stroke-width="5" stroke-dasharray="251.33" stroke-dashoffset="{{process_radius .Count 10 40}}"/>
|
|
{{else}}
|
|
<circle cx="50" cy="50" r="40" fill="#fff" stroke="#aaa" stroke-width="5"/>
|
|
<circle cx="50" cy="50" r="40" fill="none" stroke="#6a4" stroke-width="5" stroke-dasharray="251.33" stroke-dashoffset="{{process_radius .Count 10 40}}"/>
|
|
{{end}}
|
|
</g>
|
|
<text x="50" y="65" fill="#555" text-anchor="middle" style="font: 50px Roboto,Verdana,sans-serif;">{{.Count}}</text>
|
|
</svg>
|