Client: try to be responsive
authorChocobozzz <florian.bigard@gmail.com>
Mon, 1 May 2017 16:05:28 +0000 (18:05 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Mon, 1 May 2017 16:16:50 +0000 (18:16 +0200)
client/src/app/app.component.html
client/src/app/app.component.scss
client/src/app/app.component.ts
client/src/app/core/menu/menu-admin.component.scss [deleted file]
client/src/app/core/menu/menu-admin.component.ts
client/src/app/core/menu/menu.component.scss [new file with mode: 0644]
client/src/app/core/menu/menu.component.ts
client/src/app/videos/video-watch/video-watch.component.html
client/src/app/videos/video-watch/video-watch.component.scss
client/src/sass/application.scss

index a1e38cdb1016c78ad575df936959e843da2d3fa7..df0ec5a5dfdcf5cb6b431ae190e4169ce82592e4 100644 (file)
@@ -2,11 +2,11 @@
   <div class="row header">
 
     <div class="col-md-2 col-sm-3 col-xs-3 top-left-block" [ngClass]="{ 'border-bottom': isMenuDisplayed === false }">
-      <div class="hamburger-block">
-        <span (click)="toggleMenu()" class="glyphicon glyphicon-menu-hamburger"></span>
+      <div class="hamburger-block" (click)="toggleMenu()">
+        <span class="glyphicon glyphicon-menu-hamburger"></span>
       </div>
 
-      <div id="peertube-title" class="title-menu-left-block header">
+      <div id="peertube-title">
         <a [routerLink]="['/videos/list']" title="Homepage"></a>
       </div>
     </div>
index f5da651b2ae9113dbbc428ab037c50190bcaa37b..68fadbe7c0c68908336b67daf5a8c8907a37cd80 100644 (file)
     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;
         }
       }
     }
+
+    @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 {
index a6eb4cd2e7582ec2cab7a4578c8884155c77c09d..b8b7321695ff5642931c936a204b42c1525d4b67 100644 (file)
@@ -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 (file)
index 5881475..0000000
+++ /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;
-    }
-  }
-}
index a3d920fdda27b05bdfe2862127867b3cdb152171..236161fce81523b8f2e5344193a516e37559b334 100644 (file)
@@ -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 (file)
index 0000000..38a6b95
--- /dev/null
@@ -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;
+    }
+  }
+}
index e2b9987478f56f92f0923b054db247d02cf9eee2..5ab8bf46440194be7c0e9a38726cf31dadca7cd0 100644 (file)
@@ -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;
index 5e758401eb52b0cc3ef64243b74be7d06d4a2a27..13f6719bb30c06eb1f70e4b5a21cf5652e4dc9ee 100644 (file)
 
 <div *ngIf="video !== null" id="video-info">
   <div class="row video-name-views">
-    <div class="col-md-8 video-name">
+    <div class="col-xs-8 col-md-8 video-name">
       {{ video.name }}
     </div>
 
-    <div class="col-md-4 pull-right video-views">
+    <div class="col-xs-4 col-md-4 pull-right video-views">
       {{ video.views}} views
     </div>
   </div>
 
   <div class="row video-small-blocks">
-    <div class="col-md-3 video-small-block video-small-block-author">
+    <div class="col-xs-5 col-xs-3 col-md-3 video-small-block video-small-block-author">
       <a title="Access to all videos of this user" [routerLink]="['/videos/list', { field: 'author', search: video.author }]">
         {{ video.by }}
       </a>
     </div>
 
-    <div class="col-md-3 video-small-block video-small-block-share">
+    <div class="col-xs-2 col-md-3 video-small-block video-small-block-share">
       <a class="option" (click)="showShareModal()" title="Share the video">
         <span class="glyphicon glyphicon-share"></span>
         <span class="video-small-block-text">Share</span>
       </a>
     </div>
 
-    <div class="col-md-3 video-small-block video-small-block-more">
+    <div class="col-xs-2 col-md-3 video-small-block video-small-block-more">
       <div class="video-small-block-dropdown" dropdown dropup="true" placement="right">
         <a class="option" title="Access to more options" dropdownToggle>
           <span class="glyphicon glyphicon-option-horizontal"></span>
@@ -94,7 +94,7 @@
       </div>
     </div>
 
-    <div class="col-md-3 video-small-block video-small-block-rating">
+    <div class="col-xs-3 col-md-3 video-small-block video-small-block-rating">
       <div class="video-small-block-like">
         <span
           class="glyphicon glyphicon-thumbs-up" title="Like this video"
   </div>
 
   <div class="row video-details">
-    <div class="video-details-date-description col-md-9">
+    <div class="video-details-date-description col-xs-8 col-md-9">
       <div class="video-details-date">
         Published on {{ video.createdAt | date:'short' }}
       </div>
       </div>
     </div>
 
-    <div class="video-details-attributes col-md-3">
+    <div class="video-details-attributes col-xs-4 col-md-3">
       <div class="video-details-attribute">
         <span class="video-details-attribute-label">
           Category:
index 8d8454cfdc38fc9f2766b4972f7dcf530057e0f3..767a3ed4ebcf196c445844ec227f514daf83cefb 100644 (file)
@@ -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;
       }
     }
   }
+
+  @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;
+        }
+      }
+    }
+  }
 }
index db23afd0d0acd6eef4f21ac08982d26f3b2a78c7..fa5b564b709c8e47e0815be401e0ec56915ed0fd 100644 (file)
@@ -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;
     }