Commit bc2b71db6fd6b04a63eb50d730d15ef0b8b6756a

Authored by Marcelo Puebla
1 parent 569a98e9fa
Exists in master

Cambio en vista de pedidos salientes.

src/app/components/pedidos-salientes/pedidos-salientes.component.html
1 <div class="bg-primary-gradient vh-100"> 1 <div class="bg-primary-gradient vh-100">
2 <div class="d-flex justify-content-center"> 2 <div class="d-flex justify-content-center">
3 <div class="row my-5 text-white text-center"> 3 <div class="row m-5 text-white text-center">
4 <h1 class="col-12">Su pedido ya esta listo.</h1>
5 <h2 class="col-12 mt-3">Nº de Pedido</h2>
6 4
7 <h1 *ngIf="pedidosRecientes.length" class="col-12 border rounded"> 5 <div class="col-12 p-0">
8 {{rellenar(pedidosRecientes[0].id, 2)}} 6 <p class="h1 m-0">Su pedido ya esta listo.</p>
9 </h1> 7 <p class="h2 m-0">Nº de Pedido</p>
8 </div>
9
10 <div
11 *ngIf="pedidosRecientes.length"
12 class="col-12 p-2">
13 <div class="border rounded shadow h-big">
14 <div class="font-weight-bold heartbeat m-0 h-100">
15 {{rellenar(pedidosRecientes[0].id, 2)}}
16 </div>
17 </div>
18 </div>
19
20 <div
21 *ngFor="let pedido of pedidosRecientes; let i = index"
22 [hidden]="i == 0 || i > 8"
23 class="col-3 p-2">
24 <p class="font-weight-bold display-1 m-0 py-1 border rounded shadow">
25 {{rellenar(pedido.id, 2)}}
26 </p>
27 </div>
10 28
11 <h2 *ngFor="let pedido of pedidosRecientes; let i = index" [hidden]="i == 0" class="col-4 border rounded mx-0">
12 {{rellenar(pedido.id, 2)}}
src/app/components/pedidos-salientes/pedidos-salientes.component.scss
1 .h-big {
2 font-size: 24vh;
3 height: 35vh;
4 }
5
src/app/components/pedidos-salientes/pedidos-salientes.component.ts
1 import { Component, OnInit } from '@angular/core'; 1 import { Component, OnInit } from '@angular/core';
2 import { ComandaService } from 'src/app/services/comanda.service'; 2 import { ComandaService } from 'src/app/services/comanda.service';
3 3
4 @Component({ 4 @Component({
5 selector: 'app-pedidos-salientes', 5 selector: 'app-pedidos-salientes',
6 templateUrl: './pedidos-salientes.component.html', 6 templateUrl: './pedidos-salientes.component.html',
7 styleUrls: ['./pedidos-salientes.component.scss'] 7 styleUrls: ['./pedidos-salientes.component.scss']
8 }) 8 })
9 export class PedidosSalientesComponent implements OnInit { 9 export class PedidosSalientesComponent implements OnInit {
10 10
11 private pedidosRecientes = []; 11 private pedidosRecientes = [];
12 private ciclo; 12 private ciclo;
13 13
14 constructor(private comandaService: ComandaService) { } 14 constructor(private comandaService: ComandaService) { }
15 15
16 ngOnInit() { 16 ngOnInit() {
17 this.buscar(); 17 this.buscar();
18 18
19 this.ciclo = setTimeout(() => { 19 this.ciclo = setTimeout(() => {
20 this.buscar(); 20 this.buscar();
21 }, 5000) 21 }, 5000)
22 } 22 }
23 23
24 ngOnDestroy() { 24 ngOnDestroy() {
25 25
26 clearTimeout(this.ciclo); 26 clearTimeout(this.ciclo);
27 } 27 }
28 28
29 buscar() { 29 buscar() {
30 30
31 this.comandaService 31 this.comandaService.getPendientesEntrega()
32 .getPendientesEntrega() 32 .subscribe((pedidos: []) => {
33 .subscribe((pedidos: []) => {
34 33
35 this.pedidosRecientes = pedidos; 34 this.pedidosRecientes = pedidos;
36 }, console.log); 35 }, console.log);
37 } 36 }
38 37
39 rellenar(relleno, longitud) { 38 rellenar(relleno, longitud) {
40 relleno = '' + relleno; 39 relleno = '' + relleno;
41 while (relleno.length < longitud) { 40 while (relleno.length < longitud) {
42 relleno = '0' + relleno; 41 relleno = '0' + relleno;
43 } 42 }
44 return relleno; 43 return relleno;
45 } 44 }
46 } 45 }
47 46
src/assets/scss/animation.scss
1 .fade-in { 1 .fade-in {
2 -webkit-animation: fadein 0.6s cubic-bezier(0.39, 0.575, 0.565, 1) both; 2 -webkit-animation: fadein 0.6s cubic-bezier(0.39, 0.575, 0.565, 1) both;
3 animation: fadein 0.6s cubic-bezier(0.39, 0.575, 0.565, 1) both; 3 animation: fadein 0.6s cubic-bezier(0.39, 0.575, 0.565, 1) both;
4 } 4 }
5 5
6 @-webkit-keyframes fadein { 6 @-webkit-keyframes fadein {
7 0% { 7 0% {
8 -webkit-transform: translateZ(80px); 8 -webkit-transform: translateZ(80px);
9 transform: translateZ(80px); 9 transform: translateZ(80px);
10 opacity: 0; 10 opacity: 0;
11 } 11 }
12 100% { 12 100% {
13 -webkit-transform: translateZ(0); 13 -webkit-transform: translateZ(0);
14 transform: translateZ(0); 14 transform: translateZ(0);
15 opacity: 1; 15 opacity: 1;
16 } 16 }
17 } 17 }
18 18
19 @keyframes fadein { 19 @keyframes fadein {
20 0% { 20 0% {
21 -webkit-transform: translateZ(80px); 21 -webkit-transform: translateZ(80px);
22 transform: translateZ(80px); 22 transform: translateZ(80px);
23 opacity: 0; 23 opacity: 0;
24 } 24 }
25 100% { 25 100% {
26 -webkit-transform: translateZ(0); 26 -webkit-transform: translateZ(0);
27 transform: translateZ(0); 27 transform: translateZ(0);
28 opacity: 1; 28 opacity: 1;
29 } 29 }
30 } 30 }
31 31
32 .fade-right { 32 .fade-right {
33 animation: faderight 1s; 33 animation: faderight 1s;
34 -moz-animation: faderight 1s; /* Firefox */ 34 -moz-animation: faderight 1s; /* Firefox */
35 -webkit-animation: faderight 1s; /* Safari and Chrome */ 35 -webkit-animation: faderight 1s; /* Safari and Chrome */
36 -o-animation: faderight 1s; /* Opera */ 36 -o-animation: faderight 1s; /* Opera */
37 } 37 }
38 38
39 @keyframes faderight { 39 @keyframes faderight {
40 from { 40 from {
41 opacity: 0; 41 opacity: 0;
42 transform: translateX(-20px); 42 transform: translateX(-20px);
43 } 43 }
44 to { 44 to {
45 opacity: 1; 45 opacity: 1;
46 transform: translateX(0); 46 transform: translateX(0);
47 } 47 }
48 } 48 }
49 49
50 @-moz-keyframes faderight { 50 @-moz-keyframes faderight {
51 /* Firefox */ 51 /* Firefox */
52 from { 52 from {
53 opacity: 0; 53 opacity: 0;
54 -moz-transform: translateX(-20px); 54 -moz-transform: translateX(-20px);
55 } 55 }
56 to { 56 to {
57 opacity: 1; 57 opacity: 1;
58 -moz-transform: translateX(0); 58 -moz-transform: translateX(0);
59 } 59 }
60 } 60 }
61 61
62 @-webkit-keyframes faderight { 62 @-webkit-keyframes faderight {
63 /* Safari and Chrome */ 63 /* Safari and Chrome */
64 from { 64 from {
65 opacity: 0; 65 opacity: 0;
66 -webkit-transform: translateX(-20px); 66 -webkit-transform: translateX(-20px);
67 } 67 }
68 to { 68 to {
69 opacity: 1; 69 opacity: 1;
70 -webkit-transform: translateX(0); 70 -webkit-transform: translateX(0);
71 } 71 }
72 } 72 }
73 73
74 .fade-left { 74 .fade-left {
75 -webkit-animation: fadeleft 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; 75 -webkit-animation: fadeleft 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
76 animation: fadeleft 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; 76 animation: fadeleft 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
77 } 77 }
78 78
79 @-webkit-keyframes fadeleft { 79 @-webkit-keyframes fadeleft {
80 0% { 80 0% {
81 -webkit-transform: scaleX(0); 81 -webkit-transform: scaleX(0);
82 transform: scaleX(0); 82 transform: scaleX(0);
83 -webkit-transform-origin: 100% 100%; 83 -webkit-transform-origin: 100% 100%;
84 transform-origin: 100% 100%; 84 transform-origin: 100% 100%;
85 opacity: 1; 85 opacity: 1;
86 } 86 }
87 100% { 87 100% {
88 -webkit-transform: scaleX(1); 88 -webkit-transform: scaleX(1);
89 transform: scaleX(1); 89 transform: scaleX(1);
90 -webkit-transform-origin: 100% 100%; 90 -webkit-transform-origin: 100% 100%;
91 transform-origin: 100% 100%; 91 transform-origin: 100% 100%;
92 opacity: 1; 92 opacity: 1;
93 } 93 }
94 } 94 }
95 95
96 @keyframes fadeleft { 96 @keyframes fadeleft {
97 0% { 97 0% {
98 -webkit-transform: scaleX(0); 98 -webkit-transform: scaleX(0);
99 transform: scaleX(0); 99 transform: scaleX(0);
100 -webkit-transform-origin: 100% 100%; 100 -webkit-transform-origin: 100% 100%;
101 transform-origin: 100% 100%; 101 transform-origin: 100% 100%;
102 opacity: 1; 102 opacity: 1;
103 } 103 }
104 100% { 104 100% {
105 -webkit-transform: scaleX(1); 105 -webkit-transform: scaleX(1);
106 transform: scaleX(1); 106 transform: scaleX(1);
107 -webkit-transform-origin: 100% 100%; 107 -webkit-transform-origin: 100% 100%;
108 transform-origin: 100% 100%; 108 transform-origin: 100% 100%;
109 opacity: 1; 109 opacity: 1;
110 } 110 }
111 } 111 }
112 112
113 .fade-bottom { 113 .fade-bottom {
114 -webkit-animation: fade-bottom 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both; 114 -webkit-animation: fade-bottom 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;
115 animation: fade-bottom 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both; 115 animation: fade-bottom 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;
116 } 116 }
117 117
118 @-webkit-keyframes fade-bottom { 118 @-webkit-keyframes fade-bottom {
119 0% { 119 0% {
120 -webkit-transform: scaleY(0.4); 120 -webkit-transform: scaleY(0.4);
121 transform: scaleY(0.4); 121 transform: scaleY(0.4);
122 -webkit-transform-origin: 100% 0%; 122 -webkit-transform-origin: 100% 0%;
123 transform-origin: 100% 0%; 123 transform-origin: 100% 0%;
124 } 124 }
125 100% { 125 100% {
126 -webkit-transform: scaleY(1); 126 -webkit-transform: scaleY(1);
127 transform: scaleY(1); 127 transform: scaleY(1);
128 -webkit-transform-origin: 100% 0%; 128 -webkit-transform-origin: 100% 0%;
129 transform-origin: 100% 0%; 129 transform-origin: 100% 0%;
130 } 130 }
131 } 131 }
132 132
133 @keyframes fade-bottom { 133 @keyframes fade-bottom {
134 0% { 134 0% {
135 -webkit-transform: scaleY(0.4); 135 -webkit-transform: scaleY(0.4);
136 transform: scaleY(0.4); 136 transform: scaleY(0.4);
137 -webkit-transform-origin: 100% 0%; 137 -webkit-transform-origin: 100% 0%;
138 transform-origin: 100% 0%; 138 transform-origin: 100% 0%;
139 } 139 }
140 100% { 140 100% {
141 -webkit-transform: scaleY(1); 141 -webkit-transform: scaleY(1);
142 transform: scaleY(1); 142 transform: scaleY(1);
143 -webkit-transform-origin: 100% 0%; 143 -webkit-transform-origin: 100% 0%;
144 transform-origin: 100% 0%; 144 transform-origin: 100% 0%;
145 } 145 }
146 } 146 }
147 147
148 .slide-in-bl { 148 .slide-in-bl {
149 -webkit-animation: slide-in-bl 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; 149 -webkit-animation: slide-in-bl 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
150 animation: slide-in-bl 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; 150 animation: slide-in-bl 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
151 } 151 }
152 152
153 @-webkit-keyframes slide-in-bl { 153 @-webkit-keyframes slide-in-bl {
154 0% { 154 0% {
155 -webkit-transform: translateY(1000px) translateX(-1000px); 155 -webkit-transform: translateY(1000px) translateX(-1000px);
156 transform: translateY(1000px) translateX(-1000px); 156 transform: translateY(1000px) translateX(-1000px);
157 opacity: 0; 157 opacity: 0;
158 } 158 }
159 100% { 159 100% {
160 -webkit-transform: translateY(0) translateX(0); 160 -webkit-transform: translateY(0) translateX(0);
161 transform: translateY(0) translateX(0); 161 transform: translateY(0) translateX(0);
162 opacity: 1; 162 opacity: 1;
163 } 163 }
164 } 164 }
165 165
166 @keyframes slide-in-bl { 166 @keyframes slide-in-bl {
167 0% { 167 0% {
168 -webkit-transform: translateY(1000px) translateX(-1000px); 168 -webkit-transform: translateY(1000px) translateX(-1000px);
169 transform: translateY(1000px) translateX(-1000px); 169 transform: translateY(1000px) translateX(-1000px);
170 opacity: 0; 170 opacity: 0;
171 } 171 }
172 100% { 172 100% {
173 -webkit-transform: translateY(0) translateX(0); 173 -webkit-transform: translateY(0) translateX(0);
174 transform: translateY(0) translateX(0); 174 transform: translateY(0) translateX(0);
175 opacity: 1; 175 opacity: 1;
176 } 176 }
177 } 177 }
178
179 .heartbeat {
180 -webkit-animation: heartbeat 1.5s ease-in-out infinite both;
181 animation: heartbeat 1.5s ease-in-out infinite both;
182 }
183
184 @-webkit-keyframes heartbeat {
185 from {
186 -webkit-transform: scale(1);
187 transform: scale(1);
188 -webkit-transform-origin: center center;
189 transform-origin: center center;
190 -webkit-animation-timing-function: ease-out;
191 animation-timing-function: ease-out;
192 }
193 10% {
194 -webkit-transform: scale(0.91);
195 transform: scale(0.91);
196 -webkit-animation-timing-function: ease-in;
197 animation-timing-function: ease-in;
198 }
199 17% {
200 -webkit-transform: scale(0.98);
201 transform: scale(0.98);
202 -webkit-animation-timing-function: ease-out;
203 animation-timing-function: ease-out;
204 }
205 33% {
206 -webkit-transform: scale(0.87);
207 transform: scale(0.87);
208 -webkit-animation-timing-function: ease-in;
209 animation-timing-function: ease-in;
210 }
211 45% {
212 -webkit-transform: scale(1);
213 transform: scale(1);
214 -webkit-animation-timing-function: ease-out;
215 animation-timing-function: ease-out;
216 }
217 }
218
219 @keyframes heartbeat {
220 from {
221 -webkit-transform: scale(1);
222 transform: scale(1);
223 -webkit-transform-origin: center center;
224 transform-origin: center center;
225 -webkit-animation-timing-function: ease-out;
226 animation-timing-function: ease-out;
227 }
228 10% {
229 -webkit-transform: scale(0.91);
230 transform: scale(0.91);
231 -webkit-animation-timing-function: ease-in;
232 animation-timing-function: ease-in;
233 }
234 17% {
235 -webkit-transform: scale(0.98);
236 transform: scale(0.98);
237 -webkit-animation-timing-function: ease-out;
238 animation-timing-function: ease-out;
239 }
240 33% {
241 -webkit-transform: scale(0.87);
242 transform: scale(0.87);
243 -webkit-animation-timing-function: ease-in;
244 animation-timing-function: ease-in;
245 }
246 45% {
247 -webkit-transform: scale(1);
248 transform: scale(1);
249 -webkit-animation-timing-function: ease-out;
250 animation-timing-function: ease-out;
251 }
252 }
178 253