X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fsass%2Finclude%2F_miniature.scss;h=070aa339868d397915d8fb95e9eb202b45f887b9;hb=c27463a603186b623500b03c6a56b330a6568350;hp=c937a0f72c3fc7e44f559d0afcb91311efcd8518;hpb=c2a89b70ce75c4955cbdb1ced6fd20a5010a8c9b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/sass/include/_miniature.scss b/client/src/sass/include/_miniature.scss index c937a0f72..070aa3398 100644 --- a/client/src/sass/include/_miniature.scss +++ b/client/src/sass/include/_miniature.scss @@ -3,12 +3,11 @@ @mixin miniature-name { @include ellipsis-multiline(1.1em, 2); + @include peertube-word-wrap(false); transition: color 0.2s; font-weight: $font-semibold; - color: var(--mainForegroundColor); - margin-top: 10px; - margin-bottom: 5px; + color: pvar(--mainForegroundColor); &:hover { text-decoration: none; @@ -20,20 +19,20 @@ } } -$play-overlay-transition: 0.2s ease; -$play-overlay-height: 26px; -$play-overlay-width: 18px; - @mixin miniature-thumbnail { + $play-overlay-transition: 0.2s ease; + $play-overlay-height: 26px; + $play-overlay-width: 18px; + @include disable-outline; display: flex; flex-direction: column; position: relative; border-radius: 3px; + width: 100%; + height: 100%; overflow: hidden; - width: $video-thumbnail-width; - height: $video-thumbnail-height; background-color: #ececec; transition: filter $play-overlay-transition; @@ -47,23 +46,13 @@ $play-overlay-width: 18px; opacity: 0; background-color: rgba(0, 0, 0, 0.3); - &, .icon { + &, + .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,7 @@ $play-overlay-width: 18px; } &.focus-visible { - box-shadow: #{$focus-box-shadow-form} var(--mainColorLightest); + box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest); outline: none; } @@ -90,7 +79,7 @@ $play-overlay-width: 18px; &.blur-filter { filter: blur(20px); - transform : scale(1.03); + transform: scale(1.03); } } } @@ -108,145 +97,61 @@ $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-bottom: 10px; - width: 100%; - height: calc(100% / #{$video-thumbnail-ratio}); - border-radius: 0; - - img { - width: 100%; - height: 100%; - } - } - } -} - -@mixin miniature-rows { - &:first-child { - padding-top: 30px; - - .section-title { - border-top: none !important; - } - } +// Use margin by default, or padding if $margin is false +@mixin grid-videos-miniature-margins ($margin: true, $min-margin: 0) { + --gridVideosMiniatureMargins: #{pvar(--videosHorizontalMarginContent)}; - my-video-miniature { - text-align: left; + @if $margin { + margin-left: var(--gridVideosMiniatureMargins) !important; + margin-right: var(--gridVideosMiniatureMargins) !important; + } @else { + padding-left: var(--gridVideosMiniatureMargins) !important; + padding-right: var(--gridVideosMiniatureMargins) !important; } - .section-title { - font-size: 24px; - font-weight: $font-semibold; - padding-top: 15px; - margin-bottom: 15px; - display: flex; - justify-content: space-between; - border-top: 1px solid $separator-border-color; - - a { - &:hover, &:focus:not(.focus-visible), &:active { - text-decoration: none; - outline: none; - } + @media screen and (max-width: $mobile-view) { + --gridVideosMiniatureMargins: #{$min-margin}; - color: var(--mainForegroundColor); - } + width: auto; } +} - &.channel { - .section-title { - a { - display: flex; - width: fit-content; - align-items: center; - - img { - @include avatar(28px); +@mixin grid-videos-miniature-layout { + @include grid-videos-miniature-margins; + + @media screen and (min-width: $mobile-view) { + .videos, + .playlists { + --miniatureMinWidth: #{$video-thumbnail-width - 25px}; + --miniatureMaxWidth: #{$video-thumbnail-width}; + + display: grid; + column-gap: 30px; + grid-template-columns: repeat( + auto-fill, + minmax(var(--miniatureMinWidth), 1fr) + ); + + .video-wrapper, + .playlist-wrapper { + margin: 0 auto; + width: 100%; - margin-right: 8px; + my-video-miniature, + my-video-playlist-miniature { + display: block; + min-width: var(--miniatureMinWidth); + max-width: var(--miniatureMaxWidth); } } - .followers { - color: $grey-foreground-color; - font-weight: normal; - font-size: 14px; - margin-left: 10px; - position: relative; - top: 2px; + @media screen and (min-width: #{breakpoint(xm)}) { + column-gap: 15px; } - } - } - - .show-more { - position: relative; - top: -5px; - display: inline-block; - font-size: 16px; - text-transform: uppercase; - color: $grey-foreground-color; - 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; - } - } -} -@mixin adapt-margin-content-width { - width: $video-miniature-width * 6; - margin: auto !important; - - @media screen and (max-width: 1800px) { - width: $video-miniature-width * 5; - } - - @media screen and (max-width: 1800px - $video-miniature-width) { - width: $video-miniature-width * 4; - } - - @media screen and (max-width: 1800px - (2* $video-miniature-width)) { - width: $video-miniature-width * 3; - } - - @media screen and (max-width: 1800px - (3* $video-miniature-width)) { - width: $video-miniature-width * 2; - } - - @media screen and (max-width: $mobile-view) { - width: auto; - margin: 0 !important; - - .videos { - @include video-miniature-small-screen; + @media screen and (min-width: #{breakpoint(fhd)}) { + column-gap: 2%; + } } } }