From 3eeeb87fe62fab3e48455f53c8a725b49878b9b3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 1 May 2017 18:05:28 +0200 Subject: 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 ++ client/src/app/core/menu/menu-admin.component.scss | 39 -------------- client/src/app/core/menu/menu-admin.component.ts | 2 +- client/src/app/core/menu/menu.component.scss | 50 +++++++++++++++++ client/src/app/core/menu/menu.component.ts | 2 +- .../videos/video-watch/video-watch.component.html | 16 +++--- .../videos/video-watch/video-watch.component.scss | 53 ++++++++++++++++++ 9 files changed, 181 insertions(+), 54 deletions(-) delete mode 100644 client/src/app/core/menu/menu-admin.component.scss create mode 100644 client/src/app/core/menu/menu.component.scss (limited to 'client/src/app') 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.scss b/client/src/app/core/menu/menu-admin.component.scss deleted file mode 100644 index 5881475f1..000000000 --- a/client/src/app/core/menu/menu-admin.component.scss +++ /dev/null @@ -1,39 +0,0 @@ -menu { - background-color: $black-background; - padding: 25px; - margin: 0; - height: 100%; - - .panel-block { - margin-bottom: 15px; - } - - .block-title { - text-transform: uppercase; - font-weight: bold; - color: $menu-color-block; - margin-bottom: 10px; - } - - a { - display: block; - margin-left: 5px; - height: 30px; - color: $menu-color-link; - cursor: pointer; - transition: color 0.3s; - - &:hover, &:focus { - text-decoration: none !important; - outline: none !important; - } - - .glyphicon { - margin-right: 15px; - } - - &:hover, &.active { - color: #fff; - } - } -} 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.component.scss b/client/src/app/core/menu/menu.component.scss new file mode 100644 index 000000000..38a6b95b6 --- /dev/null +++ b/client/src/app/core/menu/menu.component.scss @@ -0,0 +1,50 @@ +menu { + background-color: $black-background; + 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; + } + + .block-title { + text-transform: uppercase; + font-weight: bold; + color: $menu-color-block; + margin-bottom: 10px; + } + + a { + display: block; + margin-left: 5px; + height: 30px; + color: $menu-color-link; + cursor: pointer; + transition: color 0.3s; + + &:hover, &:focus { + text-decoration: none !important; + outline: none !important; + } + + .glyphicon { + margin-right: 15px; + } + + &:hover, &.active { + color: #fff; + } + } +} 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; + } + } + } + } } -- cgit v1.2.3