From 3eeeb87fe62fab3e48455f53c8a725b49878b9b3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 1 May 2017 18:05:28 +0200 Subject: [PATCH] Client: try to be responsive --- client/src/app/app.component.html | 6 +- client/src/app/app.component.scss | 62 ++++++++++++++++++- client/src/app/app.component.ts | 5 ++ .../src/app/core/menu/menu-admin.component.ts | 2 +- ...min.component.scss => menu.component.scss} | 13 +++- client/src/app/core/menu/menu.component.ts | 2 +- .../video-watch/video-watch.component.html | 16 ++--- .../video-watch/video-watch.component.scss | 53 ++++++++++++++++ client/src/sass/application.scss | 4 ++ 9 files changed, 147 insertions(+), 16 deletions(-) rename client/src/app/core/menu/{menu-admin.component.scss => menu.component.scss} (73%) diff --git a/client/src/app/app.component.html b/client/src/app/app.component.html index a1e38cdb1..df0ec5a5d 100644 --- a/client/src/app/app.component.html +++ b/client/src/app/app.component.html @@ -2,11 +2,11 @@
-
- +
+
-
+
diff --git a/client/src/app/app.component.scss b/client/src/app/app.component.scss index f5da651b2..68fadbe7c 100644 --- a/client/src/app/app.component.scss +++ b/client/src/app/app.component.scss @@ -29,13 +29,14 @@ margin-bottom: 0; display: flex; position: fixed; + padding: 0; &.border-bottom { border-bottom: 1px solid $header-border-color; } .hamburger-block { - margin-right: 20px; + margin-right: 15px; margin-left: 15px; .glyphicon { @@ -53,9 +54,9 @@ background: url(/client/assets/logo.png) no-repeat; background-size: contain; background-position: center; - width: 180px; height: 100%; margin: auto; + width: 135px; &:hover { color: inherit !important; @@ -63,6 +64,63 @@ } } } + + @media screen and (max-width: 500px) { + #peertube-title { + display: none; + } + + .hamburger-block { + width: 100%; + text-align: center; + } + } + + @media screen and (min-width: 500px) and (max-width: 600px) { + #peertube-title a { + width: 80px; + } + } + + @media screen and (min-width: 600px) and (max-width: 700px) { + #peertube-title a { + width: 100px; + } + } + + @media screen and (min-width: 1000px) { + #peertube-title a { + width: 120px; + } + } + + @media screen and (min-width: 1000px) { + #peertube-title a { + width: 120px; + } + } + + @media screen and (min-width: 1200px) { + padding-left: 15px; + + .hamburger-block { + margin-right: 15px; + } + + #peertube-title a { + width: 135px; + } + } + + @media screen and (min-width: 1600px) { + .hamburger-block { + margin-right: 20px; + } + + #peertube-title a { + width: 180px; + } + } } my-search { diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index a6eb4cd2e..b8b732169 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -45,6 +45,11 @@ export class AppComponent implements OnInit { this.videoService.loadVideoCategories(); this.videoService.loadVideoLicences(); this.videoService.loadVideoLanguages(); + + // Do not display menu on small screens + if (window.innerWidth < 600) { + this.isMenuDisplayed = false; + } } isInAdmin() { diff --git a/client/src/app/core/menu/menu-admin.component.ts b/client/src/app/core/menu/menu-admin.component.ts index a3d920fdd..236161fce 100644 --- a/client/src/app/core/menu/menu-admin.component.ts +++ b/client/src/app/core/menu/menu-admin.component.ts @@ -3,6 +3,6 @@ import { Component } from '@angular/core'; @Component({ selector: 'my-menu-admin', templateUrl: './menu-admin.component.html', - styleUrls: [ './menu-admin.component.scss' ] + styleUrls: [ './menu.component.scss' ] }) export class MenuAdminComponent { } diff --git a/client/src/app/core/menu/menu-admin.component.scss b/client/src/app/core/menu/menu.component.scss similarity index 73% rename from client/src/app/core/menu/menu-admin.component.scss rename to client/src/app/core/menu/menu.component.scss index 5881475f1..38a6b95b6 100644 --- a/client/src/app/core/menu/menu-admin.component.scss +++ b/client/src/app/core/menu/menu.component.scss @@ -1,8 +1,19 @@ menu { background-color: $black-background; - padding: 25px; + padding: 15px; margin: 0; height: 100%; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + + @media screen and (max-width: 550px) { + font-size: 90%; + } + + @media screen and (min-width: 1200px) { + padding: 25px; + } .panel-block { margin-bottom: 15px; diff --git a/client/src/app/core/menu/menu.component.ts b/client/src/app/core/menu/menu.component.ts index e2b998747..5ab8bf464 100644 --- a/client/src/app/core/menu/menu.component.ts +++ b/client/src/app/core/menu/menu.component.ts @@ -7,7 +7,7 @@ import { ConfigService } from '../config'; @Component({ selector: 'my-menu', templateUrl: './menu.component.html', - styleUrls: [ './menu-admin.component.scss' ] + styleUrls: [ './menu.component.scss' ] }) export class MenuComponent implements OnInit { isLoggedIn: boolean; diff --git a/client/src/app/videos/video-watch/video-watch.component.html b/client/src/app/videos/video-watch/video-watch.component.html index 5e758401e..13f6719bb 100644 --- a/client/src/app/videos/video-watch/video-watch.component.html +++ b/client/src/app/videos/video-watch/video-watch.component.html @@ -30,30 +30,30 @@
-
+
{{ video.name }}
-
+
{{ video.views}} views
-
+ -
+ -
+ -
+
-
+
Published on {{ video.createdAt | date:'short' }}
@@ -130,7 +130,7 @@
-
+
Category: diff --git a/client/src/app/videos/video-watch/video-watch.component.scss b/client/src/app/videos/video-watch/video-watch.component.scss index 8d8454cfd..767a3ed4e 100644 --- a/client/src/app/videos/video-watch/video-watch.component.scss +++ b/client/src/app/videos/video-watch/video-watch.component.scss @@ -47,6 +47,7 @@ // Keep a symmetry with the video name padding-right: $video-watch-info-padding-left } + } .video-small-blocks { @@ -66,6 +67,9 @@ a { cursor: pointer; transition: color 0.3s; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; &, &:hover { color: inherit; @@ -181,4 +185,53 @@ } } } + + @media screen and (max-width: 400px) { + .video-name-views { + font-size: 16px !important; + } + } + + @media screen and (max-width: 800px) { + .video-name-views { + .video-name { + padding-left: 5px; + padding-right: 0px; + } + + .video-views { + padding-left: 0px; + padding-right: 5px; + } + } + + .video-small-blocks { + a, .video-small-block-text { + font-size: 13px !important; + } + + .glyphicon { + font-size: 18px !important; + } + + .video-small-block-author { + padding-left: 10px; + } + } + + .video-details { + .video-details-date-description { + padding-left: 10px; + font-size: 13px !important; + } + + .video-details-attributes { + font-size: 11px !important; + + .video-details-attribute-label { + width: 50px; + } + } + } + } } diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss index db23afd0d..fa5b564b7 100644 --- a/client/src/sass/application.scss +++ b/client/src/sass/application.scss @@ -26,6 +26,10 @@ input.readonly { .content-padding { padding: 15px 30px; + @media screen and (max-width: 800px) { + padding: 15px 10px; + } + @media screen and (min-width: 1400px) { padding: 15px 40px; } -- 2.41.0