Sazzz02 commited on
Commit
3fa5f5a
·
verified ·
1 Parent(s): 552a5d5

Create robot_ui.html

Browse files
Files changed (1) hide show
  1. robot_ui.html +257 -0
robot_ui.html ADDED
@@ -0,0 +1,257 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>AI Cold Email Generator</title>
7
+ <style>
8
+ @import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap');
9
+
10
+ :root {
11
+ --bg-color: #1a1a2e;
12
+ --container-color: #162447;
13
+ --text-color: #e4e4e4;
14
+ --accent-color: #e94560;
15
+ --form-bg: #2d3b5b;
16
+ --input-border: #4a5b7d;
17
+ }
18
+
19
+ body {
20
+ font-family: 'Roboto Mono', monospace;
21
+ background-color: var(--bg-color);
22
+ color: var(--text-color);
23
+ margin: 0;
24
+ display: flex;
25
+ justify-content: center;
26
+ align-items: center;
27
+ min-height: 100vh;
28
+ text-align: center;
29
+ }
30
+
31
+ .container {
32
+ width: 90%;
33
+ max-width: 800px;
34
+ padding: 40px;
35
+ background-color: var(--container-color);
36
+ border-radius: 15px;
37
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
38
+ transition: all 0.3s ease-in-out;
39
+ border: 2px solid var(--input-border);
40
+ }
41
+
42
+ .robot-container {
43
+ position: relative;
44
+ margin-bottom: 50px;
45
+ }
46
+
47
+ .robot-head {
48
+ width: 80px;
49
+ height: 60px;
50
+ background-color: var(--form-bg);
51
+ border: 3px solid var(--accent-color);
52
+ border-radius: 10px 10px 20px 20px;
53
+ margin: 0 auto;
54
+ position: relative;
55
+ animation: float 2s ease-in-out infinite;
56
+ }
57
+
58
+ .robot-head::before, .robot-head::after {
59
+ content: '';
60
+ position: absolute;
61
+ top: 20px;
62
+ width: 12px;
63
+ height: 12px;
64
+ background-color: var(--accent-color);
65
+ border-radius: 50%;
66
+ animation: blink 3s infinite;
67
+ }
68
+
69
+ .robot-head::before { left: 15px; }
70
+ .robot-head::after { right: 15px; }
71
+
72
+ .chat-bubble {
73
+ background-color: var(--form-bg);
74
+ color: var(--text-color);
75
+ padding: 20px;
76
+ border-radius: 10px;
77
+ position: relative;
78
+ margin-top: 20px;
79
+ font-size: 1.1em;
80
+ text-align: left;
81
+ border: 1px solid var(--input-border);
82
+ animation: popin 0.5s ease-out;
83
+ }
84
+
85
+ .chat-bubble::after {
86
+ content: '';
87
+ position: absolute;
88
+ top: -10px;
89
+ left: 50%;
90
+ transform: translateX(-50%);
91
+ width: 0;
92
+ height: 0;
93
+ border-left: 10px solid transparent;
94
+ border-right: 10px solid transparent;
95
+ border-bottom: 10px solid var(--form-bg);
96
+ }
97
+
98
+ .form-container {
99
+ margin-top: 30px;
100
+ text-align: left;
101
+ display: none;
102
+ animation: fadein 1s;
103
+ }
104
+
105
+ .form-container.active, .output-container.active {
106
+ display: block;
107
+ }
108
+
109
+ label {
110
+ display: block;
111
+ margin-bottom: 8px;
112
+ color: var(--accent-color);
113
+ }
114
+
115
+ input[type="text"], input[type="password"], input[type="file"] {
116
+ width: 100%;
117
+ padding: 12px;
118
+ margin-bottom: 20px;
119
+ border-radius: 5px;
120
+ border: 1px solid var(--input-border);
121
+ background-color: var(--container-color);
122
+ color: var(--text-color);
123
+ font-family: 'Roboto Mono', monospace;
124
+ }
125
+
126
+ input[type="submit"], button {
127
+ background-color: var(--accent-color);
128
+ color: white;
129
+ border: none;
130
+ padding: 15px 30px;
131
+ border-radius: 5px;
132
+ font-family: 'Roboto Mono', monospace;
133
+ font-size: 1.1em;
134
+ cursor: pointer;
135
+ transition: background-color 0.3s;
136
+ }
137
+
138
+ input[type="submit"]:hover, button:hover {
139
+ background-color: #c4374b;
140
+ }
141
+
142
+ .output-container {
143
+ margin-top: 40px;
144
+ text-align: left;
145
+ display: none;
146
+ animation: fadein 1s;
147
+ }
148
+
149
+ .output-container h2 {
150
+ color: var(--accent-color);
151
+ }
152
+
153
+ pre {
154
+ background-color: #0d1222;
155
+ padding: 20px;
156
+ border-radius: 10px;
157
+ white-space: pre-wrap;
158
+ word-wrap: break-word;
159
+ border: 1px solid var(--input-border);
160
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
161
+ }
162
+
163
+ @keyframes float {
164
+ 0% { transform: translateY(0px); }
165
+ 50% { transform: translateY(-10px); }
166
+ 100% { transform: translateY(0px); }
167
+ }
168
+
169
+ @keyframes blink {
170
+ 0%, 50%, 100% { transform: scaleY(1); }
171
+ 52%, 98% { transform: scaleY(0.1); }
172
+ }
173
+
174
+ @keyframes fadein {
175
+ from { opacity: 0; transform: translateY(20px); }
176
+ to { opacity: 1; transform: translateY(0); }
177
+ }
178
+
179
+ @keyframes popin {
180
+ from { transform: scale(0.8); opacity: 0; }
181
+ to { transform: scale(1); opacity: 1; }
182
+ }
183
+ </style>
184
+ </head>
185
+ <body>
186
+ <div class="container">
187
+ <div class="robot-container">
188
+ <div class="robot-head"></div>
189
+ <div class="chat-bubble" id="chat-message">
190
+ Hello. I am your AI Cold Mail Generator. Please provide a job posting URL and I will draft an email.
191
+ </div>
192
+ </div>
193
+
194
+ <form id="input-form" class="form-container" action="/generate" method="post">
195
+ <label for="job_url">Job Posting URL:</label>
196
+ <input type="text" id="job_url" name="job_url" required>
197
+
198
+ <input type="submit" value="Generate Email">
199
+ </form>
200
+
201
+ <div id="output-container" class="output-container">
202
+ <h2>Generated Email</h2>
203
+ <pre id="output-content"></pre>
204
+ <button onclick="window.location.reload();">Start Over</button>
205
+ </div>
206
+ </div>
207
+
208
+ <script>
209
+ document.addEventListener('DOMContentLoaded', () => {
210
+ const formContainer = document.getElementById('input-form');
211
+ const chatBubble = document.getElementById('chat-message');
212
+
213
+ setTimeout(() => {
214
+ formContainer.classList.add('active');
215
+ }, 1500);
216
+
217
+ const form = document.getElementById('input-form');
218
+ form.addEventListener('submit', async (e) => {
219
+ e.preventDefault();
220
+ chatBubble.textContent = "Processing your request... This may take a moment. Please wait.";
221
+
222
+ const formData = new FormData(form);
223
+ const outputContainer = document.getElementById('output-container');
224
+ const outputContent = document.getElementById('output-content');
225
+ const submitButton = form.querySelector('input[type="submit"]');
226
+
227
+ submitButton.disabled = true;
228
+ submitButton.value = "Generating...";
229
+
230
+ try {
231
+ const response = await fetch('/generate', {
232
+ method: 'POST',
233
+ body: formData
234
+ });
235
+
236
+ const data = await response.text();
237
+
238
+ if (!response.ok) {
239
+ chatBubble.textContent = `Error: ${data}`;
240
+ outputContent.textContent = "An error occurred. Please try again.";
241
+ } else {
242
+ outputContent.textContent = data;
243
+ chatBubble.textContent = "Request complete! Here is your email.";
244
+ formContainer.classList.remove('active');
245
+ outputContainer.classList.add('active');
246
+ }
247
+ } catch (error) {
248
+ chatBubble.textContent = `An unexpected error occurred: ${error}`;
249
+ } finally {
250
+ submitButton.disabled = false;
251
+ submitButton.value = "Generate Email";
252
+ }
253
+ });
254
+ });
255
+ </script>
256
+ </body>
257
+ </html>