-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from mihaiborbea/improve-responsive-design
Improve responsive design
- Loading branch information
Showing
15 changed files
with
261 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
mat-sidenav-container, | ||
mat-sidenav-content, | ||
mat-sidenav { | ||
height: 100%; | ||
height: 100vh; | ||
} | ||
mat-sidenav { | ||
width: 250px; | ||
} | ||
main { | ||
padding: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,68 @@ | ||
<mat-toolbar color="primary"> | ||
<div fxHide.gt-xs *ngIf="isAuthenticated"> | ||
<button mat-icon-button (click)="onToggleSidenav()"> | ||
<mat-icon>menu</mat-icon> | ||
</button> | ||
</div> | ||
<div class="navbar-brand"> | ||
<a routerLink="/"> | ||
<img | ||
src="../../../assets/logo/brand-logo-mono-white.png" | ||
class="brand-logo" | ||
/> | ||
</a> | ||
</div> | ||
<div fxFlex fxLayout fxLayoutAlign="start" fxHide.xs> | ||
<ul fxLayout fxLayoutGap="15px" class="navigation-items"> | ||
<li routerLinkActive="active" *ngIf="isAuthenticated"> | ||
<a routerLink="/recipes">My Recipes</a> | ||
</li> | ||
<li routerLinkActive="active" *ngIf="isAuthenticated"> | ||
<a routerLink="/shopping-list">Shopping List</a> | ||
</li> | ||
</ul> | ||
</div> | ||
<div fxFlex fxLayout fxLayoutAlign="end" fxHide.xs *ngIf="isAuthenticated"> | ||
<button mat-icon-button [matMenuTriggerFor]="menu"> | ||
<mat-icon>more_vert</mat-icon> | ||
</button> | ||
<mat-menu #menu="matMenu"> | ||
<button mat-menu-item (click)="$event.stopPropagation()"> | ||
<app-theme-switch></app-theme-switch> | ||
<div | ||
fxLayout="row" | ||
fxLayoutAlign.xs="start center" | ||
fxLayoutAlign="center center" | ||
fxFlexFill | ||
class="full-width" | ||
> | ||
<div | ||
fxFlex="10" | ||
fxLayoutAlign="start center" | ||
fxHide.gt-xs | ||
*ngIf="isAuthenticated" | ||
> | ||
<button mat-icon-button (click)="onToggleSidenav()"> | ||
<mat-icon>menu</mat-icon> | ||
</button> | ||
<button mat-menu-item (click)="onLogout()"> | ||
<span>Logout</span> | ||
</div> | ||
<div | ||
fxFlex.lt-sm="90" | ||
fxFlex.xs="10" | ||
fxLayoutAlign="start center" | ||
class="navbar-brand" | ||
> | ||
<a routerLink="/"> | ||
<img | ||
src="../../../assets/logo/brand-logo-mono-white.png" | ||
class="brand-logo" | ||
/> | ||
</a> | ||
</div> | ||
<div | ||
fxFlex="80" | ||
fxLayoutAlign.lt-xl="start center" | ||
fxLayoutAlign.xl="center center" | ||
fxHide.xs | ||
> | ||
<ul fxLayout fxLayoutGap="15px" class="navigation-items"> | ||
<li *ngIf="isAuthenticated"> | ||
<a routerLink="/recipes" routerLinkActive="active">My Recipes</a> | ||
</li> | ||
<li *ngIf="isAuthenticated"> | ||
<a routerLink="/shopping-list" routerLinkActive="active" | ||
>Shopping List</a | ||
> | ||
</li> | ||
</ul> | ||
</div> | ||
<div | ||
fxFlex="10" | ||
fxLayoutAlign="end center" | ||
fxHide.xs | ||
*ngIf="isAuthenticated" | ||
> | ||
<button mat-icon-button [matMenuTriggerFor]="menu"> | ||
<mat-icon>more_vert</mat-icon> | ||
</button> | ||
</mat-menu> | ||
<mat-menu #menu="matMenu"> | ||
<button mat-menu-item (click)="$event.stopPropagation()"> | ||
<app-theme-switch></app-theme-switch> | ||
</button> | ||
<button mat-menu-item (click)="onLogout()"> | ||
<span>Logout</span> | ||
</button> | ||
</mat-menu> | ||
</div> | ||
</div> | ||
</mat-toolbar> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 45 additions & 43 deletions
88
src/app/recipes/recipe-detail/recipe-detail.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,52 @@ | ||
<div fxLayout="row"> | ||
<div fxLayout="column" fxFlex="80" fxFlex.lt-md="100"> | ||
<h1>{{ recipe.name }}</h1> | ||
<div class="container"> | ||
<div fxLayout="row"> | ||
<div fxLayout="column" fxFlexFill fxFlex.lt-md="100"> | ||
<h1>{{ recipe.name }}</h1> | ||
</div> | ||
</div> | ||
</div> | ||
<div fxLayout="row"> | ||
<div fxLayout="column" fxFlexFill class="img-canvas"> | ||
<img [src]="recipe.imagePath" alt="" [ngClass.gt-sm]="'img-fluid'" /> | ||
<div fxLayout="row"> | ||
<div fxLayout="column" fxFlexFill class="img-canvas"> | ||
<img [src]="recipe.imagePath" alt="" [ngClass.gt-sm]="'img-fluid'" /> | ||
</div> | ||
</div> | ||
</div> | ||
<div fxLayout="row"> | ||
<div fxLayout="column"> | ||
<button | ||
mat-raised-button | ||
color="primary" | ||
type="button" | ||
[matMenuTriggerFor]="recipeMenu" | ||
> | ||
Manage Recipe <mat-icon>expand_more</mat-icon> | ||
</button> | ||
<mat-menu #recipeMenu="matMenu"> | ||
<button mat-menu-item (click)="onAddToShoppingList()"> | ||
<span>Add to Shopping List</span> | ||
</button> | ||
<button mat-menu-item (click)="onEditRecipe()"> | ||
<span>Edit Recipe</span> | ||
<div fxLayout="row"> | ||
<div fxLayout="column"> | ||
<button | ||
mat-raised-button | ||
color="primary" | ||
type="button" | ||
[matMenuTriggerFor]="recipeMenu" | ||
> | ||
Manage Recipe <mat-icon>expand_more</mat-icon> | ||
</button> | ||
<button mat-menu-item (click)="onDeleteRecipe()"> | ||
<span>Delete Recipe</span> | ||
</button> | ||
</mat-menu> | ||
<mat-menu #recipeMenu="matMenu"> | ||
<button mat-menu-item (click)="onAddToShoppingList()"> | ||
<span>Add to Shopping List</span> | ||
</button> | ||
<button mat-menu-item (click)="onEditRecipe()"> | ||
<span>Edit Recipe</span> | ||
</button> | ||
<button mat-menu-item (click)="onDeleteRecipe()"> | ||
<span>Delete Recipe</span> | ||
</button> | ||
</mat-menu> | ||
</div> | ||
</div> | ||
</div> | ||
<br /> | ||
<div fxLayout="row"> | ||
<div fxLayout="column" fxFlex="80" fxFlex.lt-md="100"> | ||
<p>{{ recipe.description }}</p> | ||
<br /> | ||
<div fxLayout="row"> | ||
<div fxLayout="column" fxFlexFill fxFlex.lt-md="100"> | ||
<p>{{ recipe.description }}</p> | ||
</div> | ||
</div> | ||
</div> | ||
<br /> | ||
<div fxLayout="row"> | ||
<div fxLayout="column" fxFlex="80" fxFlex.lt-md="100"> | ||
<mat-list> | ||
<mat-list-item *ngFor="let ingredient of recipe.ingredients"> | ||
{{ ingredient.name }} - {{ ingredient.amount }} | ||
<mat-divider></mat-divider> | ||
</mat-list-item> | ||
</mat-list> | ||
<br /> | ||
<div fxLayout="row"> | ||
<div fxLayout="column" fxFlexFill fxFlex.lt-md="100"> | ||
<mat-list> | ||
<mat-list-item *ngFor="let ingredient of recipe.ingredients"> | ||
{{ ingredient.name }} - {{ ingredient.amount }} | ||
<mat-divider></mat-divider> | ||
</mat-list-item> | ||
</mat-list> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
.img-fluid { | ||
max-width: 80%; | ||
max-width: 100%; | ||
} | ||
|
||
.img-canvas { | ||
margin-bottom: 15px; | ||
} | ||
|
||
.container { | ||
padding-bottom: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,5 +24,9 @@ mat-divider { | |
} | ||
|
||
.img-fluid { | ||
max-width: 80%; | ||
max-width: 100%; | ||
} | ||
|
||
.container { | ||
padding-bottom: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
<div fxLayout.gt-sm="row" fxLayout.lt-md="column" fxLayoutGap="30px"> | ||
<div fxLayout="column" fxFlexFill fxFlex.gt-sm="40" [fxHide.lt-md]="hideList"> | ||
<app-recipe-list></app-recipe-list> | ||
</div> | ||
<div | ||
fxLayout.gt-sm="row" | ||
fxLayoutAlign.gt-sm="center start" | ||
fxLayoutAlign.lt-md="center center" | ||
fxLayout.lt-md="column" | ||
fxLayoutGap="30px" | ||
class="container" | ||
> | ||
<div | ||
fxLayout="column" | ||
fxLayoutAlign="start start" | ||
fxHide | ||
[fxShow.lt-md]="hideList" | ||
[fxHide.lt-md]="hideList" | ||
[ngClass.lt-md]="'full-width'" | ||
class="list-container" | ||
> | ||
<app-recipe-list></app-recipe-list> | ||
</div> | ||
<div fxLayout="column" fxFlexAlign="start" fxHide [fxShow.lt-md]="hideList"> | ||
<button mat-icon-button color="accent" routerLink="/recipes"> | ||
<mat-icon>arrow_back</mat-icon> Back | ||
</button> | ||
</div> | ||
<div fxLayout="column" fxFlexFill fxFlex.gt-sm="60"> | ||
<div | ||
fxLayout="column" | ||
[ngClass.lt-md]="'full-width'" | ||
class="detail-container" | ||
> | ||
<router-outlet></router-outlet> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.container { | ||
margin: 0 25px 25px 25px; | ||
} | ||
|
||
.list-container { | ||
width: 40%; | ||
max-width: 640px; | ||
} | ||
|
||
.detail-container { | ||
width: 60%; | ||
max-width: 960px; | ||
} | ||
|
||
.full-width { | ||
width: 100% !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.