From 539dcfc9d866f6f178bec3a7aa7069509f15a17b Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 30 Dec 2020 18:25:46 +0100 Subject: [PATCH] Cleaning up the navbar for small screens --- src/app/app.component.html | 35 +++++++++++++++++++++++++---------- src/app/app.component.scss | 26 ++++++++++++++++++++++---- src/app/app.component.ts | 2 +- 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index e80cf042..96ea298b 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,24 +1,23 @@ @@ -50,3 +56,12 @@
+ + +
+ + diff --git a/src/app/app.component.scss b/src/app/app.component.scss index 773b520e..563cb751 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -17,6 +17,11 @@ { outline: none; + @include media-breakpoint-down(sm) + { + text-align: center; + } + > a { outline: none; @@ -51,14 +56,24 @@ } } -.navbar-brand:hover +.navbar-brand { - color: var(--accentColor); + &:hover + { + color: var(--accentColor); + } + + @media (max-width: 350px) + { + display: none; + } } .searchbar { border-radius: 30px; + display: flex !important; + flex-flow: row-reverse nowrap; > input { @@ -69,13 +84,14 @@ border-bottom: 1px solid #cfcfcf; width: 0; padding: 0; + max-width: 20rem; transition: width 0.4s ease-in-out; &:focus, &.searching { - width: 12rem; + width: 100%; - @include media-breakpoint-up(sm) + @include media-breakpoint-up(md) { width: 20rem; } @@ -93,12 +109,14 @@ input::-webkit-search-cancel-button padding: 8px; display: inline-block; opacity: 0.7; + outline: none; &:host-context(.hoverEnabled) &:hover { cursor: pointer; opacity: 1; } + } .profilePicture diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c3a9600b..82a798e4 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -76,7 +76,7 @@ export class AppComponent { event.target.classList.add("searching"); this.router.navigate(["/search", query], { - replaceUrl: true + replaceUrl: this.router.url.startsWith("/search") }); } else