Skip to content

Commit

Permalink
Add resizing for navbar (CS3219-AY2425S1#65)
Browse files Browse the repository at this point in the history
* Adjust resizing for nav-bar

* Reduce size of logo and logo font
* Reduce padding of login and signup buttons
* Hide overflow on nav-bar
* Change vh to dvh for resizing based on mobile dynamic viewport

* Fix linting
  • Loading branch information
McNaBry authored Oct 29, 2024
1 parent 89cb0bb commit ee93410
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app/account/account.component.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.layout-container {
display: flex;
flex-direction: column;
min-height: calc(100vh - 80px);
min-height: calc(100dvh - 160px);
width: 100%;
justify-content: center;
align-items: center;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/matching/matching.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
justify-content: center;
align-items: center;
width: 100%;
min-height: calc(100vh - 160px);
min-height: calc(100dvh - 160px);
padding: 1rem;
}

Expand Down
13 changes: 9 additions & 4 deletions frontend/src/app/navigation-bar/navigation-bar.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
z-index: 100;
backdrop-filter: blur(10px);
justify-content: center;
align-items: center;
height: 80px;
width: 100%;
overflow: hidden;
}

:host ::ng-deep p-menubarsub {
Expand All @@ -24,6 +27,8 @@
background: transparent;
border: transparent;
color: white;
padding: 5px;
border-radius: 0.5rem;
}

a.fill-div {
Expand All @@ -38,14 +43,14 @@ a.fill-div {
font-family: "Poppins", sans-serif;
font-weight: 100;
font-style: normal;
}
}

.poppins-bold {
.poppins-bold {
font-family: "Poppins", sans-serif;
font-weight: 700;
font-style: normal;
}
}

p.logo-font-size {
font-size: 28px;
font-size: 1.5rem;
}
14 changes: 5 additions & 9 deletions frontend/src/app/navigation-bar/navigation-bar.component.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
<p-menubar>
<ng-template pTemplate="start">
<div class="pl-2 flex align-items-center" style="cursor: pointer" [routerLink]="['/matching']">
<img src="/logo.png" alt="logo" style="width: auto; height: 55px" />
<img src="/logo.png" alt="logo" style="width: auto; height: 35px" />
<p class="pl-2 mr-3 poppins-bold logo-font-size">PeerPrep</p>
</div>
</ng-template>
<ng-template pTemplate="end">
@if (user) {
<p-menu #menu [model]="items" [popup]="true" appendTo="body"></p-menu>
<p-button
[label]="user.username"
(onClick)="menu.toggle($event)"
icon="pi pi-user"
class="nav-dropdown"></p-button>
<p-button [label]="user.username" (onClick)="menu.toggle($event)" icon="pi pi-user" class="nav-dropdown" />
} @else {
<div class="flex flex-row gap-2">
<div class="flex flex-row gap-2 p-2">
<p-button
label="Login"
icon="pi pi-sign-in"
class="nav-dropdown min-w-max"
routerLink="account/login"></p-button>
routerLink="account/login" />
<p-button
label="Sign Up"
icon="pi pi-pen-to-square"
class="nav-dropdown min-w-max"
routerLink="/account/register"></p-button>
routerLink="/account/register" />
</div>
}
</ng-template>
Expand Down

0 comments on commit ee93410

Please sign in to comment.