X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fsass%2Finclude%2F_miniature.scss;h=eb77f2c3d44d5a289fd6a0c1c21173ee5914a186;hb=0c302acb3c358b4d4d8dee45aed1de1108ea37ea;hp=e4ed88d31d261984663c519870dd496fa3135a5e;hpb=dc8902634864841be7ca483b8e1c0f5afa609c32;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/sass/include/_miniature.scss b/client/src/sass/include/_miniature.scss index e4ed88d31..eb77f2c3d 100644 --- a/client/src/sass/include/_miniature.scss +++ b/client/src/sass/include/_miniature.scss @@ -1,39 +1,39 @@ -@import '_variables'; -@import '_mixins'; +@use '_variables' as *; +@use '_mixins' as *; @mixin miniature-name { - @include ellipsis-multiline(1.1em, 2); + @include peertube-word-wrap(false); + font-size: 1.1em; transition: color 0.2s; font-weight: $font-semibold; - color: var(--mainForegroundColor); - margin-top: 10px; - margin-bottom: 5px; + color: pvar(--mainForegroundColor); &:hover { text-decoration: none; } &.blur-filter { + @include padding-left(4px); + filter: blur(3px); - padding-left: 4px; } } -$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; @@ -45,25 +45,15 @@ $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 { + &, + .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 +70,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 { @@ -89,7 +80,7 @@ $play-overlay-width: 18px; &.blur-filter { filter: blur(20px); - transform : scale(1.03); + transform: scale(1.03); } } } @@ -107,147 +98,64 @@ $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; +// Use margin by default, or padding if $margin is false +@mixin grid-videos-miniature-margins ($margin: true, $min-margin: 0) { + --gridVideosMiniatureMargins: #{pvar(--videosHorizontalMarginContent)}; - img { - width: 100%; - height: 100%; - } - } + @if $margin { + @include margin-left(var(--gridVideosMiniatureMargins) !important); + @include margin-right(var(--gridVideosMiniatureMargins) !important); + } @else { + @include padding-left(var(--gridVideosMiniatureMargins) !important); + @include padding-right(var(--gridVideosMiniatureMargins) !important); } -} - -@mixin miniature-rows { - max-height: 540px; // 2 rows max - overflow: hidden; - - &:first-child { - padding-top: 30px; - .section-title { - border-top: none !important; - } - } - - my-video-miniature { - text-align: left; - } - - .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 { + @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; - } - @media screen and (max-width: $mobile-view) { - max-height: initial; - overflow: initial; - - @include video-miniature-small-screen; - - .section-title { - font-size: 17px; + @media screen and (min-width: #{breakpoint(fhd)}) { + column-gap: 2%; + } } } } -@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: 500px) { - width: auto; - margin: 0 !important; - - .videos { - @include video-miniature-small-screen; - } - } +@mixin grid-videos-miniature-layout-with-margins { + @include grid-videos-miniature-margins; + @include grid-videos-miniature-layout; }