-
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 #7 from oidacra/add-basic-layout
Layout base
- Loading branch information
Showing
14 changed files
with
244 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
<router-outlet></router-outlet> | ||
<nz-layout class="layout"> | ||
<nz-header> | ||
<div class="logo"></div> | ||
<ul nz-menu nzMode="horizontal" nzTheme="dark"> | ||
<li nz-menu-item>nav 1</li> | ||
<li nz-menu-item>nav 2</li> | ||
<li nz-menu-item>nav 3</li> | ||
</ul> | ||
</nz-header> | ||
<nz-content> | ||
<div class="inner-content"> | ||
<router-outlet></router-outlet> | ||
</div> | ||
</nz-content> | ||
<nz-footer>Series Demo ©2024 Arcadio Quintero</nz-footer> | ||
</nz-layout> |
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,40 @@ | ||
.layout { | ||
min-height: 100vh; | ||
} | ||
|
||
.logo { | ||
width: 120px; | ||
height: 31px; | ||
background: rgba(255, 255, 255, 0.2); | ||
margin: 16px 24px 16px 0; | ||
float: left; | ||
} | ||
|
||
nz-header { | ||
position: fixed; | ||
width: 100%; | ||
z-index: 1; | ||
} | ||
|
||
[nz-menu] { | ||
line-height: 64px; | ||
} | ||
|
||
nz-content { | ||
padding: 0 50px; | ||
margin-top: 64px; | ||
} | ||
|
||
nz-breadcrumb { | ||
margin: 16px 0; | ||
} | ||
|
||
.inner-content { | ||
background: #fff; | ||
padding: 24px; | ||
min-height: 380px; | ||
} | ||
|
||
nz-footer { | ||
text-align: center; | ||
} |
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,12 +1,28 @@ | ||
<h1>Series</h1> | ||
@if (vm().isLoading){ | ||
@if (vm().isLoading) { | ||
<p>Loading...</p> | ||
} @else{ | ||
<ul> | ||
@for (item of vm().series; track item.id;) { | ||
<li>{{ item.name }}</li> | ||
} @else { | ||
<div class="series-card__wrapper"> | ||
@for (item of vm().series; track item.id; ) { | ||
|
||
<nz-card nzHoverable [nzCover]="coverTemplate"> | ||
<nz-card-meta [nzTitle]="item.name" /> | ||
</nz-card> | ||
|
||
<ng-template #coverTemplate> | ||
<img | ||
loading="lazy" | ||
width="210" | ||
height="295" | ||
[alt]="item.name" | ||
[ngSrc]="item.image.medium" | ||
/> | ||
</ng-template> | ||
|
||
} @empty { | ||
<li>No series found</li> | ||
<nz-empty></nz-empty> | ||
} | ||
</ul> | ||
|
||
<nz-pagination [nzPageIndex]="1" [nzTotal]="50"></nz-pagination> | ||
</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,14 @@ | ||
.series-card__wrapper { | ||
display: flex; | ||
flex-wrap: wrap; | ||
width: 100%; | ||
justify-content: space-around; | ||
gap: 2rem; | ||
} | ||
|
||
:host ::ng-deep { | ||
nz-card { | ||
width: 210px; | ||
flex: 0 0 auto; | ||
} | ||
} |
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,19 +1,17 @@ | ||
import { inject, Injectable } from '@angular/core'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { delay, Observable, tap } from 'rxjs'; | ||
import { Observable, tap } from 'rxjs'; | ||
import { Serie } from '../shared/series.models'; | ||
|
||
const TVMAZE_ENDPOINT = 'https://api.tvmaze.com/'; | ||
const DELAY_MS = 1000; | ||
|
||
@Injectable() | ||
export class SeriesService { | ||
private httpClient = inject(HttpClient); | ||
|
||
getSeries(): Observable<Serie[]> { | ||
return this.httpClient.get<Serie[]>(`${TVMAZE_ENDPOINT}shows`).pipe( | ||
delay(DELAY_MS), | ||
tap((s) => console.log(s)) | ||
); | ||
return this.httpClient | ||
.get<Serie[]>(`${TVMAZE_ENDPOINT}shows`) | ||
.pipe(tap((s) => console.log(s))); | ||
} | ||
} |
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 +1 @@ | ||
/* You can add global styles to this file, and also import other style files */ | ||
//@import "~ng-zorro-antd/ng-zorro-antd.css"; |
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,25 @@ | ||
// For more information: https://ng.ant.design/docs/customize-theme/en | ||
// -------- import official less file ----------- | ||
@import '/node_modules/ng-zorro-antd/ng-zorro-antd.less'; | ||
|
||
@imdb-yellow: #f5c518; // Color amarillo de IMDB | ||
@imdb-black: #000000; // Negro | ||
@imdb-grey: #f4f4f4; // Gris claro para fondos | ||
|
||
// -------- override less variables ----------- | ||
// View all variables: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/components/style/themes/default.less | ||
|
||
// Sobrescribir variables de NG-ZORRO | ||
@primary-color: @imdb-yellow; // Color primario | ||
@layout-header-background: @imdb-black; // Color de fondo del header | ||
@layout-body-background: @imdb-grey; // Color de fondo del contenido | ||
@text-color: darken(@imdb-grey, 70%); // Color del texto | ||
@heading-color: @imdb-black; // Color de los encabezados | ||
@border-radius-base: 4px; // Radio de borde | ||
@link-color: @imdb-yellow; // Color de los enlaces | ||
|
||
// Otros colores de estado | ||
@success-color: #52c41a; // Verde para éxitos | ||
@warning-color: #faad14; // Amarillo para advertencias | ||
@error-color: #f5222d; // Rojo para errores | ||
@info-color: @primary-color; // Color para información, usa el color primario |
Oops, something went wrong.