-
Notifications
You must be signed in to change notification settings - Fork 3
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 #3 from Babali42/responsive
Responsive et factorisation des liens dans le menu
- Loading branch information
Showing
6 changed files
with
97 additions
and
33 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,34 @@ | ||
import { Component } from '@angular/core'; | ||
import {Component, OnInit} from '@angular/core'; | ||
import {BreakpointObserver, Breakpoints} from '@angular/cdk/layout'; | ||
import {Link} from "./models/link"; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.scss'] | ||
}) | ||
export class AppComponent { | ||
title = 'DrumsPatternLibrary'; | ||
export class AppComponent implements OnInit { | ||
isMobileDisplay: boolean = true; | ||
links: Link[] = [ | ||
new Link("Techno", "/techno"), | ||
new Link("Drum & Bass", "/drum-n-bass"), | ||
new Link("Garage - 2 step", "/garage"), | ||
new Link("Psytrance", "/psytrance"), | ||
new Link("Metal", "/metal"), | ||
new Link("Rock", "/rock"), | ||
new Link("Rock variation", "/rock-variation"), | ||
new Link("Half time groove", "/half-time-groove") | ||
] | ||
|
||
constructor(private responsive: BreakpointObserver) { | ||
} | ||
|
||
ngOnInit(): void { | ||
this.responsive.observe([ | ||
Breakpoints.Web, | ||
]) | ||
.subscribe(result => { | ||
this.isMobileDisplay = !result.matches; | ||
}); | ||
} | ||
} |
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,9 @@ | ||
export class Link { | ||
label: string; | ||
link: string; | ||
|
||
constructor(label: string, link: string) { | ||
this.label = label; | ||
this.link = link; | ||
} | ||
} |