├── src ├── assets │ ├── .gitkeep │ ├── card │ │ ├── calabresa.jpg │ │ ├── coca-cola.jpg │ │ ├── cardapio.svg │ │ └── pizza-pink.svg │ └── header │ │ └── pizza.svg ├── app │ ├── app.component.css │ ├── app.component.html │ ├── components │ │ └── template │ │ │ ├── content │ │ │ ├── bebida.model.ts │ │ │ ├── pizza.model.ts │ │ │ ├── produtos.service.spec.ts │ │ │ ├── produtos.model.ts │ │ │ ├── produtos.service.ts │ │ │ ├── content.component.spec.ts │ │ │ ├── content.component.css │ │ │ ├── content.component.ts │ │ │ └── content.component.html │ │ │ ├── pedido │ │ │ ├── pedido.component.html │ │ │ ├── pedido.service.spec.ts │ │ │ ├── pedido.component.ts │ │ │ ├── pedido.component.css │ │ │ ├── pedido.component.spec.ts │ │ │ ├── pedido-form │ │ │ │ ├── pedido-form.component.spec.ts │ │ │ │ ├── pedido-form.component.css │ │ │ │ ├── pedido-form.component.ts │ │ │ │ └── pedido-form.component.html │ │ │ ├── pedido-dialog │ │ │ │ ├── pedido-dialog.component.spec.ts │ │ │ │ ├── pedido-dialog.component.css │ │ │ │ ├── pedido-dialog.component.ts │ │ │ │ └── pedido-dialog.component.html │ │ │ └── pedido.service.ts │ │ │ ├── footer │ │ │ ├── footer.component.ts │ │ │ ├── footer.component.spec.ts │ │ │ ├── footer.component.css │ │ │ └── footer.component.html │ │ │ └── header │ │ │ ├── header.component.ts │ │ │ ├── header.component.html │ │ │ ├── header.component.css │ │ │ └── header.component.spec.ts │ ├── app.component.ts │ ├── app-routing.module.ts │ ├── app.component.spec.ts │ └── app.module.ts ├── favicon.ico ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── main.ts ├── index.html ├── test.ts ├── styles.css └── polyfills.ts ├── github ├── desktop.png ├── interface.gif └── pizza.svg ├── e2e ├── src │ ├── app.po.ts │ └── app.e2e-spec.ts ├── tsconfig.json └── protractor.conf.js ├── .editorconfig ├── tsconfig.app.json ├── tsconfig.spec.json ├── .browserslistrc ├── .gitignore ├── tsconfig.json ├── README.md ├── package.json ├── karma.conf.js ├── tslint.json └── angular.json /src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrorivald/pizzaria-angular/HEAD/src/favicon.ico -------------------------------------------------------------------------------- /github/desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrorivald/pizzaria-angular/HEAD/github/desktop.png -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /github/interface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrorivald/pizzaria-angular/HEAD/github/interface.gif -------------------------------------------------------------------------------- /src/assets/card/calabresa.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrorivald/pizzaria-angular/HEAD/src/assets/card/calabresa.jpg -------------------------------------------------------------------------------- /src/assets/card/coca-cola.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrorivald/pizzaria-angular/HEAD/src/assets/card/coca-cola.jpg -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/app/components/template/content/bebida.model.ts: -------------------------------------------------------------------------------- 1 | export interface Bebida { 2 | id: number; 3 | name: string; 4 | price: number; 5 | volume: string; 6 | img: string; 7 | } -------------------------------------------------------------------------------- /src/app/components/template/content/pizza.model.ts: -------------------------------------------------------------------------------- 1 | export interface Pizza { 2 | id: number; 3 | name: string; 4 | price: number; 5 | ingredients: string; 6 | img: string; 7 | } -------------------------------------------------------------------------------- /src/app/components/template/pedido/pedido.component.html: -------------------------------------------------------------------------------- 1 |
2 | 6 |
7 | -------------------------------------------------------------------------------- /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 = 'pizzaria'; 10 | } 11 | -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.forRoot(routes)], 8 | exports: [RouterModule] 9 | }) 10 | export class AppRoutingModule { } 11 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | async navigateTo(): Promise { 5 | return browser.get(browser.baseUrl); 6 | } 7 | 8 | async getTitleText(): Promise { 9 | return element(by.css('app-root .content span')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.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/e2e", 6 | "module": "commonjs", 7 | "target": "es2018", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.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/components/template/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit(): void { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/components/template/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-header', 5 | templateUrl: './header.component.html', 6 | styleUrls: ['./header.component.css'] 7 | }) 8 | export class HeaderComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit(): void { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /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/components/template/pedido/pedido.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { PedidoService } from './pedido.service'; 4 | 5 | describe('PedidoService', () => { 6 | let service: PedidoService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(PedidoService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/components/template/content/produtos.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ProdutosService } from './produtos.service'; 4 | 5 | describe('ProdutosService', () => { 6 | let service: ProdutosService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(ProdutosService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/app/components/template/content/produtos.model.ts: -------------------------------------------------------------------------------- 1 | export interface Produto { 2 | pizzas: any[]; 3 | bebidas: any[]; 4 | // pizzas: [ 5 | // { 6 | // id: number, 7 | // name: string, 8 | // price: number, 9 | // ingredients: string, 10 | // img: string 11 | // } 12 | // ], 13 | // bebidas: [ 14 | // { 15 | // id: number, 16 | // name: string, 17 | // price: number, 18 | // volume: string, 19 | // img: string 20 | // } 21 | // ] 22 | } -------------------------------------------------------------------------------- /src/app/components/template/header/header.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | logo - pizzaria 4 | 5 | 6 | PizzaDelivery 7 | 8 | 9 | 10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/app/components/template/pedido/pedido.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {MatDialog} from '@angular/material/dialog'; 3 | import { PedidoDialogComponent } from './pedido-dialog/pedido-dialog.component'; 4 | 5 | @Component({ 6 | selector: 'app-pedido', 7 | templateUrl: './pedido.component.html', 8 | styleUrls: ['./pedido.component.css'] 9 | }) 10 | export class PedidoComponent { 11 | constructor(public dialog: MatDialog) {} 12 | 13 | openPedido() { 14 | const dialogRef = this.dialog.open(PedidoDialogComponent); 15 | 16 | dialogRef.afterClosed().subscribe(result => {}); 17 | } 18 | } -------------------------------------------------------------------------------- /src/app/components/template/content/produtos.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import { Observable } from 'rxjs'; 4 | import { Produto } from './produtos.model'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class ProdutosService { 10 | 11 | private readonly API = 'https://script.google.com/macros/s/AKfycbz4bzrd6iGG8G9J1hTsvsjDk850Rpe97iQk9ciMk2-mTdRoENJO/exec'; 12 | 13 | constructor(private http: HttpClient) { } 14 | 15 | public getProdutos(): Observable{ 16 | return this.http.get(this.API); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/app/components/template/pedido/pedido.component.css: -------------------------------------------------------------------------------- 1 | .pedido { 2 | position: fixed; 3 | bottom: 30px; 4 | right: 25px; 5 | 6 | z-index: 100; 7 | } 8 | 9 | .pedido-btn { 10 | width: 140px; 11 | height: 50px; 12 | 13 | border-radius: 30px; 14 | 15 | background-color: #ff033c; 16 | color: #fff; 17 | font-size: 1rem; 18 | } 19 | 20 | .pedido-btn:hover{ 21 | opacity: 0.8; 22 | } 23 | 24 | @media screen and (max-width: 600px) { 25 | .pedido-btn { 26 | width: 130px; 27 | height: 45px; 28 | 29 | border-radius: 20px; 30 | 31 | background-color: #ff033c; 32 | color: #fff; 33 | font-size: 0.9rem; 34 | } 35 | } -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` 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/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', async () => { 12 | await page.navigateTo(); 13 | expect(await page.getTitleText()).toEqual('pizzaria app is running!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /src/app/components/template/header/header.component.css: -------------------------------------------------------------------------------- 1 | .example-spacer { 2 | flex: 1 1 auto; 3 | } 4 | 5 | a { 6 | text-decoration: none; 7 | cursor: pointer; 8 | } 9 | 10 | .icon-header { 11 | padding-left: 7px; 12 | padding-right: 7px; 13 | } 14 | 15 | .title { 16 | font-family: 'Galindo', 'Roboto'; 17 | margin-left: 15px; 18 | font-size: 1.5rem; 19 | color: #333; 20 | font-weight: bold; 21 | letter-spacing: 1.5px; 22 | } 23 | 24 | button { 25 | color: #ff033c; 26 | } 27 | 28 | button i { 29 | font-size: 1.7rem; 30 | padding-right: 4px; 31 | padding-bottom: 2px; 32 | } 33 | 34 | 35 | @media screen and (max-width: 600px) { 36 | button span { 37 | display: none; 38 | } 39 | 40 | button i { 41 | padding-right: 0; 42 | } 43 | } -------------------------------------------------------------------------------- /.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 | not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. 18 | -------------------------------------------------------------------------------- /src/app/components/template/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ FooterComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/template/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/template/pedido/pedido.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PedidoComponent } from './pedido.component'; 4 | 5 | describe('PedidoComponent', () => { 6 | let component: PedidoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ PedidoComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(PedidoComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/template/content/content.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ContentComponent } from './content.component'; 4 | 5 | describe('ContentComponent', () => { 6 | let component: ContentComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ContentComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ContentComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/template/pedido/pedido-form/pedido-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PedidoFormComponent } from './pedido-form.component'; 4 | 5 | describe('PedidoFormComponent', () => { 6 | let component: PedidoFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ PedidoFormComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(PedidoFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/template/pedido/pedido-form/pedido-form.component.css: -------------------------------------------------------------------------------- 1 | mat-form-field { 2 | width: 100%; 3 | } 4 | 5 | mat-label { 6 | color: #ff033c; 7 | } 8 | 9 | .mat-form-field-subscript-wrapper{ 10 | background-color: #ff033c; 11 | } 12 | 13 | .numero { 14 | width: 30%; 15 | } 16 | 17 | .complemento { 18 | width: 70%; 19 | } 20 | 21 | .btn-dialog { 22 | display: flex; 23 | justify-content: flex-end; 24 | color: #333; 25 | } 26 | 27 | .btn-dialog button { 28 | background-color: #ffff8c; 29 | } 30 | 31 | /*.dialog-icon { 32 | padding-bottom: 3px; 33 | }*/ 34 | 35 | @media screen and (max-width: 600px) { 36 | .btn-dialog{ 37 | justify-content: center; 38 | } 39 | 40 | .btn-dialog button .span-icon { 41 | display: none; 42 | } 43 | 44 | button .dialog-icon { 45 | padding-right: 0; 46 | } 47 | } -------------------------------------------------------------------------------- /.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 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | speed-measure-plugin*.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /src/app/components/template/pedido/pedido-dialog/pedido-dialog.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PedidoDialogComponent } from './pedido-dialog.component'; 4 | 5 | describe('PedidoDialogComponent', () => { 6 | let component: PedidoDialogComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ PedidoDialogComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(PedidoDialogComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PizzaDelivery 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /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/dist/zone-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 | keys(): string[]; 13 | (id: string): T; 14 | }; 15 | }; 16 | 17 | // First, initialize the Angular testing environment. 18 | getTestBed().initTestEnvironment( 19 | BrowserDynamicTestingModule, 20 | platformBrowserDynamicTesting() 21 | ); 22 | // Then we find all the tests. 23 | const context = require.context('./', true, /\.spec\.ts$/); 24 | // And load the modules. 25 | context.keys().map(context); 26 | -------------------------------------------------------------------------------- /src/app/components/template/pedido/pedido-dialog/pedido-dialog.component.css: -------------------------------------------------------------------------------- 1 | h2 { 2 | color: #333; 3 | } 4 | 5 | table { 6 | width: 60vw; 7 | } 8 | 9 | table th { 10 | text-align: center; 11 | } 12 | 13 | table td { 14 | text-align: center; 15 | } 16 | 17 | tr.mat-footer-row { 18 | font-weight: bold; 19 | } 20 | 21 | .btn-dialog { 22 | display: flex; 23 | justify-content: flex-end; 24 | color: #333; 25 | } 26 | 27 | .btn-dialog button { 28 | background-color: #ffff8c; 29 | } 30 | 31 | .excluir { 32 | cursor: pointer; 33 | } 34 | 35 | /*.dialog-icon { 36 | padding-bottom: 3px; 37 | }*/ 38 | 39 | @media screen and (max-width: 600px) { 40 | .btn-dialog{ 41 | justify-content: center; 42 | } 43 | 44 | .btn-dialog button .span-icon { 45 | display: none; 46 | } 47 | 48 | button .dialog-icon { 49 | padding-right: 0; 50 | } 51 | } -------------------------------------------------------------------------------- /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": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true, 11 | "sourceMap": true, 12 | "declaration": false, 13 | "downlevelIteration": true, 14 | "experimentalDecorators": true, 15 | "moduleResolution": "node", 16 | "importHelpers": true, 17 | "target": "es2015", 18 | "module": "es2020", 19 | "lib": [ 20 | "es2018", 21 | "dom" 22 | ] 23 | }, 24 | "angularCompilerOptions": { 25 | "strictInjectionParameters": true, 26 | "strictInputAccessModifiers": true, 27 | "strictTemplates": true 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | 3 | html, body { height: 100%; } 4 | body { 5 | margin: 0; 6 | font-family: Roboto, "Helvetica Neue", sans-serif; 7 | 8 | } 9 | 10 | .mat-form-field.mat-focused .mat-form-field-ripple { 11 | background-color: #ff033c; 12 | } 13 | 14 | .color-white { 15 | color: #fff; 16 | } 17 | 18 | .color-gray { 19 | color: #333; 20 | } 21 | 22 | .color-pink{ 23 | color: #ff033c; 24 | } 25 | 26 | .bg-pink { 27 | background: #ff033c; 28 | } 29 | 30 | .bg-yellow { 31 | background: #ffff8c; 32 | } 33 | 34 | .mat-tab-group.mat-primary .mat-ink-bar, .mat-tab-nav-bar.mat-primary .mat-ink-bar { 35 | background-color: #ff033c; 36 | } 37 | 38 | .mat-progress-spinner circle, .mat-spinner circle { 39 | stroke: #ff033c; 40 | } 41 | 42 | .txt-center{ 43 | text-align: center; 44 | } 45 | 46 | .link-a { 47 | text-decoration: none; 48 | } -------------------------------------------------------------------------------- /e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | browserName: 'chrome' 17 | }, 18 | directConnect: true, 19 | SELENIUM_PROMISE_MANAGER: false, 20 | baseUrl: 'http://localhost:4200/', 21 | framework: 'jasmine', 22 | jasmineNodeOpts: { 23 | showColors: true, 24 | defaultTimeoutInterval: 30000, 25 | print: function() {} 26 | }, 27 | onPrepare() { 28 | require('ts-node').register({ 29 | project: require('path').join(__dirname, './tsconfig.json') 30 | }); 31 | jasmine.getEnv().addReporter(new SpecReporter({ 32 | spec: { 33 | displayStacktrace: StacktraceOption.PRETTY 34 | } 35 | })); 36 | } 37 | }; -------------------------------------------------------------------------------- /src/app/components/template/pedido/pedido-form/pedido-form.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { PedidoService } from '../pedido.service'; 3 | 4 | @Component({ 5 | selector: 'app-pedido-form', 6 | templateUrl: './pedido-form.component.html', 7 | styleUrls: ['./pedido-form.component.css'] 8 | }) 9 | export class PedidoFormComponent implements OnInit { 10 | 11 | nome: string = ''; 12 | numero: string = ''; 13 | rua: string = ''; 14 | bairro: string = ''; 15 | complemento: string = ''; 16 | troco: string = ''; 17 | 18 | constructor(private pedidoService: PedidoService) { } 19 | 20 | ngOnInit(): void { 21 | } 22 | 23 | concluirPedido(): void { 24 | let texto = `*Nome:* ${this.nome};\n*Bairro:* ${this.bairro};\n*Rua:* ${this.rua};\n*Número:* ${this.numero};\n*Complemento:* ${this.complemento};\n*Troco para:* ${this.troco}\n\n`; 25 | let textoURI = encodeURIComponent(texto); 26 | 27 | window.open(`https://api.whatsapp.com/send?phone=5585996455918&text=${textoURI}${this.pedidoService.pedidoURI}`); 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/app/components/template/pedido/pedido.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | import { 4 | MatSnackBar, 5 | MatSnackBarHorizontalPosition, 6 | MatSnackBarVerticalPosition, 7 | } from '@angular/material/snack-bar'; 8 | 9 | export interface Transaction { 10 | item: string; 11 | price: number; 12 | num: number; 13 | } 14 | 15 | @Injectable({ 16 | providedIn: 'root' 17 | }) 18 | export class PedidoService { 19 | 20 | pedidoURI: string = ''; 21 | formularioURI: string = ''; 22 | 23 | transactions: Transaction[] = []; 24 | 25 | constructor(private _snackBar: MatSnackBar) {} 26 | 27 | horizontalPosition: MatSnackBarHorizontalPosition = 'right'; 28 | verticalPosition: MatSnackBarVerticalPosition = 'top'; 29 | 30 | 31 | openSnackBar(msg: string) { 32 | this._snackBar.open(msg, 'X', { 33 | duration: 700, 34 | horizontalPosition: this.horizontalPosition, 35 | verticalPosition: this.verticalPosition, 36 | }); 37 | } 38 | 39 | getPedidoValues(item: string, price: number) { 40 | this.transactions.push({item: item, price: price, num: this.transactions.length}); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /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 'pizzaria'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.componentInstance; 26 | expect(app.title).toEqual('pizzaria'); 27 | }); 28 | 29 | it('should render title', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.nativeElement; 33 | expect(compiled.querySelector('.content span').textContent).toContain('pizzaria app is running!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 |
3 | PizzaDelivery 4 |
5 |

6 | 7 |
8 | 9 | 10 |

Aplicação de delivery para pizzarias, feita em Angular!

11 | 12 | Acessar: https://pizzadelivery.vercel.app 13 | 14 | 15 | ## :hammer: **Tecnologias Usadas** :wrench: 16 | ![Angular](https://img.shields.io/badge/-Angular-e00000?style=flat-square&logo=Angular) 17 | ![TypeScript](https://img.shields.io/badge/-TypeScript-black?style=flat-square&logo=typescript) 18 | ![HTML5](https://img.shields.io/badge/-HTML5-E34F26?style=flat-square&logo=html5&logoColor=white) 19 | ![JavaScript](https://img.shields.io/badge/-JavaScript-black?style=flat-square&logo=javascript) 20 | ![CSS3](https://img.shields.io/badge/-CSS3-1572B6?style=flat-square&logo=css3) 21 | 22 | ## :iphone: Mobile 23 | 24 | 25 | 26 | ## :desktop_computer: Desktop 27 | 28 | 29 | 30 | Este projeto foi gerado com [Angular CLI](https://github.com/angular/angular-cli) version 11.0.3. 31 | 32 | 33 |
-------------------------------------------------------------------------------- /src/app/components/template/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | .footer-content { 2 | min-height: 120px; 3 | display: flex; 4 | justify-content: center; 5 | } 6 | 7 | .footer-content div{ 8 | width: 60%; 9 | font-weight: 500; 10 | font-size: 1.1rem; 11 | color: #333; 12 | text-align: center; 13 | padding-top: 30px; 14 | padding-bottom: 30px; 15 | } 16 | 17 | .footer-content div a { 18 | color: #333; 19 | } 20 | 21 | .icon-title { 22 | padding-right: 4px; 23 | } 24 | 25 | .redes { 26 | display: flex; 27 | justify-content: center; 28 | margin-top: 10px; 29 | padding-top: 15px; 30 | } 31 | 32 | .redes p { 33 | padding: 10px; 34 | } 35 | 36 | .redes a > i { 37 | font-size: 1.8rem; 38 | } 39 | 40 | .fa-facebook { 41 | color: #1877f2; 42 | } 43 | 44 | .fa-whatsapp-square { 45 | color: #00e676; 46 | } 47 | 48 | .fa-instagram { 49 | color: #ba33ac; 50 | } 51 | 52 | .fa-store { 53 | color: #ff033c; 54 | } 55 | 56 | .fa-map-marker-alt { 57 | color: green; 58 | } 59 | 60 | .fa-laptop-code { 61 | color: darkslateblue; 62 | } 63 | 64 | .fa-github { 65 | color: #333; 66 | padding: 5px; 67 | font-size: 1.2rem; 68 | } 69 | 70 | @media screen and (max-width: 600px) { 71 | .footer-content div { 72 | width: 80%; 73 | } 74 | } -------------------------------------------------------------------------------- /src/app/components/template/content/content.component.css: -------------------------------------------------------------------------------- 1 | .content { 2 | margin-top: 25px; 3 | } 4 | 5 | .example-tab-icon { 6 | margin-right: 8px; 7 | } 8 | 9 | .mat-card-pizza, .mat-card-bebida{ 10 | padding-top: 10px; 11 | margin: 10px; 12 | margin-top: 30px; 13 | } 14 | 15 | .avatar { 16 | height: 50px; 17 | width: 50px; 18 | border: none; 19 | } 20 | 21 | .subtitle { 22 | height: 40px; 23 | } 24 | 25 | .pizza-header-image, .bebida-header-image { 26 | background-image: url('../../../../assets/card/cardapio.svg'); 27 | background-size: 85%; 28 | background-repeat: no-repeat; 29 | } 30 | 31 | .img-bebida, .img-pizza { 32 | display: flex; 33 | justify-content: center; 34 | align-self: center; 35 | margin-top: 10px; 36 | border-radius: 5px; 37 | height: 60%; 38 | } 39 | 40 | .img-bebida img { 41 | width: 60%; 42 | } 43 | 44 | .img-pizza img{ 45 | width: 95%; 46 | } 47 | 48 | .price { 49 | font-size: 1.8rem; 50 | text-align: center; 51 | } 52 | 53 | .btn { 54 | display: flex; 55 | justify-content: center; 56 | } 57 | 58 | .spinner { 59 | width: 100%; 60 | height: 60vh; 61 | 62 | display: flex; 63 | justify-content: center; 64 | align-items: center; 65 | } 66 | 67 | /* 960 -> 2 colunas */ 68 | /* 600 -> 1 coluna */ 69 | 70 | @media screen and (max-width: 600px) { 71 | .subtitle { 72 | height: auto; 73 | } 74 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pizzaria", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~11.0.3", 15 | "@angular/cdk": "^11.0.3", 16 | "@angular/common": "~11.0.3", 17 | "@angular/compiler": "~11.0.3", 18 | "@angular/core": "~11.0.3", 19 | "@angular/flex-layout": "^9.0.0-beta.31", 20 | "@angular/forms": "~11.0.3", 21 | "@angular/material": "^11.0.3", 22 | "@angular/platform-browser": "~11.0.3", 23 | "@angular/platform-browser-dynamic": "~11.0.3", 24 | "@angular/router": "~11.0.3", 25 | "axios": "^0.21.1", 26 | "rxjs": "~6.6.0", 27 | "tslib": "^2.0.0", 28 | "zone.js": "~0.10.2" 29 | }, 30 | "devDependencies": { 31 | "@angular-devkit/build-angular": "~0.1100.3", 32 | "@angular/cli": "~11.0.3", 33 | "@angular/compiler-cli": "~11.0.3", 34 | "@types/jasmine": "~3.6.0", 35 | "@types/node": "^12.11.1", 36 | "codelyzer": "^6.0.0", 37 | "jasmine-core": "~3.6.0", 38 | "jasmine-spec-reporter": "~5.0.0", 39 | "karma": "~5.1.0", 40 | "karma-chrome-launcher": "~3.1.0", 41 | "karma-coverage": "~2.0.3", 42 | "karma-jasmine": "~4.0.0", 43 | "karma-jasmine-html-reporter": "^1.5.0", 44 | "protractor": "~7.0.0", 45 | "ts-node": "~8.3.0", 46 | "tslint": "~6.1.0", 47 | "typescript": "~4.0.2" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/app/components/template/content/content.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { PedidoService } from '../pedido/pedido.service'; 3 | import { Bebida } from './bebida.model'; 4 | import { Pizza } from './pizza.model'; 5 | import { ProdutosService } from './produtos.service'; 6 | 7 | @Component({ 8 | selector: 'app-content', 9 | templateUrl: './content.component.html', 10 | styleUrls: ['./content.component.css'] 11 | }) 12 | export class ContentComponent implements OnInit { 13 | 14 | pizzasArray: Pizza[] = []; 15 | bebidasArray: Bebida[] = []; 16 | 17 | constructor(private produtosService: ProdutosService, private pedidoService: PedidoService) { } 18 | 19 | ngOnInit(): void { 20 | this.getPizzas(); 21 | } 22 | 23 | getPizzas() { 24 | this.produtosService.getProdutos().subscribe(data => { 25 | this.pizzasArray = data.pizzas; 26 | this.bebidasArray = data.bebidas; 27 | }); 28 | } 29 | 30 | addPizzaPedido(id: number) { 31 | this.pizzasArray.forEach((value)=> { 32 | if(value.id === id){ 33 | this.pedidoService.getPedidoValues(value.name, value.price); 34 | this.pedidoService.openSnackBar('Pizza adicionada!'); 35 | } 36 | }); 37 | } 38 | 39 | addBebidaPedido(id: number) { 40 | this.bebidasArray.forEach((value)=> { 41 | if(value.id === id){ 42 | this.pedidoService.getPedidoValues(`${value.name} ${value.volume}`, value.price); 43 | this.pedidoService.openSnackBar('Bebida adicionada!'); 44 | } 45 | }); 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /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/pizzaria'), 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/components/template/pedido/pedido-dialog/pedido-dialog.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { PedidoFormComponent } from '../pedido-form/pedido-form.component'; 3 | import {MatDialog} from '@angular/material/dialog'; 4 | import { PedidoService } from '../pedido.service'; 5 | 6 | @Component({ 7 | selector: 'app-pedido-dialog', 8 | templateUrl: './pedido-dialog.component.html', 9 | styleUrls: ['./pedido-dialog.component.css'] 10 | }) 11 | export class PedidoDialogComponent implements OnInit { 12 | 13 | constructor(public dialog: MatDialog, private pedidoService: PedidoService) { } 14 | 15 | transactions = this.pedidoService.transactions; 16 | 17 | ngOnInit(): void { 18 | } 19 | 20 | displayedColumns: string[] = ['item', 'price', 'action']; 21 | 22 | getTotalPrice() { 23 | return this.transactions.map(t => t.price).reduce((acc, value) => acc + value, 0); 24 | } 25 | 26 | openPedidoForm(): void{ 27 | const dialogRef = this.dialog.open(PedidoFormComponent); 28 | let pedido = '*Pedido:*\n'; 29 | 30 | dialogRef.afterClosed().subscribe(result => {}); 31 | 32 | this.transactions.forEach(obj => { 33 | pedido += `*${obj.item}* -> R$${obj.price}\n`; 34 | }); 35 | 36 | pedido += `*Total:* R$${this.getTotalPrice()}`; 37 | 38 | let pedidoURI = encodeURIComponent(pedido); 39 | 40 | this.pedidoService.pedidoURI = pedidoURI; 41 | } 42 | 43 | removerItem(num: number) { 44 | this.pedidoService.transactions.splice(num, 1); 45 | this.pedidoService.openSnackBar('Item removido!'); 46 | } 47 | 48 | removerPedido() { 49 | this.pedidoService.transactions = []; 50 | this.pedidoService.openSnackBar('Pedido removido!'); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/app/components/template/pedido/pedido-form/pedido-form.component.html: -------------------------------------------------------------------------------- 1 |

Formulário de Pedido

2 | 3 |
4 |

5 | 6 | Nome 7 | 8 | 9 |

10 |

11 | 12 | Bairro 13 | 14 | 15 |

16 |

17 | 18 | Rua 19 | 20 | 21 |

22 | 23 |

24 | 25 | Número 26 | 27 | 28 | 29 | 30 | Complemento 31 | 32 | 33 |

34 | 35 |

36 | 37 | Troco para? 38 | 39 | 40 |

41 | 42 |
43 |
44 | 45 | 46 | 50 | 51 | 55 | 56 | -------------------------------------------------------------------------------- /src/app/components/template/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 | 61 | -------------------------------------------------------------------------------- /src/app/components/template/pedido/pedido-dialog/pedido-dialog.component.html: -------------------------------------------------------------------------------- 1 |

Meu Pedido

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 27 | 28 | 29 | 30 | 31 | 32 |
Item {{transaction.item}} Total Preço {{transaction.price | currency: 'BRL'}} {{getTotalPrice() | currency: 'BRL'}} Excluir 22 | remove_circle 23 | 25 | delete 26 |
33 |
34 | 35 | 36 | 40 | 41 | 45 | -------------------------------------------------------------------------------- /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 Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | /*************************************************************************************************** 56 | * Zone JS is required by default for Angular itself. 57 | */ 58 | import 'zone.js/dist/zone'; // Included with Angular CLI. 59 | 60 | 61 | /*************************************************************************************************** 62 | * APPLICATION IMPORTS 63 | */ 64 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule, LOCALE_ID } from '@angular/core'; 3 | import { FormsModule } from "@angular/forms"; 4 | import { HttpClientModule } from '@angular/common/http'; 5 | 6 | import { AppRoutingModule } from './app-routing.module'; 7 | import { AppComponent } from './app.component'; 8 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 9 | import { HeaderComponent } from './components/template/header/header.component'; 10 | import { ContentComponent } from './components/template/content/content.component'; 11 | import { FooterComponent } from './components/template/footer/footer.component'; 12 | import { PedidoComponent } from './components/template/pedido/pedido.component'; 13 | 14 | import { FlexLayoutModule } from "@angular/flex-layout"; 15 | 16 | //material 17 | import {MatToolbarModule} from '@angular/material/toolbar'; 18 | import {MatIconModule} from '@angular/material/icon'; 19 | import {MatTabsModule} from '@angular/material/tabs'; 20 | import {MatCardModule} from '@angular/material/card'; 21 | import {MatButtonModule} from '@angular/material/button'; 22 | import {MatButtonToggleModule} from '@angular/material/button-toggle'; 23 | import {MatBadgeModule} from '@angular/material/badge'; 24 | import {MatDialogModule} from '@angular/material/dialog'; 25 | import {MatTableModule} from '@angular/material/table'; 26 | import {MatInputModule} from '@angular/material/input'; 27 | import {MatFormFieldModule} from '@angular/material/form-field'; 28 | import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; 29 | import {MatSnackBarModule} from '@angular/material/snack-bar'; 30 | 31 | import {ScrollingModule} from '@angular/cdk/scrolling'; 32 | import { PedidoDialogComponent } from './components/template/pedido/pedido-dialog/pedido-dialog.component'; 33 | 34 | import localePt from '@angular/common/locales/pt'; 35 | import { registerLocaleData } from '@angular/common'; 36 | import { PedidoFormComponent } from './components/template/pedido/pedido-form/pedido-form.component' 37 | 38 | registerLocaleData(localePt); 39 | 40 | @NgModule({ 41 | declarations: [ 42 | AppComponent, 43 | HeaderComponent, 44 | ContentComponent, 45 | FooterComponent, 46 | PedidoComponent, 47 | PedidoDialogComponent, 48 | PedidoFormComponent, 49 | ], 50 | imports: [ 51 | BrowserModule, 52 | AppRoutingModule, 53 | BrowserAnimationsModule, 54 | MatToolbarModule, 55 | MatIconModule, 56 | MatTabsModule, 57 | MatCardModule, 58 | FlexLayoutModule, 59 | MatButtonModule, 60 | MatBadgeModule, 61 | MatDialogModule, 62 | MatButtonToggleModule, 63 | ScrollingModule, 64 | MatTableModule, 65 | MatInputModule, 66 | MatFormFieldModule, 67 | FormsModule, 68 | HttpClientModule, 69 | MatProgressSpinnerModule, 70 | MatSnackBarModule 71 | ], 72 | providers: [{ 73 | provide: LOCALE_ID, 74 | useValue: 'pt-BR' 75 | } 76 | ], 77 | bootstrap: [AppComponent] 78 | }) 79 | export class AppModule { } 80 | -------------------------------------------------------------------------------- /src/app/components/template/content/content.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | local_pizza 5 | Pizzas 6 | 7 |
8 | 9 | 10 | 13 | 14 | 15 |
16 | {{ pizza.name }} 17 | {{ pizza.ingredients }} 18 |
19 | 20 |
21 | Pizza Sabor {{ pizza.name }} 23 |
24 | 25 |

26 | {{ pizza.price | currency: 'BRL' }} 27 |

28 | 29 | 30 | 34 | 35 | 36 |
37 | 38 |
39 | 40 |
41 | 42 |
43 | 44 | 45 | 46 | local_bar 47 | Bebidas 48 | 49 | 50 | 51 |
52 | 53 | 54 | 57 | 58 | 59 |
60 | {{ bebida.name }} 61 | {{ bebida.volume }} 62 |
63 | 64 |
65 | Bebida {{ bebida.name }} 67 |
68 | 69 |

70 | {{ bebida.price | currency: 'BRL' }} 71 |

72 | 73 | 74 | 78 | 79 | 80 |
81 | 82 |
83 |
84 | 85 |
86 | 87 |
88 | 89 | 90 |
91 |
92 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rulesDirectory": [ 4 | "codelyzer" 5 | ], 6 | "rules": { 7 | "align": { 8 | "options": [ 9 | "parameters", 10 | "statements" 11 | ] 12 | }, 13 | "array-type": false, 14 | "arrow-return-shorthand": true, 15 | "curly": true, 16 | "deprecation": { 17 | "severity": "warning" 18 | }, 19 | "eofline": true, 20 | "import-blacklist": [ 21 | true, 22 | "rxjs/Rx" 23 | ], 24 | "import-spacing": true, 25 | "indent": { 26 | "options": [ 27 | "spaces" 28 | ] 29 | }, 30 | "max-classes-per-file": false, 31 | "max-line-length": [ 32 | true, 33 | 140 34 | ], 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-console": [ 47 | true, 48 | "debug", 49 | "info", 50 | "time", 51 | "timeEnd", 52 | "trace" 53 | ], 54 | "no-empty": false, 55 | "no-inferrable-types": [ 56 | true, 57 | "ignore-params" 58 | ], 59 | "no-non-null-assertion": true, 60 | "no-redundant-jsdoc": true, 61 | "no-switch-case-fall-through": true, 62 | "no-var-requires": false, 63 | "object-literal-key-quotes": [ 64 | true, 65 | "as-needed" 66 | ], 67 | "quotemark": [ 68 | true, 69 | "single" 70 | ], 71 | "semicolon": { 72 | "options": [ 73 | "always" 74 | ] 75 | }, 76 | "space-before-function-paren": { 77 | "options": { 78 | "anonymous": "never", 79 | "asyncArrow": "always", 80 | "constructor": "never", 81 | "method": "never", 82 | "named": "never" 83 | } 84 | }, 85 | "typedef": [ 86 | true, 87 | "call-signature" 88 | ], 89 | "typedef-whitespace": { 90 | "options": [ 91 | { 92 | "call-signature": "nospace", 93 | "index-signature": "nospace", 94 | "parameter": "nospace", 95 | "property-declaration": "nospace", 96 | "variable-declaration": "nospace" 97 | }, 98 | { 99 | "call-signature": "onespace", 100 | "index-signature": "onespace", 101 | "parameter": "onespace", 102 | "property-declaration": "onespace", 103 | "variable-declaration": "onespace" 104 | } 105 | ] 106 | }, 107 | "variable-name": { 108 | "options": [ 109 | "ban-keywords", 110 | "check-format", 111 | "allow-pascal-case" 112 | ] 113 | }, 114 | "whitespace": { 115 | "options": [ 116 | "check-branch", 117 | "check-decl", 118 | "check-operator", 119 | "check-separator", 120 | "check-type", 121 | "check-typecast" 122 | ] 123 | }, 124 | "component-class-suffix": true, 125 | "contextual-lifecycle": true, 126 | "directive-class-suffix": true, 127 | "no-conflicting-lifecycle": true, 128 | "no-host-metadata-property": true, 129 | "no-input-rename": true, 130 | "no-inputs-metadata-property": true, 131 | "no-output-native": true, 132 | "no-output-on-prefix": true, 133 | "no-output-rename": true, 134 | "no-outputs-metadata-property": true, 135 | "template-banana-in-box": true, 136 | "template-no-negated-async": true, 137 | "use-lifecycle-interface": true, 138 | "use-pipe-transform-interface": true, 139 | "directive-selector": [ 140 | true, 141 | "attribute", 142 | "app", 143 | "camelCase" 144 | ], 145 | "component-selector": [ 146 | true, 147 | "element", 148 | "app", 149 | "kebab-case" 150 | ] 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /src/assets/card/cardapio.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "pizzaria": { 7 | "projectType": "application", 8 | "schematics": { 9 | "@schematics/angular:application": { 10 | "strict": true 11 | } 12 | }, 13 | "root": "", 14 | "sourceRoot": "src", 15 | "prefix": "app", 16 | "architect": { 17 | "build": { 18 | "builder": "@angular-devkit/build-angular:browser", 19 | "options": { 20 | "outputPath": "dist/pizzaria", 21 | "index": "src/index.html", 22 | "main": "src/main.ts", 23 | "polyfills": "src/polyfills.ts", 24 | "tsConfig": "tsconfig.app.json", 25 | "aot": true, 26 | "assets": [ 27 | "src/favicon.ico", 28 | "src/assets" 29 | ], 30 | "styles": [ 31 | "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", 32 | "src/styles.css" 33 | ], 34 | "scripts": [] 35 | }, 36 | "configurations": { 37 | "production": { 38 | "fileReplacements": [ 39 | { 40 | "replace": "src/environments/environment.ts", 41 | "with": "src/environments/environment.prod.ts" 42 | } 43 | ], 44 | "optimization": true, 45 | "outputHashing": "all", 46 | "sourceMap": false, 47 | "namedChunks": false, 48 | "extractLicenses": true, 49 | "vendorChunk": false, 50 | "buildOptimizer": true, 51 | "budgets": [ 52 | { 53 | "type": "initial", 54 | "maximumWarning": "500kb", 55 | "maximumError": "1mb" 56 | }, 57 | { 58 | "type": "anyComponentStyle", 59 | "maximumWarning": "2kb", 60 | "maximumError": "4kb" 61 | } 62 | ] 63 | } 64 | } 65 | }, 66 | "serve": { 67 | "builder": "@angular-devkit/build-angular:dev-server", 68 | "options": { 69 | "browserTarget": "pizzaria:build" 70 | }, 71 | "configurations": { 72 | "production": { 73 | "browserTarget": "pizzaria:build:production" 74 | } 75 | } 76 | }, 77 | "extract-i18n": { 78 | "builder": "@angular-devkit/build-angular:extract-i18n", 79 | "options": { 80 | "browserTarget": "pizzaria:build" 81 | } 82 | }, 83 | "test": { 84 | "builder": "@angular-devkit/build-angular:karma", 85 | "options": { 86 | "main": "src/test.ts", 87 | "polyfills": "src/polyfills.ts", 88 | "tsConfig": "tsconfig.spec.json", 89 | "karmaConfig": "karma.conf.js", 90 | "assets": [ 91 | "src/favicon.ico", 92 | "src/assets" 93 | ], 94 | "styles": [ 95 | "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", 96 | "src/styles.css" 97 | ], 98 | "scripts": [] 99 | } 100 | }, 101 | "lint": { 102 | "builder": "@angular-devkit/build-angular:tslint", 103 | "options": { 104 | "tsConfig": [ 105 | "tsconfig.app.json", 106 | "tsconfig.spec.json", 107 | "e2e/tsconfig.json" 108 | ], 109 | "exclude": [ 110 | "**/node_modules/**" 111 | ] 112 | } 113 | }, 114 | "e2e": { 115 | "builder": "@angular-devkit/build-angular:protractor", 116 | "options": { 117 | "protractorConfig": "e2e/protractor.conf.js", 118 | "devServerTarget": "pizzaria:serve" 119 | }, 120 | "configurations": { 121 | "production": { 122 | "devServerTarget": "pizzaria:serve:production" 123 | } 124 | } 125 | } 126 | } 127 | } 128 | }, 129 | "defaultProject": "pizzaria" 130 | } 131 | -------------------------------------------------------------------------------- /src/assets/card/pizza-pink.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /github/pizza.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/header/pizza.svg: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------