Repository navigation
Expand file tree
/
Copy pathcode.html
More file actions
104 lines (100 loc) · 3.24 KB
/
Copy pathcode.html
File metadata and controls
104 lines (100 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Code Creator</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 20px;
}
.container {
max-width: 600px;
margin: 0 auto;
background: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
h1 {
color: #333;
text-align: center;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-top: 10px;
margin-bottom: 5px;
color: #555;
}
input[type="text"],
select,
textarea {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ddd;
border-radius: 4px;
}
input[type="submit"] {
background-color: #5cb85c;
color: white;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
margin-top: 10px;
}
input[type="submit"]:hover {
background-color: #4cae4c;
}
img.spinner {
display: none;
width: 200px;
height: 200px;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
img.show {
display: block;
}
.fade-out {
opacity: 0;
}
</style>
</head>
<body>
<div class="container">
<h1>Programming Code Generator</h1>
<form method="post" id="code" action="code" onsubmit="document.getElementById('spinner').classList.add('show'); return true;">
<label for="prompt">Single word prompt (e.g. name of function):</label>
<input type="text" id="prompt" name="prompt" required>
<label for="domain">Coding Language:</label>
<select name="domain" id="domain">
<option value="Rust">Rust</option>
<option value="Java">Java</option>
<option value="python">python</option>
<option value="HTML">HTML</option>
</select>
<i>Tested with Rust, Java, Python and HTML. Other Languages should work too.</i>
<!--
<input type="text" id="domain" name="domain" placeholder="Rust, Java, Python or HTML" required>
-->
<label for="system">System Area for additional context and instructions:</label>
<textarea id="system" name="system" columns="80" rows="10"></textarea>
<i>Iterative refinement is recommended. For example adding the word 'efficient' may make the code less readable but faster. Mentioning specific libraries and algorithms is recommended too.</i>
<input type="submit" value="Submit">
</form>
<h3>This will take some time to process after submitting...</h3>
<h2>${message}</h2>
<img src="spinner.gif" id="spinner" class="spinner">
</div>
</body>
</html>