Skip to content

Commit

Permalink
feat(mobile): vertical layout on mobile screens
Browse files Browse the repository at this point in the history
  • Loading branch information
4gray committed Sep 7, 2024
1 parent c862997 commit e977312
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ mat-nav-list {
height: calc(100vh - 120px);
}

@media only screen and (max-width: 480px) {
@media only screen and (max-width: 599px) {
.channel-name {
max-width: 100px;
}
Expand All @@ -76,4 +76,8 @@ mat-nav-list {
.tab-icon {
display: block;
}

.scroll-viewport {
min-height: calc(50vh - 159px);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@
width: 100%;
height: calc(100vh - 60px);
}


@media only screen and (max-width: 599px) {
#video-player {
width: 100%;
height: calc(50vh - 60px) !important;
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
<div id="playlists-navigation">
<div class="current-playlist">
<button mat-icon-button matTooltip="Back" (click)="goBack()">
<mat-icon>arrow_back_ios</mat-icon>
</button>
<div class="playlist-info">
<div class="name">
@if (sidebarView === 'CHANNELS') {
{{ playlistTitle$ | async }}
} @else {
{{ 'HOME.PLAYLISTS.MY_PLAYLISTS' | translate }}
}
</div>
<div class="channels-count">
{{
sidebarView === 'CHANNELS'
? channels?.length +
' ' +
('HOME.PLAYLISTS.CHANNELS' | translate)
: ('HOME.PLAYLISTS.MY_PLAYLISTS_SUBTITLE' | translate)
}}
<div class="left">
<button mat-icon-button matTooltip="Back" (click)="goBack()">
<mat-icon>arrow_back_ios</mat-icon>
</button>
<div class="playlist-info">
<div class="name">
@if (sidebarView === 'CHANNELS') {
{{ playlistTitle$ | async }}
} @else {
{{ 'HOME.PLAYLISTS.MY_PLAYLISTS' | translate }}
}
</div>
<div class="channels-count">
{{
sidebarView === 'CHANNELS'
? channels?.length +
' ' +
('HOME.PLAYLISTS.CHANNELS' | translate)
: ('HOME.PLAYLISTS.MY_PLAYLISTS_SUBTITLE'
| translate)
}}
</div>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@
display: flex;
align-items: center;
padding: 8px;
justify-content: space-between;

.left {
display: flex;
gap: 5px;
}
}

.playlist-info {
flex: 1;
max-width: 300px;


.name {
font-size: 1.1em;
overflow: hidden;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MatButtonModule } from '@angular/material/button';
import { MatDividerModule } from '@angular/material/divider';
import { MatIconModule } from '@angular/material/icon';
import { MatTooltipModule } from '@angular/material/tooltip';
import { Router } from '@angular/router';
import { Router, RouterLink } from '@angular/router';
import { Store } from '@ngrx/store';
import { TranslateModule } from '@ngx-translate/core';
import { Channel } from '../../../../../../shared/channel.interface';
Expand All @@ -29,6 +29,7 @@ import { ChannelListContainerComponent } from './../../channel-list-container/ch
NgIf,
RecentPlaylistsComponent,
TranslateModule,
RouterLink,
],
})
export class SidebarComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
mat-icon-button
(click)="toggleLeftDrawerClicked.emit()"
[matTooltip]="'TOP_MENU.OPEN_CHANNELS_LIST' | translate"
class="sidenav-toggle-button"
>
<mat-icon>menu</mat-icon>
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.spacer {
flex: 1 1 auto;
}

@media only screen and (max-width: 599px) {
.sidenav-toggle-button {
display: none;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<mat-drawer-container class="main-container">
<!-- sidebar content -->
<mat-drawer #drawer mode="side" opened disableClose>
<mat-drawer #drawer mode="side" opened disableClose class="mat-drawer">
@defer {
<app-sidebar [channels]="channels$ | async" />
} @loading {
Expand All @@ -9,7 +9,7 @@
<p>Loading...</p>
}
</mat-drawer>
<mat-drawer-content>
<mat-drawer-content class="drawer-content">
<ng-container *ngIf="activeChannel$ | async as activeChannel">
<!-- toolbar with drawer icon -->
<app-toolbar
Expand All @@ -34,9 +34,9 @@
src:
activeChannel?.url +
activeChannel?.epgParams,
type: 'application/x-mpegURL'
}
]
type: 'application/x-mpegURL',
},
],
}"
[class.hide-captions]="!playerSettings.showCaptions"
></app-vjs-player>
Expand Down
18 changes: 15 additions & 3 deletions src/app/player/components/video-player/video-player.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,23 @@
padding: 20px;
}

@media only screen and (max-width: 480px) {
@media only screen and (max-width: 599px) {
.main-container {
display: flex;
flex-direction: column-reverse;
}

.mat-drawer {
width: 200px;
min-width: 200px;
height: 50vh;
width: 100%;
position: unset;
}

.drawer-content {
height: 50vh;
margin-left: 0 !important;
}

}

@media (prefers-color-scheme: dark) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@
display: none;
}
}


@media only screen and (max-width: 599px) {
.video-js {
height: calc(50vh - 65px) !important;
}
}
18 changes: 18 additions & 0 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ html {

.mat-toolbar.mat-primary {
background: #000;
color: #b8b8b8;
}

.full-width {
Expand Down Expand Up @@ -114,3 +115,20 @@ textarea,
.mat-drawer-inner-container {
overflow: hidden !important;
}

@media only screen and (max-width: 599px) {
.cet-container {
.video-js {
height: calc(50vh - 70px) !important;
}

#video-player {
height: calc(50vh - 80px) !important;
}

.scroll-viewport {
min-height: calc(50vh - 159px) !important
}
}

}

0 comments on commit e977312

Please sign in to comment.