moodtracker/views/index.erb
Christophe Robillard 4caf937019 pimp view
wip
2024-10-07 21:49:51 +02:00

110 lines
1.8 KiB
Text

<style>
body {
margin: 0px;
font: 1.8rem "Fira Sans", sans-serif;
}
main {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
.mode {
height: 100vh;
flex: 1 527px;
}
img {
height: 100%;
width:100%;
// min-width: 527px;
object-fit: contain;
}
table {
empty-cells: hide;
border-collapse: collapse;
}
tbody tr td {
border: 1px solid black;
border-spacing: 3px;
min-width: 20px;
min-height: 20px;
border-radius: 50%;
margin: 5px;
}
.tracker {
display: flex;
flex: 1 527px;
flex-direction: column;
flex-wrap: wrap;
align-items: center;
justify-content: center;
background-color: lightgoldenrodyellow;
height: 100vh;
width: 100%;
}
.info h1 {
margin-bottom: 40px;
font-weight: 350;
}
.tracks {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: flex-start;
margin: 30px;
}
.week {
display: flex;
flex-direction: column;
justify-items: start;
flex-wrap: wrap;
margin-bottom: 20px;
}
.day {
border: 1px;
margin: 4px;
min-width: 20px;
min-height: 20px;
}
.creatif {
background-color: red;
}
.en-charge {
background-color: orange;
}
.frigo-vide {
background-color: grey;
}
.croisiere {
background-color: green;
}
</style>
<main>
<div class="mode">
<img src="<%= @last_mood.mode %>.png">
</div>
<div class="tracker">
<div class="info">
<h1>Humeurs 2024</h1>
</div>
<div class="tracks">
<% @mood_log.each do |week| %>
<div class="week">
<% week.each do |d| %>
<% if d[1] %>
<div title="<%= d[0] %> : <%= d[1] %>" class="day <%= d[1] %>"></div>
<% else %>
<div class="day"></div>
<% end %>
<% end %>
</div>
<% end %>
</div>
</div>
</main>