-
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.
- Loading branch information
Showing
15 changed files
with
216 additions
and
528 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="col"> | ||
<h5 class="pb-3 display-5">Buscar:</h5> | ||
<input | ||
type="text" | ||
class="form-control shadow mb-4 p-3 border border-4 rounded-pill" | ||
placeholder="Buscar Gifs..." | ||
(keyup.enter)="buscarTexto( )" | ||
#txtBuscar | ||
> | ||
</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,32 @@ | ||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; | ||
import { GifsService } from '../sevices/gifs.service'; | ||
|
||
@Component({ | ||
selector: 'app-busqueda', | ||
templateUrl: './busqueda.component.html', | ||
styles: [ | ||
] | ||
}) | ||
export class BusquedaComponent implements OnInit { | ||
|
||
@ViewChild('txtBuscar') txtBuscar!:ElementRef<HTMLInputElement>; | ||
|
||
constructor( private gifsService:GifsService, ) { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
|
||
buscarTexto( ){ | ||
const valor = this.txtBuscar.nativeElement.value; | ||
|
||
// console.log( valor ); | ||
this.gifsService.buscarGifs( valor ); | ||
|
||
this.txtBuscar.nativeElement.value = ''; | ||
|
||
} | ||
|
||
|
||
|
||
} |
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,8 @@ | ||
<div class="row"> | ||
<app-busqueda></app-busqueda> | ||
</div> | ||
|
||
|
||
<div class="row"> | ||
<app-resultados></app-resultados> | ||
</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,16 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-gifs-page', | ||
templateUrl: './gifs-page.component.html', | ||
styles: [ | ||
] | ||
}) | ||
export class GifsPageComponent 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { GifsPageComponent } from './gifs-page/gifs-page.component'; | ||
import { BusquedaComponent } from './busqueda/busqueda.component'; | ||
import { ResultadosComponent } from './resultados/resultados.component'; | ||
|
||
|
||
|
||
@NgModule({ | ||
declarations: [GifsPageComponent, BusquedaComponent, ResultadosComponent], | ||
exports:[ | ||
GifsPageComponent, | ||
|
||
], | ||
imports: [ | ||
CommonModule | ||
] | ||
}) | ||
export class GifsModule { } |
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,5 @@ | ||
<div class="col"> | ||
<hr> | ||
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Labore distinctio, iste accusamus consequatur ut eligendi quos et tempore explicabo delectus, inventore voluptas corporis maiores incidunt illum. Voluptatem quo ab eveniet?</p> | ||
|
||
</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,16 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-resultados', | ||
templateUrl: './resultados.component.html', | ||
styles: [ | ||
] | ||
}) | ||
export class ResultadosComponent 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Injectable } from '@angular/core'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class GifsService { | ||
|
||
private _historial:string[] = []; | ||
|
||
get historial (){ | ||
return [...this._historial]; | ||
} | ||
|
||
buscarGifs( query:string ){ | ||
this._historial.unshift( query ); | ||
|
||
console.log(this._historial); | ||
} | ||
|
||
|
||
} |
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,20 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { SidebarComponent } from './sidebar/sidebar.component'; | ||
|
||
|
||
|
||
@NgModule({ | ||
declarations: [ | ||
SidebarComponent, | ||
|
||
], | ||
exports:[ | ||
SidebarComponent, | ||
|
||
], | ||
imports: [ | ||
CommonModule, | ||
] | ||
}) | ||
export class SharedModule { } |
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,16 @@ | ||
<div class="bg-dark text-light border-right p-3" id="sidebar"> | ||
<h3 class="text-light display-6"> | ||
Gifs App | ||
</h3> | ||
<hr> | ||
<div class="list-group list-reset"> | ||
<a href="#" | ||
class="list-group-item list-group-item-action" | ||
*ngFor="let item of historial" | ||
>{{item}} | ||
</a> | ||
|
||
</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,18 @@ | ||
import { Component } from '@angular/core'; | ||
import { GifsService } from '../../gifs/sevices/gifs.service'; | ||
|
||
@Component({ | ||
selector: 'app-sidebar', | ||
templateUrl: './sidebar.component.html', | ||
styles: [ | ||
] | ||
}) | ||
export class SidebarComponent { | ||
|
||
get historial (){ | ||
return this._gifsService.historial; | ||
} | ||
|
||
constructor( private _gifsService: GifsService, ){} | ||
|
||
} |
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,13 @@ | ||
/* You can add global styles to this file, and also import other style files */ | ||
|
||
html, body{ | ||
height: 100%; | ||
} | ||
#sidebar{ | ||
height: 100%; | ||
min-height: 100vh; | ||
min-width: 180px; | ||
} | ||
.main-container{ | ||
margin-top: 30px; | ||
} |