├── src ├── assets │ ├── .gitkeep │ └── imagens │ │ ├── logo.png │ │ ├── favicon.png │ │ ├── icone-busca.png │ │ ├── logo-google.png │ │ ├── capa-indisponivel.png │ │ └── ilustracao-estante.png ├── app │ ├── app.component.css │ ├── componentes │ │ ├── rodape │ │ │ ├── rodape.component.html │ │ │ ├── rodape.component.ts │ │ │ ├── rodape.component.css │ │ │ └── rodape.component.spec.ts │ │ ├── cabecalho │ │ │ ├── cabecalho.component.html │ │ │ ├── cabecalho.component.ts │ │ │ ├── cabecalho.component.css │ │ │ └── cabecalho.component.spec.ts │ │ └── livro │ │ │ ├── livro.component.ts │ │ │ ├── livro.component.spec.ts │ │ │ ├── livro.component.html │ │ │ └── livro.component.css │ ├── app.component.html │ ├── app.component.ts │ ├── views │ │ ├── lista-livros │ │ │ ├── lista-livros.component.ts │ │ │ ├── lista-livros.component.spec.ts │ │ │ ├── lista-livros.component.html │ │ │ └── lista-livros.component.css │ │ └── modal-livro │ │ │ ├── modal-livro.component.spec.ts │ │ │ ├── modal-livro.component.ts │ │ │ ├── modal-livro.component.html │ │ │ └── modal-livro.component.css │ ├── app-routing.module.ts │ ├── app.component.spec.ts │ └── app.module.ts ├── favicon.ico ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── main.ts ├── index.html ├── styles.css ├── test.ts └── polyfills.ts ├── .vscode ├── extensions.json ├── launch.json └── tasks.json ├── .editorconfig ├── tsconfig.app.json ├── tsconfig.spec.json ├── .browserslistrc ├── .gitignore ├── tsconfig.json ├── README.md ├── package.json ├── karma.conf.js └── angular.json /src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alura-cursos/2685-angular-rxjs/HEAD/src/favicon.ico -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/assets/imagens/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alura-cursos/2685-angular-rxjs/HEAD/src/assets/imagens/logo.png -------------------------------------------------------------------------------- /src/assets/imagens/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alura-cursos/2685-angular-rxjs/HEAD/src/assets/imagens/favicon.png -------------------------------------------------------------------------------- /src/app/componentes/rodape/rodape.component.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /src/assets/imagens/icone-busca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alura-cursos/2685-angular-rxjs/HEAD/src/assets/imagens/icone-busca.png -------------------------------------------------------------------------------- /src/assets/imagens/logo-google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alura-cursos/2685-angular-rxjs/HEAD/src/assets/imagens/logo-google.png -------------------------------------------------------------------------------- /src/assets/imagens/capa-indisponivel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alura-cursos/2685-angular-rxjs/HEAD/src/assets/imagens/capa-indisponivel.png -------------------------------------------------------------------------------- /src/assets/imagens/ilustracao-estante.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alura-cursos/2685-angular-rxjs/HEAD/src/assets/imagens/ilustracao-estante.png -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | 6 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'buscante'; 10 | } 11 | -------------------------------------------------------------------------------- /src/app/componentes/rodape/rodape.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-rodape', 5 | templateUrl: './rodape.component.html', 6 | styleUrls: ['./rodape.component.css'] 7 | }) 8 | export class RodapeComponent { 9 | 10 | constructor() { } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts", 10 | "src/polyfills.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/app/views/lista-livros/lista-livros.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-lista-livros', 5 | templateUrl: './lista-livros.component.html', 6 | styleUrls: ['./lista-livros.component.css'] 7 | }) 8 | export class ListaLivrosComponent { 9 | 10 | listaLivros: []; 11 | 12 | constructor() { } 13 | 14 | } 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/app/componentes/cabecalho/cabecalho.component.html: -------------------------------------------------------------------------------- 1 |
2 | 5 |
6 | Sobre 7 | Contato 8 |
9 |
10 | -------------------------------------------------------------------------------- /tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /src/app/componentes/livro/livro.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-livro', 5 | templateUrl: './livro.component.html', 6 | styleUrls: ['./livro.component.css'] 7 | }) 8 | export class LivroComponent { 9 | 10 | @Input() livro: Object; 11 | modalAberto: boolean; 12 | 13 | onModelChange(evento: boolean) { 14 | this.modalAberto = evento; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/app/componentes/rodape/rodape.component.css: -------------------------------------------------------------------------------- 1 | footer { 2 | background-color: #050C42; 3 | height: 83px; 4 | width: 100%; 5 | bottom: 0; 6 | position: absolute; 7 | color: #FFFFFF; 8 | display: flex; 9 | justify-content: center; 10 | align-items: center; 11 | font-family: 'Poppins', sans-serif; 12 | font-weight: 400; 13 | } 14 | 15 | span { 16 | margin-right: 0.5rem; 17 | margin-top: 0.75rem; 18 | font-size: 36px; 19 | } 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Buscante 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "pwa-chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { ListaLivrosComponent } from './views/lista-livros/lista-livros.component'; 2 | import { NgModule } from '@angular/core'; 3 | import { RouterModule, Routes } from '@angular/router'; 4 | 5 | const routes: Routes = [ 6 | { 7 | path: "", 8 | redirectTo: 'lista-livros', 9 | pathMatch: 'full' 10 | }, 11 | { 12 | path: 'lista-livros', 13 | component: ListaLivrosComponent 14 | } 15 | ]; 16 | 17 | @NgModule({ 18 | imports: [RouterModule.forRoot(routes)], 19 | exports: [RouterModule] 20 | }) 21 | export class AppRoutingModule { } 22 | -------------------------------------------------------------------------------- /src/app/componentes/cabecalho/cabecalho.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | 4 | @Component({ 5 | selector: 'app-cabecalho', 6 | templateUrl: './cabecalho.component.html', 7 | styleUrls: ['./cabecalho.component.css'] 8 | }) 9 | export class CabecalhoComponent { 10 | 11 | constructor(private router: Router) {} 12 | 13 | irParaTelaInicial() { 14 | this.router.routeReuseStrategy.shouldReuseRoute = () => false; 15 | this.router.onSameUrlNavigation = 'reload' 16 | this.router.navigate([this.router.url]) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/app/componentes/cabecalho/cabecalho.component.css: -------------------------------------------------------------------------------- 1 | header { 2 | background-color: #050C42; 3 | height: 96px; 4 | width: 100%; 5 | display: flex; 6 | align-items: center; 7 | justify-content:space-around; 8 | font-family: 'Poppins', sans-serif; 9 | } 10 | 11 | header a { 12 | text-decoration: none; 13 | color: #FFFFFF; 14 | font-style: normal; 15 | font-weight: 400; 16 | font-size: 18px; 17 | line-height: 27px; 18 | margin-right: 1.5rem; 19 | width: 79px; 20 | height: 48px; 21 | } 22 | 23 | button { 24 | background-color: #050C42; 25 | cursor: pointer; 26 | border: none; 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # For the full list of supported browsers by the Angular framework, please see: 6 | # https://angular.io/guide/browser-support 7 | 8 | # You can see what browsers were selected by your queries by running: 9 | # npx browserslist 10 | 11 | last 1 Chrome version 12 | last 1 Firefox version 13 | last 2 Edge major versions 14 | last 2 Safari major versions 15 | last 2 iOS major versions 16 | Firefox ESR 17 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap'); 2 | 3 | 4 | * { 5 | margin: 0; 6 | padding: 0; 7 | } 8 | 9 | h1, h2, h3 { 10 | font-family: 'Poppins', sans-serif; 11 | } 12 | 13 | html { 14 | position: relative; 15 | min-height: 100vh; 16 | } 17 | 18 | body { 19 | padding-bottom: 83px; 20 | } 21 | 22 | .container { 23 | padding-right: 1rem; 24 | padding-left: 1rem; 25 | padding-top: 2rem; 26 | padding-bottom: 1rem; 27 | margin-right: auto; 28 | margin-left: auto; 29 | margin-top: 1rem; 30 | } 31 | 32 | button:hover { 33 | background: #050C42; 34 | transition: all 0.5s ease-in; 35 | border: 2px solid #050C42; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/app/componentes/livro/livro.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LivroComponent } from './livro.component'; 4 | 5 | describe('LivroComponent', () => { 6 | let component: LivroComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ LivroComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(LivroComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/app/componentes/rodape/rodape.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { RodapeComponent } from './rodape.component'; 4 | 5 | describe('RodapeComponent', () => { 6 | let component: RodapeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ RodapeComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(RodapeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /src/app/componentes/livro/livro.component.html: -------------------------------------------------------------------------------- 1 |
2 | Capa do livro 5 |
6 |

{{ livro }}

7 |

Autoria:

8 |

{{ livro }}

9 |

Data de publicação:

10 |

{{ livro }}

11 |

Editora:

12 |

{{ livro }}

13 | 14 |
15 |
16 |
17 | 18 |
19 | 20 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /src/app/componentes/cabecalho/cabecalho.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CabecalhoComponent } from './cabecalho.component'; 4 | 5 | describe('CabecalhoComponent', () => { 6 | let component: CabecalhoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ CabecalhoComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(CabecalhoComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/app/views/modal-livro/modal-livro.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ModalLivroComponent } from './modal-livro.component'; 4 | 5 | describe('ModalLivroComponent', () => { 6 | let component: ModalLivroComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ModalLivroComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ModalLivroComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/app/views/lista-livros/lista-livros.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ListaLivrosComponent } from './lista-livros.component'; 4 | 5 | describe('ListaLivrosComponent', () => { 6 | let component: ListaLivrosComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ListaLivrosComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ListaLivrosComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: { 11 | context(path: string, deep?: boolean, filter?: RegExp): { 12 | (id: string): T; 13 | keys(): string[]; 14 | }; 15 | }; 16 | 17 | // First, initialize the Angular testing environment. 18 | getTestBed().initTestEnvironment( 19 | BrowserDynamicTestingModule, 20 | platformBrowserDynamicTesting(), 21 | ); 22 | 23 | // Then we find all the tests. 24 | const context = require.context('./', true, /\.spec\.ts$/); 25 | // And load the modules. 26 | context.keys().forEach(context); 27 | -------------------------------------------------------------------------------- /src/app/views/modal-livro/modal-livro.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, EventEmitter, Input, Output } from '@angular/core'; 2 | 3 | const body = document.querySelector("body"); 4 | 5 | @Component({ 6 | selector: 'app-modal-livro', 7 | templateUrl: './modal-livro.component.html', 8 | styleUrls: ['./modal-livro.component.css'] 9 | }) 10 | export class ModalLivroComponent { 11 | 12 | constructor() { } 13 | 14 | @Input() livro: Object; 15 | statusModal: boolean = true; 16 | @Output() mudouModal = new EventEmitter() 17 | 18 | fecharModal() { 19 | this.statusModal = false 20 | this.mudouModal.emit(this.statusModal) 21 | body.style.overflow = "scroll" 22 | } 23 | 24 | esconderScroll(){ 25 | if(this.statusModal == true ) { 26 | body.style.overflow = "hidden"; 27 | } 28 | } 29 | 30 | lerPrevia() { 31 | window.open( '_blank'); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/app/views/lista-livros/lista-livros.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Que livro você procura?
3 |
4 | 7 | 10 |
11 |

Busque por assunto, autoria, nome...

12 |
13 |
14 | 15 |
16 |
17 | 18 |
19 |

Busque o livro
que quiser na
nossa estante!

20 | Ilustração de uma pessoa em pé ao lado de uma estante com livros e plantas 24 |
25 |
26 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": false, 9 | "noImplicitOverride": true, 10 | "noPropertyAccessFromIndexSignature": true, 11 | "noImplicitReturns": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "sourceMap": true, 14 | "declaration": false, 15 | "downlevelIteration": true, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "es2020", 20 | "module": "es2020", 21 | "lib": [ 22 | "es2020", 23 | "dom" 24 | ] 25 | }, 26 | "angularCompilerOptions": { 27 | "enableI18nLegacyMessageIdFormat": false, 28 | "strictInjectionParameters": true, 29 | "strictInputAccessModifiers": true, 30 | "strictTemplates": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/app/views/modal-livro/modal-livro.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Capa do livro 6 |
7 |

{{ livro }}

8 |

Autoria:

9 |

{{ livro }}

10 |

Data de publicação:

11 |

{{ livro }}

12 |

Editora:

13 |

{{ livro }}

14 | 15 |
16 | 19 |
20 |

Sinopse

21 |

{{ livro }}

22 |
23 |
24 |
25 |
26 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 3 | "version": "2.0.0", 4 | "tasks": [ 5 | { 6 | "type": "npm", 7 | "script": "start", 8 | "isBackground": true, 9 | "problemMatcher": { 10 | "owner": "typescript", 11 | "pattern": "$tsc", 12 | "background": { 13 | "activeOnStart": true, 14 | "beginsPattern": { 15 | "regexp": "(.*?)" 16 | }, 17 | "endsPattern": { 18 | "regexp": "bundle generation complete" 19 | } 20 | } 21 | } 22 | }, 23 | { 24 | "type": "npm", 25 | "script": "test", 26 | "isBackground": true, 27 | "problemMatcher": { 28 | "owner": "typescript", 29 | "pattern": "$tsc", 30 | "background": { 31 | "activeOnStart": true, 32 | "beginsPattern": { 33 | "regexp": "(.*?)" 34 | }, 35 | "endsPattern": { 36 | "regexp": "bundle generation complete" 37 | } 38 | } 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Buscante 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.0.3. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. 28 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "buscante", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "test": "ng test" 10 | }, 11 | "private": true, 12 | "dependencies": { 13 | "@angular/animations": "^14.0.0", 14 | "@angular/common": "^14.0.0", 15 | "@angular/compiler": "^14.0.0", 16 | "@angular/core": "^14.0.0", 17 | "@angular/forms": "^14.0.0", 18 | "@angular/platform-browser": "^14.0.0", 19 | "@angular/platform-browser-dynamic": "^14.0.0", 20 | "@angular/router": "^14.0.0", 21 | "rxjs": "~7.5.0", 22 | "tslib": "^2.3.0", 23 | "zone.js": "~0.11.4" 24 | }, 25 | "devDependencies": { 26 | "@angular-devkit/build-angular": "^14.0.3", 27 | "@angular/cli": "~14.0.3", 28 | "@angular/compiler-cli": "^14.0.0", 29 | "@types/jasmine": "~4.0.0", 30 | "jasmine-core": "~4.1.0", 31 | "karma": "~6.3.0", 32 | "karma-chrome-launcher": "~3.1.0", 33 | "karma-coverage": "~2.2.0", 34 | "karma-jasmine": "~5.0.0", 35 | "karma-jasmine-html-reporter": "~1.7.0", 36 | "typescript": "~4.7.2" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | }); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'buscante'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.componentInstance; 26 | expect(app.title).toEqual('buscante'); 27 | }); 28 | 29 | it('should render title', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.nativeElement as HTMLElement; 33 | expect(compiled.querySelector('.content span')?.textContent).toContain('buscante app is running!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { RouterModule } from '@angular/router'; 2 | import { NgModule } from '@angular/core'; 3 | import { BrowserModule } from '@angular/platform-browser'; 4 | 5 | import { AppRoutingModule } from './app-routing.module'; 6 | import { AppComponent } from './app.component'; 7 | import { CabecalhoComponent } from './componentes/cabecalho/cabecalho.component'; 8 | import { RodapeComponent } from './componentes/rodape/rodape.component'; 9 | import { LivroComponent } from './componentes/livro/livro.component'; 10 | import { ListaLivrosComponent } from './views/lista-livros/lista-livros.component'; 11 | import { ModalLivroComponent } from './views/modal-livro/modal-livro.component'; 12 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 13 | import { HttpClientModule } from '@angular/common/http'; 14 | 15 | @NgModule({ 16 | declarations: [ 17 | AppComponent, 18 | CabecalhoComponent, 19 | RodapeComponent, 20 | LivroComponent, 21 | ListaLivrosComponent, 22 | ModalLivroComponent 23 | ], 24 | imports: [ 25 | BrowserModule, 26 | AppRoutingModule, 27 | RouterModule, 28 | FormsModule, 29 | HttpClientModule, 30 | ReactiveFormsModule 31 | ], 32 | providers: [], 33 | bootstrap: [AppComponent] 34 | }) 35 | export class AppModule { } 36 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | jasmine: { 17 | // you can add configuration options for Jasmine here 18 | // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html 19 | // for example, you can disable the random execution with `random: false` 20 | // or set a specific seed with `seed: 4321` 21 | }, 22 | clearContext: false // leave Jasmine Spec Runner output visible in browser 23 | }, 24 | jasmineHtmlReporter: { 25 | suppressAll: true // removes the duplicated traces 26 | }, 27 | coverageReporter: { 28 | dir: require('path').join(__dirname, './coverage/buscante'), 29 | subdir: '.', 30 | reporters: [ 31 | { type: 'html' }, 32 | { type: 'text-summary' } 33 | ] 34 | }, 35 | reporters: ['progress', 'kjhtml'], 36 | port: 9876, 37 | colors: true, 38 | logLevel: config.LOG_INFO, 39 | autoWatch: true, 40 | browsers: ['Chrome'], 41 | singleRun: false, 42 | restartOnFileChange: true 43 | }); 44 | }; 45 | -------------------------------------------------------------------------------- /src/app/componentes/livro/livro.component.css: -------------------------------------------------------------------------------- 1 | .card-livro { 2 | display: flex; 3 | width: 384px; 4 | filter: drop-shadow(2px 2px 8px rgba(0, 0, 0, 0.2)); 5 | margin: 24px; 6 | border-radius: 8px 0px 0px 8px; 7 | } 8 | 9 | img { 10 | min-width: 198px; 11 | } 12 | 13 | .card { 14 | display: flex; 15 | width: 384px; 16 | height: 310px; 17 | filter: drop-shadow(2px 2px 8px rgba(0, 0, 0, 0.2)); 18 | margin: 24px; 19 | border-radius: 8px 0px 0px 8px; 20 | } 21 | 22 | .info-card { 23 | padding-top: 7px; 24 | padding-bottom: 7px; 25 | padding-left: 14px; 26 | padding-right: 6px; 27 | background: #FFFFFF; 28 | border-radius: 0px 8px 8px 0px; 29 | display: flex; 30 | flex-direction: column; 31 | min-width: 50%; 32 | justify-content: space-evenly; 33 | align-items: baseline; 34 | } 35 | 36 | .titulo { 37 | font-family: 'Poppins'; 38 | font-style: normal; 39 | font-weight: 600; 40 | font-size: 20px; 41 | line-height: 30px; 42 | color: #6C63FF; 43 | } 44 | 45 | .informacoes { 46 | font-family: 'Poppins'; 47 | font-style: normal; 48 | font-weight: 600; 49 | font-size: 16px; 50 | line-height: 24px; 51 | color: #8B8B8B; 52 | } 53 | 54 | .resultado { 55 | font-family: 'Poppins'; 56 | font-style: normal; 57 | font-weight: 400; 58 | font-size: 16px; 59 | line-height: 24px; 60 | color: #8B8B8B; 61 | } 62 | 63 | button { 64 | background: #6C63FF; 65 | width: 156px; 66 | height: 40px; 67 | border-radius: 8px; 68 | font-family: 'Poppins'; 69 | font-style: normal; 70 | font-weight: 600; 71 | font-size: 16px; 72 | line-height: 24px; 73 | color: #FFFFFF; 74 | border: none; 75 | cursor: pointer; 76 | } 77 | 78 | button:hover { 79 | background: #050C42; 80 | } 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes recent versions of Safari, Chrome (including 12 | * Opera), Edge on the desktop, and iOS and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** 22 | * By default, zone.js will patch all possible macroTask and DomEvents 23 | * user can disable parts of macroTask/DomEvents patch by setting following flags 24 | * because those flags need to be set before `zone.js` being loaded, and webpack 25 | * will put import in the top of bundle, so user need to create a separate file 26 | * in this directory (for example: zone-flags.ts), and put the following flags 27 | * into that file, and then add the following code before importing zone.js. 28 | * import './zone-flags'; 29 | * 30 | * The flags allowed in zone-flags.ts are listed here. 31 | * 32 | * The following flags will work for all browsers. 33 | * 34 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 35 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 36 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 37 | * 38 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 39 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 40 | * 41 | * (window as any).__Zone_enable_cross_context_check = true; 42 | * 43 | */ 44 | 45 | /*************************************************************************************************** 46 | * Zone JS is required by default for Angular itself. 47 | */ 48 | import 'zone.js'; // Included with Angular CLI. 49 | 50 | 51 | /*************************************************************************************************** 52 | * APPLICATION IMPORTS 53 | */ 54 | -------------------------------------------------------------------------------- /src/app/views/modal-livro/modal-livro.component.css: -------------------------------------------------------------------------------- 1 | .card { 2 | display: grid; 3 | grid-template-areas: "imagem info-card botao-fechar" "sinopse sinopse sinopse"; 4 | grid-row-gap: 1rem; 5 | min-height: 30rem; 6 | max-height: 90%; 7 | grid-template-columns: 1fr 3fr 20px; 8 | grid-template-rows: min-content; 9 | border-radius: 8px; 10 | background: #fff; 11 | position: fixed; 12 | transform: translate(-50%, -50%); 13 | left: 50%; 14 | top: 50%; 15 | padding: 24px; 16 | z-index: 11; 17 | } 18 | 19 | .titulo { 20 | font-family: 'Poppins'; 21 | font-style: normal; 22 | font-weight: 600; 23 | font-size: 20px; 24 | line-height: 30px; 25 | color: #6C63FF; 26 | padding-top: 16px; 27 | } 28 | 29 | .informacoes { 30 | font-family: 'Poppins'; 31 | font-style: normal; 32 | font-weight: 600; 33 | font-size: 16px; 34 | line-height: 24px; 35 | color: #8B8B8B; 36 | padding-bottom: 4px; 37 | } 38 | 39 | .resultado { 40 | font-family: 'Poppins'; 41 | font-style: normal; 42 | font-weight: 400; 43 | font-size: 16px; 44 | line-height: 24px; 45 | color: #8B8B8B; 46 | padding-bottom: 8px; 47 | } 48 | 49 | .detalhes { 50 | background: #6C63FF; 51 | width: 9rem; 52 | height: 2.5rem; 53 | border-radius: 8px; 54 | font-family: 'Poppins'; 55 | font-style: normal; 56 | font-weight: 600; 57 | font-size: 16px; 58 | line-height: 24px; 59 | color: #FFFFFF; 60 | border: none; 61 | cursor: pointer; 62 | } 63 | 64 | .info-card { 65 | background: #FFFFFF; 66 | width: 12rem; 67 | padding-left: 1.5rem; 68 | grid-area: info-card; 69 | display: flex; 70 | flex-direction: column; 71 | justify-content: space-evenly; 72 | } 73 | 74 | .imagem { 75 | height: 18rem; 76 | grid-area: imagem; 77 | padding-top: 1rem; 78 | } 79 | 80 | .sinopse { 81 | grid-area: sinopse; 82 | padding-bottom: 0; 83 | } 84 | 85 | .overlay { 86 | background: #000; 87 | height: 100vh; 88 | left: 0; 89 | opacity: 0.5; 90 | position: fixed; 91 | top: 0; 92 | width: 100vw; 93 | z-index: 10; 94 | } 95 | 96 | .botao-fechar { 97 | width: 24px; 98 | height: 24px; 99 | font-style: normal; 100 | font-weight: 400; 101 | font-size: 24px; 102 | line-height: 24px; 103 | border: none; 104 | color: #444444; 105 | opacity: 0.5; 106 | cursor: pointer; 107 | background: none; 108 | grid-area: botao-fechar; 109 | margin-top: 0.5rem; 110 | } 111 | 112 | .detalhes:hover { 113 | background: #050C42; 114 | } 115 | 116 | 117 | -------------------------------------------------------------------------------- /src/app/views/lista-livros/lista-livros.component.css: -------------------------------------------------------------------------------- 1 | section { 2 | display: flex; 3 | justify-content: center; 4 | flex-direction: column; 5 | align-items: center; 6 | min-height: 100%; 7 | } 8 | 9 | header { 10 | color: #6C63FF; 11 | font-style: normal; 12 | font-weight: 600; 13 | font-size: 24px; 14 | line-height: 36px; 15 | margin-top: 76px; 16 | margin-bottom: 5px; 17 | filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25)); 18 | font-family: 'Poppins', sans-serif; 19 | } 20 | 21 | section input { 22 | width: 588px; 23 | height: 56px; 24 | border: 2px solid #6C63FF; 25 | border-radius: 10px; 26 | outline: 0; 27 | box-sizing: border-box; 28 | top: 220px; 29 | background: url(../../../assets/imagens/logo-google.png); 30 | background-repeat: no-repeat; 31 | background-position-y: center; 32 | background-position-x: 4.08%; 33 | font-family: 'Poppins', sans-serif; 34 | font-style: normal; 35 | font-weight: 400; 36 | font-size: 16px; 37 | line-height: 24px; 38 | padding-left: 20px; 39 | } 40 | 41 | section p { 42 | font-family: 'Poppins'; 43 | font-style: normal; 44 | font-weight: 400; 45 | font-size: 16px; 46 | line-height: 24px; 47 | color: #8B8B8B; 48 | } 49 | 50 | .resultados { 51 | display: flex; 52 | justify-content: center; 53 | margin-top: 2rem; 54 | font-family: 'Poppins'; 55 | font-style: normal; 56 | font-weight: 400; 57 | font-size: 16px; 58 | line-height: 24px; 59 | color: #8B8B8B; 60 | } 61 | 62 | .mensagemErro { 63 | color: #6C63FF; 64 | } 65 | 66 | input[type='search']:focus { 67 | background-image: none; 68 | outline: none; 69 | text-decoration: none; 70 | padding-left: 10px; 71 | } 72 | 73 | input[type="search"]::-webkit-search-decoration, 74 | ::-webkit-search-cancel-button, 75 | ::-webkit-search-results-button, 76 | ::-webkit-search-results-decoration { display: none; } 77 | 78 | section button { 79 | border: none; 80 | text-decoration: none; 81 | background: none; 82 | position: relative; 83 | top: 0.3rem; 84 | right: 50px; 85 | cursor: pointer; 86 | } 87 | 88 | .busca { 89 | display: flex; 90 | } 91 | 92 | .teste { 93 | cursor:auto; 94 | background-color: orange; 95 | font-family: "Poppins"; 96 | font-size: 20px; 97 | cursor: pointer; 98 | } 99 | 100 | .container-card { 101 | margin-bottom: 2rem; 102 | display: flex; 103 | flex-wrap: wrap; 104 | justify-content: center; 105 | margin-left: 80px; 106 | margin-right: 80px; 107 | } 108 | 109 | .imagens { 110 | display: flex; 111 | } 112 | 113 | .ilustracao { 114 | margin-top: 72px; 115 | margin-left: 130px; 116 | margin-right: 64px; 117 | } 118 | 119 | .titulo { 120 | margin-top: 72px; 121 | margin-left: 64px; 122 | } 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "buscante": { 7 | "projectType": "application", 8 | "schematics": {}, 9 | "root": "", 10 | "sourceRoot": "src", 11 | "prefix": "app", 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist/buscante", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "tsconfig.app.json", 21 | "assets": [ 22 | "src/favicon.ico", 23 | "src/assets" 24 | ], 25 | "styles": [ 26 | "src/styles.css" 27 | ], 28 | "scripts": [] 29 | }, 30 | "configurations": { 31 | "production": { 32 | "budgets": [ 33 | { 34 | "type": "initial", 35 | "maximumWarning": "500kb", 36 | "maximumError": "1mb" 37 | }, 38 | { 39 | "type": "anyComponentStyle", 40 | "maximumWarning": "2kb", 41 | "maximumError": "4kb" 42 | } 43 | ], 44 | "fileReplacements": [ 45 | { 46 | "replace": "src/environments/environment.ts", 47 | "with": "src/environments/environment.prod.ts" 48 | } 49 | ], 50 | "outputHashing": "all" 51 | }, 52 | "development": { 53 | "buildOptimizer": false, 54 | "optimization": false, 55 | "vendorChunk": true, 56 | "extractLicenses": false, 57 | "sourceMap": true, 58 | "namedChunks": true 59 | } 60 | }, 61 | "defaultConfiguration": "production" 62 | }, 63 | "serve": { 64 | "builder": "@angular-devkit/build-angular:dev-server", 65 | "configurations": { 66 | "production": { 67 | "browserTarget": "buscante:build:production" 68 | }, 69 | "development": { 70 | "browserTarget": "buscante:build:development" 71 | } 72 | }, 73 | "defaultConfiguration": "development" 74 | }, 75 | "extract-i18n": { 76 | "builder": "@angular-devkit/build-angular:extract-i18n", 77 | "options": { 78 | "browserTarget": "buscante:build" 79 | } 80 | }, 81 | "test": { 82 | "builder": "@angular-devkit/build-angular:karma", 83 | "options": { 84 | "main": "src/test.ts", 85 | "polyfills": "src/polyfills.ts", 86 | "tsConfig": "tsconfig.spec.json", 87 | "karmaConfig": "karma.conf.js", 88 | "assets": [ 89 | "src/favicon.ico", 90 | "src/assets" 91 | ], 92 | "styles": [ 93 | "src/styles.css" 94 | ], 95 | "scripts": [] 96 | } 97 | } 98 | } 99 | } 100 | } 101 | } 102 | --------------------------------------------------------------------------------