pleasing button layout, indicating that it is checked
This commit is contained in:
parent
fa0d8930b8
commit
897309a3b9
3 changed files with 21 additions and 4 deletions
BIN
foods.db
BIN
foods.db
Binary file not shown.
|
|
@ -21,17 +21,17 @@
|
|||
{% if loop.index as i32 <= food.target_servings %}
|
||||
<label class="ok">
|
||||
{% if loop.index as i32 <= food.actual_servings %}
|
||||
<input type="checkbox" checked hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 - 1}}" hx-target="#card-{{ food.id }}">
|
||||
<input type="button" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 - 1}}" hx-target="#card-{{ food.id }}" value="●" class="checked">
|
||||
{% else %}
|
||||
<input type="checkbox" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 }}" hx-target="#card-{{ food.id }}">
|
||||
<input type="button" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 }}" hx-target="#card-{{ food.id }}" value="●" class="unchecked">
|
||||
{% endif %}
|
||||
</label>
|
||||
{% else %}
|
||||
<label class="bad">
|
||||
{% if loop.index as i32 <= food.actual_servings %}
|
||||
<input type="checkbox" checked hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 - 1}}" hx-target="#card-{{ food.id }}">
|
||||
<input type="button" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 - 1}}" hx-target="#card-{{ food.id }}" value="●" class="checked">
|
||||
{% else %}
|
||||
<input type="checkbox" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 }}" hx-target="#card-{{ food.id }}">
|
||||
<input type="button" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 }}" hx-target="#card-{{ food.id }}" value="●" class="unchecked">
|
||||
{% endif %}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -132,5 +132,22 @@
|
|||
accent-color: hsl(from #cb8175 h 90% l);
|
||||
background-color: hsl(from #cb8175 h 60% l);
|
||||
}
|
||||
|
||||
input[type="button"] {
|
||||
display: inline-block;
|
||||
border: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.unchecked {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
input[type="button"]:hover {
|
||||
background-color: beige;
|
||||
}
|
||||
</style>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue