@@ -48,12 +48,16 @@ import {
4848 previousPage ,
4949 sendToUserInbox ,
5050 wrapper ,
51+ non_picture_section ,
52+ menuIcon
5153} from "./js_utilities/query_selector.js" ;
5254
5355let currentCameraIndex = 0 ;
5456const switchCameraButton = document . getElementById ( "switchCamera" ) ;
5557let emailObject ;
5658
59+ console . log ( non_picture_section )
60+
5761wantToTakeAPicture . addEventListener ( "click" , ( ) => {
5862 removeElements ( [ pictureSectionHeadline , wantToTakeAPicture ] ) ;
5963 displayElementsFlex ( [ videoBtnCanvas ] ) ;
@@ -155,7 +159,8 @@ recipeButtons.forEach((button) => {
155159 console . log ( userText . value ) ;
156160 button . addEventListener ( "click" , async ( ) => {
157161 displayElements ( [ loadingContainer ] ) ;
158- removeElements ( [ mainElement ] ) ;
162+ removeElements ( [ mainElement ] )
163+
159164 const userRecipe = createUserRecipe ( button , dietaryRequirements , userText ) ;
160165 console . log ( userRecipe ) ;
161166
@@ -166,6 +171,7 @@ recipeButtons.forEach((button) => {
166171 eventSource . onmessage = async function ( event ) {
167172 let eventData = JSON . parse ( event . data ) ;
168173 if ( eventData . message ) {
174+
169175 if ( eventData . message === "stop" ) {
170176 eventSource . close ( ) ;
171177 return ;
@@ -193,6 +199,7 @@ recipeButtons.forEach((button) => {
193199 console . log ( "data.image" , eventData . image ) ;
194200
195201 if ( data . audio && data . image ) {
202+
196203 createImage ( data ) ;
197204
198205 const { speedBtn, speechBtns } = createTextToSpeech ( data ) ;
@@ -231,6 +238,9 @@ recipeButtons.forEach((button) => {
231238function createImage ( param ) {
232239 removeElements ( [ loadingContainer ] ) ;
233240 const imageUrl = param . image . data [ 0 ] . url ;
241+ backgroundImg . style . backgroundSize = "cover" ;
242+
243+
234244 backgroundImg . src = imageUrl ;
235245 return backgroundImg ;
236246}
@@ -335,7 +345,7 @@ takePicture.addEventListener("click", () => {
335345} ) ;
336346
337347// Menu icon toggle
338- const menuIcon = document . querySelector ( ".menu-icon" ) ;
348+
339349
340350menuIcon . addEventListener ( "click" , ( ) => {
341351 wrapper . classList . toggle ( "change" ) ;
0 commit comments