hhelesto commited on
Commit
b466696
·
verified ·
1 Parent(s): d1d6660

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +7 -41
templates/index.html CHANGED
@@ -2,70 +2,36 @@
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>AI Comment Generator</title>
7
  <style>
8
  body {
9
  font-family: sans-serif;
10
  max-width: 600px;
11
- margin: 40px auto;
12
- padding: 20px;
13
  background: #f7f7f7;
 
14
  border-radius: 8px;
15
  }
16
  textarea {
17
  width: 100%;
18
- height: 100px;
19
- margin-bottom: 10px;
20
- font-size: 16px;
21
  padding: 10px;
 
22
  }
23
  button {
24
  padding: 10px 20px;
25
  font-size: 16px;
26
  cursor: pointer;
27
- }
28
- #result {
29
- margin-top: 20px;
30
- white-space: pre-wrap;
31
- background: #fff;
32
- padding: 10px;
33
- border-radius: 4px;
34
- min-height: 50px;
35
  }
36
  </style>
37
  </head>
38
  <body>
39
  <h1>AI Comment Generator</h1>
40
- <form id="promptForm">
41
  <label for="prompt">Enter your prompt:</label><br>
42
- <textarea id="prompt" name="prompt"></textarea><br>
43
  <button type="submit">Generate</button>
44
  </form>
45
- <div id="result"></div>
46
-
47
- <script>
48
- const form = document.getElementById('promptForm');
49
- const resultDiv = document.getElementById('result');
50
-
51
- form.addEventListener('submit', async (e) => {
52
- e.preventDefault();
53
-
54
- const prompt = document.getElementById('prompt').value;
55
-
56
- resultDiv.textContent = "Generating...";
57
-
58
- const res = await fetch('/generate', {
59
- method: 'POST',
60
- headers: {
61
- 'Content-Type': 'application/json'
62
- },
63
- body: JSON.stringify({ prompt })
64
- });
65
-
66
- const data = await res.json();
67
- resultDiv.textContent = data.generated_text || "Error generating text.";
68
- });
69
- </script>
70
  </body>
71
  </html>
 
2
  <html lang="en">
3
  <head>
4
  <meta charset="UTF-8" />
 
5
  <title>AI Comment Generator</title>
6
  <style>
7
  body {
8
  font-family: sans-serif;
9
  max-width: 600px;
10
+ margin: 50px auto;
 
11
  background: #f7f7f7;
12
+ padding: 20px;
13
  border-radius: 8px;
14
  }
15
  textarea {
16
  width: 100%;
17
+ height: 150px;
 
 
18
  padding: 10px;
19
+ font-size: 16px;
20
  }
21
  button {
22
  padding: 10px 20px;
23
  font-size: 16px;
24
  cursor: pointer;
25
+ margin-top: 10px;
 
 
 
 
 
 
 
26
  }
27
  </style>
28
  </head>
29
  <body>
30
  <h1>AI Comment Generator</h1>
31
+ <form action="/generate" method="post">
32
  <label for="prompt">Enter your prompt:</label><br>
33
+ <textarea id="prompt" name="prompt" required></textarea><br>
34
  <button type="submit">Generate</button>
35
  </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  </body>
37
  </html>