Yova Kementchedjhieva commited on
Commit
ca2f921
1 Parent(s): 2edba59
old_index.html DELETED
@@ -1,83 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Recipe Generator</title>
7
- <style>
8
- body {
9
- font-family: Arial, sans-serif;
10
- margin: 0;
11
- padding: 0;
12
- display: flex;
13
- justify-content: center;
14
- align-items: center;
15
- height: 100vh;
16
- background-color: #f0f0f0;
17
- }
18
- .container {
19
- text-align: center;
20
- }
21
- h1 {
22
- margin-bottom: 20px;
23
- }
24
- input[type="text"] {
25
- padding: 10px;
26
- margin-bottom: 20px;
27
- width: 300px;
28
- font-size: 16px;
29
- border-radius: 5px;
30
- border: 1px solid #ccc;
31
- }
32
- button {
33
- padding: 10px 20px;
34
- font-size: 16px;
35
- background-color: #007bff;
36
- color: #fff;
37
- border: none;
38
- border-radius: 5px;
39
- cursor: pointer;
40
- }
41
- button:hover {
42
- background-color: #0056b3;
43
- }
44
- #recipe {
45
- margin-top: 20px;
46
- }
47
- </style>
48
- </head>
49
- <body>
50
- <div class="container">
51
- <h1>Recipe Generator</h1>
52
- <form id="ingredientsForm">
53
- <input type="text" id="ingredientsInput" placeholder="Enter ingredients (comma-separated)" required>
54
- <button type="submit">Generate Recipe</button>
55
- </form>
56
- <div id="recipe"></div>
57
- </div>
58
-
59
- <script>
60
- document.getElementById('ingredientsForm').addEventListener('submit', function(event) {
61
- event.preventDefault();
62
- var ingredients = document.getElementById('ingredientsInput').value.trim();
63
- if (ingredients) {
64
- fetch('/recipe', {
65
- method: 'POST',
66
- headers: {
67
- 'Content-Type': 'application/x-www-form-urlencoded',
68
- },
69
- body: 'ingredients=' + encodeURIComponent(ingredients),
70
- })
71
- .then(response => response.text())
72
- .then(recipe => {
73
- document.getElementById('recipe').innerHTML = recipe;
74
- })
75
- .catch(error => console.error('Error:', error));
76
- } else {
77
- alert('Please enter at least one ingredient.');
78
- }
79
- });
80
- </script>
81
- </body>
82
- </html>
83
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
index.html → templates/index.html RENAMED
File without changes