Skip to content

Commit cc3d8fb

Browse files
IsmaestroIsmael Ramos
authored andcommitted
fix(responsive): updated main list and added css media queries
1 parent f74a4e2 commit cc3d8fb

4 files changed

Lines changed: 33 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Live demo [here](https://ismaestro.github.io/angular4-example-app/)!
88

9-
![angular4-example-app](http://i68.tinypic.com/4vst21.jpg)
9+
![angular4-example-app](http://i68.tinypic.com/2jbwkyd.jpg)
1010

1111
## Usage
1212

src/app/core/nav/nav.component.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,18 @@
3131
}
3232
}
3333

34+
@media (max-width: 425px) {
35+
:host(toh-nav) {
36+
padding-top: 0;
37+
38+
header {
39+
position: relative;
40+
41+
nav {
42+
height: 7em;
43+
display: flex;
44+
padding: 1em 2em 0;
45+
}
46+
}
47+
}
48+
}

src/app/heroes/hero-top/hero-top.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ <h1 class="section-title">{{'topHeroes' | translate}}</h1>
44
[color]="'primary'"
55
[mode]="'indeterminate'">
66
</md-progress-spinner>
7-
<md-grid-list cols="2" rowHeight="400px" *ngIf="heroes">
8-
<md-grid-tile *ngFor="let hero of heroes">
7+
<div id="heroes-list" *ngIf="heroes">
8+
<ng-container *ngFor="let hero of heroes">
99
<md-card class="hero-card">
1010
<md-card-header>
1111
<div md-card-avatar class="hero-header-image"
@@ -23,5 +23,5 @@ <h1 class="section-title">{{'topHeroes' | translate}}</h1>
2323
</md-card-header>
2424
<img md-card-image src="assets/images/heroes/{{hero.id}}.jpg">
2525
</md-card>
26-
</md-grid-tile>
27-
</md-grid-list>
26+
</ng-container>
27+
</div>

src/app/heroes/hero-top/hero-top.component.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
#heroes-list {
2+
margin: 2em;
3+
}
4+
15
.hero-card {
2-
width: 70%;
6+
width: 45%;
7+
margin: 2em auto;
38
}
49

510
.hero-header-image {
@@ -13,3 +18,10 @@
1318
.progress-spinner {
1419
margin: 0 auto;
1520
}
21+
22+
@media (max-width: 425px) {
23+
.hero-card {
24+
width: 80%;
25+
margin: 0 auto;
26+
}
27+
}

0 commit comments

Comments
 (0)