@@ -12,10 +12,8 @@ import {
12
12
stopAudio ,
13
13
createAudio ,
14
14
createUserRecipe ,
15
- cacheData ,
16
- CACHE_NAME_AUDIO ,
17
15
audioElement ,
18
- alert_message
16
+ alert_message ,
19
17
} from "./js_utilities/functions_and_variables.js" ;
20
18
21
19
import {
@@ -49,7 +47,7 @@ import {
49
47
pictureEmailSection ,
50
48
previousPage ,
51
49
sendToUserInbox ,
52
- wrapper
50
+ wrapper ,
53
51
} from "./js_utilities/query_selector.js" ;
54
52
55
53
let currentCameraIndex = 0 ;
@@ -190,25 +188,14 @@ recipeButtons.forEach((button) => {
190
188
if ( eventData . image ) {
191
189
data . image = eventData . image ;
192
190
}
193
-
191
+
194
192
console . log ( "data.audio" , eventData . audio ) ;
195
193
console . log ( "data.image" , eventData . image ) ;
196
194
197
195
if ( data . audio && data . image ) {
196
+ createImage ( data ) ;
198
197
199
- createImage ( data )
200
-
201
-
202
-
203
-
204
-
205
- ///
206
-
207
- // await cacheData(imageUrl, CACHE_NAME_URL, "image");
208
-
209
- // const audio_data = createAudio(data.audio);
210
- // await cacheData(audio_data, CACHE_NAME_AUDIO, "audio");
211
- const { speedBtn, speechBtns } = createTextToSpeech ( data ) ;
198
+ const { speedBtn, speechBtns } = createTextToSpeech ( data ) ;
212
199
213
200
userWantAnotherRecipe . addEventListener ( "click" , ( ) => {
214
201
displayElements ( [ headline , allergies , ...recipeButtons , mainElement ] ) ;
@@ -241,7 +228,6 @@ recipeButtons.forEach((button) => {
241
228
} ) ;
242
229
} ) ;
243
230
244
-
245
231
function createImage ( param ) {
246
232
removeElements ( [ loadingContainer ] ) ;
247
233
const imageUrl = param . image . data [ 0 ] . url ;
@@ -259,7 +245,7 @@ function createTextToSpeech(param) {
259
245
this . pause ( ) ;
260
246
this . currentTime = 0 ;
261
247
} ;
262
- return { speedBtn, speechBtns } ;
248
+ return { speedBtn, speechBtns } ;
263
249
}
264
250
265
251
// Picture section
@@ -313,7 +299,6 @@ async function initializeCamera() {
313
299
314
300
initializeCamera ( ) ;
315
301
316
-
317
302
function capturePhoto ( ) {
318
303
context . drawImage ( video , 0 , 0 , 400 , 100 ) ;
319
304
}
@@ -352,7 +337,6 @@ takePicture.addEventListener("click", () => {
352
337
// Menu icon toggle
353
338
const menuIcon = document . querySelector ( ".menu-icon" ) ;
354
339
355
-
356
340
menuIcon . addEventListener ( "click" , ( ) => {
357
- wrapper . classList . toggle ( "change" ) ;
341
+ wrapper . classList . toggle ( "change" ) ;
358
342
} ) ;
0 commit comments