X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fsass%2Finclude%2F_miniature.scss;h=457a7151cd8ba3945d82f710ff757f6409998f37;hb=218f730c7bceda5511d46f26191e7b1726c9ffd3;hp=56126d41f9e91950bf87b01a5f7b15374c6dadd1;hpb=6eb62c33908025d877a28f1cfbc527c511ae3103;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/sass/include/_miniature.scss b/client/src/sass/include/_miniature.scss index 56126d41f..457a7151c 100644 --- a/client/src/sass/include/_miniature.scss +++ b/client/src/sass/include/_miniature.scss @@ -6,7 +6,7 @@ transition: color 0.2s; font-weight: $font-semibold; - color: var(--mainForegroundColor); + color: pvar(--mainForegroundColor); margin-top: 10px; margin-bottom: 5px; @@ -45,25 +45,14 @@ $play-overlay-width: 18px; width: inherit; height: inherit; opacity: 0; - background-color: rgba(0, 0, 0, 0.7); + background-color: rgba(0, 0, 0, 0.3); &, .icon { transition: all $play-overlay-transition; } .icon { - width: 0; - height: 0; - - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%, -50%) scale(0.5); - - border-top: ($play-overlay-height / 2) solid transparent; - border-bottom: ($play-overlay-height / 2) solid transparent; - - border-left: $play-overlay-width solid rgba(255, 255, 255, 0.95); + @include play-icon($play-overlay-width, $play-overlay-height); } } @@ -80,7 +69,8 @@ $play-overlay-width: 18px; } &.focus-visible { - box-shadow: 0 0 0 2px var(--mainColor); + box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest); + outline: none; } img { @@ -107,38 +97,6 @@ $play-overlay-width: 18px; color: #fff; } -@mixin video-miniature-small-screen { - text-align: center; - - ::ng-deep .video-miniature { - padding-right: 0; - height: auto; - width: 100%; - margin-bottom: 20px; - - .video-miniature-information { - width: 100% !important; - text-align: left; - - span { - width: 100%; - } - } - - .video-thumbnail { - margin: 0 -15px 10px -15px; - width: 100vw; - height: calc(100vw / #{$video-thumbnail-ratio}); - border-radius: 0; - - img { - width: 100%; - height: 100%; - } - } - } -} - @mixin miniature-rows { &:first-child { padding-top: 30px; @@ -148,10 +106,6 @@ $play-overlay-width: 18px; } } - my-video-miniature { - text-align: left; - } - .section-title { font-size: 24px; font-weight: $font-semibold; @@ -159,7 +113,10 @@ $play-overlay-width: 18px; margin-bottom: 15px; display: flex; justify-content: space-between; - border-top: 1px solid $separator-border-color; + + &:not(h2) { + border-top: 1px solid $separator-border-color; + } a { &:hover, &:focus:not(.focus-visible), &:active { @@ -167,7 +124,7 @@ $play-overlay-width: 18px; outline: none; } - color: var(--mainForegroundColor); + color: pvar(--mainForegroundColor); } } @@ -179,14 +136,14 @@ $play-overlay-width: 18px; align-items: center; img { - @include avatar(28px); + @include channel-avatar(28px); margin-right: 8px; } } .followers { - color: $grey-foreground-color; + color: pvar(--greyForegroundColor); font-weight: normal; font-size: 14px; margin-left: 10px; @@ -202,49 +159,113 @@ $play-overlay-width: 18px; display: inline-block; font-size: 16px; text-transform: uppercase; - color: $grey-foreground-color; + color: pvar(--greyForegroundColor); margin-bottom: 10px; font-weight: $font-semibold; + text-decoration: none; } @media screen and (max-width: $mobile-view) { max-height: initial; overflow: initial; - @include video-miniature-small-screen; - .section-title { font-size: 17px; + margin-left: 10px; } } } -@mixin adapt-margin-content-width { - width: $video-miniature-width * 6; - margin: auto !important; - - @media screen and (max-width: 1800px) { - width: $video-miniature-width * 5; +// Use margin by default, or padding if $margin is false +@mixin fluid-videos-miniature-margins ($margin: true, $min-margin: 0) { + @if $margin { + margin-left: $not-expanded-horizontal-margins !important; + margin-right: $not-expanded-horizontal-margins !important; + } @else { + padding-left: $not-expanded-horizontal-margins !important; + padding-right: $not-expanded-horizontal-margins !important; } - @media screen and (max-width: 1800px - $video-miniature-width) { - width: $video-miniature-width * 4; - } + @media screen and (max-width: $mobile-view) { + width: auto; - @media screen and (max-width: 1800px - (2* $video-miniature-width)) { - width: $video-miniature-width * 3; + @if $margin { + margin: $min-margin !important; + } @else { + padding: $min-margin !important; + } } - @media screen and (max-width: 1800px - (3* $video-miniature-width)) { - width: $video-miniature-width * 2; + @media screen and (min-width: #{breakpoint(fhd)}) { + @if $margin { + margin-left: 6vw !important; + margin-right: 6vw !important; + } @else { + padding-left: 6vw !important; + padding-right: 6vw !important; + } } +} - @media screen and (max-width: 500px) { - width: auto; - margin: 0 !important; +@mixin fluid-videos-miniature-layout { + @include fluid-videos-miniature-margins; + @media screen and (max-width: $mobile-view) { .videos { - @include video-miniature-small-screen; + text-align: center; + + ::ng-deep .video-miniature { + padding-right: 0; + height: auto; + width: 100%; + margin-bottom: 25px; + + .video-miniature-information { + width: 100% !important; + text-align: left; + + span { + width: 100%; + } + } + + .video-thumbnail { + border-radius: 0; + } + } + } + } + + @media screen and (min-width: $mobile-view) { + .videos { + --miniature-min-width: #{$video-thumbnail-width - 15px}; + --miniature-max-width: #{$video-thumbnail-width}; + + display: grid; + column-gap: 5px; + grid-template-columns: repeat( + auto-fill, + minmax( + var(--miniature-min-width), + 1fr + ) + ); + + @media screen and (min-width: #{breakpoint(fhd)}) { + column-gap: 1%; + --miniature-min-width: #{$video-thumbnail-width}; + } + + .video-wrapper { + margin: 0 auto; + width: 100%; + + my-video-miniature { + display: block; + min-width: var(--miniature-min-width); + max-width: var(--miniature-max-width); + } + } } } }