diff --git a/src/app/vote-choice/vote-choice.component.html b/src/app/vote-choice/vote-choice.component.html index aee7a1b8..b6ac1c0d 100644 --- a/src/app/vote-choice/vote-choice.component.html +++ b/src/app/vote-choice/vote-choice.component.html @@ -1,5 +1,4 @@
-
{{choice.date | date:'EEE'}} {{choice.date | date:'dd'}} {{choice.date | date:'LLL'}} @@ -21,22 +20,48 @@
-
-
+
Choix ayant reçu le plus de votes
- - -
- -
\ No newline at end of file +
\ No newline at end of file diff --git a/src/app/vote-choice/vote-choice.component.scss b/src/app/vote-choice/vote-choice.component.scss index b28c4636..9e520d3b 100644 --- a/src/app/vote-choice/vote-choice.component.scss +++ b/src/app/vote-choice/vote-choice.component.scss @@ -12,13 +12,13 @@ // -- VARIABLES // ---------------------------- -$box-padding: 2rem; -$box-border-width: .6rem; -$btn-size: 5rem; -$btn-margin-x: 1rem; -$btn-margin-y: 1.5rem; -$btn-wrap-size: calc(2 * #{$btn-size} + 4 * #{$btn-margin-x}); -$breakpoint-responsive: 640px; // à définir +$box-padding : 2rem; +$box-border-width : .6rem; +$btn-size : 5rem; +$btn-margin-x : 1rem; +$btn-margin-y : 1.5rem; +$btn-wrap-size : calc(2 * #{$btn-size} + 4 * #{$btn-margin-x}); +$breakpoint-responsive : 640px; // à définir @@ -31,7 +31,7 @@ $breakpoint-responsive: 640px; // à définir padding: $box-padding $box-padding $box-padding calc(#{$box-padding} - #{$box-border-width}); border-left: $box-border-width solid transparent; background-color: $white; - box-shadow: 0 .3rem .6rem 0 rgba($black, .2); + box-shadow: 0 0 .6rem 0 rgba($black, .2); &--active { padding-left: $box-padding; border-left-color: $primary_color; @@ -83,6 +83,7 @@ $breakpoint-responsive: 640px; // à définir .choicebox__actions { position: absolute; + z-index: 1; display: flex; max-width: $btn-wrap-size; top: 50%; @@ -141,24 +142,121 @@ $breakpoint-responsive: 640px; // à définir // ---------------------------- .choicebox__count { + position: relative; padding-right: $btn-wrap-size; - @media (min-width: $breakpoint-responsive) { + text-align: right; padding-right: 0; } } +.choicebox__votes { + border: 0; + padding: 0; + line-height: normal; + @media (min-width: $breakpoint-responsive) { + padding: 1.5rem; + &:focus, + &:hover, + &:active { + & .choicebox__tooltip { + display: flex; + } + } + } +} + .choicebox__vote { display: inline-block; vertical-align: middle; - margin-right: 3rem; + & + .choicebox__vote { + margin-left: 1.5rem; + } } .choicebox__countxt { display: none; margin-top: .5rem; - color: $primary_color; .choicebox--active & { display: block; + @media (min-width: $breakpoint-responsive) { + display: none; + } } -} \ No newline at end of file +} + + + +// -- TOOLTIP +// ---------------------------- + +.choicebox__tooltip { + display: none; + @media (min-width: $breakpoint-responsive) { + position: absolute; + min-width: 18rem; + font-weight: normal; + top: 5rem; + left: 50%; + z-index: 1; + padding: 2rem; + border: .1rem solid rgba($black, .1); + background-color: $white; + text-align: left; + transform: translateX(-50%); + &::after, + &::before { + position: absolute; + width: 0; + height: 0; + bottom: 100%; + left: 50%; + content: " "; + pointer-events: none; + border: solid transparent; + } + &::after { + margin-left: -1.5rem; + border-width: 1.5rem; + border-color: rgba($white, 0); + border-bottom-color: #fff; + } + &::before { + margin-left: -1.6rem; + border-width: 1.6rem; + border-color: rgba($black, 0); + border-bottom-color: rgba($black, .1); + } + ul { + margin: 0; + padding: 0; + list-style: none; + } + } +} + +.choicebox__tooltiplist { + & + .choicebox__tooltiplist { + padding-left: 3rem; + } + ul { + max-height: 15rem; + overflow: scroll; + } +} + +.choicebox__tooltipttl { + @media (min-width: $breakpoint-responsive) { + margin-bottom: 1rem; + font-size: 1.6rem; + font-weight: bold; + white-space: nowrap; + img { + margin-right: .5rem; + vertical-align: sub; + } + & ~ .choicebox__tooltipttl { + margin-top: 3rem; + } + } +}