metag-sdk-ionic 1.2.7-dev-0.58 → 1.2.7-dev-0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/app/pages/id-vision/components/camara-video-selfie/camara-video-selfie.component.js +405 -405
- package/dist/src/app/pages/id-vision/components/direct-photo-selfie/direct-photo-selfie.component.d.ts +37 -37
- package/dist/src/app/pages/id-vision/components/direct-photo-selfie/direct-photo-selfie.component.js +204 -204
- package/dist/src/app/pages/id-vision/components/photo-selfie-camera/photo-selfie-camera.component.d.ts +48 -48
- package/dist/src/app/pages/id-vision/components/photo-selfie-camera/photo-selfie-camera.component.js +261 -261
- package/dist/src/app/pages/id-vision/components/simple-acuerdo-video/simple-acuerdo-video.component.js +480 -480
- package/dist/src/app/pages/id-vision/id-vision.component.d.ts +122 -122
- package/dist/src/app/pages/id-vision/id-vision.component.js +1414 -1409
- package/dist/src/app/pages/id-vision/id-vision.component.js.map +1 -1
- package/dist/src/app/pages/id-vision/services/modal-services/sdk-communication-services.js +21 -21
- package/package.json +1 -1
|
@@ -1,481 +1,481 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output, ViewChild, ViewEncapsulation } from '@angular/core';
|
|
2
|
-
import { Camera } from '@capacitor/camera';
|
|
3
|
-
import { ScreenBrightness } from '@capacitor-community/screen-brightness';
|
|
4
|
-
import { Capacitor } from '@capacitor/core';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
import * as i1 from "@ionic/angular";
|
|
7
|
-
import * as i2 from "@angular/platform-browser";
|
|
8
|
-
import * as i3 from "@angular/common";
|
|
9
|
-
const _c0 = ["videoElement"];
|
|
10
|
-
const _c1 = ["progressRing"];
|
|
11
|
-
const _c2 = a0 => ({ "red": a0 });
|
|
12
|
-
function SimpleAcuerdoVideoComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
13
|
-
i0.ɵɵelementStart(0, "div", 24)(1, "div", 25);
|
|
14
|
-
i0.ɵɵtext(2);
|
|
15
|
-
i0.ɵɵelementEnd()();
|
|
16
|
-
} if (rf & 2) {
|
|
17
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
18
|
-
i0.ɵɵadvance(2);
|
|
19
|
-
i0.ɵɵtextInterpolate(ctx_r1.countdown);
|
|
20
|
-
} }
|
|
21
|
-
function SimpleAcuerdoVideoComponent_div_23_span_2_Template(rf, ctx) { if (rf & 1) {
|
|
22
|
-
i0.ɵɵelementStart(0, "span", 29);
|
|
23
|
-
i0.ɵɵtext(1);
|
|
24
|
-
i0.ɵɵelementEnd();
|
|
25
|
-
} if (rf & 2) {
|
|
26
|
-
const word_r3 = ctx.$implicit;
|
|
27
|
-
i0.ɵɵadvance();
|
|
28
|
-
i0.ɵɵtextInterpolate1(" ", word_r3, " ");
|
|
29
|
-
} }
|
|
30
|
-
function SimpleAcuerdoVideoComponent_div_23_Template(rf, ctx) { if (rf & 1) {
|
|
31
|
-
i0.ɵɵelementStart(0, "div", 26)(1, "p", 27);
|
|
32
|
-
i0.ɵɵtemplate(2, SimpleAcuerdoVideoComponent_div_23_span_2_Template, 2, 1, "span", 28);
|
|
33
|
-
i0.ɵɵelementEnd()();
|
|
34
|
-
} if (rf & 2) {
|
|
35
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
36
|
-
i0.ɵɵadvance(2);
|
|
37
|
-
i0.ɵɵproperty("ngForOf", ctx_r1.words);
|
|
38
|
-
} }
|
|
39
|
-
function SimpleAcuerdoVideoComponent_ion_button_25_Template(rf, ctx) { if (rf & 1) {
|
|
40
|
-
const _r4 = i0.ɵɵgetCurrentView();
|
|
41
|
-
i0.ɵɵelementStart(0, "ion-button", 30);
|
|
42
|
-
i0.ɵɵlistener("click", function SimpleAcuerdoVideoComponent_ion_button_25_Template_ion_button_click_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.recordVideo()); });
|
|
43
|
-
i0.ɵɵelement(1, "ion-icon", 31);
|
|
44
|
-
i0.ɵɵelementEnd();
|
|
45
|
-
} }
|
|
46
|
-
function SimpleAcuerdoVideoComponent_ion_button_26_Template(rf, ctx) { if (rf & 1) {
|
|
47
|
-
const _r5 = i0.ɵɵgetCurrentView();
|
|
48
|
-
i0.ɵɵelementStart(0, "ion-button", 32);
|
|
49
|
-
i0.ɵɵlistener("click", function SimpleAcuerdoVideoComponent_ion_button_26_Template_ion_button_click_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.stopRecording()); });
|
|
50
|
-
i0.ɵɵelement(1, "ion-icon", 33);
|
|
51
|
-
i0.ɵɵelementEnd();
|
|
52
|
-
} if (rf & 2) {
|
|
53
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
54
|
-
i0.ɵɵproperty("disabled", !ctx_r1.canStopRecording);
|
|
55
|
-
} }
|
|
56
|
-
function SimpleAcuerdoVideoComponent_ng_template_28_span_6_Template(rf, ctx) { if (rf & 1) {
|
|
57
|
-
i0.ɵɵelementStart(0, "span", 29);
|
|
58
|
-
i0.ɵɵtext(1);
|
|
59
|
-
i0.ɵɵelementEnd();
|
|
60
|
-
} if (rf & 2) {
|
|
61
|
-
const word_r7 = ctx.$implicit;
|
|
62
|
-
i0.ɵɵadvance();
|
|
63
|
-
i0.ɵɵtextInterpolate1(" ", word_r7, " ");
|
|
64
|
-
} }
|
|
65
|
-
function SimpleAcuerdoVideoComponent_ng_template_28_Template(rf, ctx) { if (rf & 1) {
|
|
66
|
-
const _r6 = i0.ɵɵgetCurrentView();
|
|
67
|
-
i0.ɵɵelementStart(0, "div", 34)(1, "div", 35);
|
|
68
|
-
i0.ɵɵelement(2, "img", 36);
|
|
69
|
-
i0.ɵɵelementStart(3, "h2");
|
|
70
|
-
i0.ɵɵtext(4, "Instrucciones");
|
|
71
|
-
i0.ɵɵelementEnd();
|
|
72
|
-
i0.ɵɵelementStart(5, "div", 27);
|
|
73
|
-
i0.ɵɵtemplate(6, SimpleAcuerdoVideoComponent_ng_template_28_span_6_Template, 2, 1, "span", 28);
|
|
74
|
-
i0.ɵɵelementEnd();
|
|
75
|
-
i0.ɵɵelementStart(7, "div", 37)(8, "ion-button", 7);
|
|
76
|
-
i0.ɵɵlistener("click", function SimpleAcuerdoVideoComponent_ng_template_28_Template_ion_button_click_8_listener() { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.closeModal()); });
|
|
77
|
-
i0.ɵɵtext(9, "Comenzar");
|
|
78
|
-
i0.ɵɵelementEnd()()()();
|
|
79
|
-
} if (rf & 2) {
|
|
80
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
81
|
-
i0.ɵɵadvance(6);
|
|
82
|
-
i0.ɵɵproperty("ngForOf", ctx_r1.instructionWords);
|
|
83
|
-
i0.ɵɵadvance(2);
|
|
84
|
-
i0.ɵɵproperty("disabled", ctx_r1.isSpeaking);
|
|
85
|
-
} }
|
|
86
|
-
function SimpleAcuerdoVideoComponent_ng_template_30_Template(rf, ctx) { if (rf & 1) {
|
|
87
|
-
i0.ɵɵelementStart(0, "div", 34)(1, "div", 38)(2, "div", 39);
|
|
88
|
-
i0.ɵɵelement(3, "ion-icon", 40);
|
|
89
|
-
i0.ɵɵelementEnd();
|
|
90
|
-
i0.ɵɵelementStart(4, "div", 41)(5, "p");
|
|
91
|
-
i0.ɵɵtext(6, "Contesta con tu voz");
|
|
92
|
-
i0.ɵɵelementEnd();
|
|
93
|
-
i0.ɵɵelementStart(7, "div", 42)(8, "div", 43)(9, "p");
|
|
94
|
-
i0.ɵɵtext(10, "S\u00ED");
|
|
95
|
-
i0.ɵɵelementEnd()();
|
|
96
|
-
i0.ɵɵelementStart(11, "div", 44)(12, "p");
|
|
97
|
-
i0.ɵɵtext(13, "o");
|
|
98
|
-
i0.ɵɵelementEnd()();
|
|
99
|
-
i0.ɵɵelementStart(14, "div", 43)(15, "p");
|
|
100
|
-
i0.ɵɵtext(16, "No");
|
|
101
|
-
i0.ɵɵelementEnd()()()()()();
|
|
102
|
-
} }
|
|
103
|
-
//import { TextToSpeech } from '@capacitor-community/text-to-speech';
|
|
104
|
-
export class SimpleAcuerdoVideoComponent {
|
|
105
|
-
constructor(platform, modalController, sanitizer, renderer, alertController, changeDetector) {
|
|
106
|
-
this.platform = platform;
|
|
107
|
-
this.modalController = modalController;
|
|
108
|
-
this.sanitizer = sanitizer;
|
|
109
|
-
this.renderer = renderer;
|
|
110
|
-
this.alertController = alertController;
|
|
111
|
-
this.changeDetector = changeDetector;
|
|
112
|
-
this.closeRequested = new EventEmitter();
|
|
113
|
-
this.stream = null;
|
|
114
|
-
this.isRecording = false;
|
|
115
|
-
this.mediaRecorder = null;
|
|
116
|
-
this.recordedChunks = [];
|
|
117
|
-
this.countdown = 0; // Propiedad para la cuenta regresiva
|
|
118
|
-
this.minRecordingTime = 3000; // 3 seconds
|
|
119
|
-
this.maxRecordingTime = 5000; // 5 seconds
|
|
120
|
-
this.timeRemaining = this.maxRecordingTime / 1000; // Inicializar con el tiempo máximo en segundos
|
|
121
|
-
this.canStopRecording = true;
|
|
122
|
-
this.isLoading = true; // Variable para mostrar el loader
|
|
123
|
-
this.defaultBrightness = null; // Para guardar el brillo original del dispositivo
|
|
124
|
-
this.isModalOpen = false;
|
|
125
|
-
this.isModalVoiceOpen = false;
|
|
126
|
-
//TTS
|
|
127
|
-
this.text = '¿Acepta los términos y condiciones del crédito que está solicitando en Fundación Génesis Empresarial?';
|
|
128
|
-
this.instructions = 'Por favor contesta "SI" o "NO" a la pregunta para completar el proceso.';
|
|
129
|
-
this.words = [];
|
|
130
|
-
this.instructionWords = [];
|
|
131
|
-
this.currentIndex = 0;
|
|
132
|
-
this.timePerWord = 380; //350
|
|
133
|
-
this.isSpeaking = false;
|
|
134
|
-
this.showTextAcuerdo = false;
|
|
135
|
-
this.isAndroid = this.platform.is('android');
|
|
136
|
-
this.isIOS = this.platform.is('ios');
|
|
137
|
-
}
|
|
138
|
-
async ngAfterViewInit() {
|
|
139
|
-
// this.isModalOpen = true;
|
|
140
|
-
this.openModal();
|
|
141
|
-
// this.openModalVoice();
|
|
142
|
-
this.words = this.text.split(' ');
|
|
143
|
-
this.instructionWords = this.instructions.split(' ');
|
|
144
|
-
setTimeout(() => {
|
|
145
|
-
this.speakText(this.instructionWords, this.instructions);
|
|
146
|
-
}, 500);
|
|
147
|
-
if (this.isAndroid || this.isIOS) {
|
|
148
|
-
try {
|
|
149
|
-
const { brightness } = await ScreenBrightness.getBrightness();
|
|
150
|
-
this.defaultBrightness = brightness;
|
|
151
|
-
await ScreenBrightness.setBrightness({ brightness: 1.0 });
|
|
152
|
-
}
|
|
153
|
-
catch (error) {
|
|
154
|
-
console.warn('Error al obtener el brillo de la pantalla:', error);
|
|
155
|
-
}
|
|
156
|
-
await this.requestPermissions();
|
|
157
|
-
}
|
|
158
|
-
await this.initCamera();
|
|
159
|
-
// await this.startRecording();
|
|
160
|
-
await this.waitForCameraReady();
|
|
161
|
-
}
|
|
162
|
-
async ngOnDestroy() {
|
|
163
|
-
this.stopCamera();
|
|
164
|
-
try {
|
|
165
|
-
if (this.defaultBrightness !== null) {
|
|
166
|
-
await ScreenBrightness.setBrightness({
|
|
167
|
-
brightness: this.defaultBrightness,
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
catch (error) {
|
|
172
|
-
console.warn('Error al restaurar el brillo original:', error);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
// Función para abrir la modal
|
|
176
|
-
openModal() {
|
|
177
|
-
this.isModalOpen = true; // Abrir la modal
|
|
178
|
-
}
|
|
179
|
-
openModalVoice() {
|
|
180
|
-
this.isModalVoiceOpen = true;
|
|
181
|
-
}
|
|
182
|
-
closeModalVoice() {
|
|
183
|
-
this.isModalVoiceOpen = false;
|
|
184
|
-
}
|
|
185
|
-
// Función para cerrar la modal
|
|
186
|
-
closeModal() {
|
|
187
|
-
this.isModalOpen = false; // Cerrar la modal
|
|
188
|
-
}
|
|
189
|
-
async waitForCameraReady() {
|
|
190
|
-
return new Promise((resolve) => {
|
|
191
|
-
this.videoElement.nativeElement.onloadedmetadata = () => {
|
|
192
|
-
resolve();
|
|
193
|
-
};
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
async requestPermissions() {
|
|
197
|
-
if (Capacitor.getPlatform() !== 'web') {
|
|
198
|
-
if (this.isAndroid || this.isIOS) {
|
|
199
|
-
const permissions = await Camera.requestPermissions();
|
|
200
|
-
if (permissions.camera === 'denied') {
|
|
201
|
-
console.error('Permiso de cámara denegado');
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
async initCamera() {
|
|
208
|
-
let isCameraReady = false;
|
|
209
|
-
try {
|
|
210
|
-
const constraints = {
|
|
211
|
-
video: {
|
|
212
|
-
width: { ideal: 640 },
|
|
213
|
-
height: { ideal: 480 },
|
|
214
|
-
facingMode: 'user',
|
|
215
|
-
},
|
|
216
|
-
};
|
|
217
|
-
this.stream = await navigator.mediaDevices.getUserMedia(constraints);
|
|
218
|
-
this.videoElement.nativeElement.srcObject = this.stream;
|
|
219
|
-
// Esperar hasta que la cámara esté lista
|
|
220
|
-
this.videoElement.nativeElement.onloadedmetadata = () => {
|
|
221
|
-
isCameraReady = true;
|
|
222
|
-
};
|
|
223
|
-
// Espera activa para asegurarte de que está lista
|
|
224
|
-
await new Promise((resolve) => {
|
|
225
|
-
const interval = setInterval(() => {
|
|
226
|
-
if (isCameraReady) {
|
|
227
|
-
clearInterval(interval);
|
|
228
|
-
resolve(true);
|
|
229
|
-
}
|
|
230
|
-
}, 100);
|
|
231
|
-
});
|
|
232
|
-
this.isLoading = false;
|
|
233
|
-
await this.startRecording();
|
|
234
|
-
}
|
|
235
|
-
catch (error) {
|
|
236
|
-
console.error('Error al inicializar la cámara:', error);
|
|
237
|
-
this.isLoading = false;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
async startRecording() {
|
|
241
|
-
if (!this.stream)
|
|
242
|
-
return;
|
|
243
|
-
const options = {
|
|
244
|
-
mimeType: this.isIOS ? 'video/mp4' : 'video/webm',
|
|
245
|
-
videoBitsPerSecond: 400000,
|
|
246
|
-
};
|
|
247
|
-
this.mediaRecorder = new MediaRecorder(this.stream, options);
|
|
248
|
-
let chunks = [];
|
|
249
|
-
this.mediaRecorder.ondataavailable = (event) => {
|
|
250
|
-
if (event.data.size > 0) {
|
|
251
|
-
chunks.push(event.data);
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
this.mediaRecorder.onstop = async () => {
|
|
257
|
-
if (chunks.length === 0) {
|
|
258
|
-
console.error('No se capturaron datos en la grabación.');
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
const fileType = this.isIOS ? 'video/mp4' : 'video/webm';
|
|
262
|
-
const fileExtension = this.isIOS ? 'mp4' : 'webm';
|
|
263
|
-
const videoBlob = new Blob(chunks, { type: fileType });
|
|
264
|
-
const videoFile = this.blobToFile(videoBlob, `video-selfie.${fileExtension}`);
|
|
265
|
-
if (this.backFunction) {
|
|
266
|
-
await this.backFunction(videoFile);
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
blobToFile(blob, fileName) {
|
|
271
|
-
const b = blob;
|
|
272
|
-
b.lastModified = new Date().getTime();
|
|
273
|
-
b.lastModifiedDate = new Date();
|
|
274
|
-
b.name = fileName;
|
|
275
|
-
//Cast to a File() type
|
|
276
|
-
return b;
|
|
277
|
-
}
|
|
278
|
-
async recordVideo() {
|
|
279
|
-
// Mostrar la cuenta regresiva antes de iniciar la grabación
|
|
280
|
-
this.countdown = 3;
|
|
281
|
-
const countdownInterval = setInterval(async () => {
|
|
282
|
-
this.countdown -= 1;
|
|
283
|
-
if (this.countdown <= 0) {
|
|
284
|
-
this.showTextAcuerdo = true;
|
|
285
|
-
clearInterval(countdownInterval);
|
|
286
|
-
await this.speakText(this.words, this.text);
|
|
287
|
-
this.openModalVoice();
|
|
288
|
-
this.startVideoRecord(); // Iniciar la grabación después de la cuenta regresiva
|
|
289
|
-
}
|
|
290
|
-
this.changeDetector.detectChanges(); // Actualizar la vista
|
|
291
|
-
}, 1000);
|
|
292
|
-
}
|
|
293
|
-
async startVideoRecord() {
|
|
294
|
-
if (this.mediaRecorder && !this.isRecording) {
|
|
295
|
-
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
296
|
-
this.mediaRecorder.start(100);
|
|
297
|
-
this.isRecording = true;
|
|
298
|
-
this.canStopRecording = false; // Deshabilitar el botón de detener inicialmente
|
|
299
|
-
this.renderer.addClass(this.progressRing.nativeElement, 'progress-active');
|
|
300
|
-
this.timeRemaining = this.maxRecordingTime / 1000; // Reiniciar el tiempo restante
|
|
301
|
-
this.updateTimeRemaining(); // Iniciar la actualización del tiempo restante
|
|
302
|
-
// Habilitar el botón de detener después de minRecordingTime
|
|
303
|
-
setTimeout(() => {
|
|
304
|
-
this.canStopRecording = true;
|
|
305
|
-
}, this.minRecordingTime);
|
|
306
|
-
this.recordingTimer = setTimeout(async () => {
|
|
307
|
-
await this.stopRecording();
|
|
308
|
-
}, this.maxRecordingTime);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
updateTimeRemaining() {
|
|
312
|
-
const interval = 1000; // Actualizar cada segundo
|
|
313
|
-
const timer = setInterval(() => {
|
|
314
|
-
if (this.isRecording) {
|
|
315
|
-
this.timeRemaining -= 1;
|
|
316
|
-
if (this.timeRemaining <= 0) {
|
|
317
|
-
clearInterval(timer);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
else {
|
|
321
|
-
clearInterval(timer);
|
|
322
|
-
}
|
|
323
|
-
this.changeDetector.detectChanges(); // Actualizar la vista
|
|
324
|
-
}, interval);
|
|
325
|
-
}
|
|
326
|
-
async stopRecording() {
|
|
327
|
-
if (this.mediaRecorder && this.isRecording && this.canStopRecording) {
|
|
328
|
-
this.closeModalVoice();
|
|
329
|
-
console.log(this.capVideo);
|
|
330
|
-
await this.backFunction(this.capVideo);
|
|
331
|
-
this.mediaRecorder.stop();
|
|
332
|
-
this.isRecording = false;
|
|
333
|
-
}
|
|
334
|
-
if (this.scanTimeout) {
|
|
335
|
-
clearTimeout(this.scanTimeout);
|
|
336
|
-
}
|
|
337
|
-
// Detiene la animación del borde circular
|
|
338
|
-
this.renderer.removeClass(this.progressRing.nativeElement, 'progress-active');
|
|
339
|
-
}
|
|
340
|
-
async closeOverlayVideo() {
|
|
341
|
-
this.stopCamera();
|
|
342
|
-
// Restaura el brillo original si estaba guardado
|
|
343
|
-
if (this.defaultBrightness !== null) {
|
|
344
|
-
await ScreenBrightness.setBrightness({
|
|
345
|
-
brightness: this.defaultBrightness,
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
this.modalController.dismiss();
|
|
349
|
-
}
|
|
350
|
-
stopCamera() {
|
|
351
|
-
if (this.stream) {
|
|
352
|
-
this.stream.getTracks().forEach((track) => track.stop());
|
|
353
|
-
this.stream = null;
|
|
354
|
-
}
|
|
355
|
-
if (this.scanTimeout)
|
|
356
|
-
clearTimeout(this.scanTimeout);
|
|
357
|
-
}
|
|
358
|
-
//TTS
|
|
359
|
-
async speakText(words, text) {
|
|
360
|
-
if (this.isSpeaking) {
|
|
361
|
-
return; // Si ya se está hablando, no hacer nada
|
|
362
|
-
}
|
|
363
|
-
this.isSpeaking = true; // Establecer que el proceso está en marcha
|
|
364
|
-
this.currentIndex = 0;
|
|
365
|
-
this.highlightWord(this.currentIndex); // Resaltar la primera palabra
|
|
366
|
-
await this.speakSentenceWithHighlights(words, text); // Hablar la oración y resaltar simultáneamente
|
|
367
|
-
}
|
|
368
|
-
async speakSentenceWithHighlights(words, text) {
|
|
369
|
-
// Leer todo el texto fluido
|
|
370
|
-
// Resaltar las palabras mientras se lee el texto
|
|
371
|
-
words.forEach((word, index) => {
|
|
372
|
-
setTimeout(() => {
|
|
373
|
-
this.currentIndex = index;
|
|
374
|
-
this.highlightWord(this.currentIndex); // Resaltar la palabra
|
|
375
|
-
}, this.timePerWord * index); // Sincroniza con el tiempo de la palabra
|
|
376
|
-
});
|
|
377
|
-
// await TextToSpeech.speak({
|
|
378
|
-
// text: text,
|
|
379
|
-
// lang: 'es-MX',
|
|
380
|
-
// rate: 0.85,
|
|
381
|
-
// volume: 1.0,
|
|
382
|
-
// pitch: 1.2,
|
|
383
|
-
// });
|
|
384
|
-
// Una vez que se termine, habilitar nuevamente el botón
|
|
385
|
-
this.isSpeaking = false;
|
|
386
|
-
}
|
|
387
|
-
// Función para resaltar la palabra que está siendo leída
|
|
388
|
-
highlightWord(index) {
|
|
389
|
-
const wordElements = document.querySelectorAll('.subtitle-word');
|
|
390
|
-
wordElements.forEach((el, idx) => {
|
|
391
|
-
if (idx === index) {
|
|
392
|
-
el.classList.add('highlight'); // Resalta la palabra actual
|
|
393
|
-
el.classList.remove('read'); // Elimina el color de texto leído
|
|
394
|
-
}
|
|
395
|
-
else {
|
|
396
|
-
el.classList.remove('highlight');
|
|
397
|
-
el.classList.add('read'); // Marca como leído
|
|
398
|
-
}
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
static { this.ɵfac = function SimpleAcuerdoVideoComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SimpleAcuerdoVideoComponent)(i0.ɵɵdirectiveInject(i1.Platform), i0.ɵɵdirectiveInject(i1.ModalController), i0.ɵɵdirectiveInject(i2.DomSanitizer), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i1.AlertController), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); }; }
|
|
402
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SimpleAcuerdoVideoComponent, selectors: [["app-simple-acuerdo-video"]], viewQuery: function SimpleAcuerdoVideoComponent_Query(rf, ctx) { if (rf & 1) {
|
|
403
|
-
i0.ɵɵviewQuery(_c0, 5);
|
|
404
|
-
i0.ɵɵviewQuery(_c1, 5);
|
|
405
|
-
} if (rf & 2) {
|
|
406
|
-
let _t;
|
|
407
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.videoElement = _t.first);
|
|
408
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.progressRing = _t.first);
|
|
409
|
-
} }, inputs: { backFunction: "backFunction" }, outputs: { closeRequested: "closeRequested" }, decls: 31, vars: 11, consts: [["videoElement", ""], ["progressRing", ""], ["color", "light", 1, "custom-content"], ["class", "countdown-overlay", 4, "ngIf"], [1, "ion-no-border"], ["color", "light"], ["slot", "end"], [3, "click", "disabled"], ["name", "close"], [1, "main-header"], [1, "main-title"], [1, "acuerdo-text"], [1, "camera-container"], [1, "video-wrapper"], ["muted", "", "autoplay", "", "playsinline", "", 2, "transform", "scaleX(-1)"], ["width", "300", "height", "300", 1, "progress-ring"], ["cx", "150", "cy", "150", "r", "150", 1, "progress-ring__circle"], [3, "ngClass"], ["class", "text-container", 4, "ngIf"], [1, "fixed-footer"], ["size", "large", "expand", "block", "shape", "round", 3, "click", 4, "ngIf"], ["size", "large", "expand", "block", 3, "disabled", "click", 4, "ngIf"], ["id", "example-modal", 3, "didDismiss", "isOpen"], ["id", "voice-modal", 3, "didDismiss", "isOpen"], [1, "countdown-overlay"], [1, "countdown"], [1, "text-container"], [1, "subtitle"], ["class", "subtitle-word", 4, "ngFor", "ngForOf"], [1, "subtitle-word"], ["size", "large", "expand", "block", "shape", "round", 3, "click"], ["slot", "icon-only", "name", "camera-outline"], ["size", "large", "expand", "block", 3, "click", "disabled"], ["slot", "icon-only", "name", "stop-outline"], [1, "full-content"], [1, "modal-content"], ["src", "https://placeholder.pics/svg/150x150", "alt", ""], [1, "button-container"], [1, "modal-content-2"], [1, "modal-header"], ["name", "mic", "size", "large", 2, "width", "50px !important", "height", "50px !important"], [1, "modal-body"], [1, "icons-container"], [1, "custom-text"], [1, "o-text"]], template: function SimpleAcuerdoVideoComponent_Template(rf, ctx) { if (rf & 1) {
|
|
410
|
-
const _r1 = i0.ɵɵgetCurrentView();
|
|
411
|
-
i0.ɵɵelementStart(0, "ion-content", 2);
|
|
412
|
-
i0.ɵɵtemplate(1, SimpleAcuerdoVideoComponent_div_1_Template, 3, 1, "div", 3);
|
|
413
|
-
i0.ɵɵelementStart(2, "ion-header", 4)(3, "ion-toolbar", 5)(4, "ion-buttons", 6)(5, "ion-button", 7);
|
|
414
|
-
i0.ɵɵlistener("click", function SimpleAcuerdoVideoComponent_Template_ion_button_click_5_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.closeOverlayVideo()); });
|
|
415
|
-
i0.ɵɵelement(6, "ion-icon", 8);
|
|
416
|
-
i0.ɵɵelementEnd()()()();
|
|
417
|
-
i0.ɵɵelementStart(7, "div", 9)(8, "div", 10)(9, "h1");
|
|
418
|
-
i0.ɵɵtext(10, "Acuerdo de Video");
|
|
419
|
-
i0.ɵɵelementEnd()();
|
|
420
|
-
i0.ɵɵelementStart(11, "div", 11)(12, "p");
|
|
421
|
-
i0.ɵɵtext(13, "Contesta \u00FAnicamente \"S\u00ED\" si est\u00E1s de acuerdo con el cr\u00E9dito y contesta \"No\" para cancelar el proceso.");
|
|
422
|
-
i0.ɵɵelementEnd()()();
|
|
423
|
-
i0.ɵɵelementStart(14, "div", 12)(15, "div", 13);
|
|
424
|
-
i0.ɵɵelement(16, "video", 14, 0);
|
|
425
|
-
i0.ɵɵnamespaceSVG();
|
|
426
|
-
i0.ɵɵelementStart(18, "svg", 15, 1);
|
|
427
|
-
i0.ɵɵelement(20, "circle", 16);
|
|
428
|
-
i0.ɵɵelementEnd()();
|
|
429
|
-
i0.ɵɵnamespaceHTML();
|
|
430
|
-
i0.ɵɵelementStart(21, "ion-label", 17);
|
|
431
|
-
i0.ɵɵtext(22);
|
|
432
|
-
i0.ɵɵelementEnd();
|
|
433
|
-
i0.ɵɵtemplate(23, SimpleAcuerdoVideoComponent_div_23_Template, 3, 1, "div", 18);
|
|
434
|
-
i0.ɵɵelementStart(24, "div", 19);
|
|
435
|
-
i0.ɵɵtemplate(25, SimpleAcuerdoVideoComponent_ion_button_25_Template, 2, 0, "ion-button", 20)(26, SimpleAcuerdoVideoComponent_ion_button_26_Template, 2, 1, "ion-button", 21);
|
|
436
|
-
i0.ɵɵelementEnd()();
|
|
437
|
-
i0.ɵɵelementStart(27, "ion-modal", 22);
|
|
438
|
-
i0.ɵɵlistener("didDismiss", function SimpleAcuerdoVideoComponent_Template_ion_modal_didDismiss_27_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.closeModal()); });
|
|
439
|
-
i0.ɵɵtemplate(28, SimpleAcuerdoVideoComponent_ng_template_28_Template, 10, 2, "ng-template");
|
|
440
|
-
i0.ɵɵelementEnd();
|
|
441
|
-
i0.ɵɵelementStart(29, "ion-modal", 23);
|
|
442
|
-
i0.ɵɵlistener("didDismiss", function SimpleAcuerdoVideoComponent_Template_ion_modal_didDismiss_29_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.closeModalVoice()); });
|
|
443
|
-
i0.ɵɵtemplate(30, SimpleAcuerdoVideoComponent_ng_template_30_Template, 17, 0, "ng-template");
|
|
444
|
-
i0.ɵɵelementEnd()();
|
|
445
|
-
} if (rf & 2) {
|
|
446
|
-
i0.ɵɵadvance();
|
|
447
|
-
i0.ɵɵproperty("ngIf", ctx.countdown > 0);
|
|
448
|
-
i0.ɵɵadvance(4);
|
|
449
|
-
i0.ɵɵproperty("disabled", !ctx.canStopRecording);
|
|
450
|
-
i0.ɵɵadvance(16);
|
|
451
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c2, ctx.isRecording));
|
|
452
|
-
i0.ɵɵadvance();
|
|
453
|
-
i0.ɵɵtextInterpolate1("00:", ctx.timeRemaining < 10 ? "0" + ctx.timeRemaining : ctx.timeRemaining, "");
|
|
454
|
-
i0.ɵɵadvance();
|
|
455
|
-
i0.ɵɵproperty("ngIf", ctx.showTextAcuerdo);
|
|
456
|
-
i0.ɵɵadvance(2);
|
|
457
|
-
i0.ɵɵproperty("ngIf", !ctx.isRecording);
|
|
458
|
-
i0.ɵɵadvance();
|
|
459
|
-
i0.ɵɵproperty("ngIf", ctx.isRecording);
|
|
460
|
-
i0.ɵɵadvance();
|
|
461
|
-
i0.ɵɵproperty("isOpen", ctx.isModalOpen);
|
|
462
|
-
i0.ɵɵadvance(2);
|
|
463
|
-
i0.ɵɵproperty("isOpen", ctx.isModalVoiceOpen);
|
|
464
|
-
} }, dependencies: [i3.NgClass, i3.NgForOf, i3.NgIf, i1.IonButton, i1.IonButtons, i1.IonContent, i1.IonHeader, i1.IonIcon, i1.IonLabel, i1.IonToolbar, i1.IonModal], styles: [".camera-container[_ngcontent-%COMP%] {\r\n justify-content: center;\r\n align-items: center;\r\n position: relative;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n height: 50%; // Antes era 70%\r\n background-color: white;\r\n}\r\n\r\n.video-wrapper[_ngcontent-%COMP%] {\r\n position: relative;\r\n width: 300px;\r\n height: 300px;\r\n border-radius: 50%;\r\n overflow: hidden;\r\n}\r\n\r\nvideo[_ngcontent-%COMP%] {\r\n width: 100%;\r\n height: 100%;\r\n object-fit: cover;\r\n border-radius: 50%;\r\n}\r\n\r\n.progress-ring[_ngcontent-%COMP%] {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n transform: rotate(-90deg); \n\r\n}\r\n\r\n.progress-ring__circle[_ngcontent-%COMP%] {\r\n fill: transparent;\r\n stroke: purple;\r\n stroke-width: 12;\r\n stroke-dasharray: 945; \n\r\n stroke-dashoffset: 880; \n\r\n transition: stroke-dashoffset 12s linear; \n\r\n}\r\n\r\n.progress-active[_ngcontent-%COMP%] .progress-ring__circle[_ngcontent-%COMP%] {\r\n animation: _ngcontent-%COMP%_progress-animation 5s linear forwards;\r\n}\r\n\r\n@keyframes _ngcontent-%COMP%_progress-animation {\r\n from {\r\n stroke-dashoffset: 880;\r\n }\r\n to {\r\n stroke-dashoffset: 0;\r\n }\r\n}\r\n\r\n//[_ngcontent-%COMP%] div[_ngcontent-%COMP%] //[_ngcontent-%COMP%] {\r\n// color: #ffffff;\r\n// font-weight: 50px;\r\n// border-radius: 20px;\r\n// margin-top: 20px;\r\n// //width: 90%;\r\n// //max-width: 300px;\r\n// align-self: center;\r\n// text-transform: none;\r\n\r\n// --background: var(--purple-primary);\r\n// --background-hover: var(--purple-secondary);\r\n// --background-activated: var(--purple-secondary);\r\n// --background-focused: var(--purple-secondary);\r\n\r\n// --color: var(--purple-primary);\r\n\r\n// --border-radius: 20px;\r\n// --border-color: var(--purple-primary);\r\n// --border-style: solid;\r\n// --border-width: 1px;\r\n\r\n// --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\r\n\r\n// --ripple-color: var(--purple-secondary);\r\n\r\n\r\n// --padding-top: 10px;\r\n// --padding-bottom: 10px;\r\n// }\r\n\r\n.text-container[_ngcontent-%COMP%] {\r\n height: 40px;\r\n color: black;\r\n}\r\n\r\nion-header[_ngcontent-%COMP%] {\r\n --background: #ffffff; \n\r\n}\r\n\r\n\r\n\r\n.centered-title[_ngcontent-%COMP%] {\r\n text-align: center;\r\n width: 100%; \n\r\n font-weight: bold;\r\n}\r\n\r\n.fixed-footer[_ngcontent-%COMP%] {\r\n\r\n position: fixed;\r\n bottom: 0;\r\n // left: 0;\r\n left: 50%;\r\n // width: 100%;\r\n width: auto;\r\n transform: translateX(-50%); \n\r\n justify-content: center;\r\n padding: 10px;\r\n background-color: #fff; // Color de fondo, opcional\r\n // box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);\r\n\r\n ion-button {\r\n // width: 90%;\r\n // max-width: 300px; // anteriormente 300\r\n width: auto;\r\n margin: 0 auto;\r\n background-color: #ffcc00;\r\n color: #ffffff;\r\n font-weight: bold;\r\n border-radius: 20px;\r\n\r\n --background: var(--purple-primary);\r\n --background-hover: var(--purple-secondary);\r\n --background-activated: var(--purple-secondary);\r\n --background-focused: var(--purple-secondary);\r\n \r\n --color: var(--purple-primary);\r\n \r\n --border-radius: 20px;\r\n --border-color: var(--purple-primary);\r\n --border-style: solid;\r\n --border-width: 1px;\r\n \r\n --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\r\n \r\n --ripple-color: var(--purple-secondary);\r\n \r\n\r\n &:hover {\r\n background-color: #ffb300;\r\n }\r\n\r\n &:active {\r\n background-color: #e6a800;\r\n }\r\n }\r\n}\r\n\r\n\r\nion-header[_ngcontent-%COMP%] {\r\n --background: #ffffff; \n\r\n color: #000000; \n\r\n}\r\n\r\nion-toolbar[_ngcontent-%COMP%] {\r\n --ion-background-color: #ffffff !important;\r\n --background: #ffffff !important;\r\n color: #000000;\r\n}\r\n\r\n\r\nion-header[_ngcontent-%COMP%] {\r\n --background: #ffffff; \n\r\n}\r\n\r\nion-toolbar[_ngcontent-%COMP%] {\r\n --ion-background-color: #ffffff !important;\r\n --background: #ffffff !important;\r\n color: #000000;\r\n display: flex;\r\n justify-content: space-between; \n\r\n align-items: center;\r\n}\r\n\r\n.centered-title[_ngcontent-%COMP%] {\r\n flex: 1;\r\n text-align: center; \n\r\n font-weight: bold;\r\n color: #000000;\r\n margin: 0; \n\r\n}\r\n\r\nion-buttons[_ngcontent-%COMP%] {\r\n justify-content: flex-end; \n\r\n}\r\n.countdown-overlay[_ngcontent-%COMP%] {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgba(0, 0, 0, 0.6); \n\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n margin: 0;\r\n padding: 0;\r\n z-index: 1000; \n\r\n animation: _ngcontent-%COMP%_fadeIn 0.5s ease-out, _ngcontent-%COMP%_fadeOut 0.5s ease-out 2.5s; \n\r\n box-sizing: border-box;\r\n border-radius: 0px;\r\n\r\n}\r\n\r\nion-content.custom-content[_ngcontent-%COMP%] {\r\n --padding-top: 0;\r\n --padding-bottom: 0;\r\n margin: 0;\r\n padding: 0;\r\n margin-top: 10vh; // Levanta el contenido un 10% desde el tope\r\n height: 90vh; // Ajusta la altura para que junto con el margin sea 100%\r\n}\r\n\r\n.countdown[_ngcontent-%COMP%] {\r\n font-size: 100px;\r\n font-weight: bold;\r\n color: white;\r\n animation: _ngcontent-%COMP%_scaleUp 0.5s ease-out, _ngcontent-%COMP%_scaleDown 0.5s ease-out 2.5s; \n\r\n}\r\n\r\n\n\r\n@keyframes _ngcontent-%COMP%_fadeIn {\r\n from {\r\n opacity: 0;\r\n }\r\n to {\r\n opacity: 1;\r\n }\r\n}\r\n\r\n@keyframes _ngcontent-%COMP%_fadeOut {\r\n from {\r\n opacity: 1;\r\n }\r\n to {\r\n opacity: 0;\r\n }\r\n}\r\n\r\n\n\r\n@keyframes _ngcontent-%COMP%_scaleUp {\r\n from {\r\n transform: scale(0.8);\r\n opacity: 0;\r\n }\r\n to {\r\n transform: scale(1);\r\n opacity: 1;\r\n }\r\n}\r\n\r\n@keyframes _ngcontent-%COMP%_scaleDown {\r\n from {\r\n transform: scale(1);\r\n opacity: 1;\r\n }\r\n to {\r\n transform: scale(0.8);\r\n opacity: 0;\r\n }\r\n}\r\n\r\n.red[_ngcontent-%COMP%] {\r\n padding: 10px;\r\n color: red;\r\n}\r\n\r\n.text-center[_ngcontent-%COMP%]{\r\n text-align: center;\r\n padding-left: 20%;\r\n padding-right: 20%;\r\n color: #333;\r\n}\r\n\r\n.loading-overlay[_ngcontent-%COMP%] {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgba(0, 0, 0, 0.8); \n\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n z-index: 1000; \n\r\n margin: 0;\r\n padding: 0;\r\n box-sizing: border-box;\r\n border-radius: 0px;\r\n}\r\n\r\nion-spinner[_ngcontent-%COMP%] {\r\n color: white;\r\n width: 50px;\r\n height: 50px;\r\n}\r\n\r\n.main-header[_ngcontent-%COMP%] {\r\n padding-left: 24px;\r\n padding-right: 24px;\r\n}\r\n\r\n.main-title[_ngcontent-%COMP%] {\r\n font-size: 24px;\r\n font-weight: bold;\r\n color: var(--purple-secondary);\r\n}\r\n\r\n.acuerdo-text[_ngcontent-%COMP%] {\r\n font-size: 14px;\r\n color: black;\r\n}\r\n\r\n//TTS\r\n\r\n.subtitle[_ngcontent-%COMP%] {\r\n padding: 0px 24px;\r\n text-align: left;\r\n font-size: 17px;\r\n}\r\n.subtitle-word[_ngcontent-%COMP%] {\r\n display: inline-block;\r\n margin: 0 3px;\r\n transition: background-color 0.3s ease, color 0.3s ease;\r\n border-radius: 10px;\r\n\r\n}\r\n\r\n.subtitle-word.highlight[_ngcontent-%COMP%] {\r\n background-color: purple;\r\n border-radius: 6px;\r\n color: white;\r\n padding: 4px;\r\n font-weight: 600;\r\n}\r\n\r\n\r\n.subtitle-word.read[_ngcontent-%COMP%] {\r\n color: gray; \n\r\n}\r\n\r\n.button-container[_ngcontent-%COMP%] {\r\n justify-content: center;\r\n display: flex;\r\n}\r\n\r\n\r\n//[_ngcontent-%COMP%] MODAL\r\n\r\nion-modal[_ngcontent-%COMP%] {\r\n--display: flex;\r\n--height: 100%;\r\n--width: 100%;\r\n// --border-radius: 16px;\r\n// --box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\r\n// --background: rgba(0, 0, 0, 0.30) !important;\r\n}\r\n\r\n.full-content[_ngcontent-%COMP%] {\r\nwidth: 100%;\r\nheight: 100%;\r\ndisplay: flex;\r\njustify-content: center;\r\nalign-items: center;\r\nbackground-color: rgba(0, 0, 0, 0.30) !important;\r\n\r\n}\r\n\r\n.modal-content[_ngcontent-%COMP%] {\r\ntext-align: center;\r\npadding: 10px;\r\nleft: 50%;\r\nborder-radius: 16px;\r\nheight: 370px;\r\nwidth: 80%;\r\nbackground-color: white;\r\n justify-content: center;\r\nalign-items: center; \r\n\r\nh2 {\r\n color: var(--purple-primary);\r\n}\r\n\r\n.subtitle {\r\n margin-bottom: 20px;\r\n}\r\n\r\nion-button {\r\n // width: 90%;\r\n // max-width: 300px; // anteriormente 300\r\n width: auto;\r\n margin: 0 auto;\r\n background-color: #ffcc00;\r\n color: #ffffff;\r\n font-weight: bold;\r\n border-radius: 20px;\r\n\r\n --background: var(--orange-primary);\r\n --background-hover: var(--orange-secondary);\r\n --background-activated: var(--orange-secondary);\r\n --background-focused: var(--orange-secondary);\r\n \r\n --color: var(--orange-primary);\r\n \r\n --border-radius: 20px;\r\n --border-color: var(--orange-primary);\r\n --border-style: solid;\r\n --border-width: 1px;\r\n \r\n --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\r\n \r\n --ripple-color: var(--orange-secondary);\r\n \r\n\r\n &:hover {\r\n background-color: #ffb300;\r\n }\r\n\r\n &:active {\r\n background-color: #e6a800;\r\n }\r\n }\r\n\r\n // .button-container {\r\n // display: block;\r\n // // position: fixed;\r\n // // bottom: 32%;\r\n // // left: 0;\r\n // left: 50%;\r\n // // width: 100%;\r\n // width: auto;\r\n // transform: translateX(-50%); \n\r\n // justify-content: center;\r\n // padding: 5px;\r\n // }\r\n}\r\nion-modal[_ngcontent-%COMP%]::part(backdrop) {\r\nbackground: rgb(136, 138, 142);\r\nopacity: 1;\r\n}\r\n\r\nion-modal[_ngcontent-%COMP%] ion-toolbar[_ngcontent-%COMP%] {\r\n--background: rgb(14 116 144);\r\n--color: white;\r\n}\r\n\r\nion-modal.stack-modal[_ngcontent-%COMP%] {\r\n--box-shadow: 0 28px 48px rgba(0, 0, 0, 0.4);\r\n--backdrop-opacity: var(--ion-backdrop-opacity, 0.32);\r\n}\r\n\r\n\r\n.modal-content-2[_ngcontent-%COMP%] {\r\nbackground-color: white;\r\npadding: 20px;\r\ntext-align: center;\r\nborder-radius: 12px;\r\nheight: auto;\r\nwidth: 80%;\r\njustify-content: center;\r\nalign-items: center;\r\n}\r\n\r\n.modal-header[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%] {\r\ncolor: #ff9a00; \n\r\nmargin-bottom: 10px;\r\nfont-size: 3rem !important\r\n;\r\n}\r\n\r\n.modal-body[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\r\n// font-size: 18px;\r\nmargin-bottom: 20px;\r\n}\r\n\r\n.icons-container[_ngcontent-%COMP%] {\r\ndisplay: flex;\r\njustify-content: center;\r\nalign-items: center;\r\nmargin-top: 20px;\r\ngap: 15px; \r\n\r\n}\r\n\r\n.modal-body[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\r\nfont-size: 20px;\r\n}\r\n.custom-text[_ngcontent-%COMP%] {\r\nbackground-color: var(--orange-primary);\r\ncolor: white;\r\nborder-radius: 10px;\r\npadding: 0 15px;\r\nfont-size: 22px;\r\n}\r\n\r\n.o-text[_ngcontent-%COMP%] {\r\npadding: 0 15px;\r\nfont-size: 22px;\r\n}"] }); }
|
|
465
|
-
}
|
|
466
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SimpleAcuerdoVideoComponent, [{
|
|
467
|
-
type: Component,
|
|
468
|
-
args: [{ selector: 'app-simple-acuerdo-video', encapsulation: ViewEncapsulation.Emulated, template: "<ion-content color=\"light\" class=\"custom-content\">\r\n <!-- Loading deshabilitado para evitar conflictos con loading principal -->\r\n <!-- <div *ngIf=\"isLoading\" class=\"loading-overlay\">\r\n <ion-spinner name=\"crescent\"></ion-spinner>\r\n </div> -->\r\n \r\n <div *ngIf=\"countdown > 0\" class=\"countdown-overlay\">\r\n <div class=\"countdown\">{{ countdown }}</div>\r\n </div>\r\n <ion-header class=\"ion-no-border\">\r\n <ion-toolbar color=\"light\">\r\n <!-- <ion-title class=\"centered-title\">Video Selfie</ion-title> -->\r\n <ion-buttons slot=\"end\">\r\n <ion-button (click)=\"closeOverlayVideo()\" [disabled]=\"!canStopRecording\">\r\n <ion-icon name=\"close\"></ion-icon>\r\n </ion-button>\r\n </ion-buttons>\r\n </ion-toolbar>\r\n </ion-header>\r\n\r\n <div class=\"main-header\">\r\n <div class=\"main-title\">\r\n <h1>Acuerdo de Video</h1>\r\n </div>\r\n <div class=\"acuerdo-text\">\r\n <p>Contesta \u00FAnicamente \"S\u00ED\" si est\u00E1s de acuerdo con el cr\u00E9dito y contesta \"No\" para cancelar el proceso.</p>\r\n </div>\r\n </div>\r\n <!-- Contenedor de la c\u00E1mara y progresi\u00F3n -->\r\n <div class=\"camera-container\">\r\n <div class=\"video-wrapper\">\r\n <video #videoElement muted autoplay playsinline style=\"transform: scaleX(-1)\"></video>\r\n <svg class=\"progress-ring\" #progressRing width=\"300\" height=\"300\">\r\n <circle class=\"progress-ring__circle\" cx=\"150\" cy=\"150\" r=\"150\" />\r\n </svg>\r\n </div>\r\n <ion-label [ngClass]=\"{'red': isRecording}\">00:{{ timeRemaining < 10 ? '0' + timeRemaining : timeRemaining\r\n }}</ion-label>\r\n\r\n <div class=\"text-container\" *ngIf=\"showTextAcuerdo\">\r\n <!-- Mostrar las palabras como subt\u00EDtulos -->\r\n <p class=\"subtitle\">\r\n <span *ngFor=\"let word of words; let i = index\" class=\"subtitle-word\">\r\n {{ word }} \r\n </span>\r\n </p>\r\n </div>\r\n <!-- <p class=\"text-center\">Permanece quieto, con tu rostro en el centro del circulo</p> -->\r\n\r\n \r\n <!-- Botones de grabaci\u00F3n -->\r\n <div class=\"fixed-footer\">\r\n <ion-button *ngIf=\"!isRecording\" size=\"large\" expand=\"block\" (click)=\"recordVideo()\" shape=\"round\"><ion-icon slot=\"icon-only\" name=\"camera-outline\"></ion-icon></ion-button>\r\n <ion-button *ngIf=\"isRecording\" size=\"large\" expand=\"block\" (click)=\"stopRecording()\" [disabled]=\"!canStopRecording\"><ion-icon slot=\"icon-only\" name=\"stop-outline\"></ion-icon></ion-button>\r\n </div>\r\n </div>\r\n\r\n <ion-modal id=\"example-modal\" [isOpen]=\"isModalOpen\" (didDismiss)=\"closeModal()\">\r\n <ng-template>\r\n <div class=\"full-content\"> \r\n <div class=\"modal-content\">\r\n <img src=\"https://placeholder.pics/svg/150x150\" alt=\"\">\r\n <h2>Instrucciones</h2> \r\n <!-- Subt\u00EDtulos din\u00E1micos y TTS -->\r\n <div class=\"subtitle\">\r\n <span *ngFor=\"let word of instructionWords; let i = index\" class=\"subtitle-word\">\r\n {{ word }}\r\n </span>\r\n </div>\r\n <div class=\"button-container\">\r\n <ion-button (click)=\"closeModal()\" [disabled]=\"isSpeaking\">Comenzar</ion-button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ion-modal>\r\n\r\n <ion-modal id=\"voice-modal\" [isOpen]=\"isModalVoiceOpen\" (didDismiss)=\"closeModalVoice()\">\r\n <ng-template>\r\n <div class=\"full-content\">\r\n <div class=\"modal-content-2\">\r\n <div class=\"modal-header\">\r\n <ion-icon name=\"mic\" size=\"large\" style=\"width: 50px !important; height: 50px !important;\"></ion-icon>\r\n </div>\r\n <div class=\"modal-body\">\r\n <p>Contesta con tu voz</p>\r\n <div class=\"icons-container\">\r\n <div class=\"custom-text\">\r\n <p>S\u00ED</p>\r\n </div>\r\n <div class=\"o-text\">\r\n <p>o</p>\r\n </div>\r\n <div class=\"custom-text\">\r\n <p>No</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-template>\r\n </ion-modal>\r\n</ion-content>", styles: [".camera-container {\r\n justify-content: center;\r\n align-items: center;\r\n position: relative;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n height: 50%; // Antes era 70%\r\n background-color: white;\r\n}\r\n\r\n.video-wrapper {\r\n position: relative;\r\n width: 300px;\r\n height: 300px;\r\n border-radius: 50%;\r\n overflow: hidden;\r\n}\r\n\r\nvideo {\r\n width: 100%;\r\n height: 100%;\r\n object-fit: cover;\r\n border-radius: 50%;\r\n}\r\n\r\n.progress-ring {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n transform: rotate(-90deg); /* Rotamos el c\u00EDrculo para que la animaci\u00F3n inicie desde arriba */\r\n}\r\n\r\n.progress-ring__circle {\r\n fill: transparent;\r\n stroke: purple;\r\n stroke-width: 12;\r\n stroke-dasharray: 945; /* La circunferencia del c\u00EDrculo 880*/\r\n stroke-dashoffset: 880; /* Oculto por completo al inicio */\r\n transition: stroke-dashoffset 12s linear; /* Esto controlar\u00E1 el llenado progresivo */\r\n}\r\n\r\n.progress-active .progress-ring__circle {\r\n animation: progress-animation 5s linear forwards;\r\n}\r\n\r\n@keyframes progress-animation {\r\n from {\r\n stroke-dashoffset: 880;\r\n }\r\n to {\r\n stroke-dashoffset: 0;\r\n }\r\n}\r\n\r\n// div \r\n// {\r\n// color: #ffffff;\r\n// font-weight: 50px;\r\n// border-radius: 20px;\r\n// margin-top: 20px;\r\n// //width: 90%;\r\n// //max-width: 300px;\r\n// align-self: center;\r\n// text-transform: none;\r\n\r\n// --background: var(--purple-primary);\r\n// --background-hover: var(--purple-secondary);\r\n// --background-activated: var(--purple-secondary);\r\n// --background-focused: var(--purple-secondary);\r\n\r\n// --color: var(--purple-primary);\r\n\r\n// --border-radius: 20px;\r\n// --border-color: var(--purple-primary);\r\n// --border-style: solid;\r\n// --border-width: 1px;\r\n\r\n// --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\r\n\r\n// --ripple-color: var(--purple-secondary);\r\n\r\n\r\n// --padding-top: 10px;\r\n// --padding-bottom: 10px;\r\n// }\r\n\r\n.text-container {\r\n height: 40px;\r\n color: black;\r\n}\r\n\r\nion-header {\r\n --background: #ffffff; /* Fondo blanco para el header */\r\n}\r\n\r\n\r\n\r\n.centered-title {\r\n text-align: center;\r\n width: 100%; /* Asegura que el t\u00EDtulo est\u00E9 centrado */\r\n font-weight: bold;\r\n}\r\n\r\n.fixed-footer {\r\n\r\n position: fixed;\r\n bottom: 0;\r\n // left: 0;\r\n left: 50%;\r\n // width: 100%;\r\n width: auto;\r\n transform: translateX(-50%); /* Centra el contenedor */\r\n justify-content: center;\r\n padding: 10px;\r\n background-color: #fff; // Color de fondo, opcional\r\n // box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);\r\n\r\n ion-button {\r\n // width: 90%;\r\n // max-width: 300px; // anteriormente 300\r\n width: auto;\r\n margin: 0 auto;\r\n background-color: #ffcc00;\r\n color: #ffffff;\r\n font-weight: bold;\r\n border-radius: 20px;\r\n\r\n --background: var(--purple-primary);\r\n --background-hover: var(--purple-secondary);\r\n --background-activated: var(--purple-secondary);\r\n --background-focused: var(--purple-secondary);\r\n \r\n --color: var(--purple-primary);\r\n \r\n --border-radius: 20px;\r\n --border-color: var(--purple-primary);\r\n --border-style: solid;\r\n --border-width: 1px;\r\n \r\n --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\r\n \r\n --ripple-color: var(--purple-secondary);\r\n \r\n\r\n &:hover {\r\n background-color: #ffb300;\r\n }\r\n\r\n &:active {\r\n background-color: #e6a800;\r\n }\r\n }\r\n}\r\n\r\n\r\nion-header {\r\n --background: #ffffff; /* Fondo blanco */\r\n color: #000000; /* Texto negro */\r\n}\r\n\r\nion-toolbar {\r\n --ion-background-color: #ffffff !important;\r\n --background: #ffffff !important;\r\n color: #000000;\r\n}\r\n\r\n\r\nion-header {\r\n --background: #ffffff; /* Fondo blanco */\r\n}\r\n\r\nion-toolbar {\r\n --ion-background-color: #ffffff !important;\r\n --background: #ffffff !important;\r\n color: #000000;\r\n display: flex;\r\n justify-content: space-between; /* Espacio entre t\u00EDtulo y bot\u00F3n */\r\n align-items: center;\r\n}\r\n\r\n.centered-title {\r\n flex: 1;\r\n text-align: center; /* Centrar el t\u00EDtulo */\r\n font-weight: bold;\r\n color: #000000;\r\n margin: 0; /* Quita cualquier margen del t\u00EDtulo */\r\n}\r\n\r\nion-buttons {\r\n justify-content: flex-end; /* Alinea el bot\u00F3n a la derecha */\r\n}\r\n.countdown-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgba(0, 0, 0, 0.6); /* Fondo semi-transparente */\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n margin: 0;\r\n padding: 0;\r\n z-index: 1000; /* Asegurarse de que est\u00E9 encima de otros elementos */\r\n animation: fadeIn 0.5s ease-out, fadeOut 0.5s ease-out 2.5s; /* Animaciones de entrada y salida */\r\n box-sizing: border-box;\r\n border-radius: 0px;\r\n\r\n}\r\n\r\nion-content.custom-content {\r\n --padding-top: 0;\r\n --padding-bottom: 0;\r\n margin: 0;\r\n padding: 0;\r\n margin-top: 10vh; // Levanta el contenido un 10% desde el tope\r\n height: 90vh; // Ajusta la altura para que junto con el margin sea 100%\r\n}\r\n\r\n.countdown {\r\n font-size: 100px;\r\n font-weight: bold;\r\n color: white;\r\n animation: scaleUp 0.5s ease-out, scaleDown 0.5s ease-out 2.5s; /* Escalar en entrada y salida */\r\n}\r\n\r\n/* Animaci\u00F3n para desvanecer la superposici\u00F3n */\r\n@keyframes fadeIn {\r\n from {\r\n opacity: 0;\r\n }\r\n to {\r\n opacity: 1;\r\n }\r\n}\r\n\r\n@keyframes fadeOut {\r\n from {\r\n opacity: 1;\r\n }\r\n to {\r\n opacity: 0;\r\n }\r\n}\r\n\r\n/* Animaci\u00F3n para escalar el n\u00FAmero */\r\n@keyframes scaleUp {\r\n from {\r\n transform: scale(0.8);\r\n opacity: 0;\r\n }\r\n to {\r\n transform: scale(1);\r\n opacity: 1;\r\n }\r\n}\r\n\r\n@keyframes scaleDown {\r\n from {\r\n transform: scale(1);\r\n opacity: 1;\r\n }\r\n to {\r\n transform: scale(0.8);\r\n opacity: 0;\r\n }\r\n}\r\n\r\n.red {\r\n padding: 10px;\r\n color: red;\r\n}\r\n\r\n.text-center{\r\n text-align: center;\r\n padding-left: 20%;\r\n padding-right: 20%;\r\n color: #333;\r\n}\r\n\r\n.loading-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgba(0, 0, 0, 0.8); /* Fondo oscuro semi-transparente */\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n z-index: 1000; /* Aseg\u00FArate de que est\u00E9 por encima del contenido */\r\n margin: 0;\r\n padding: 0;\r\n box-sizing: border-box;\r\n border-radius: 0px;\r\n}\r\n\r\nion-spinner {\r\n color: white;\r\n width: 50px;\r\n height: 50px;\r\n}\r\n\r\n.main-header {\r\n padding-left: 24px;\r\n padding-right: 24px;\r\n}\r\n\r\n.main-title {\r\n font-size: 24px;\r\n font-weight: bold;\r\n color: var(--purple-secondary);\r\n}\r\n\r\n.acuerdo-text {\r\n font-size: 14px;\r\n color: black;\r\n}\r\n\r\n//TTS\r\n\r\n.subtitle {\r\n padding: 0px 24px;\r\n text-align: left;\r\n font-size: 17px;\r\n}\r\n.subtitle-word {\r\n display: inline-block;\r\n margin: 0 3px;\r\n transition: background-color 0.3s ease, color 0.3s ease;\r\n border-radius: 10px;\r\n\r\n}\r\n\r\n.subtitle-word.highlight {\r\n background-color: purple;\r\n border-radius: 6px;\r\n color: white;\r\n padding: 4px;\r\n font-weight: 600;\r\n}\r\n\r\n\r\n.subtitle-word.read {\r\n color: gray; /* Color para el texto ya le\u00EDdo */\r\n}\r\n\r\n.button-container {\r\n justify-content: center;\r\n display: flex;\r\n}\r\n\r\n\r\n// MODAL\r\n\r\nion-modal {\r\n--display: flex;\r\n--height: 100%;\r\n--width: 100%;\r\n// --border-radius: 16px;\r\n// --box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\r\n// --background: rgba(0, 0, 0, 0.30) !important;\r\n}\r\n\r\n.full-content {\r\nwidth: 100%;\r\nheight: 100%;\r\ndisplay: flex;\r\njustify-content: center;\r\nalign-items: center;\r\nbackground-color: rgba(0, 0, 0, 0.30) !important;\r\n\r\n}\r\n\r\n.modal-content {\r\ntext-align: center;\r\npadding: 10px;\r\nleft: 50%;\r\nborder-radius: 16px;\r\nheight: 370px;\r\nwidth: 80%;\r\nbackground-color: white;\r\n justify-content: center;\r\nalign-items: center; \r\n\r\nh2 {\r\n color: var(--purple-primary);\r\n}\r\n\r\n.subtitle {\r\n margin-bottom: 20px;\r\n}\r\n\r\nion-button {\r\n // width: 90%;\r\n // max-width: 300px; // anteriormente 300\r\n width: auto;\r\n margin: 0 auto;\r\n background-color: #ffcc00;\r\n color: #ffffff;\r\n font-weight: bold;\r\n border-radius: 20px;\r\n\r\n --background: var(--orange-primary);\r\n --background-hover: var(--orange-secondary);\r\n --background-activated: var(--orange-secondary);\r\n --background-focused: var(--orange-secondary);\r\n \r\n --color: var(--orange-primary);\r\n \r\n --border-radius: 20px;\r\n --border-color: var(--orange-primary);\r\n --border-style: solid;\r\n --border-width: 1px;\r\n \r\n --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\r\n \r\n --ripple-color: var(--orange-secondary);\r\n \r\n\r\n &:hover {\r\n background-color: #ffb300;\r\n }\r\n\r\n &:active {\r\n background-color: #e6a800;\r\n }\r\n }\r\n\r\n // .button-container {\r\n // display: block;\r\n // // position: fixed;\r\n // // bottom: 32%;\r\n // // left: 0;\r\n // left: 50%;\r\n // // width: 100%;\r\n // width: auto;\r\n // transform: translateX(-50%); /* Centra el contenedor */\r\n // justify-content: center;\r\n // padding: 5px;\r\n // }\r\n}\r\nion-modal::part(backdrop) {\r\nbackground: rgb(136, 138, 142);\r\nopacity: 1;\r\n}\r\n\r\nion-modal ion-toolbar {\r\n--background: rgb(14 116 144);\r\n--color: white;\r\n}\r\n\r\nion-modal.stack-modal {\r\n--box-shadow: 0 28px 48px rgba(0, 0, 0, 0.4);\r\n--backdrop-opacity: var(--ion-backdrop-opacity, 0.32);\r\n}\r\n\r\n\r\n.modal-content-2 {\r\nbackground-color: white;\r\npadding: 20px;\r\ntext-align: center;\r\nborder-radius: 12px;\r\nheight: auto;\r\nwidth: 80%;\r\njustify-content: center;\r\nalign-items: center;\r\n}\r\n\r\n.modal-header ion-icon {\r\ncolor: #ff9a00; /* Color del micr\u00F3fono */\r\nmargin-bottom: 10px;\r\nfont-size: 3rem !important\r\n;\r\n}\r\n\r\n.modal-body p {\r\n// font-size: 18px;\r\nmargin-bottom: 20px;\r\n}\r\n\r\n.icons-container {\r\ndisplay: flex;\r\njustify-content: center;\r\nalign-items: center;\r\nmargin-top: 20px;\r\ngap: 15px; \r\n\r\n}\r\n\r\n.modal-body p {\r\nfont-size: 20px;\r\n}\r\n.custom-text {\r\nbackground-color: var(--orange-primary);\r\ncolor: white;\r\nborder-radius: 10px;\r\npadding: 0 15px;\r\nfont-size: 22px;\r\n}\r\n\r\n.o-text {\r\npadding: 0 15px;\r\nfont-size: 22px;\r\n}\r\n"] }]
|
|
469
|
-
}], () => [{ type: i1.Platform }, { type: i1.ModalController }, { type: i2.DomSanitizer }, { type: i0.Renderer2 }, { type: i1.AlertController }, { type: i0.ChangeDetectorRef }], { videoElement: [{
|
|
470
|
-
type: ViewChild,
|
|
471
|
-
args: ['videoElement']
|
|
472
|
-
}], progressRing: [{
|
|
473
|
-
type: ViewChild,
|
|
474
|
-
args: ['progressRing']
|
|
475
|
-
}], backFunction: [{
|
|
476
|
-
type: Input
|
|
477
|
-
}], closeRequested: [{
|
|
478
|
-
type: Output
|
|
479
|
-
}] }); })();
|
|
480
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SimpleAcuerdoVideoComponent, { className: "SimpleAcuerdoVideoComponent", filePath: "src\\app\\pages\\id-vision\\components\\simple-acuerdo-video\\simple-acuerdo-video.component.ts", lineNumber: 15 }); })();
|
|
1
|
+
import { Component, EventEmitter, Input, Output, ViewChild, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
import { Camera } from '@capacitor/camera';
|
|
3
|
+
import { ScreenBrightness } from '@capacitor-community/screen-brightness';
|
|
4
|
+
import { Capacitor } from '@capacitor/core';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "@ionic/angular";
|
|
7
|
+
import * as i2 from "@angular/platform-browser";
|
|
8
|
+
import * as i3 from "@angular/common";
|
|
9
|
+
const _c0 = ["videoElement"];
|
|
10
|
+
const _c1 = ["progressRing"];
|
|
11
|
+
const _c2 = a0 => ({ "red": a0 });
|
|
12
|
+
function SimpleAcuerdoVideoComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
13
|
+
i0.ɵɵelementStart(0, "div", 24)(1, "div", 25);
|
|
14
|
+
i0.ɵɵtext(2);
|
|
15
|
+
i0.ɵɵelementEnd()();
|
|
16
|
+
} if (rf & 2) {
|
|
17
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
18
|
+
i0.ɵɵadvance(2);
|
|
19
|
+
i0.ɵɵtextInterpolate(ctx_r1.countdown);
|
|
20
|
+
} }
|
|
21
|
+
function SimpleAcuerdoVideoComponent_div_23_span_2_Template(rf, ctx) { if (rf & 1) {
|
|
22
|
+
i0.ɵɵelementStart(0, "span", 29);
|
|
23
|
+
i0.ɵɵtext(1);
|
|
24
|
+
i0.ɵɵelementEnd();
|
|
25
|
+
} if (rf & 2) {
|
|
26
|
+
const word_r3 = ctx.$implicit;
|
|
27
|
+
i0.ɵɵadvance();
|
|
28
|
+
i0.ɵɵtextInterpolate1(" ", word_r3, " ");
|
|
29
|
+
} }
|
|
30
|
+
function SimpleAcuerdoVideoComponent_div_23_Template(rf, ctx) { if (rf & 1) {
|
|
31
|
+
i0.ɵɵelementStart(0, "div", 26)(1, "p", 27);
|
|
32
|
+
i0.ɵɵtemplate(2, SimpleAcuerdoVideoComponent_div_23_span_2_Template, 2, 1, "span", 28);
|
|
33
|
+
i0.ɵɵelementEnd()();
|
|
34
|
+
} if (rf & 2) {
|
|
35
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
36
|
+
i0.ɵɵadvance(2);
|
|
37
|
+
i0.ɵɵproperty("ngForOf", ctx_r1.words);
|
|
38
|
+
} }
|
|
39
|
+
function SimpleAcuerdoVideoComponent_ion_button_25_Template(rf, ctx) { if (rf & 1) {
|
|
40
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
41
|
+
i0.ɵɵelementStart(0, "ion-button", 30);
|
|
42
|
+
i0.ɵɵlistener("click", function SimpleAcuerdoVideoComponent_ion_button_25_Template_ion_button_click_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.recordVideo()); });
|
|
43
|
+
i0.ɵɵelement(1, "ion-icon", 31);
|
|
44
|
+
i0.ɵɵelementEnd();
|
|
45
|
+
} }
|
|
46
|
+
function SimpleAcuerdoVideoComponent_ion_button_26_Template(rf, ctx) { if (rf & 1) {
|
|
47
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
48
|
+
i0.ɵɵelementStart(0, "ion-button", 32);
|
|
49
|
+
i0.ɵɵlistener("click", function SimpleAcuerdoVideoComponent_ion_button_26_Template_ion_button_click_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.stopRecording()); });
|
|
50
|
+
i0.ɵɵelement(1, "ion-icon", 33);
|
|
51
|
+
i0.ɵɵelementEnd();
|
|
52
|
+
} if (rf & 2) {
|
|
53
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
54
|
+
i0.ɵɵproperty("disabled", !ctx_r1.canStopRecording);
|
|
55
|
+
} }
|
|
56
|
+
function SimpleAcuerdoVideoComponent_ng_template_28_span_6_Template(rf, ctx) { if (rf & 1) {
|
|
57
|
+
i0.ɵɵelementStart(0, "span", 29);
|
|
58
|
+
i0.ɵɵtext(1);
|
|
59
|
+
i0.ɵɵelementEnd();
|
|
60
|
+
} if (rf & 2) {
|
|
61
|
+
const word_r7 = ctx.$implicit;
|
|
62
|
+
i0.ɵɵadvance();
|
|
63
|
+
i0.ɵɵtextInterpolate1(" ", word_r7, " ");
|
|
64
|
+
} }
|
|
65
|
+
function SimpleAcuerdoVideoComponent_ng_template_28_Template(rf, ctx) { if (rf & 1) {
|
|
66
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
|
67
|
+
i0.ɵɵelementStart(0, "div", 34)(1, "div", 35);
|
|
68
|
+
i0.ɵɵelement(2, "img", 36);
|
|
69
|
+
i0.ɵɵelementStart(3, "h2");
|
|
70
|
+
i0.ɵɵtext(4, "Instrucciones");
|
|
71
|
+
i0.ɵɵelementEnd();
|
|
72
|
+
i0.ɵɵelementStart(5, "div", 27);
|
|
73
|
+
i0.ɵɵtemplate(6, SimpleAcuerdoVideoComponent_ng_template_28_span_6_Template, 2, 1, "span", 28);
|
|
74
|
+
i0.ɵɵelementEnd();
|
|
75
|
+
i0.ɵɵelementStart(7, "div", 37)(8, "ion-button", 7);
|
|
76
|
+
i0.ɵɵlistener("click", function SimpleAcuerdoVideoComponent_ng_template_28_Template_ion_button_click_8_listener() { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.closeModal()); });
|
|
77
|
+
i0.ɵɵtext(9, "Comenzar");
|
|
78
|
+
i0.ɵɵelementEnd()()()();
|
|
79
|
+
} if (rf & 2) {
|
|
80
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
81
|
+
i0.ɵɵadvance(6);
|
|
82
|
+
i0.ɵɵproperty("ngForOf", ctx_r1.instructionWords);
|
|
83
|
+
i0.ɵɵadvance(2);
|
|
84
|
+
i0.ɵɵproperty("disabled", ctx_r1.isSpeaking);
|
|
85
|
+
} }
|
|
86
|
+
function SimpleAcuerdoVideoComponent_ng_template_30_Template(rf, ctx) { if (rf & 1) {
|
|
87
|
+
i0.ɵɵelementStart(0, "div", 34)(1, "div", 38)(2, "div", 39);
|
|
88
|
+
i0.ɵɵelement(3, "ion-icon", 40);
|
|
89
|
+
i0.ɵɵelementEnd();
|
|
90
|
+
i0.ɵɵelementStart(4, "div", 41)(5, "p");
|
|
91
|
+
i0.ɵɵtext(6, "Contesta con tu voz");
|
|
92
|
+
i0.ɵɵelementEnd();
|
|
93
|
+
i0.ɵɵelementStart(7, "div", 42)(8, "div", 43)(9, "p");
|
|
94
|
+
i0.ɵɵtext(10, "S\u00ED");
|
|
95
|
+
i0.ɵɵelementEnd()();
|
|
96
|
+
i0.ɵɵelementStart(11, "div", 44)(12, "p");
|
|
97
|
+
i0.ɵɵtext(13, "o");
|
|
98
|
+
i0.ɵɵelementEnd()();
|
|
99
|
+
i0.ɵɵelementStart(14, "div", 43)(15, "p");
|
|
100
|
+
i0.ɵɵtext(16, "No");
|
|
101
|
+
i0.ɵɵelementEnd()()()()()();
|
|
102
|
+
} }
|
|
103
|
+
//import { TextToSpeech } from '@capacitor-community/text-to-speech';
|
|
104
|
+
export class SimpleAcuerdoVideoComponent {
|
|
105
|
+
constructor(platform, modalController, sanitizer, renderer, alertController, changeDetector) {
|
|
106
|
+
this.platform = platform;
|
|
107
|
+
this.modalController = modalController;
|
|
108
|
+
this.sanitizer = sanitizer;
|
|
109
|
+
this.renderer = renderer;
|
|
110
|
+
this.alertController = alertController;
|
|
111
|
+
this.changeDetector = changeDetector;
|
|
112
|
+
this.closeRequested = new EventEmitter();
|
|
113
|
+
this.stream = null;
|
|
114
|
+
this.isRecording = false;
|
|
115
|
+
this.mediaRecorder = null;
|
|
116
|
+
this.recordedChunks = [];
|
|
117
|
+
this.countdown = 0; // Propiedad para la cuenta regresiva
|
|
118
|
+
this.minRecordingTime = 3000; // 3 seconds
|
|
119
|
+
this.maxRecordingTime = 5000; // 5 seconds
|
|
120
|
+
this.timeRemaining = this.maxRecordingTime / 1000; // Inicializar con el tiempo máximo en segundos
|
|
121
|
+
this.canStopRecording = true;
|
|
122
|
+
this.isLoading = true; // Variable para mostrar el loader
|
|
123
|
+
this.defaultBrightness = null; // Para guardar el brillo original del dispositivo
|
|
124
|
+
this.isModalOpen = false;
|
|
125
|
+
this.isModalVoiceOpen = false;
|
|
126
|
+
//TTS
|
|
127
|
+
this.text = '¿Acepta los términos y condiciones del crédito que está solicitando en Fundación Génesis Empresarial?';
|
|
128
|
+
this.instructions = 'Por favor contesta "SI" o "NO" a la pregunta para completar el proceso.';
|
|
129
|
+
this.words = [];
|
|
130
|
+
this.instructionWords = [];
|
|
131
|
+
this.currentIndex = 0;
|
|
132
|
+
this.timePerWord = 380; //350
|
|
133
|
+
this.isSpeaking = false;
|
|
134
|
+
this.showTextAcuerdo = false;
|
|
135
|
+
this.isAndroid = this.platform.is('android');
|
|
136
|
+
this.isIOS = this.platform.is('ios');
|
|
137
|
+
}
|
|
138
|
+
async ngAfterViewInit() {
|
|
139
|
+
// this.isModalOpen = true;
|
|
140
|
+
this.openModal();
|
|
141
|
+
// this.openModalVoice();
|
|
142
|
+
this.words = this.text.split(' ');
|
|
143
|
+
this.instructionWords = this.instructions.split(' ');
|
|
144
|
+
setTimeout(() => {
|
|
145
|
+
this.speakText(this.instructionWords, this.instructions);
|
|
146
|
+
}, 500);
|
|
147
|
+
if (this.isAndroid || this.isIOS) {
|
|
148
|
+
try {
|
|
149
|
+
const { brightness } = await ScreenBrightness.getBrightness();
|
|
150
|
+
this.defaultBrightness = brightness;
|
|
151
|
+
await ScreenBrightness.setBrightness({ brightness: 1.0 });
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
console.warn('Error al obtener el brillo de la pantalla:', error);
|
|
155
|
+
}
|
|
156
|
+
await this.requestPermissions();
|
|
157
|
+
}
|
|
158
|
+
await this.initCamera();
|
|
159
|
+
// await this.startRecording();
|
|
160
|
+
await this.waitForCameraReady();
|
|
161
|
+
}
|
|
162
|
+
async ngOnDestroy() {
|
|
163
|
+
this.stopCamera();
|
|
164
|
+
try {
|
|
165
|
+
if (this.defaultBrightness !== null) {
|
|
166
|
+
await ScreenBrightness.setBrightness({
|
|
167
|
+
brightness: this.defaultBrightness,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
console.warn('Error al restaurar el brillo original:', error);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
// Función para abrir la modal
|
|
176
|
+
openModal() {
|
|
177
|
+
this.isModalOpen = true; // Abrir la modal
|
|
178
|
+
}
|
|
179
|
+
openModalVoice() {
|
|
180
|
+
this.isModalVoiceOpen = true;
|
|
181
|
+
}
|
|
182
|
+
closeModalVoice() {
|
|
183
|
+
this.isModalVoiceOpen = false;
|
|
184
|
+
}
|
|
185
|
+
// Función para cerrar la modal
|
|
186
|
+
closeModal() {
|
|
187
|
+
this.isModalOpen = false; // Cerrar la modal
|
|
188
|
+
}
|
|
189
|
+
async waitForCameraReady() {
|
|
190
|
+
return new Promise((resolve) => {
|
|
191
|
+
this.videoElement.nativeElement.onloadedmetadata = () => {
|
|
192
|
+
resolve();
|
|
193
|
+
};
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
async requestPermissions() {
|
|
197
|
+
if (Capacitor.getPlatform() !== 'web') {
|
|
198
|
+
if (this.isAndroid || this.isIOS) {
|
|
199
|
+
const permissions = await Camera.requestPermissions();
|
|
200
|
+
if (permissions.camera === 'denied') {
|
|
201
|
+
console.error('Permiso de cámara denegado');
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
async initCamera() {
|
|
208
|
+
let isCameraReady = false;
|
|
209
|
+
try {
|
|
210
|
+
const constraints = {
|
|
211
|
+
video: {
|
|
212
|
+
width: { ideal: 640 },
|
|
213
|
+
height: { ideal: 480 },
|
|
214
|
+
facingMode: 'user',
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
this.stream = await navigator.mediaDevices.getUserMedia(constraints);
|
|
218
|
+
this.videoElement.nativeElement.srcObject = this.stream;
|
|
219
|
+
// Esperar hasta que la cámara esté lista
|
|
220
|
+
this.videoElement.nativeElement.onloadedmetadata = () => {
|
|
221
|
+
isCameraReady = true;
|
|
222
|
+
};
|
|
223
|
+
// Espera activa para asegurarte de que está lista
|
|
224
|
+
await new Promise((resolve) => {
|
|
225
|
+
const interval = setInterval(() => {
|
|
226
|
+
if (isCameraReady) {
|
|
227
|
+
clearInterval(interval);
|
|
228
|
+
resolve(true);
|
|
229
|
+
}
|
|
230
|
+
}, 100);
|
|
231
|
+
});
|
|
232
|
+
this.isLoading = false;
|
|
233
|
+
await this.startRecording();
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
console.error('Error al inicializar la cámara:', error);
|
|
237
|
+
this.isLoading = false;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
async startRecording() {
|
|
241
|
+
if (!this.stream)
|
|
242
|
+
return;
|
|
243
|
+
const options = {
|
|
244
|
+
mimeType: this.isIOS ? 'video/mp4' : 'video/webm',
|
|
245
|
+
videoBitsPerSecond: 400000,
|
|
246
|
+
};
|
|
247
|
+
this.mediaRecorder = new MediaRecorder(this.stream, options);
|
|
248
|
+
let chunks = [];
|
|
249
|
+
this.mediaRecorder.ondataavailable = (event) => {
|
|
250
|
+
if (event.data.size > 0) {
|
|
251
|
+
chunks.push(event.data);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
this.mediaRecorder.onstop = async () => {
|
|
257
|
+
if (chunks.length === 0) {
|
|
258
|
+
console.error('No se capturaron datos en la grabación.');
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
const fileType = this.isIOS ? 'video/mp4' : 'video/webm';
|
|
262
|
+
const fileExtension = this.isIOS ? 'mp4' : 'webm';
|
|
263
|
+
const videoBlob = new Blob(chunks, { type: fileType });
|
|
264
|
+
const videoFile = this.blobToFile(videoBlob, `video-selfie.${fileExtension}`);
|
|
265
|
+
if (this.backFunction) {
|
|
266
|
+
await this.backFunction(videoFile);
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
blobToFile(blob, fileName) {
|
|
271
|
+
const b = blob;
|
|
272
|
+
b.lastModified = new Date().getTime();
|
|
273
|
+
b.lastModifiedDate = new Date();
|
|
274
|
+
b.name = fileName;
|
|
275
|
+
//Cast to a File() type
|
|
276
|
+
return b;
|
|
277
|
+
}
|
|
278
|
+
async recordVideo() {
|
|
279
|
+
// Mostrar la cuenta regresiva antes de iniciar la grabación
|
|
280
|
+
this.countdown = 3;
|
|
281
|
+
const countdownInterval = setInterval(async () => {
|
|
282
|
+
this.countdown -= 1;
|
|
283
|
+
if (this.countdown <= 0) {
|
|
284
|
+
this.showTextAcuerdo = true;
|
|
285
|
+
clearInterval(countdownInterval);
|
|
286
|
+
await this.speakText(this.words, this.text);
|
|
287
|
+
this.openModalVoice();
|
|
288
|
+
this.startVideoRecord(); // Iniciar la grabación después de la cuenta regresiva
|
|
289
|
+
}
|
|
290
|
+
this.changeDetector.detectChanges(); // Actualizar la vista
|
|
291
|
+
}, 1000);
|
|
292
|
+
}
|
|
293
|
+
async startVideoRecord() {
|
|
294
|
+
if (this.mediaRecorder && !this.isRecording) {
|
|
295
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
296
|
+
this.mediaRecorder.start(100);
|
|
297
|
+
this.isRecording = true;
|
|
298
|
+
this.canStopRecording = false; // Deshabilitar el botón de detener inicialmente
|
|
299
|
+
this.renderer.addClass(this.progressRing.nativeElement, 'progress-active');
|
|
300
|
+
this.timeRemaining = this.maxRecordingTime / 1000; // Reiniciar el tiempo restante
|
|
301
|
+
this.updateTimeRemaining(); // Iniciar la actualización del tiempo restante
|
|
302
|
+
// Habilitar el botón de detener después de minRecordingTime
|
|
303
|
+
setTimeout(() => {
|
|
304
|
+
this.canStopRecording = true;
|
|
305
|
+
}, this.minRecordingTime);
|
|
306
|
+
this.recordingTimer = setTimeout(async () => {
|
|
307
|
+
await this.stopRecording();
|
|
308
|
+
}, this.maxRecordingTime);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
updateTimeRemaining() {
|
|
312
|
+
const interval = 1000; // Actualizar cada segundo
|
|
313
|
+
const timer = setInterval(() => {
|
|
314
|
+
if (this.isRecording) {
|
|
315
|
+
this.timeRemaining -= 1;
|
|
316
|
+
if (this.timeRemaining <= 0) {
|
|
317
|
+
clearInterval(timer);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
clearInterval(timer);
|
|
322
|
+
}
|
|
323
|
+
this.changeDetector.detectChanges(); // Actualizar la vista
|
|
324
|
+
}, interval);
|
|
325
|
+
}
|
|
326
|
+
async stopRecording() {
|
|
327
|
+
if (this.mediaRecorder && this.isRecording && this.canStopRecording) {
|
|
328
|
+
this.closeModalVoice();
|
|
329
|
+
console.log(this.capVideo);
|
|
330
|
+
await this.backFunction(this.capVideo);
|
|
331
|
+
this.mediaRecorder.stop();
|
|
332
|
+
this.isRecording = false;
|
|
333
|
+
}
|
|
334
|
+
if (this.scanTimeout) {
|
|
335
|
+
clearTimeout(this.scanTimeout);
|
|
336
|
+
}
|
|
337
|
+
// Detiene la animación del borde circular
|
|
338
|
+
this.renderer.removeClass(this.progressRing.nativeElement, 'progress-active');
|
|
339
|
+
}
|
|
340
|
+
async closeOverlayVideo() {
|
|
341
|
+
this.stopCamera();
|
|
342
|
+
// Restaura el brillo original si estaba guardado
|
|
343
|
+
if (this.defaultBrightness !== null) {
|
|
344
|
+
await ScreenBrightness.setBrightness({
|
|
345
|
+
brightness: this.defaultBrightness,
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
this.modalController.dismiss();
|
|
349
|
+
}
|
|
350
|
+
stopCamera() {
|
|
351
|
+
if (this.stream) {
|
|
352
|
+
this.stream.getTracks().forEach((track) => track.stop());
|
|
353
|
+
this.stream = null;
|
|
354
|
+
}
|
|
355
|
+
if (this.scanTimeout)
|
|
356
|
+
clearTimeout(this.scanTimeout);
|
|
357
|
+
}
|
|
358
|
+
//TTS
|
|
359
|
+
async speakText(words, text) {
|
|
360
|
+
if (this.isSpeaking) {
|
|
361
|
+
return; // Si ya se está hablando, no hacer nada
|
|
362
|
+
}
|
|
363
|
+
this.isSpeaking = true; // Establecer que el proceso está en marcha
|
|
364
|
+
this.currentIndex = 0;
|
|
365
|
+
this.highlightWord(this.currentIndex); // Resaltar la primera palabra
|
|
366
|
+
await this.speakSentenceWithHighlights(words, text); // Hablar la oración y resaltar simultáneamente
|
|
367
|
+
}
|
|
368
|
+
async speakSentenceWithHighlights(words, text) {
|
|
369
|
+
// Leer todo el texto fluido
|
|
370
|
+
// Resaltar las palabras mientras se lee el texto
|
|
371
|
+
words.forEach((word, index) => {
|
|
372
|
+
setTimeout(() => {
|
|
373
|
+
this.currentIndex = index;
|
|
374
|
+
this.highlightWord(this.currentIndex); // Resaltar la palabra
|
|
375
|
+
}, this.timePerWord * index); // Sincroniza con el tiempo de la palabra
|
|
376
|
+
});
|
|
377
|
+
// await TextToSpeech.speak({
|
|
378
|
+
// text: text,
|
|
379
|
+
// lang: 'es-MX',
|
|
380
|
+
// rate: 0.85,
|
|
381
|
+
// volume: 1.0,
|
|
382
|
+
// pitch: 1.2,
|
|
383
|
+
// });
|
|
384
|
+
// Una vez que se termine, habilitar nuevamente el botón
|
|
385
|
+
this.isSpeaking = false;
|
|
386
|
+
}
|
|
387
|
+
// Función para resaltar la palabra que está siendo leída
|
|
388
|
+
highlightWord(index) {
|
|
389
|
+
const wordElements = document.querySelectorAll('.subtitle-word');
|
|
390
|
+
wordElements.forEach((el, idx) => {
|
|
391
|
+
if (idx === index) {
|
|
392
|
+
el.classList.add('highlight'); // Resalta la palabra actual
|
|
393
|
+
el.classList.remove('read'); // Elimina el color de texto leído
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
el.classList.remove('highlight');
|
|
397
|
+
el.classList.add('read'); // Marca como leído
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
static { this.ɵfac = function SimpleAcuerdoVideoComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SimpleAcuerdoVideoComponent)(i0.ɵɵdirectiveInject(i1.Platform), i0.ɵɵdirectiveInject(i1.ModalController), i0.ɵɵdirectiveInject(i2.DomSanitizer), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i1.AlertController), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); }; }
|
|
402
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SimpleAcuerdoVideoComponent, selectors: [["app-simple-acuerdo-video"]], viewQuery: function SimpleAcuerdoVideoComponent_Query(rf, ctx) { if (rf & 1) {
|
|
403
|
+
i0.ɵɵviewQuery(_c0, 5);
|
|
404
|
+
i0.ɵɵviewQuery(_c1, 5);
|
|
405
|
+
} if (rf & 2) {
|
|
406
|
+
let _t;
|
|
407
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.videoElement = _t.first);
|
|
408
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.progressRing = _t.first);
|
|
409
|
+
} }, inputs: { backFunction: "backFunction" }, outputs: { closeRequested: "closeRequested" }, decls: 31, vars: 11, consts: [["videoElement", ""], ["progressRing", ""], ["color", "light", 1, "custom-content"], ["class", "countdown-overlay", 4, "ngIf"], [1, "ion-no-border"], ["color", "light"], ["slot", "end"], [3, "click", "disabled"], ["name", "close"], [1, "main-header"], [1, "main-title"], [1, "acuerdo-text"], [1, "camera-container"], [1, "video-wrapper"], ["muted", "", "autoplay", "", "playsinline", "", 2, "transform", "scaleX(-1)"], ["width", "300", "height", "300", 1, "progress-ring"], ["cx", "150", "cy", "150", "r", "150", 1, "progress-ring__circle"], [3, "ngClass"], ["class", "text-container", 4, "ngIf"], [1, "fixed-footer"], ["size", "large", "expand", "block", "shape", "round", 3, "click", 4, "ngIf"], ["size", "large", "expand", "block", 3, "disabled", "click", 4, "ngIf"], ["id", "example-modal", 3, "didDismiss", "isOpen"], ["id", "voice-modal", 3, "didDismiss", "isOpen"], [1, "countdown-overlay"], [1, "countdown"], [1, "text-container"], [1, "subtitle"], ["class", "subtitle-word", 4, "ngFor", "ngForOf"], [1, "subtitle-word"], ["size", "large", "expand", "block", "shape", "round", 3, "click"], ["slot", "icon-only", "name", "camera-outline"], ["size", "large", "expand", "block", 3, "click", "disabled"], ["slot", "icon-only", "name", "stop-outline"], [1, "full-content"], [1, "modal-content"], ["src", "https://placeholder.pics/svg/150x150", "alt", ""], [1, "button-container"], [1, "modal-content-2"], [1, "modal-header"], ["name", "mic", "size", "large", 2, "width", "50px !important", "height", "50px !important"], [1, "modal-body"], [1, "icons-container"], [1, "custom-text"], [1, "o-text"]], template: function SimpleAcuerdoVideoComponent_Template(rf, ctx) { if (rf & 1) {
|
|
410
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
411
|
+
i0.ɵɵelementStart(0, "ion-content", 2);
|
|
412
|
+
i0.ɵɵtemplate(1, SimpleAcuerdoVideoComponent_div_1_Template, 3, 1, "div", 3);
|
|
413
|
+
i0.ɵɵelementStart(2, "ion-header", 4)(3, "ion-toolbar", 5)(4, "ion-buttons", 6)(5, "ion-button", 7);
|
|
414
|
+
i0.ɵɵlistener("click", function SimpleAcuerdoVideoComponent_Template_ion_button_click_5_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.closeOverlayVideo()); });
|
|
415
|
+
i0.ɵɵelement(6, "ion-icon", 8);
|
|
416
|
+
i0.ɵɵelementEnd()()()();
|
|
417
|
+
i0.ɵɵelementStart(7, "div", 9)(8, "div", 10)(9, "h1");
|
|
418
|
+
i0.ɵɵtext(10, "Acuerdo de Video");
|
|
419
|
+
i0.ɵɵelementEnd()();
|
|
420
|
+
i0.ɵɵelementStart(11, "div", 11)(12, "p");
|
|
421
|
+
i0.ɵɵtext(13, "Contesta \u00FAnicamente \"S\u00ED\" si est\u00E1s de acuerdo con el cr\u00E9dito y contesta \"No\" para cancelar el proceso.");
|
|
422
|
+
i0.ɵɵelementEnd()()();
|
|
423
|
+
i0.ɵɵelementStart(14, "div", 12)(15, "div", 13);
|
|
424
|
+
i0.ɵɵelement(16, "video", 14, 0);
|
|
425
|
+
i0.ɵɵnamespaceSVG();
|
|
426
|
+
i0.ɵɵelementStart(18, "svg", 15, 1);
|
|
427
|
+
i0.ɵɵelement(20, "circle", 16);
|
|
428
|
+
i0.ɵɵelementEnd()();
|
|
429
|
+
i0.ɵɵnamespaceHTML();
|
|
430
|
+
i0.ɵɵelementStart(21, "ion-label", 17);
|
|
431
|
+
i0.ɵɵtext(22);
|
|
432
|
+
i0.ɵɵelementEnd();
|
|
433
|
+
i0.ɵɵtemplate(23, SimpleAcuerdoVideoComponent_div_23_Template, 3, 1, "div", 18);
|
|
434
|
+
i0.ɵɵelementStart(24, "div", 19);
|
|
435
|
+
i0.ɵɵtemplate(25, SimpleAcuerdoVideoComponent_ion_button_25_Template, 2, 0, "ion-button", 20)(26, SimpleAcuerdoVideoComponent_ion_button_26_Template, 2, 1, "ion-button", 21);
|
|
436
|
+
i0.ɵɵelementEnd()();
|
|
437
|
+
i0.ɵɵelementStart(27, "ion-modal", 22);
|
|
438
|
+
i0.ɵɵlistener("didDismiss", function SimpleAcuerdoVideoComponent_Template_ion_modal_didDismiss_27_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.closeModal()); });
|
|
439
|
+
i0.ɵɵtemplate(28, SimpleAcuerdoVideoComponent_ng_template_28_Template, 10, 2, "ng-template");
|
|
440
|
+
i0.ɵɵelementEnd();
|
|
441
|
+
i0.ɵɵelementStart(29, "ion-modal", 23);
|
|
442
|
+
i0.ɵɵlistener("didDismiss", function SimpleAcuerdoVideoComponent_Template_ion_modal_didDismiss_29_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.closeModalVoice()); });
|
|
443
|
+
i0.ɵɵtemplate(30, SimpleAcuerdoVideoComponent_ng_template_30_Template, 17, 0, "ng-template");
|
|
444
|
+
i0.ɵɵelementEnd()();
|
|
445
|
+
} if (rf & 2) {
|
|
446
|
+
i0.ɵɵadvance();
|
|
447
|
+
i0.ɵɵproperty("ngIf", ctx.countdown > 0);
|
|
448
|
+
i0.ɵɵadvance(4);
|
|
449
|
+
i0.ɵɵproperty("disabled", !ctx.canStopRecording);
|
|
450
|
+
i0.ɵɵadvance(16);
|
|
451
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c2, ctx.isRecording));
|
|
452
|
+
i0.ɵɵadvance();
|
|
453
|
+
i0.ɵɵtextInterpolate1("00:", ctx.timeRemaining < 10 ? "0" + ctx.timeRemaining : ctx.timeRemaining, "");
|
|
454
|
+
i0.ɵɵadvance();
|
|
455
|
+
i0.ɵɵproperty("ngIf", ctx.showTextAcuerdo);
|
|
456
|
+
i0.ɵɵadvance(2);
|
|
457
|
+
i0.ɵɵproperty("ngIf", !ctx.isRecording);
|
|
458
|
+
i0.ɵɵadvance();
|
|
459
|
+
i0.ɵɵproperty("ngIf", ctx.isRecording);
|
|
460
|
+
i0.ɵɵadvance();
|
|
461
|
+
i0.ɵɵproperty("isOpen", ctx.isModalOpen);
|
|
462
|
+
i0.ɵɵadvance(2);
|
|
463
|
+
i0.ɵɵproperty("isOpen", ctx.isModalVoiceOpen);
|
|
464
|
+
} }, dependencies: [i3.NgClass, i3.NgForOf, i3.NgIf, i1.IonButton, i1.IonButtons, i1.IonContent, i1.IonHeader, i1.IonIcon, i1.IonLabel, i1.IonToolbar, i1.IonModal], styles: [".camera-container[_ngcontent-%COMP%] {\r\n justify-content: center;\r\n align-items: center;\r\n position: relative;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n height: 50%; // Antes era 70%\r\n background-color: white;\r\n}\r\n\r\n.video-wrapper[_ngcontent-%COMP%] {\r\n position: relative;\r\n width: 300px;\r\n height: 300px;\r\n border-radius: 50%;\r\n overflow: hidden;\r\n}\r\n\r\nvideo[_ngcontent-%COMP%] {\r\n width: 100%;\r\n height: 100%;\r\n object-fit: cover;\r\n border-radius: 50%;\r\n}\r\n\r\n.progress-ring[_ngcontent-%COMP%] {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n transform: rotate(-90deg); \n\r\n}\r\n\r\n.progress-ring__circle[_ngcontent-%COMP%] {\r\n fill: transparent;\r\n stroke: purple;\r\n stroke-width: 12;\r\n stroke-dasharray: 945; \n\r\n stroke-dashoffset: 880; \n\r\n transition: stroke-dashoffset 12s linear; \n\r\n}\r\n\r\n.progress-active[_ngcontent-%COMP%] .progress-ring__circle[_ngcontent-%COMP%] {\r\n animation: _ngcontent-%COMP%_progress-animation 5s linear forwards;\r\n}\r\n\r\n@keyframes _ngcontent-%COMP%_progress-animation {\r\n from {\r\n stroke-dashoffset: 880;\r\n }\r\n to {\r\n stroke-dashoffset: 0;\r\n }\r\n}\r\n\r\n//[_ngcontent-%COMP%] div[_ngcontent-%COMP%] //[_ngcontent-%COMP%] {\r\n// color: #ffffff;\r\n// font-weight: 50px;\r\n// border-radius: 20px;\r\n// margin-top: 20px;\r\n// //width: 90%;\r\n// //max-width: 300px;\r\n// align-self: center;\r\n// text-transform: none;\r\n\r\n// --background: var(--purple-primary);\r\n// --background-hover: var(--purple-secondary);\r\n// --background-activated: var(--purple-secondary);\r\n// --background-focused: var(--purple-secondary);\r\n\r\n// --color: var(--purple-primary);\r\n\r\n// --border-radius: 20px;\r\n// --border-color: var(--purple-primary);\r\n// --border-style: solid;\r\n// --border-width: 1px;\r\n\r\n// --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\r\n\r\n// --ripple-color: var(--purple-secondary);\r\n\r\n\r\n// --padding-top: 10px;\r\n// --padding-bottom: 10px;\r\n// }\r\n\r\n.text-container[_ngcontent-%COMP%] {\r\n height: 40px;\r\n color: black;\r\n}\r\n\r\nion-header[_ngcontent-%COMP%] {\r\n --background: #ffffff; \n\r\n}\r\n\r\n\r\n\r\n.centered-title[_ngcontent-%COMP%] {\r\n text-align: center;\r\n width: 100%; \n\r\n font-weight: bold;\r\n}\r\n\r\n.fixed-footer[_ngcontent-%COMP%] {\r\n\r\n position: fixed;\r\n bottom: 0;\r\n // left: 0;\r\n left: 50%;\r\n // width: 100%;\r\n width: auto;\r\n transform: translateX(-50%); \n\r\n justify-content: center;\r\n padding: 10px;\r\n background-color: #fff; // Color de fondo, opcional\r\n // box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);\r\n\r\n ion-button {\r\n // width: 90%;\r\n // max-width: 300px; // anteriormente 300\r\n width: auto;\r\n margin: 0 auto;\r\n background-color: #ffcc00;\r\n color: #ffffff;\r\n font-weight: bold;\r\n border-radius: 20px;\r\n\r\n --background: var(--purple-primary);\r\n --background-hover: var(--purple-secondary);\r\n --background-activated: var(--purple-secondary);\r\n --background-focused: var(--purple-secondary);\r\n \r\n --color: var(--purple-primary);\r\n \r\n --border-radius: 20px;\r\n --border-color: var(--purple-primary);\r\n --border-style: solid;\r\n --border-width: 1px;\r\n \r\n --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\r\n \r\n --ripple-color: var(--purple-secondary);\r\n \r\n\r\n &:hover {\r\n background-color: #ffb300;\r\n }\r\n\r\n &:active {\r\n background-color: #e6a800;\r\n }\r\n }\r\n}\r\n\r\n\r\nion-header[_ngcontent-%COMP%] {\r\n --background: #ffffff; \n\r\n color: #000000; \n\r\n}\r\n\r\nion-toolbar[_ngcontent-%COMP%] {\r\n --ion-background-color: #ffffff !important;\r\n --background: #ffffff !important;\r\n color: #000000;\r\n}\r\n\r\n\r\nion-header[_ngcontent-%COMP%] {\r\n --background: #ffffff; \n\r\n}\r\n\r\nion-toolbar[_ngcontent-%COMP%] {\r\n --ion-background-color: #ffffff !important;\r\n --background: #ffffff !important;\r\n color: #000000;\r\n display: flex;\r\n justify-content: space-between; \n\r\n align-items: center;\r\n}\r\n\r\n.centered-title[_ngcontent-%COMP%] {\r\n flex: 1;\r\n text-align: center; \n\r\n font-weight: bold;\r\n color: #000000;\r\n margin: 0; \n\r\n}\r\n\r\nion-buttons[_ngcontent-%COMP%] {\r\n justify-content: flex-end; \n\r\n}\r\n.countdown-overlay[_ngcontent-%COMP%] {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgba(0, 0, 0, 0.6); \n\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n margin: 0;\r\n padding: 0;\r\n z-index: 1000; \n\r\n animation: _ngcontent-%COMP%_fadeIn 0.5s ease-out, _ngcontent-%COMP%_fadeOut 0.5s ease-out 2.5s; \n\r\n box-sizing: border-box;\r\n border-radius: 0px;\r\n\r\n}\r\n\r\nion-content.custom-content[_ngcontent-%COMP%] {\r\n --padding-top: 0;\r\n --padding-bottom: 0;\r\n margin: 0;\r\n padding: 0;\r\n margin-top: 10vh; // Levanta el contenido un 10% desde el tope\r\n height: 90vh; // Ajusta la altura para que junto con el margin sea 100%\r\n}\r\n\r\n.countdown[_ngcontent-%COMP%] {\r\n font-size: 100px;\r\n font-weight: bold;\r\n color: white;\r\n animation: _ngcontent-%COMP%_scaleUp 0.5s ease-out, _ngcontent-%COMP%_scaleDown 0.5s ease-out 2.5s; \n\r\n}\r\n\r\n\n\r\n@keyframes _ngcontent-%COMP%_fadeIn {\r\n from {\r\n opacity: 0;\r\n }\r\n to {\r\n opacity: 1;\r\n }\r\n}\r\n\r\n@keyframes _ngcontent-%COMP%_fadeOut {\r\n from {\r\n opacity: 1;\r\n }\r\n to {\r\n opacity: 0;\r\n }\r\n}\r\n\r\n\n\r\n@keyframes _ngcontent-%COMP%_scaleUp {\r\n from {\r\n transform: scale(0.8);\r\n opacity: 0;\r\n }\r\n to {\r\n transform: scale(1);\r\n opacity: 1;\r\n }\r\n}\r\n\r\n@keyframes _ngcontent-%COMP%_scaleDown {\r\n from {\r\n transform: scale(1);\r\n opacity: 1;\r\n }\r\n to {\r\n transform: scale(0.8);\r\n opacity: 0;\r\n }\r\n}\r\n\r\n.red[_ngcontent-%COMP%] {\r\n padding: 10px;\r\n color: red;\r\n}\r\n\r\n.text-center[_ngcontent-%COMP%]{\r\n text-align: center;\r\n padding-left: 20%;\r\n padding-right: 20%;\r\n color: #333;\r\n}\r\n\r\n.loading-overlay[_ngcontent-%COMP%] {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgba(0, 0, 0, 0.8); \n\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n z-index: 1000; \n\r\n margin: 0;\r\n padding: 0;\r\n box-sizing: border-box;\r\n border-radius: 0px;\r\n}\r\n\r\nion-spinner[_ngcontent-%COMP%] {\r\n color: white;\r\n width: 50px;\r\n height: 50px;\r\n}\r\n\r\n.main-header[_ngcontent-%COMP%] {\r\n padding-left: 24px;\r\n padding-right: 24px;\r\n}\r\n\r\n.main-title[_ngcontent-%COMP%] {\r\n font-size: 24px;\r\n font-weight: bold;\r\n color: var(--purple-secondary);\r\n}\r\n\r\n.acuerdo-text[_ngcontent-%COMP%] {\r\n font-size: 14px;\r\n color: black;\r\n}\r\n\r\n//TTS\r\n\r\n.subtitle[_ngcontent-%COMP%] {\r\n padding: 0px 24px;\r\n text-align: left;\r\n font-size: 17px;\r\n}\r\n.subtitle-word[_ngcontent-%COMP%] {\r\n display: inline-block;\r\n margin: 0 3px;\r\n transition: background-color 0.3s ease, color 0.3s ease;\r\n border-radius: 10px;\r\n\r\n}\r\n\r\n.subtitle-word.highlight[_ngcontent-%COMP%] {\r\n background-color: purple;\r\n border-radius: 6px;\r\n color: white;\r\n padding: 4px;\r\n font-weight: 600;\r\n}\r\n\r\n\r\n.subtitle-word.read[_ngcontent-%COMP%] {\r\n color: gray; \n\r\n}\r\n\r\n.button-container[_ngcontent-%COMP%] {\r\n justify-content: center;\r\n display: flex;\r\n}\r\n\r\n\r\n//[_ngcontent-%COMP%] MODAL\r\n\r\nion-modal[_ngcontent-%COMP%] {\r\n--display: flex;\r\n--height: 100%;\r\n--width: 100%;\r\n// --border-radius: 16px;\r\n// --box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\r\n// --background: rgba(0, 0, 0, 0.30) !important;\r\n}\r\n\r\n.full-content[_ngcontent-%COMP%] {\r\nwidth: 100%;\r\nheight: 100%;\r\ndisplay: flex;\r\njustify-content: center;\r\nalign-items: center;\r\nbackground-color: rgba(0, 0, 0, 0.30) !important;\r\n\r\n}\r\n\r\n.modal-content[_ngcontent-%COMP%] {\r\ntext-align: center;\r\npadding: 10px;\r\nleft: 50%;\r\nborder-radius: 16px;\r\nheight: 370px;\r\nwidth: 80%;\r\nbackground-color: white;\r\n justify-content: center;\r\nalign-items: center; \r\n\r\nh2 {\r\n color: var(--purple-primary);\r\n}\r\n\r\n.subtitle {\r\n margin-bottom: 20px;\r\n}\r\n\r\nion-button {\r\n // width: 90%;\r\n // max-width: 300px; // anteriormente 300\r\n width: auto;\r\n margin: 0 auto;\r\n background-color: #ffcc00;\r\n color: #ffffff;\r\n font-weight: bold;\r\n border-radius: 20px;\r\n\r\n --background: var(--orange-primary);\r\n --background-hover: var(--orange-secondary);\r\n --background-activated: var(--orange-secondary);\r\n --background-focused: var(--orange-secondary);\r\n \r\n --color: var(--orange-primary);\r\n \r\n --border-radius: 20px;\r\n --border-color: var(--orange-primary);\r\n --border-style: solid;\r\n --border-width: 1px;\r\n \r\n --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\r\n \r\n --ripple-color: var(--orange-secondary);\r\n \r\n\r\n &:hover {\r\n background-color: #ffb300;\r\n }\r\n\r\n &:active {\r\n background-color: #e6a800;\r\n }\r\n }\r\n\r\n // .button-container {\r\n // display: block;\r\n // // position: fixed;\r\n // // bottom: 32%;\r\n // // left: 0;\r\n // left: 50%;\r\n // // width: 100%;\r\n // width: auto;\r\n // transform: translateX(-50%); \n\r\n // justify-content: center;\r\n // padding: 5px;\r\n // }\r\n}\r\nion-modal[_ngcontent-%COMP%]::part(backdrop) {\r\nbackground: rgb(136, 138, 142);\r\nopacity: 1;\r\n}\r\n\r\nion-modal[_ngcontent-%COMP%] ion-toolbar[_ngcontent-%COMP%] {\r\n--background: rgb(14 116 144);\r\n--color: white;\r\n}\r\n\r\nion-modal.stack-modal[_ngcontent-%COMP%] {\r\n--box-shadow: 0 28px 48px rgba(0, 0, 0, 0.4);\r\n--backdrop-opacity: var(--ion-backdrop-opacity, 0.32);\r\n}\r\n\r\n\r\n.modal-content-2[_ngcontent-%COMP%] {\r\nbackground-color: white;\r\npadding: 20px;\r\ntext-align: center;\r\nborder-radius: 12px;\r\nheight: auto;\r\nwidth: 80%;\r\njustify-content: center;\r\nalign-items: center;\r\n}\r\n\r\n.modal-header[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%] {\r\ncolor: #ff9a00; \n\r\nmargin-bottom: 10px;\r\nfont-size: 3rem !important\r\n;\r\n}\r\n\r\n.modal-body[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\r\n// font-size: 18px;\r\nmargin-bottom: 20px;\r\n}\r\n\r\n.icons-container[_ngcontent-%COMP%] {\r\ndisplay: flex;\r\njustify-content: center;\r\nalign-items: center;\r\nmargin-top: 20px;\r\ngap: 15px; \r\n\r\n}\r\n\r\n.modal-body[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\r\nfont-size: 20px;\r\n}\r\n.custom-text[_ngcontent-%COMP%] {\r\nbackground-color: var(--orange-primary);\r\ncolor: white;\r\nborder-radius: 10px;\r\npadding: 0 15px;\r\nfont-size: 22px;\r\n}\r\n\r\n.o-text[_ngcontent-%COMP%] {\r\npadding: 0 15px;\r\nfont-size: 22px;\r\n}"] }); }
|
|
465
|
+
}
|
|
466
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SimpleAcuerdoVideoComponent, [{
|
|
467
|
+
type: Component,
|
|
468
|
+
args: [{ selector: 'app-simple-acuerdo-video', encapsulation: ViewEncapsulation.Emulated, template: "<ion-content color=\"light\" class=\"custom-content\">\r\n <!-- Loading deshabilitado para evitar conflictos con loading principal -->\r\n <!-- <div *ngIf=\"isLoading\" class=\"loading-overlay\">\r\n <ion-spinner name=\"crescent\"></ion-spinner>\r\n </div> -->\r\n \r\n <div *ngIf=\"countdown > 0\" class=\"countdown-overlay\">\r\n <div class=\"countdown\">{{ countdown }}</div>\r\n </div>\r\n <ion-header class=\"ion-no-border\">\r\n <ion-toolbar color=\"light\">\r\n <!-- <ion-title class=\"centered-title\">Video Selfie</ion-title> -->\r\n <ion-buttons slot=\"end\">\r\n <ion-button (click)=\"closeOverlayVideo()\" [disabled]=\"!canStopRecording\">\r\n <ion-icon name=\"close\"></ion-icon>\r\n </ion-button>\r\n </ion-buttons>\r\n </ion-toolbar>\r\n </ion-header>\r\n\r\n <div class=\"main-header\">\r\n <div class=\"main-title\">\r\n <h1>Acuerdo de Video</h1>\r\n </div>\r\n <div class=\"acuerdo-text\">\r\n <p>Contesta \u00FAnicamente \"S\u00ED\" si est\u00E1s de acuerdo con el cr\u00E9dito y contesta \"No\" para cancelar el proceso.</p>\r\n </div>\r\n </div>\r\n <!-- Contenedor de la c\u00E1mara y progresi\u00F3n -->\r\n <div class=\"camera-container\">\r\n <div class=\"video-wrapper\">\r\n <video #videoElement muted autoplay playsinline style=\"transform: scaleX(-1)\"></video>\r\n <svg class=\"progress-ring\" #progressRing width=\"300\" height=\"300\">\r\n <circle class=\"progress-ring__circle\" cx=\"150\" cy=\"150\" r=\"150\" />\r\n </svg>\r\n </div>\r\n <ion-label [ngClass]=\"{'red': isRecording}\">00:{{ timeRemaining < 10 ? '0' + timeRemaining : timeRemaining\r\n }}</ion-label>\r\n\r\n <div class=\"text-container\" *ngIf=\"showTextAcuerdo\">\r\n <!-- Mostrar las palabras como subt\u00EDtulos -->\r\n <p class=\"subtitle\">\r\n <span *ngFor=\"let word of words; let i = index\" class=\"subtitle-word\">\r\n {{ word }} \r\n </span>\r\n </p>\r\n </div>\r\n <!-- <p class=\"text-center\">Permanece quieto, con tu rostro en el centro del circulo</p> -->\r\n\r\n \r\n <!-- Botones de grabaci\u00F3n -->\r\n <div class=\"fixed-footer\">\r\n <ion-button *ngIf=\"!isRecording\" size=\"large\" expand=\"block\" (click)=\"recordVideo()\" shape=\"round\"><ion-icon slot=\"icon-only\" name=\"camera-outline\"></ion-icon></ion-button>\r\n <ion-button *ngIf=\"isRecording\" size=\"large\" expand=\"block\" (click)=\"stopRecording()\" [disabled]=\"!canStopRecording\"><ion-icon slot=\"icon-only\" name=\"stop-outline\"></ion-icon></ion-button>\r\n </div>\r\n </div>\r\n\r\n <ion-modal id=\"example-modal\" [isOpen]=\"isModalOpen\" (didDismiss)=\"closeModal()\">\r\n <ng-template>\r\n <div class=\"full-content\"> \r\n <div class=\"modal-content\">\r\n <img src=\"https://placeholder.pics/svg/150x150\" alt=\"\">\r\n <h2>Instrucciones</h2> \r\n <!-- Subt\u00EDtulos din\u00E1micos y TTS -->\r\n <div class=\"subtitle\">\r\n <span *ngFor=\"let word of instructionWords; let i = index\" class=\"subtitle-word\">\r\n {{ word }}\r\n </span>\r\n </div>\r\n <div class=\"button-container\">\r\n <ion-button (click)=\"closeModal()\" [disabled]=\"isSpeaking\">Comenzar</ion-button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ion-modal>\r\n\r\n <ion-modal id=\"voice-modal\" [isOpen]=\"isModalVoiceOpen\" (didDismiss)=\"closeModalVoice()\">\r\n <ng-template>\r\n <div class=\"full-content\">\r\n <div class=\"modal-content-2\">\r\n <div class=\"modal-header\">\r\n <ion-icon name=\"mic\" size=\"large\" style=\"width: 50px !important; height: 50px !important;\"></ion-icon>\r\n </div>\r\n <div class=\"modal-body\">\r\n <p>Contesta con tu voz</p>\r\n <div class=\"icons-container\">\r\n <div class=\"custom-text\">\r\n <p>S\u00ED</p>\r\n </div>\r\n <div class=\"o-text\">\r\n <p>o</p>\r\n </div>\r\n <div class=\"custom-text\">\r\n <p>No</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-template>\r\n </ion-modal>\r\n</ion-content>", styles: [".camera-container {\r\n justify-content: center;\r\n align-items: center;\r\n position: relative;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n height: 50%; // Antes era 70%\r\n background-color: white;\r\n}\r\n\r\n.video-wrapper {\r\n position: relative;\r\n width: 300px;\r\n height: 300px;\r\n border-radius: 50%;\r\n overflow: hidden;\r\n}\r\n\r\nvideo {\r\n width: 100%;\r\n height: 100%;\r\n object-fit: cover;\r\n border-radius: 50%;\r\n}\r\n\r\n.progress-ring {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n transform: rotate(-90deg); /* Rotamos el c\u00EDrculo para que la animaci\u00F3n inicie desde arriba */\r\n}\r\n\r\n.progress-ring__circle {\r\n fill: transparent;\r\n stroke: purple;\r\n stroke-width: 12;\r\n stroke-dasharray: 945; /* La circunferencia del c\u00EDrculo 880*/\r\n stroke-dashoffset: 880; /* Oculto por completo al inicio */\r\n transition: stroke-dashoffset 12s linear; /* Esto controlar\u00E1 el llenado progresivo */\r\n}\r\n\r\n.progress-active .progress-ring__circle {\r\n animation: progress-animation 5s linear forwards;\r\n}\r\n\r\n@keyframes progress-animation {\r\n from {\r\n stroke-dashoffset: 880;\r\n }\r\n to {\r\n stroke-dashoffset: 0;\r\n }\r\n}\r\n\r\n// div \r\n// {\r\n// color: #ffffff;\r\n// font-weight: 50px;\r\n// border-radius: 20px;\r\n// margin-top: 20px;\r\n// //width: 90%;\r\n// //max-width: 300px;\r\n// align-self: center;\r\n// text-transform: none;\r\n\r\n// --background: var(--purple-primary);\r\n// --background-hover: var(--purple-secondary);\r\n// --background-activated: var(--purple-secondary);\r\n// --background-focused: var(--purple-secondary);\r\n\r\n// --color: var(--purple-primary);\r\n\r\n// --border-radius: 20px;\r\n// --border-color: var(--purple-primary);\r\n// --border-style: solid;\r\n// --border-width: 1px;\r\n\r\n// --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\r\n\r\n// --ripple-color: var(--purple-secondary);\r\n\r\n\r\n// --padding-top: 10px;\r\n// --padding-bottom: 10px;\r\n// }\r\n\r\n.text-container {\r\n height: 40px;\r\n color: black;\r\n}\r\n\r\nion-header {\r\n --background: #ffffff; /* Fondo blanco para el header */\r\n}\r\n\r\n\r\n\r\n.centered-title {\r\n text-align: center;\r\n width: 100%; /* Asegura que el t\u00EDtulo est\u00E9 centrado */\r\n font-weight: bold;\r\n}\r\n\r\n.fixed-footer {\r\n\r\n position: fixed;\r\n bottom: 0;\r\n // left: 0;\r\n left: 50%;\r\n // width: 100%;\r\n width: auto;\r\n transform: translateX(-50%); /* Centra el contenedor */\r\n justify-content: center;\r\n padding: 10px;\r\n background-color: #fff; // Color de fondo, opcional\r\n // box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);\r\n\r\n ion-button {\r\n // width: 90%;\r\n // max-width: 300px; // anteriormente 300\r\n width: auto;\r\n margin: 0 auto;\r\n background-color: #ffcc00;\r\n color: #ffffff;\r\n font-weight: bold;\r\n border-radius: 20px;\r\n\r\n --background: var(--purple-primary);\r\n --background-hover: var(--purple-secondary);\r\n --background-activated: var(--purple-secondary);\r\n --background-focused: var(--purple-secondary);\r\n \r\n --color: var(--purple-primary);\r\n \r\n --border-radius: 20px;\r\n --border-color: var(--purple-primary);\r\n --border-style: solid;\r\n --border-width: 1px;\r\n \r\n --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\r\n \r\n --ripple-color: var(--purple-secondary);\r\n \r\n\r\n &:hover {\r\n background-color: #ffb300;\r\n }\r\n\r\n &:active {\r\n background-color: #e6a800;\r\n }\r\n }\r\n}\r\n\r\n\r\nion-header {\r\n --background: #ffffff; /* Fondo blanco */\r\n color: #000000; /* Texto negro */\r\n}\r\n\r\nion-toolbar {\r\n --ion-background-color: #ffffff !important;\r\n --background: #ffffff !important;\r\n color: #000000;\r\n}\r\n\r\n\r\nion-header {\r\n --background: #ffffff; /* Fondo blanco */\r\n}\r\n\r\nion-toolbar {\r\n --ion-background-color: #ffffff !important;\r\n --background: #ffffff !important;\r\n color: #000000;\r\n display: flex;\r\n justify-content: space-between; /* Espacio entre t\u00EDtulo y bot\u00F3n */\r\n align-items: center;\r\n}\r\n\r\n.centered-title {\r\n flex: 1;\r\n text-align: center; /* Centrar el t\u00EDtulo */\r\n font-weight: bold;\r\n color: #000000;\r\n margin: 0; /* Quita cualquier margen del t\u00EDtulo */\r\n}\r\n\r\nion-buttons {\r\n justify-content: flex-end; /* Alinea el bot\u00F3n a la derecha */\r\n}\r\n.countdown-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgba(0, 0, 0, 0.6); /* Fondo semi-transparente */\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n margin: 0;\r\n padding: 0;\r\n z-index: 1000; /* Asegurarse de que est\u00E9 encima de otros elementos */\r\n animation: fadeIn 0.5s ease-out, fadeOut 0.5s ease-out 2.5s; /* Animaciones de entrada y salida */\r\n box-sizing: border-box;\r\n border-radius: 0px;\r\n\r\n}\r\n\r\nion-content.custom-content {\r\n --padding-top: 0;\r\n --padding-bottom: 0;\r\n margin: 0;\r\n padding: 0;\r\n margin-top: 10vh; // Levanta el contenido un 10% desde el tope\r\n height: 90vh; // Ajusta la altura para que junto con el margin sea 100%\r\n}\r\n\r\n.countdown {\r\n font-size: 100px;\r\n font-weight: bold;\r\n color: white;\r\n animation: scaleUp 0.5s ease-out, scaleDown 0.5s ease-out 2.5s; /* Escalar en entrada y salida */\r\n}\r\n\r\n/* Animaci\u00F3n para desvanecer la superposici\u00F3n */\r\n@keyframes fadeIn {\r\n from {\r\n opacity: 0;\r\n }\r\n to {\r\n opacity: 1;\r\n }\r\n}\r\n\r\n@keyframes fadeOut {\r\n from {\r\n opacity: 1;\r\n }\r\n to {\r\n opacity: 0;\r\n }\r\n}\r\n\r\n/* Animaci\u00F3n para escalar el n\u00FAmero */\r\n@keyframes scaleUp {\r\n from {\r\n transform: scale(0.8);\r\n opacity: 0;\r\n }\r\n to {\r\n transform: scale(1);\r\n opacity: 1;\r\n }\r\n}\r\n\r\n@keyframes scaleDown {\r\n from {\r\n transform: scale(1);\r\n opacity: 1;\r\n }\r\n to {\r\n transform: scale(0.8);\r\n opacity: 0;\r\n }\r\n}\r\n\r\n.red {\r\n padding: 10px;\r\n color: red;\r\n}\r\n\r\n.text-center{\r\n text-align: center;\r\n padding-left: 20%;\r\n padding-right: 20%;\r\n color: #333;\r\n}\r\n\r\n.loading-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgba(0, 0, 0, 0.8); /* Fondo oscuro semi-transparente */\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n z-index: 1000; /* Aseg\u00FArate de que est\u00E9 por encima del contenido */\r\n margin: 0;\r\n padding: 0;\r\n box-sizing: border-box;\r\n border-radius: 0px;\r\n}\r\n\r\nion-spinner {\r\n color: white;\r\n width: 50px;\r\n height: 50px;\r\n}\r\n\r\n.main-header {\r\n padding-left: 24px;\r\n padding-right: 24px;\r\n}\r\n\r\n.main-title {\r\n font-size: 24px;\r\n font-weight: bold;\r\n color: var(--purple-secondary);\r\n}\r\n\r\n.acuerdo-text {\r\n font-size: 14px;\r\n color: black;\r\n}\r\n\r\n//TTS\r\n\r\n.subtitle {\r\n padding: 0px 24px;\r\n text-align: left;\r\n font-size: 17px;\r\n}\r\n.subtitle-word {\r\n display: inline-block;\r\n margin: 0 3px;\r\n transition: background-color 0.3s ease, color 0.3s ease;\r\n border-radius: 10px;\r\n\r\n}\r\n\r\n.subtitle-word.highlight {\r\n background-color: purple;\r\n border-radius: 6px;\r\n color: white;\r\n padding: 4px;\r\n font-weight: 600;\r\n}\r\n\r\n\r\n.subtitle-word.read {\r\n color: gray; /* Color para el texto ya le\u00EDdo */\r\n}\r\n\r\n.button-container {\r\n justify-content: center;\r\n display: flex;\r\n}\r\n\r\n\r\n// MODAL\r\n\r\nion-modal {\r\n--display: flex;\r\n--height: 100%;\r\n--width: 100%;\r\n// --border-radius: 16px;\r\n// --box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\r\n// --background: rgba(0, 0, 0, 0.30) !important;\r\n}\r\n\r\n.full-content {\r\nwidth: 100%;\r\nheight: 100%;\r\ndisplay: flex;\r\njustify-content: center;\r\nalign-items: center;\r\nbackground-color: rgba(0, 0, 0, 0.30) !important;\r\n\r\n}\r\n\r\n.modal-content {\r\ntext-align: center;\r\npadding: 10px;\r\nleft: 50%;\r\nborder-radius: 16px;\r\nheight: 370px;\r\nwidth: 80%;\r\nbackground-color: white;\r\n justify-content: center;\r\nalign-items: center; \r\n\r\nh2 {\r\n color: var(--purple-primary);\r\n}\r\n\r\n.subtitle {\r\n margin-bottom: 20px;\r\n}\r\n\r\nion-button {\r\n // width: 90%;\r\n // max-width: 300px; // anteriormente 300\r\n width: auto;\r\n margin: 0 auto;\r\n background-color: #ffcc00;\r\n color: #ffffff;\r\n font-weight: bold;\r\n border-radius: 20px;\r\n\r\n --background: var(--orange-primary);\r\n --background-hover: var(--orange-secondary);\r\n --background-activated: var(--orange-secondary);\r\n --background-focused: var(--orange-secondary);\r\n \r\n --color: var(--orange-primary);\r\n \r\n --border-radius: 20px;\r\n --border-color: var(--orange-primary);\r\n --border-style: solid;\r\n --border-width: 1px;\r\n \r\n --box-shadow: 0 2px 6px 0 rgb(0, 0, 0, 0.25);\r\n \r\n --ripple-color: var(--orange-secondary);\r\n \r\n\r\n &:hover {\r\n background-color: #ffb300;\r\n }\r\n\r\n &:active {\r\n background-color: #e6a800;\r\n }\r\n }\r\n\r\n // .button-container {\r\n // display: block;\r\n // // position: fixed;\r\n // // bottom: 32%;\r\n // // left: 0;\r\n // left: 50%;\r\n // // width: 100%;\r\n // width: auto;\r\n // transform: translateX(-50%); /* Centra el contenedor */\r\n // justify-content: center;\r\n // padding: 5px;\r\n // }\r\n}\r\nion-modal::part(backdrop) {\r\nbackground: rgb(136, 138, 142);\r\nopacity: 1;\r\n}\r\n\r\nion-modal ion-toolbar {\r\n--background: rgb(14 116 144);\r\n--color: white;\r\n}\r\n\r\nion-modal.stack-modal {\r\n--box-shadow: 0 28px 48px rgba(0, 0, 0, 0.4);\r\n--backdrop-opacity: var(--ion-backdrop-opacity, 0.32);\r\n}\r\n\r\n\r\n.modal-content-2 {\r\nbackground-color: white;\r\npadding: 20px;\r\ntext-align: center;\r\nborder-radius: 12px;\r\nheight: auto;\r\nwidth: 80%;\r\njustify-content: center;\r\nalign-items: center;\r\n}\r\n\r\n.modal-header ion-icon {\r\ncolor: #ff9a00; /* Color del micr\u00F3fono */\r\nmargin-bottom: 10px;\r\nfont-size: 3rem !important\r\n;\r\n}\r\n\r\n.modal-body p {\r\n// font-size: 18px;\r\nmargin-bottom: 20px;\r\n}\r\n\r\n.icons-container {\r\ndisplay: flex;\r\njustify-content: center;\r\nalign-items: center;\r\nmargin-top: 20px;\r\ngap: 15px; \r\n\r\n}\r\n\r\n.modal-body p {\r\nfont-size: 20px;\r\n}\r\n.custom-text {\r\nbackground-color: var(--orange-primary);\r\ncolor: white;\r\nborder-radius: 10px;\r\npadding: 0 15px;\r\nfont-size: 22px;\r\n}\r\n\r\n.o-text {\r\npadding: 0 15px;\r\nfont-size: 22px;\r\n}\r\n"] }]
|
|
469
|
+
}], () => [{ type: i1.Platform }, { type: i1.ModalController }, { type: i2.DomSanitizer }, { type: i0.Renderer2 }, { type: i1.AlertController }, { type: i0.ChangeDetectorRef }], { videoElement: [{
|
|
470
|
+
type: ViewChild,
|
|
471
|
+
args: ['videoElement']
|
|
472
|
+
}], progressRing: [{
|
|
473
|
+
type: ViewChild,
|
|
474
|
+
args: ['progressRing']
|
|
475
|
+
}], backFunction: [{
|
|
476
|
+
type: Input
|
|
477
|
+
}], closeRequested: [{
|
|
478
|
+
type: Output
|
|
479
|
+
}] }); })();
|
|
480
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SimpleAcuerdoVideoComponent, { className: "SimpleAcuerdoVideoComponent", filePath: "src\\app\\pages\\id-vision\\components\\simple-acuerdo-video\\simple-acuerdo-video.component.ts", lineNumber: 15 }); })();
|
|
481
481
|
//# sourceMappingURL=simple-acuerdo-video.component.js.map
|