-
Notifications
You must be signed in to change notification settings - Fork 0
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 #2 from keks-code/dev
- Loading branch information
Showing
18 changed files
with
214 additions
and
15 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
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
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<mat-sidenav-container | ||
class="layout-container" | ||
[class.sidenav-container--modal-drawer]="mobileQuery.matches"> | ||
<mat-sidenav | ||
#snav | ||
[mode]="mobileQuery.matches ? 'over' : 'side'" | ||
[fixedInViewport]="mobileQuery.matches" | ||
[opened]="!mobileQuery.matches"> | ||
<div class="sidenav-content-container"> | ||
<div class="pseudo-title sidenav-item" style="width: 80%"></div> | ||
<div class="pseudo-title sidenav-item" style="width: 70%"></div> | ||
<div class="pseudo-title sidenav-item" style="width: 75%"></div> | ||
<div class="pseudo-title sidenav-item" style="width: 55%"></div> | ||
<div class="pseudo-title sidenav-item" style="width: 65%"></div> | ||
|
||
<mat-divider></mat-divider> | ||
|
||
<div *ngFor="let nav of fillerNav" class="pseudo-title sidenav-item" style="width: 85%"></div> | ||
|
||
<mat-divider></mat-divider> | ||
|
||
<div class="pseudo-title sidenav-item" style="width: 70%"></div> | ||
<div class="pseudo-title sidenav-item" style="width: 40%"></div> | ||
<div class="pseudo-title sidenav-item" style="width: 75%"></div> | ||
</div> | ||
</mat-sidenav> | ||
<mat-sidenav-content> | ||
<mat-toolbar color="primary"> | ||
<button | ||
mat-icon-button | ||
(click)="snav.toggle()" | ||
class="mdx-d--none-desktop"> | ||
<mat-icon>menu</mat-icon> | ||
</button> | ||
|
||
<span>My Application</span> | ||
|
||
<span class="toolbar-spacer"></span> | ||
|
||
<a mat-button | ||
routerLink="/"> | ||
<mat-icon class="mat-button__icon">home</mat-icon> | ||
<span>Home</span> | ||
</a> | ||
</mat-toolbar> | ||
|
||
<router-outlet></router-outlet> | ||
</mat-sidenav-content> | ||
</mat-sidenav-container> |
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,42 @@ | ||
.layout-container { | ||
position: absolute; | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
//background: #eee; | ||
} | ||
|
||
.toolbar-spacer { | ||
flex: 1 1 auto; | ||
} | ||
|
||
.sidenav-content-container { | ||
width: 256px; // Size is taken from Navigation drawer specs - https://material.io/components/navigation-drawer#specs | ||
padding: 32px 16px; | ||
box-sizing: border-box; // Fix. https://stackoverflow.com/a/67907083/8468354 | ||
|
||
::ng-deep .mat-divider-horizontal { | ||
position: relative ; | ||
left: -16px; | ||
width: calc(100% + 32px); | ||
margin-bottom: 24px; | ||
} | ||
} | ||
|
||
.sidenav-container--modal-drawer { | ||
z-index: unset; | ||
|
||
::ng-deep .mat-drawer-backdrop { | ||
z-index: 5; | ||
} | ||
|
||
::ng-deep .mat-sidenav-fixed { | ||
z-index: 6; | ||
} | ||
} | ||
|
||
.sidenav-item { | ||
display: block; | ||
margin-bottom: 24px; | ||
} |
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,31 @@ | ||
import { Component, OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core'; | ||
import { MediaMatcher } from '@angular/cdk/layout'; | ||
|
||
|
||
@Component({ | ||
templateUrl: './layout202.component.html', | ||
styleUrls: ['./layout202.component.scss'] | ||
}) | ||
export class Layout202Component implements OnInit, OnDestroy { | ||
|
||
mobileQuery: MediaQueryList; | ||
private _mobileQueryListener: () => void; | ||
|
||
fillerNav = Array.from({length: 3}, (_, i) => `Nav Item ${i + 1}`); | ||
|
||
constructor( | ||
changeDetectorRef: ChangeDetectorRef, | ||
media: MediaMatcher | ||
) { | ||
this.mobileQuery = media.matchMedia('(max-width: 840px)'); | ||
this._mobileQueryListener = () => changeDetectorRef.detectChanges(); | ||
this.mobileQuery.addListener(this._mobileQueryListener); | ||
} | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
ngOnDestroy() { | ||
this.mobileQuery.removeListener(this._mobileQueryListener); | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<div class="a-c--1280 mdx-p--default"> | ||
|
||
<div class="card-container"> | ||
<mat-card> | ||
<mat-card-content> | ||
<h3 class="mat-display-1 mdx-mb--3">Layout #202</h3> | ||
<div class="rich-text mdx-mb--5 mat-typography"> | ||
<ul> | ||
<li> | ||
<strong>Key Components:</strong> <a href="https://material.angular.io/components/toolbar" target="_blank">Toolbar</a>, | ||
<a href="https://material.angular.io/components/sidenav" target="_blank">Sidenav</a>. This version of layout #202 doesn't | ||
use MDC Web's <a href="https://material.io/components/app-bars-top/web" target="_blank">@material/top-app-bar</a>. | ||
Therefore scrolling downward <strong>doesn't</strong> reveal the top app bar. I plan to create another version of this layout | ||
using <i>@material/top-app-bar</i>. | ||
</li> | ||
<li> | ||
<strong>Behavior:</strong> In desktop mode, drawer (or sidenav) is always visible. Top app bar gets scrolled together with content.<br> | ||
|
||
In tablet/phone modes, drawer is hidden to maximize space available for content. It can be revealed by clicking the menu icon in top app bar. | ||
<ul> | ||
<li>Properly handled scrolling of main content when modal drawer is opened. In tablet/phone modes, when modal drawer is opened, | ||
main content behind doesn't scroll.</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
</mat-card-content> | ||
<mat-card-footer class="mdx-p--2 text-center color-secondary-text"> | ||
<div> | ||
<span class="material-icons mdx-mr--1">desktop_windows</span> | ||
<span class="material-icons mdx-mr--1">tablet_android</span> | ||
<span class="material-icons mdx-mr--1">smartphone</span> | ||
</div> | ||
<div class="mat-caption"> | ||
Check it out on desktop, tablet and phone. | ||
</div> | ||
</mat-card-footer> | ||
</mat-card> | ||
</div> | ||
|
||
<dummy-page-content></dummy-page-content> | ||
|
||
</div> |
Empty file.
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,14 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
templateUrl: './layout202.page.html', | ||
styleUrls: ['./layout202.page.scss'] | ||
}) | ||
export class Layout202Page implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
} |
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 |
---|---|---|
|
@@ -69,8 +69,3 @@ | |
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|