wip
This commit is contained in:
parent
5d799682aa
commit
2c9f95f2ab
3 changed files with 72 additions and 28 deletions
2
mood.rb
2
mood.rb
|
|
@ -23,6 +23,6 @@ class Mood < ActiveRecord::Base
|
||||||
log_mood << [ current_date.to_s, current_mode ]
|
log_mood << [ current_date.to_s, current_mode ]
|
||||||
current_date += 1
|
current_date += 1
|
||||||
end
|
end
|
||||||
log_mood.each_slice(7).to_a.last(54)
|
log_mood.each_slice(7).to_a.last(52)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,30 @@ body {
|
||||||
|
|
||||||
.legend {
|
.legend {
|
||||||
grid-area: legend;
|
grid-area: legend;
|
||||||
margin: 30px;
|
margin: 4px;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
grid-area: info;
|
grid-area: info;
|
||||||
}
|
}
|
||||||
|
.legend .bar-creatif {
|
||||||
|
background: red;
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
.legend .bar-frigo {
|
||||||
|
background: gray;
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
.legend .bar-explain {
|
||||||
|
padding-left: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
@ -56,6 +74,7 @@ main {
|
||||||
main {
|
main {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
|
grid-template-rows: 1fr;
|
||||||
grid-template-areas: "mode tracker";
|
grid-template-areas: "mode tracker";
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
@ -69,13 +88,17 @@ main {
|
||||||
grid-area: tracker;
|
grid-area: tracker;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
|
grid-template-rows: repeat(2, 1fr) repeat(4, 1fr) repeat(3, 1fr);
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
|
"title title"
|
||||||
"title title"
|
"title title"
|
||||||
"moods moods"
|
"moods moods"
|
||||||
"moods moods"
|
"moods moods"
|
||||||
"moods moods"
|
"moods moods"
|
||||||
"info legend";
|
"moods moods"
|
||||||
|
". legend"
|
||||||
|
"info info"
|
||||||
|
"info info";
|
||||||
background-color: lightgoldenrodyellow;
|
background-color: lightgoldenrodyellow;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
@ -89,14 +112,6 @@ main {
|
||||||
margin: 30px;
|
margin: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.moods {
|
|
||||||
grid-area: moods;
|
|
||||||
margin: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.legend {
|
|
||||||
grid-area: legend;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
grid-area: info;
|
grid-area: info;
|
||||||
|
|
@ -113,19 +128,31 @@ main {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.moods {
|
.moods {
|
||||||
|
grid-area: moods;
|
||||||
|
margin: 30px;
|
||||||
|
max-height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.legend {
|
||||||
|
align-self: flex-end;
|
||||||
|
}
|
||||||
|
.log {
|
||||||
|
align-self: flex-end;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: flex-start;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.moods .week {
|
.moods .log .week {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-items: start;
|
justify-items: start;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
.moods .day {
|
.moods .log .day {
|
||||||
border: 1px;
|
border: 1px;
|
||||||
margin: 4px;
|
margin: 4px;
|
||||||
min-width: 15px;
|
min-width: 15px;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
<h1>Comment il va le Robi ?</h1>
|
<h1>Comment il va le Robi ?</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="moods">
|
<div class="moods">
|
||||||
|
<div class="log">
|
||||||
<% @mood_log.each do |week| %>
|
<% @mood_log.each do |week| %>
|
||||||
<div class="week">
|
<div class="week">
|
||||||
<% week.each do |d| %>
|
<% week.each do |d| %>
|
||||||
|
|
@ -44,11 +45,27 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="legend">
|
<div class="legend">
|
||||||
Ici la légende
|
<div class="legend-mood">
|
||||||
|
<div class="bar-creatif"></div>
|
||||||
|
<div class="bar-explain">mode créatif</div>
|
||||||
|
</div>
|
||||||
|
<div class="legend-mood">
|
||||||
|
<div class="bar-frigo"></div>
|
||||||
|
<div class="bar-explain">triste comme un frigo vide</div>
|
||||||
|
</div>
|
||||||
|
<div class="legend-mood">
|
||||||
|
<div class="bar-croisiere"></div>
|
||||||
|
<div class="bar-explain">mode croisiere</div>
|
||||||
|
</div>
|
||||||
|
<div class="legend-mood">
|
||||||
|
<div class="bar-frigo"></div>
|
||||||
|
<div class="bar-explain">triste comme un frigo vide</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="current-day">20 mai 2025</div>
|
<div class="current-day">20 mai 2025</div>
|
||||||
</div>
|
</div>
|
||||||
</div
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue