Add icons on calendar plot
This commit is contained in:
parent
8db2720f75
commit
b0716a65b7
3 changed files with 13 additions and 9 deletions
|
@ -70,8 +70,8 @@
|
|||
{% endif %}
|
||||
{% if m %}
|
||||
<td class="{% if m.sum > 0 %}p{% else %}m{% endif %}"
|
||||
style="opacity: {% calendar_opacity m.sum history.max.sum %}"
|
||||
title="{{ m.sum|pmrvalue }}"></td>
|
||||
style="background-color: color-mix(in hsl, currentcolor {% calendar_opacity m.sum history.max.sum %}, white)"
|
||||
title="{{ m.sum|pmrvalue }}">{% up_down_icon m.sum %}</td>
|
||||
{% else %}
|
||||
<td></td>
|
||||
{% endif %}
|
||||
|
|
|
@ -9,7 +9,7 @@ register = template.Library()
|
|||
|
||||
@register.simple_tag
|
||||
def calendar_opacity(v, vmax):
|
||||
return f"{math.sin(math.fabs(v/vmax)*math.pi/2):.3f}"
|
||||
return f"{math.sin(math.fabs(v/vmax)*math.pi/2):.0%}"
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
|
|
|
@ -89,12 +89,6 @@ table.full-width col.bar {
|
|||
margin-top: var(--gap);
|
||||
font-feature-settings: var(--num);
|
||||
|
||||
.p {
|
||||
background: var(--green);
|
||||
}
|
||||
.m {
|
||||
background: var(--red);
|
||||
}
|
||||
table {
|
||||
tbody tr {
|
||||
background: initial;
|
||||
|
@ -104,6 +98,16 @@ table.full-width col.bar {
|
|||
&:not(:first-child) {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
td {
|
||||
text-align: center;
|
||||
&.p {
|
||||
color: var(--green);
|
||||
}
|
||||
&.m {
|
||||
color: var(--red);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue