Skip to content

Commit 286c5f4

Browse files
authored
Merge branch 'fac29b:master' into master
2 parents 88215b8 + 931cd08 commit 286c5f4

8 files changed

Lines changed: 67 additions & 19 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ No idea what to cook? No worries! The Recipe For Success app does the thinking f
1717

1818
Recipe For Success is a web application that generates personalized recipes based on user preferences and dietary restrictions. Utilizing the OpenAI API for text and image generation, this app provides unique recipes complete with AI-generated images.
1919

20-
The application is hosted on Vercel and can be accessed at [Recipe For Success](https://recipe-for-success-iota.vercel.app/).
20+
The application is hosted on Microsoft Azure and can be accessed at [Recipe For Success](https://recipe-for-success.azurewebsites.net/).
2121

2222
## Features
2323

public/index.css

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
font-weight: 200;
55
}
66

7+
html {
8+
scroll-behavior: smooth;
9+
}
10+
11+
12+
713
:root {
814
--green: rgb(183, 235, 183);
915
--black: rgb(67, 63, 63);
@@ -66,7 +72,13 @@ body.dark-mode .slider:before {
6672

6773
.parent-container {
6874
height: 100vh;
69-
width: 100vw;
75+
width: 500px;
76+
border: red 1px solid;
77+
display: flex;
78+
flex-direction: row;
79+
position: relative;
80+
margin-left: auto;
81+
margin-right: auto;
7082
}
7183

7284
.recording {
@@ -592,23 +604,22 @@ input:checked+.slider:before {
592604
}
593605

594606
.navigation {
595-
position: fixed;
596-
top: 5px;
597-
left: 56%;
598-
transform: translateX(-50%);
599-
width: 100%;
600-
max-width: 340px;
601-
height: 100vh;
607+
position: absolute;
608+
top: 0px;
609+
right: 0px;
610+
/* transform: translateX(-50%); */
611+
width: 50%;
612+
height: 200vh;
602613
/* Updated height to match the wrapper/container */
603614
background-color: var(--green);
604615
z-index: 100;
605616
display: none;
606-
align-items: center;
607617
padding-left: 1rem;
608618
border-radius: 1px;
609619
border: black 3px solid;
610620
border-top-left-radius: 5px;
611621
border-top-right-radius: 5px;
622+
612623
}
613624

614625
.change .navigation {
@@ -626,9 +637,14 @@ input:checked+.slider:before {
626637
justify-content: center;
627638
align-items: center;
628639
margin: 0 auto;
640+
/* transform: rotateZ(-15deg); */
641+
transition: all 1s;
629642
}
630643

631644
.nav-items {
645+
width: 250px;
646+
margin-top: 325px;
647+
position: fixed;
632648
display: flex;
633649
flex-direction: column;
634650
opacity: 1;
@@ -651,7 +667,7 @@ input:checked+.slider:before {
651667
}
652668

653669
/* Media Queries */
654-
@media only screen and (max-width: 768px) {
670+
/* @media only screen and (max-width: 768px) {
655671
.menu-icon {
656672
right: 2rem;
657673
margin-right: 0;
@@ -663,7 +679,7 @@ input:checked+.slider:before {
663679
width: 100%;
664680
max-width: 340px;
665681
}
666-
}
682+
} */
667683

668684
@keyframes fadeIn {
669685
from { opacity: 0; }
@@ -672,4 +688,17 @@ input:checked+.slider:before {
672688

673689
.fade-in {
674690
animation: fadeIn 1s ease-in;
675-
}
691+
}
692+
693+
/*
694+
@media (orientation: landscape) {
695+
body {
696+
flex-direction: row;
697+
}
698+
.navigation {
699+
transform: translateX(-10%) translateY(-20px);
700+
}
701+
.main-element {
702+
overflow: hidden;
703+
}
704+
} */

public/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
<input type="checkbox" class="dark-light-button" />
4545
<span class="slider round"></span>
4646
</label>
47+
<div class="non-picture-section">
4748

49+
4850
<h1 aria-label="app text" class="headline">
4951
Unsure What to Cook? Let Recipe for Success Inspire Your Next Meal!
5052

@@ -113,6 +115,7 @@ <h1 aria-label="app text" class="headline">
113115
Random
114116
</button>
115117
</section>
118+
</div>
116119

117120
<!-- <label for="user-email">Enter you email address</label> -->
118121

@@ -184,7 +187,7 @@ <h1 class="picture-section-headline">You've got some ingredients but no idea wha
184187
<div class="video-btn-canvas">
185188
<video class="video"></video>
186189
<button class="take-picture">take a picture</button>
187-
<button id="switchCamera">Switch Camera</button>
190+
<!-- <button id="switchCamera">Switch Camera</button> -->
188191
<canvas class="canvas"></canvas>
189192
<p class="chat-gpt-vision-text"></p>
190193
<button class="previous-page">previous page</button>

public/index.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

5355
let currentCameraIndex = 0;
5456
const switchCameraButton = document.getElementById("switchCamera");
5557
let emailObject;
5658

59+
console.log(non_picture_section)
60+
5761
wantToTakeAPicture.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) => {
231238
function 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
}
@@ -282,7 +292,7 @@ async function initializeCamera() {
282292
currentCameraIndex = (currentCameraIndex + 1) % videoDevices.length;
283293
startCamera(videoDevices[currentCameraIndex].deviceId);
284294
});
285-
} else {
295+
} else if (switchCameraButton) {
286296
switchCameraButton.style.display = "none";
287297
}
288298

@@ -335,7 +345,7 @@ takePicture.addEventListener("click", () => {
335345
});
336346

337347
// Menu icon toggle
338-
const menuIcon = document.querySelector(".menu-icon");
348+
339349

340350
menuIcon.addEventListener("click", () => {
341351
wrapper.classList.toggle("change");

public/js_utilities/query_selector.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ const dietaryRequirements = Array.from(
3838
const otherDietaryRequirements = document.querySelector(
3939
"#other-dietary-requirements"
4040
);
41+
const non_picture_section = document.querySelector(".non-picture-section")
42+
const menuIcon = document.querySelector(".menu-icon");
4143
const userText = document.querySelector("#user-text");
4244
const constraint = {
4345
audio: false,
@@ -87,7 +89,9 @@ export {
8789
previousPage,
8890
sendToUserInbox,
8991
emailUserRecipeSection,
90-
wrapper
92+
wrapper,
93+
non_picture_section,
94+
menuIcon
9195
};
9296

9397

public/url_folder.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
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
1+
https://oaidalleapiprodscus.blob.core.windows.net/private/org-nYbqgo3O0LNnYYAoKAmApBfx/user-58Je7efi0iy880e2UYCdYpBm/img-pcWHShzpudjH6x44lw83bfXs.png?st=2024-08-06T11%3A59%3A19Z&se=2024-08-06T13%3A59%3A19Z&sp=r&sv=2023-11-03&sr=b&rscd=inline&rsct=image/png&skoid=d505667d-d6c1-4a0a-bac7-5c84a87759f8&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2024-08-06T01%3A32%3A40Z&ske=2024-08-07T01%3A32%3A40Z&sks=b&skv=2023-11-03&sig=mm024hTeLnC1DhKflMqRX11qYYCY1T4RuP1UDFnMJt4%3D

server.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
require('dotenv').config();
13
const express = require("express");
24
const app = express();
35
app.use(express.json());

speech.mp3

-75 KB
Binary file not shown.

0 commit comments

Comments
 (0)