food-tracker/templates/index.html

153 lines
2.5 KiB
HTML
Raw Normal View History

2025-10-18 20:54:23 +02:00
<!DOCTYPE html>
<html lang="en">
2025-10-24 17:49:03 +02:00
<head>
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.7/dist/htmx.min.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Food Tracker</title>
</head>
<body>
{% include "header.html" %}
<main>
<hr>
{% for food in foods %}
2025-10-20 14:34:24 +02:00
{% include "food.html" %}
{% if !loop.last %}
2025-10-24 17:49:03 +02:00
<hr>
{% endif %}
2025-10-20 14:34:24 +02:00
{% endfor %}
2025-10-24 17:49:03 +02:00
</main>
</body>
<style>
html {
2025-10-20 14:34:24 +02:00
font-family: sans-serif;
border: 2px solid hsl(from #a8c8a6 h 40% l);
}
body {
margin: 0;
}
header {
display: inline-block;
text-align: center;
width: 100%;
background-color: hsl(from #a8c8a6 h 40% l);
}
header div {
width: 100%;
display: flex;
align-items: stretch;
}
header div span {
text-align: left;
width: inherit;
}
.card {
background-color: hsl(from #a8c8a6 h 30% l);
}
hr {
border: 0;
padding: 0;
margin: 0;
border-bottom: 1px dashed #655057;
background: #655057;
}
.card p {
margin: 0;
padding: 2px;
}
.food-name {
font-size: 1.2em;
}
.buttons {
display: flex;
flex-direction: column;
height: 100%;
}
.card-inner {
display: flex;
align-items: stretch;
gap: 5px;
}
.card-inner div button {
display: block;
}
button {
border: 0;
border-radius: 5px;
width: 2em;
height: 2em;
}
2025-10-24 23:08:23 +02:00
.amounts {
width: 4em;
}
2025-10-20 14:34:24 +02:00
.increase {
background-color: #cb8175;
}
.decrease {
background-color: #6d8d8a;
}
.increase:hover {
background-color: hsl(from #cb8175 h 80% l);
}
.decrease:hover {
background-color: hsl(from #6d8d8a h 40% l);
}
.checkboxes {
display: flex;
align-items: stretch;
justify-content: center;
flex-grow: 1;
}
.checkboxes label {
flex-grow: 1;
align-content: center;
}
.ok {
accent-color: hsl(from #a8c8a6 h 90% l);
background-color: hsl(from #a8c8a6 h 60% l);
}
.bad {
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;
}
2025-10-24 17:49:03 +02:00
</style>
2025-10-18 21:21:58 +02:00
</html>