Compare commits

..

No commits in common. "ad1b1e1c6b8baf0a8f589fc64bac810b15ec64fd" and "86435da71c3dfcc394ca7019b46464f3b578ff0d" have entirely different histories.

8 changed files with 54 additions and 95 deletions

View file

@ -67,4 +67,3 @@ group :test do
end end
gem "cssbundling-rails", "~> 1.4" gem "cssbundling-rails", "~> 1.4"
gem "rails-i18n"

View file

@ -243,9 +243,6 @@ GEM
rails-html-sanitizer (1.6.2) rails-html-sanitizer (1.6.2)
loofah (~> 2.21) loofah (~> 2.21)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rails-i18n (8.1.0)
i18n (>= 0.7, < 2)
railties (>= 8.0.0, < 9)
railties (8.0.2) railties (8.0.2)
actionpack (= 8.0.2) actionpack (= 8.0.2)
activesupport (= 8.0.2) activesupport (= 8.0.2)
@ -434,7 +431,6 @@ DEPENDENCIES
propshaft propshaft
puma (>= 5.0) puma (>= 5.0)
rails (~> 8.0.2) rails (~> 8.0.2)
rails-i18n
rspec-rails (~> 8.0.0) rspec-rails (~> 8.0.0)
rubocop-rails-omakase rubocop-rails-omakase
selenium-webdriver selenium-webdriver

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View file

@ -16,27 +16,6 @@ body {
font-style: normal; font-style: normal;
} }
main {
height: 100vh;
}
.tracker {
align-content: center;
}
.logs {
height: 60vh;
overflow: scroll;
scrollbar-width: none;
}
.current-day {
background-color: white;
position: sticky;
top: 0;
align-content: center;
}
.bar-afond { .bar-afond {
background: black; background: black;
width: 10px; width: 10px;
@ -67,11 +46,15 @@ main {
height: 10px; height: 10px;
} }
.bar-explain {
padding-left: 5px;
}
.day { .day {
border: 1px; border: 1px;
margin: 4px; margin: 4px;
width: 15px; min-width: 15px;
height: 15px; min-height: 15px;
} }
.creatif { .creatif {

View file

@ -1,15 +1,12 @@
import { Controller } from '@hotwired/stimulus' import { Controller } from '@hotwired/stimulus'
export default class extends Controller { export default class extends Controller {
static targets = [ "image", "modeDay", "modeDayMobile" ] static targets = [ "image", "info" ]
updateDayInfo(event) { updateDayInfo(event) {
const image = this.imageTarget; const image = this.imageTarget;
const modeDay = this.modeDayTarget; const infoDay = this.infoTarget;
const modeDayMobile = this.modeDayMobileTarget;
const modeDayContent = event.target.dataset.day + ' : ' + event.target.dataset.mode;
image.src = event.target.dataset.image; image.src = event.target.dataset.image;
modeDayMobile.textContent = modeDayContent; infoDay.textContent = event.target.dataset.day;
modeDay.textContent = modeDayContent;
} }
} }

View file

@ -1,56 +1,17 @@
<main data-controller="mood" class="columns m-auto"> <main data-controller="mood" class="columns m-auto">
<div class="current-day column"> <section class="mode section column m-auto">
<section class="m-4">
<h1 class="title is-3 is-spaced">Comment ça KLUK ?</h1>
<div class="is-hidden-tablet mb-4">
<div class="" data-mood-target="modeDayMobile">Aujourd'hui</div>
</div>
<figure class="image is-hidden-mobile has-ratio ">
<%= image_tag(@mode + ".jpg", "data-mood-target": "image") %> <%= image_tag(@mode + ".jpg", "data-mood-target": "image") %>
</figure>
</section> </section>
</div> <section class="tracker section column has-background-primary-light my-0 mx-auto">
<section class="section column has-background-primary-light is-flex is-flex-direction-column is-justify-content-space-around"> <h1 class="title is-1 mt-6">Comment ça KLUK aujourd'hui ?</h1>
<div class="is-hidden-mobile mb-4"> <div class="subtitle" data-mood-target="info">Aujourd'hui</div>
<div class="title is-3" data-mood-target="modeDay">Aujourd'hui</div> <div>
</div>
<div class="tracker">
<div class="legend is-flex is-flex-wrap-wrap mb-5">
<div class="is-flex is-align-items-center mr-4">
<div class="bar-frigo mr-1"></div>
<div class="">Triste</div>
</div>
<div class="is-flex is-align-items-center mr-4">
<div class="bar-en-charge mr-1"></div>
<div class="">En charge</div>
</div>
<div class="is-flex is-align-items-center mr-4">
<div class="bar-croisiere mr-1"></div>
<div class="">Croisiere</div>
</div>
<div class="is-flex is-align-items-center mr-4">
<div class="bar-creatif mr-1"></div>
<div>Creatif</div>
</div>
<div class="is-flex is-align-items-center mr-4">
<div class="bar-afond mr-1"></div>
<div class="">A fond</div>
</div>
</div>
<div class="logs">
<div class="is-flex is-flex-wrap-wrap"> <div class="is-flex is-flex-wrap-wrap">
<% @mood_log.each do |week| %> <% @mood_log.each do |week| %>
<div class="is-flex is-flex-direction-column is-flex-wrap-wrap mb-3"> <div class="is-flex is-flex-direction-column is-flex-wrap-wrap mb-3">
<div class="is-size-7 day">
<% day = Date.parse(week.first[0]) %>
<% if day.day < 8 && day.monday? %>
<%= l(day, format: "%b") %>
<% end %>
</div>
<% week.each do |d| %> <% week.each do |d| %>
<% day = Date.parse(d[0]) %>
<% if d[1] %> <% if d[1] %>
<div data-image="<%= asset_path(d[1] + ".jpg") %>" data-mode="<%= d[1] %>" data-day="<%= d[0] %>" data-action="click->mood#updateDayInfo mouseover->mood#updateDayInfo mouseleave->mood#updateDayInfo" title="<%= d[0] %> : <%= d[1] %>" class="day <%= d[1] %>"></div> <div data-image="<%= asset_path(d[1] + ".jpg") %>" data-mode="<%= d[1] %>" data-day="<%= d[0] %>" data-action="mouseover->mood#updateDayInfo mouseleave->mood#updateDayInfo" title="<%= d[0] %> : <%= d[1] %>" class="day <%= d[1] %>"></div>
<% else %> <% else %>
<div class="day"></div> <div class="day"></div>
<% end %> <% end %>
@ -59,6 +20,27 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="level m-auto">
<div class="level-item has-text-centered">
<span class="bar-frigo"></span>
<div class="bar-explain">Triste</div>
</div>
<div class="level-item has-text-centered">
<span class="bar-en-charge"></span>
<div class="bar-explain">En charge</div>
</div>
<div class="level-item has-text-centered">
<span class="bar-croisiere"></span>
<div class="bar-explain">Croisiere</div>
</div>
<div class="level-item has-text-centered">
<span class="bar-creatif"></span>
<div class="bar-explain">Créatif</div>
</div>
<div class="level-item has-text-centered">
<span class="bar-afond"></span>
<div class="bar-explain">A fond</div>
</div>
</div> </div>
</section> </section>
</main> </main>

View file

@ -16,10 +16,12 @@ module Moodie
# Common ones are `templates`, `generators`, or `middleware`, for example. # Common ones are `templates`, `generators`, or `middleware`, for example.
config.autoload_lib(ignore: %w[assets tasks]) config.autoload_lib(ignore: %w[assets tasks])
# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
# in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)" # config.time_zone = "Central Time (US & Canada)"
config.time_zone = "Europe/Paris"
config.i18n.default_locale = :fr
I18n.available_locales = [ :fr, :en ]
# config.eager_load_paths << Rails.root.join("extras") # config.eager_load_paths << Rails.root.join("extras")
end end
end end