diff --git a/public/index.js b/public/index.js index f2f8076..f5ceca0 100644 --- a/public/index.js +++ b/public/index.js @@ -12,10 +12,8 @@ import { stopAudio, createAudio, createUserRecipe, - cacheData, - CACHE_NAME_AUDIO, audioElement, - alert_message + alert_message, } from "./js_utilities/functions_and_variables.js"; import { @@ -49,7 +47,7 @@ import { pictureEmailSection, previousPage, sendToUserInbox, - wrapper + wrapper, } from "./js_utilities/query_selector.js"; let currentCameraIndex = 0; @@ -190,25 +188,14 @@ recipeButtons.forEach((button) => { if (eventData.image) { data.image = eventData.image; } - + console.log("data.audio", eventData.audio); console.log("data.image", eventData.image); if (data.audio && data.image) { + createImage(data); - createImage(data) - - - - - - /// - - // await cacheData(imageUrl, CACHE_NAME_URL, "image"); - - // const audio_data = createAudio(data.audio); - // await cacheData(audio_data, CACHE_NAME_AUDIO, "audio"); - const {speedBtn, speechBtns } = createTextToSpeech(data); + const { speedBtn, speechBtns } = createTextToSpeech(data); userWantAnotherRecipe.addEventListener("click", () => { displayElements([headline, allergies, ...recipeButtons, mainElement]); @@ -241,7 +228,6 @@ recipeButtons.forEach((button) => { }); }); - function createImage(param) { removeElements([loadingContainer]); const imageUrl = param.image.data[0].url; @@ -259,7 +245,7 @@ function createTextToSpeech(param) { this.pause(); this.currentTime = 0; }; - return {speedBtn, speechBtns }; + return { speedBtn, speechBtns }; } // Picture section @@ -313,7 +299,6 @@ async function initializeCamera() { initializeCamera(); - function capturePhoto() { context.drawImage(video, 0, 0, 400, 100); } @@ -352,7 +337,6 @@ takePicture.addEventListener("click", () => { // Menu icon toggle const menuIcon = document.querySelector(".menu-icon"); - menuIcon.addEventListener("click", () => { -wrapper.classList.toggle("change"); + wrapper.classList.toggle("change"); }); diff --git a/public/js_utilities/functions_and_variables.js b/public/js_utilities/functions_and_variables.js index f3b82a1..e06e5f2 100644 --- a/public/js_utilities/functions_and_variables.js +++ b/public/js_utilities/functions_and_variables.js @@ -113,6 +113,10 @@ function loopOverArrayOfElements(array, display) { + + + + function displayElements(array) { loopOverArrayOfElements(array, "block"); } diff --git a/public/url_folder.txt b/public/url_folder.txt index b7bbfbf..40b2ee8 100644 --- a/public/url_folder.txt +++ b/public/url_folder.txt @@ -1 +1 @@ -https://oaidalleapiprodscus.blob.core.windows.net/private/org-nYbqgo3O0LNnYYAoKAmApBfx/user-58Je7efi0iy880e2UYCdYpBm/img-fbR4IrnpCaFXDhT8PUcmxpzx.png?st=2024-08-03T13%3A15%3A50Z&se=2024-08-03T15%3A15%3A50Z&sp=r&sv=2023-11-03&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2024-08-03T02%3A55%3A58Z&ske=2024-08-04T02%3A55%3A58Z&sks=b&skv=2023-11-03&sig=sG/XDU1mSuiPQI07H8PG/7h3tfkc0OOEVLwAOds4aIg%3D \ No newline at end of file +https://oaidalleapiprodscus.blob.core.windows.net/private/org-nYbqgo3O0LNnYYAoKAmApBfx/user-58Je7efi0iy880e2UYCdYpBm/img-ovb7qD0yHMLLx0Ooe4iCpSOE.png?st=2024-08-03T13%3A22%3A53Z&se=2024-08-03T15%3A22%3A53Z&sp=r&sv=2023-11-03&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2024-08-03T04%3A05%3A06Z&ske=2024-08-04T04%3A05%3A06Z&sks=b&skv=2023-11-03&sig=bDE%2Bp86dJ7jZ6nydnnnKPumw/XA0M1VaghM8Bm5XY5E%3D \ No newline at end of file diff --git a/speech.mp3 b/speech.mp3 index 17d317a..acc7046 100644 Binary files a/speech.mp3 and b/speech.mp3 differ