Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Responsive search

Chocobozzz4429a4a6e730
diff --git a/client/src/app/+search/search.component.html b/client/src/app/+search/search.component.html
index 74c6839e1d..65d4b6ecd6 100644
--- a/client/src/app/+search/search.component.html
+++ b/client/src/app/+search/search.component.html
@@ -33,11 +33,11 @@
<ng-container *ngFor="let result of results">
<div *ngIf="isVideoChannel(result)" class="entry video-channel">
- <a *ngIf="!isExternalChannelUrl()" [routerLink]="getChannelUrl(result)">
+ <a class="link-avatar" *ngIf="!isExternalChannelUrl()" [routerLink]="getChannelUrl(result)">
<img [src]="result.avatarUrl" alt="Avatar" />
</a>
- <a *ngIf="isExternalChannelUrl()" [href]="getChannelUrl(result)" target="_blank">
+ <a class="link-avatar" *ngIf="isExternalChannelUrl()" [href]="getChannelUrl(result)" target="_blank">
<img [src]="result.avatarUrl" alt="Avatar" />
</a>
diff --git a/client/src/app/+search/search.component.scss b/client/src/app/+search/search.component.scss
index d25fdd31da..39eaadb35e 100644
--- a/client/src/app/+search/search.component.scss
+++ b/client/src/app/+search/search.component.scss
@@ -1,159 +1,121 @@
@import '_variables';
@import '_mixins';
+@mixin build-channel-img-size ($video-img-width) {
+ $image-size: min(130px, $video-img-width);
+ $margin-size: ($video-img-width - $image-size) / 2; // So we have the same width than the video miniature
+
+ @include channel-avatar($image-size);
+
+ margin: 0 $margin-size 0 $margin-size;
+}
+
.search-result {
padding: 40px;
+}
- .results-header {
- font-size: 16px;
- padding-bottom: 20px;
- margin-bottom: 30px;
- border-bottom: 1px solid #DADADA;
+.results-header {
+ font-size: 16px;
+ padding-bottom: 20px;
+ margin-bottom: 30px;
+ border-bottom: 1px solid #DADADA;
- .first-line {
- display: flex;
- flex-direction: row;
+ .first-line {
+ display: flex;
+ flex-direction: row;
- .results-counter {
- flex-grow: 1;
+ .results-counter {
+ flex-grow: 1;
- .search-value {
- font-weight: $font-semibold;
- }
+ .search-value {
+ font-weight: $font-semibold;
}
+ }
- .results-filter-button {
- cursor: pointer;
+ .results-filter-button {
+ cursor: pointer;
- .icon.icon-filter {
- @include icon(20px);
+ .icon.icon-filter {
+ @include icon(20px);
- position: relative;
- top: -1px;
- margin-right: 5px;
- background-image: url('../../assets/images/feather/filter.svg');
- }
+ position: relative;
+ top: -1px;
+ margin-right: 5px;
+ background-image: url('../../assets/images/feather/filter.svg');
}
}
}
+}
- .entry {
- display: flex;
- min-height: 130px;
- padding-bottom: 20px;
- margin-bottom: 20px;
+.entry {
+ display: flex;
+ margin-bottom: 40px;
+}
- &.video-channel {
- img {
- $image-size: 130px;
- $margin-size: ($video-thumbnail-width - $image-size) / 2; // So we have the same width than the video miniature
+.video-channel {
+ img {
+ @include build-channel-img-size($video-thumbnail-width);
+ }
+}
- @include channel-avatar($image-size);
+.video-channel-info {
+ flex-grow: 1;
+ margin: 0 10px;
+ width: fit-content;
+}
- margin: 0 ($margin-size + 10) 0 $margin-size;
- }
+.video-channel-names {
+ @include disable-default-a-behaviour;
- .video-channel-info {
- flex-grow: 1;
- width: fit-content;
-
- .video-channel-names {
- @include disable-default-a-behaviour;
-
- display: flex;
- align-items: baseline;
- color: pvar(--mainForegroundColor);
- width: fit-content;
-
- .video-channel-display-name {
- font-weight: $font-semibold;
- font-size: 18px;
- }
-
- .video-channel-name {
- font-size: 14px;
- color: $grey-actor-name;
- margin-left: 5px;
- }
- }
- }
- }
- }
+ display: flex;
+ align-items: baseline;
+ color: pvar(--mainForegroundColor);
+ width: fit-content;
}
-@media screen and (min-width: $small-view) and (max-width: breakpoint(xl)) {
- .video-channel-info .video-channel-names {
- flex-direction: column !important;
+.video-channel-display-name {
+ font-weight: $font-semibold;
+ font-size: $video-miniature-row-name-font-size;
+}
- .video-channel-name {
- @include ellipsis; // Ellipsis and max-width on channel-name to not break screen
+.video-channel-name {
+ font-size: $video-miniature-row-info-font-size;
+ color: pvar(--greyForegroundColor);
+ margin-left: 5px;
+}
- max-width: 250px;
- margin-left: 0 !important;
- }
- }
+// Use the same breakpoints than in video-miniature
+@include on-small-main-col {
+ .video-channel {
+ display: grid;
+ grid-template-columns: auto 1fr;
+ grid-template-rows: auto auto;
- :host-context(.main-col:not(.expanded)) {
- // Override the min-width: 500px to not break screen
- ::ng-deep .video-miniature-information {
- min-width: 300px !important;
+ .link-avatar {
+ grid-column: 1;
+ grid-row: 1 / -1;
}
- }
-}
-@media screen and (min-width: $small-view) and (max-width: breakpoint(lg)) {
- :host-context(.main-col:not(.expanded)) {
- .video-channel-info .video-channel-names {
- .video-channel-name {
- max-width: 160px;
- }
+ img {
+ @include build-channel-img-size($video-thumbnail-medium-width);
}
+ }
- // Override the min-width: 500px to not break screen
- ::ng-deep .video-miniature-information {
- min-width: $video-thumbnail-width !important;
- }
+ .video-channel-info {
+ grid-column: 2;
+ grid-row: 1;
}
- :host-context(.expanded) {
- // Override the min-width: 500px to not break screen
- ::ng-deep .video-miniature-information {
- min-width: 300px !important;
- }
+ my-subscribe-button {
+ grid-column: 2;
+ grid-row: 2;
+ align-self: end;
}
}
-@media screen and (max-width: $small-view) {
- .search-result {
- .entry.video-channel,
- .entry.video {
- flex-direction: column;
- height: auto;
- justify-content: center;
- align-items: center;
- text-align: center;
-
- img {
- margin: 0;
- }
-
- img {
- margin: 0;
- }
-
- .video-channel-info .video-channel-names {
- align-items: center;
- flex-direction: column !important;
-
- .video-channel-name {
- margin-left: 0 !important;
- }
- }
-
- my-subscribe-button {
- margin-top: 5px;
- }
- }
+@include on-mobile-main-col {
+ .video-channel img {
+ @include build-channel-img-size($video-thumbnail-small-width);
}
}
@@ -164,28 +126,13 @@
.results-header {
font-size: 15px !important;
}
+ }
- .entry {
- &.video {
- .video-info-name,
- .video-info-account {
- margin: auto;
- }
-
- my-video-thumbnail {
- margin-right: 0 !important;
-
- ::ng-deep .video-thumbnail {
- width: 100%;
- height: auto;
-
- img {
- width: 100%;
- height: auto;
- }
- }
- }
- }
- }
+ .video-channel-display-name {
+ font-size: $video-miniature-row-mobile-name-font-size;
+ }
+
+ .video-channel-name {
+ font-size: $video-miniature-row-mobile-info-font-size;
}
}
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.scss b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss
index 39d6e97c9d..1b50f32907 100644
--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.scss
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss
@@ -105,7 +105,6 @@ $more-button-width: 40px;
width: 100%;
}
-
.video-miniature-name {
margin-top: 10px;
margin-bottom: 5px;
@@ -169,13 +168,13 @@ $more-button-width: 40px;
}
.video-miniature-name {
- @include ellipsis-multiline(1.3em, 2);
+ @include ellipsis-multiline($video-miniature-row-name-font-size, 2);
}
.video-miniature-created-at-views,
.video-miniature-account,
.video-miniature-channel {
- font-size: 14px;
+ font-size: $video-miniature-row-info-font-size;
}
.video-actions {
@@ -196,13 +195,13 @@ $more-button-width: 40px;
--rowThumbnailHeight: #{$video-thumbnail-small-height};
.video-miniature-name {
- font-size: 14px;
+ font-size: $video-miniature-row-info-font-size;
}
.video-miniature-created-at-views,
.video-miniature-account,
.video-miniature-channel {
- font-size: 12px;
+ font-size: $video-miniature-row-mobile-info-font-size;
}
}
}
diff --git a/client/src/sass/include/_variables.scss b/client/src/sass/include/_variables.scss
index 4c9a79621e..c451febdc7 100644
--- a/client/src/sass/include/_variables.scss
+++ b/client/src/sass/include/_variables.scss
@@ -60,6 +60,13 @@ $footer-margin: 30px;
$separator-border-color: rgba(0, 0, 0, 0.10);
$video-miniature-margin-bottom: 15px;
+
+$video-miniature-row-name-font-size: 1.3em;
+$video-miniature-row-mobile-name-font-size: 14px;
+
+$video-miniature-row-info-font-size: 14px;
+$video-miniature-row-mobile-info-font-size: 12px;
+
$video-thumbnail-height: 153px;
$video-thumbnail-width: 280px;
$video-thumbnail-medium-height: 114px;