]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Refactor menu css
authorChocobozzz <me@florianbigard.com>
Thu, 15 Apr 2021 11:43:50 +0000 (13:43 +0200)
committerChocobozzz <me@florianbigard.com>
Thu, 15 Apr 2021 11:43:50 +0000 (13:43 +0200)
client/src/app/+login/login.component.scss
client/src/app/header/search-typeahead.component.scss
client/src/app/menu/menu.component.html
client/src/app/menu/menu.component.scss
client/src/app/shared/shared-thumbnail/video-thumbnail.component.scss
client/src/app/shared/shared-video-miniature/video-miniature.component.html
client/src/app/shared/shared-video-miniature/video-miniature.component.scss

index f605cbb7a06583092d6f04a96ffe5d2f8c6add12..eddaff542364fdaa3ab4358c9ac08353c813b1e4 100644 (file)
@@ -21,13 +21,6 @@ input[type=email] {
   }
 }
 
-.modal-footer.inputs {
-  .action-button.action-button-cancel {
-    width: auto !important;
-    display: inline-block;
-  }
-}
-
 @media screen and (max-width: #{map-get($container-max-widths, sm)}) {
   .modal-body {
     #forgot-password-email {
@@ -35,10 +28,8 @@ input[type=email] {
     }
   }
 
-  .modal-footer.inputs {
-    .action-button.action-button-cancel {
-      display: none;
-    }
+  .modal-footer .grey-button {
+    display: none;
   }
 }
 
index a60aa38d6924edcb4fab5fbfc3b4e6c93c3d5296..c754a99d1811e5b64842df32cd1c94385df4fb0e 100644 (file)
@@ -5,6 +5,7 @@
 
 #search-video {
   @include peertube-input-text($search-input-width);
+
   padding-left: 10px;
   padding-right: 40px; // For the search icon
   font-size: 14px;
@@ -14,7 +15,7 @@
   }
 }
 
-.icon.icon-search {
+.icon-search {
   @include icon(25px);
   height: 18px;
 
index a0777660f818d1b963310fa648f458549a6e71b6..df5c7971d3d1d33eee4bd864f2f00aba52975891 100644 (file)
 
               <a ngbDropdownItem ngbDropdownToggle class="dropdown-item settings-sensitive" routerLink="/my-account/settings"
                 fragment="video-sensitive-content-policy" #settingsSensitiveContentPolicy
-                (click)="onActiveLinkScrollToAnchor(settingsSensitiveContentPolicy)">
-                <my-global-icon class="hover-display-toggle" [ngClass]="{ 'not-displayed': user.nsfwPolicy === 'display' }" iconName="sensitive" aria-hidden="true"></my-global-icon>
-                <my-global-icon class="hover-display-toggle" [ngClass]="{ 'not-displayed': user.nsfwPolicy !== 'display' }" iconName="unsensitive" aria-hidden="true"></my-global-icon>
+                (click)="onActiveLinkScrollToAnchor(settingsSensitiveContentPolicy)"
+              >
+                <my-global-icon class="hover-display-toggle" [hidden]="user.nsfwPolicy === 'display'" iconName="sensitive" aria-hidden="true"></my-global-icon>
+                <my-global-icon class="hover-display-toggle" [hidden]="user.nsfwPolicy !== 'display'" iconName="unsensitive" aria-hidden="true"></my-global-icon>
                 <span i18n>Sensitive:</span>
                 <span class="ml-auto text-muted">{{ nsfwPolicy }}</span>
               </a>
         </div>
 
         <div class="logged-in-menu">
-          <a routerLink="/my-account" routerLinkActive="active" #settingsLink (click)="onActiveLinkScrollToAnchor(settingsLink)">
+          <a class="menu-link" routerLink="/my-account" routerLinkActive="active" #settingsLink (click)="onActiveLinkScrollToAnchor(settingsLink)">
             <my-global-icon iconName="user" aria-hidden="true"></my-global-icon>
             <ng-container i18n>My account</ng-container>
           </a>
 
-          <a routerLink="/my-library" routerLinkActive="active" #libraryLink (click)="onActiveLinkScrollToAnchor(libraryLink)">
+          <a class="menu-link" routerLink="/my-library" routerLinkActive="active" #libraryLink (click)="onActiveLinkScrollToAnchor(libraryLink)">
             <my-global-icon iconName="channel" aria-hidden="true"></my-global-icon>
             <ng-container i18n>My library</ng-container>
           </a>
 
-          <a *ngIf="userHasAdminAccess" [routerLink]="getFirstAdminRouteAvailable()" routerLinkActive="active">
+          <a class="menu-link" *ngIf="userHasAdminAccess" [routerLink]="getFirstAdminRouteAvailable()" routerLinkActive="active">
             <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
             <ng-container i18n>Administration</ng-container>
           </a>
       </div>
 
       <div *ngIf="!isLoggedIn" class="login-buttons-block">
-        <a i18n routerLink="/login" class="login-button">Login</a>
-        <a i18n *ngIf="isRegistrationAllowed()" routerLink="/signup" class="create-account-button">Create an account</a>
+        <a i18n routerLink="/login" class="peertube-button-link orange-button">Login</a>
+        <a i18n *ngIf="isRegistrationAllowed()" routerLink="/signup" class="peertube-button-link">Create an account</a>
       </div>
 
       <div *ngIf="isLoggedIn" class="in-my-library">
         <div i18n class="block-title">IN MY LIBRARY</div>
 
-        <a *ngIf="user.canSeeVideosLink" routerLink="/my-library/videos" routerLinkActive="active">
+        <a *ngIf="user.canSeeVideosLink" class="menu-link" routerLink="/my-library/videos" routerLinkActive="active">
           <my-global-icon iconName="videos" aria-hidden="true"></my-global-icon>
           <ng-container i18n>Videos</ng-container>
         </a>
 
-        <a routerLink="/my-library/video-playlists" routerLinkActive="active">
+        <a class="menu-link" routerLink="/my-library/video-playlists" routerLinkActive="active">
           <my-global-icon iconName="playlists" aria-hidden="true"></my-global-icon>
           <ng-container i18n>Playlists</ng-container>
         </a>
 
-        <a routerLink="/videos/subscriptions" routerLinkActive="active">
+        <a class="menu-link" routerLink="/videos/subscriptions" routerLinkActive="active">
           <my-global-icon iconName="subscriptions" aria-hidden="true"></my-global-icon>
           <ng-container i18n>Subscriptions</ng-container>
         </a>
 
-        <a routerLink="/my-library/history/videos" routerLinkActive="active">
+        <a class="menu-link" routerLink="/my-library/history/videos" routerLinkActive="active">
           <my-global-icon iconName="history" aria-hidden="true"></my-global-icon>
           <ng-container i18n>History</ng-container>
         </a>
       <div class="on-instance">
         <div i18n class="block-title">ON {{instanceName}}</div>
 
-        <a routerLink="/videos/overview" routerLinkActive="active">
+        <a class="menu-link" routerLink="/videos/overview" routerLinkActive="active">
           <my-global-icon iconName="globe" aria-hidden="true"></my-global-icon>
           <ng-container i18n>Discover</ng-container>
         </a>
 
-        <a routerLink="/videos/trending" routerLinkActive="active">
+        <a class="menu-link" routerLink="/videos/trending" routerLinkActive="active">
           <my-global-icon iconName="trending" aria-hidden="true"></my-global-icon>
           <ng-container i18n>Trending</ng-container>
         </a>
 
-        <a routerLink="/videos/recently-added" routerLinkActive="active">
+        <a class="menu-link" routerLink="/videos/recently-added" routerLinkActive="active">
           <my-global-icon iconName="recently-added" aria-hidden="true"></my-global-icon>
           <ng-container i18n>Recently added</ng-container>
         </a>
 
-        <a routerLink="/videos/local" routerLinkActive="active">
+        <a class="menu-link" routerLink="/videos/local" routerLinkActive="active">
           <my-global-icon iconName="home" aria-hidden="true"></my-global-icon>
           <ng-container i18n>Local videos</ng-container>
         </a>
 
     <div class="footer">
       <div class="footer-block">
-        <a *ngIf="!isLoggedIn" (click)="openQuickSettings()">
+        <a *ngIf="!isLoggedIn" class="menu-link" (click)="openQuickSettings()">
           <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
           <ng-container i18n>My settings</ng-container>
         </a>
 
-        <a routerLink="/about" routerLinkActive="active">
+        <a class="menu-link" routerLink="/about" routerLinkActive="active">
           <my-global-icon iconName="help" aria-hidden="true"></my-global-icon>
           <ng-container i18n>About</ng-container>
         </a>
       </div>
 
-      <div class="bottom-links">
+      <div class="footer-bottom">
 
         <div class="footer-links">
           <div *ngIf="isLoggedIn === false">
index 729dbc6ee529a1a7195550ba43aaa49921a9f088..00d1a1f69c2c9d9c3c60d649bf432b301f5c15ce 100644 (file)
@@ -5,7 +5,9 @@ $menu-link-icon-size: 22px;
 $menu-link-icon-margin-right: 18px;
 $footer-links-base-opacity: .8;
 
-@mixin menu-link {
+.menu-link {
+  @include disable-default-a-behaviour;
+
   display: flex;
   align-items: center;
   padding-left: $menu-lateral-padding;
@@ -91,32 +93,15 @@ menu {
     display: flex;
     align-items: center;
     justify-content: left;
-
-    my-notification {
-      margin-left: auto;
-      margin-right: 15px;
-    }
   }
 }
 
-.logged-in-more {
-  $main-radius: 25px;
-
-  flex: 1;
-  margin-left: 13px;
-  border-radius: $main-radius;
-  transition: all .1s ease-in-out;
-  cursor: pointer;
-
-  *, & {
-    line-height: 1;
-  }
-
-  &.show {
-    background-color: rgba(255, 255, 255, 0.20);
-    box-shadow: inset 0 3px 5px rgba(0, 0, 0, .325);
-  }
+my-notification {
+  margin-left: auto;
+  margin-right: 15px;
+}
 
+.logged-in-more {
   @mixin display-hints($is-mobile: false) {
     background-color: rgba(255, 255, 255, 0.15);
 
@@ -130,6 +115,20 @@ menu {
     }
   }
 
+  $main-radius: 25px;
+
+  flex: 1;
+  margin-left: 13px;
+  border-radius: $main-radius;
+  transition: all .1s ease-in-out;
+  cursor: pointer;
+  line-height: 1;
+
+  &.show {
+    background-color: rgba(255, 255, 255, 0.20);
+    box-shadow: inset 0 3px 5px rgba(0, 0, 0, .325);
+  }
+
   &:hover {
     @include display-hints;
   }
@@ -140,13 +139,14 @@ menu {
 
     /* fill space when on mobile */
     max-width: calc(100% - 80px);
+
     .dropdown-toggle {
       max-width: 100%;
     }
+
     .logged-in-info {
       max-width: calc(100% - 45px) !important;
     }
-
   }
 
   .dropdown-toggle-indicator {
@@ -175,35 +175,35 @@ menu {
     padding: 5px 7px;
     border-radius: $main-radius;
   }
+}
 
-  my-account-avatar {
-    margin-right: 10px;
-  }
+my-account-avatar {
+  margin-right: 10px;
 }
 
 .logged-in-info {
   max-width: 105px;
 
   flex-grow: 1;
+}
 
-  .logged-in-display-name,
-  .logged-in-username {
-    @include ellipsis;
-  }
+.logged-in-display-name,
+.logged-in-username {
+  @include ellipsis;
+}
 
-  .logged-in-display-name {
-    font-size: 16px;
-    font-weight: $font-semibold;
-    color: pvar(--menuForegroundColor);
+.logged-in-display-name {
+  font-size: 16px;
+  font-weight: $font-semibold;
+  color: pvar(--menuForegroundColor);
 
-    @include disable-default-a-behaviour;
-  }
+  @include disable-default-a-behaviour;
+}
 
-  .logged-in-username {
-    font-size: 13px;
-    color: #C6C6C6;
-    margin-top: 3px;
-  }
+.logged-in-username {
+  font-size: 13px;
+  color: #C6C6C6;
+  margin-top: 3px;
 }
 
 .logged-in-menu {
@@ -214,9 +214,6 @@ menu {
   line-height: $line-height-normal;
 
   a {
-    @include menu-link;
-    @include disable-default-a-behaviour;
-
     $icon-size: 13px;
     $additional-margin: ($menu-link-icon-size - $icon-size) / 2;
 
@@ -230,10 +227,6 @@ menu {
 
       // Keep aligned with other icons
       margin-left: $additional-margin;
-
-      &[iconName="channel"] {
-        margin-top: -2px;
-      }
     }
 
     &.active,
@@ -260,27 +253,22 @@ menu {
 .login-buttons-block {
   margin: 30px 25px 35px 25px;
 
-  .login-button {
-    @include peertube-button-link;
-    @include orange-button;
-
+  > a {
     display: block;
     width: 100%;
-    margin-bottom: 10px;
-  }
 
-  .create-account-button {
-    @include peertube-button-link;
-
-    display: block;
-    width: 100%;
+    :not(:last-child) {
+      margin-bottom: 10px;
+    }
+  }
+}
 
-    color: #fff;
-    background-color: rgba(255, 255, 255, 0.25);
+.create-account-button {
+  color: #fff;
+  background-color: rgba(255, 255, 255, 0.25);
 
-    &:hover {
-      background-color: rgba(255, 255, 255, 0.28);
-    }
+  &:hover {
+    background-color: rgba(255, 255, 255, 0.28);
   }
 }
 
@@ -290,48 +278,30 @@ menu {
   margin-bottom: 15px;
 
   .block-title {
+    @include ellipsis;
+
     text-transform: uppercase;
     font-weight: $font-bold; // Bold
     font-size: 13px;
     margin-bottom: 25px;
     margin-left: 26px;
-
-    @include ellipsis;
-
     margin-right: 30px;
   }
 
   a {
-    @include menu-link;
-    @include disable-default-a-behaviour;
-
     min-height: 40px;
-
-    my-global-icon {
-      &[iconName="playlists"] {
-        height: 24px;
-        width: 24px;
-
-        margin-right: 16px;
-      }
-
-      &[iconName="videos"] {
-        position: relative;
-        right: -1px;
-      }
-    }
   }
 }
 
 .footer {
   width: $menu-width;
   padding-bottom: 15px;
+}
 
-  .bottom-links {
-    display: flex;
-    flex-direction: column;
-    padding: 0 $menu-lateral-padding;
-  }
+.footer-bottom {
+  display: flex;
+  flex-direction: column;
+  padding: 0 $menu-lateral-padding;
 }
 
 .footer-links {
@@ -340,7 +310,8 @@ menu {
     flex-wrap: wrap;
   }
 
-  a, span[role=button] {
+  a,
+  span[role=button] {
     display: inline-block;
     text-decoration: none;
     color: pvar(--menuForegroundColor);
@@ -350,22 +321,6 @@ menu {
     font-weight: 500;
     line-height: 1.4rem;
     margin-right: 8px;
-
-    &.inline-global-icon {
-      display: inline-flex;
-      align-items: center;
-      white-space: nowrap;
-      height: 1.4rem;
-
-      my-global-icon {
-        @include apply-svg-color(pvar(--menuForegroundColor));
-
-        display: flex;
-        width: auto;
-        height: 90%;
-        margin-right: .2rem;
-      }
-    }
   }
 }
 
@@ -395,32 +350,13 @@ menu {
     opacity: .4;
   }
 
-  my-global-icon {
-    &[iconName="cog"],
-    &[iconName="sign-out"] {
-      position: relative;
-      right: -2px;
-      height: 20px;
-      width: 20px;
-    }
-  }
-
-  my-global-icon.not-displayed {
-    display: none;
-  }
-
   &:hover {
-    my-global-icon.hover-display-toggle.not-displayed {
-      display: inherit;
-    }
-    my-global-icon.hover-display-toggle {
+    .hover-display-toggle {
       display: none;
     }
 
-    &.settings-sensitive {
-      my-global-icon ::ng-deep svg {
-        margin-top: 2px !important;
-      }
+    .hover-display-toggle[hidden] {
+      display: inherit !important;
     }
   }
 }
@@ -440,7 +376,8 @@ menu {
     }
   }
 
-  .top-menu, .footer {
+  .top-menu,
+  .footer {
     width: 100% !important;
   }
 
@@ -448,9 +385,35 @@ menu {
     width: calc(100vw - 30px);
   }
 
-  .dropdown-item:hover, .dropdown-item:active {
+  .dropdown-item:hover,
+  .dropdown-item:active {
     &.settings-sensitive my-global-icon ::ng-deep svg {
       margin-top: 0px !important;
     }
   }
 }
+
+my-global-icon {
+  &[iconName="playlists"] {
+    height: 24px;
+    width: 24px;
+
+    margin-right: 16px;
+  }
+
+  &[iconName="videos"] {
+    position: relative;
+    right: -1px;
+  }
+
+  &[iconName="channel"] {
+    margin-top: -2px;
+  }
+
+  &[iconName="sign-out"] {
+    position: relative;
+    right: -2px;
+    height: 20px;
+    width: 20px;
+  }
+}
index 2b723a15aaec1fefecc4e701fc5ae074e3775705..ea59ab346b155193a287fdae239b37dd3578a054 100644 (file)
@@ -4,82 +4,82 @@
 
 .video-thumbnail {
   @include miniature-thumbnail;
+}
 
-  .progress-bar {
-    height: 3px;
-    width: 100%;
-    position: absolute;
-    bottom: 0;
-    background-color: rgba(0, 0, 0, 0.20);
+.progress-bar {
+  height: 3px;
+  width: 100%;
+  position: absolute;
+  bottom: 0;
+  background-color: rgba(0, 0, 0, 0.20);
 
-    div {
-      height: 100%;
-      background-color: pvar(--mainColor);
-    }
+  div {
+    height: 100%;
+    background-color: pvar(--mainColor);
   }
+}
 
-  .video-thumbnail-watch-later-overlay,
-  .video-thumbnail-label-overlay,
-  .video-thumbnail-duration-overlay,
-  .video-thumbnail-live-overlay {
-    @include static-thumbnail-overlay;
+.video-thumbnail-watch-later-overlay,
+.video-thumbnail-label-overlay,
+.video-thumbnail-duration-overlay,
+.video-thumbnail-live-overlay {
+  @include static-thumbnail-overlay;
 
-    border-radius: 3px;
-    font-size: 12px;
-    font-weight: $font-semibold;
-    line-height: 1.1;
-    z-index: z(miniature);
-  }
+  border-radius: 3px;
+  font-size: 12px;
+  font-weight: $font-semibold;
+  line-height: 1.1;
+  z-index: z(miniature);
+}
 
-  .video-thumbnail-label-overlay {
-    position: absolute;
-    padding: 0 5px;
-    left: 5px;
-    top: 5px;
-    font-weight: $font-bold;
+.video-thumbnail-label-overlay {
+  position: absolute;
+  padding: 0 5px;
+  left: 5px;
+  top: 5px;
+  font-weight: $font-bold;
 
-    &.warning { background-color: orange; }
-    &.danger { background-color: red; }
-  }
+  &.warning { background-color: orange; }
+  &.danger { background-color: red; }
+}
 
-  .video-thumbnail-duration-overlay,
-  .video-thumbnail-live-overlay {
-    position: absolute;
-    padding: 0 3px;
-    right: 5px;
-    bottom: 5px;
-  }
+.video-thumbnail-duration-overlay,
+.video-thumbnail-live-overlay {
+  position: absolute;
+  padding: 0 3px;
+  right: 5px;
+  bottom: 5px;
+}
 
-  .video-thumbnail-live-overlay {
-    font-weight: $font-semibold;
-    color: #fff;
+.video-thumbnail-live-overlay {
+  font-weight: $font-semibold;
+  color: #fff;
 
-    &:not(.live-ended) {
-      background-color: rgba(224, 8, 8, 0.7);
-    }
+  &:not(.live-ended) {
+    background-color: rgba(224, 8, 8, 0.7);
   }
+}
 
-  .video-thumbnail-actions-overlay {
-    position: absolute;
-    display: flex;
-    flex-direction: column;
-    right: 5px;
-    top: 5px;
-    opacity: 0;
+.video-thumbnail-actions-overlay {
+  position: absolute;
+  display: flex;
+  flex-direction: column;
+  right: 5px;
+  top: 5px;
+  opacity: 0;
 
-    div:not(:first-child) {
-      margin-top: 2px;
-    }
+  div:not(:first-child) {
+    margin-top: 2px;
+  }
+}
 
-    .video-thumbnail-watch-later-overlay {
-      padding: 3px;
+.video-thumbnail-watch-later-overlay {
+  padding: 3px;
 
-      my-global-icon {
-        width: 22px;
-        height: 22px;
+  my-global-icon {
+    width: 22px;
+    height: 22px;
 
-        @include apply-svg-color(#fff);
-      }
-    }
+    @include apply-svg-color(#fff);
   }
 }
index 9c11e7609c5d7da5cca303d7d082fcf58b8dc704..bc19127aaf5759b0f421df0cde49bb4c052406d2 100644 (file)
   <div class="video-bottom">
     <div class="video-miniature-information">
       <div class="d-flex video-miniature-meta">
-        <a *ngIf="displayOptions.avatar && displayOwnerVideoChannel()" class="avatar" [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle">
-          <img [src]="getAvatarUrl()" alt="" class="channel" />
+        <a *ngIf="displayOptions.avatar && displayOwnerVideoChannel()" class="channel-avatar" [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle">
+          <img [src]="getAvatarUrl()" alt="" />
         </a>
-        <my-account-avatar *ngIf="displayOptions.avatar && displayOwnerAccount()" [account]="video.account" size="40" [internalHref]="'/video-channels/' + video.byVideoChannel" [title]="channelLinkTitle"></my-account-avatar>
+
+        <my-account-avatar
+          *ngIf="displayOptions.avatar && displayOwnerAccount()" [title]="channelLinkTitle"
+          [account]="video.account" size="40" [internalHref]="'/video-channels/' + video.byVideoChannel"
+        ></my-account-avatar>
 
         <div class="w-100 d-flex flex-column">
           <a *ngIf="!videoHref" tabindex="-1" class="video-miniature-name"
index bf52b870c6b05cb3233686ecc2bd1db37f1ed95e..f6f2925f03c035d621273b4fffd42a7373ee2492 100644 (file)
@@ -13,12 +13,12 @@ $more-button-width: 40px;
 }
 
 my-account-avatar,
-.avatar {
+.channel-avatar {
   margin: 10px 10px 0 0;
+}
 
-  img.channel {
-    @include channel-avatar(40px);
-  }
+.channel-avatar img{
+  @include channel-avatar(40px);
 }
 
 .video-miniature-created-at-views {
@@ -78,9 +78,9 @@ my-account-avatar,
   }
 }
 
-.video-miniature {
-  &:hover ::ng-deep .video-thumbnail-actions-overlay,
-  &:hover .video-actions ::ng-deep .dropdown-root {
+.video-miniature:hover {
+  ::ng-deep .video-thumbnail-actions-overlay,
+  .video-actions ::ng-deep .dropdown-root {
     opacity: 1 !important;
   }
 }
@@ -153,7 +153,7 @@ my-account-avatar,
   }
 
   // We don't display avatar in row mode
-  .avatar {
+  .channel-avatar {
     display: none;
   }