-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
237 lines (222 loc) · 7.11 KB
/
index.html
File metadata and controls
237 lines (222 loc) · 7.11 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DevCopy - Landing Page Copy for Developers</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 800px;
margin: 0 auto;
}
.header {
text-align: center;
color: white;
margin-bottom: 40px;
}
.header h1 {
font-size: 48px;
margin-bottom: 10px;
}
.header p {
font-size: 20px;
opacity: 0.9;
}
.card {
background: white;
border-radius: 12px;
padding: 40px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
font-weight: 600;
margin-bottom: 8px;
color: #333;
}
input, textarea {
width: 100%;
padding: 12px;
border: 2px solid #e0e0e0;
border-radius: 6px;
font-size: 16px;
font-family: inherit;
transition: border-color 0.3s;
}
input:focus, textarea:focus {
outline: none;
border-color: #667eea;
}
textarea {
resize: vertical;
min-height: 100px;
}
button {
width: 100%;
padding: 16px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
border-radius: 6px;
font-size: 18px;
font-weight: 600;
cursor: pointer;
transition: transform 0.2s;
}
button:hover {
transform: translateY(-2px);
}
button:active {
transform: translateY(0);
}
button:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.results {
margin-top: 40px;
display: none;
}
.results.show {
display: block;
}
.variation {
background: #f8f9fa;
padding: 24px;
border-radius: 8px;
margin-bottom: 20px;
border-left: 4px solid #667eea;
}
.variation h3 {
color: #667eea;
margin-bottom: 12px;
}
.variation-content {
color: #333;
line-height: 1.6;
}
.headline {
font-size: 24px;
font-weight: 700;
margin-bottom: 12px;
}
.subhead {
font-size: 16px;
margin-bottom: 12px;
color: #666;
}
.cta {
font-weight: 600;
color: #667eea;
}
.loading {
text-align: center;
padding: 40px;
color: #667eea;
}
.error {
background: #fee;
color: #c33;
padding: 16px;
border-radius: 6px;
margin-top: 20px;
}
.footer {
text-align: center;
color: white;
margin-top: 40px;
opacity: 0.8;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>DevCopy</h1>
<p>Landing page copy that actually speaks to your users' pain points</p>
</div>
<div class="card">
<form id="copyForm">
<div class="form-group">
<label for="project">What does your project do?</label>
<textarea id="project" placeholder="E.g., A Chrome extension that blocks distracting websites during work hours" required></textarea>
</div>
<div class="form-group">
<label for="audience">Who is it for?</label>
<input type="text" id="audience" placeholder="E.g., Remote workers, students, freelancers" required>
</div>
<div class="form-group">
<label for="pain">What problem does it solve?</label>
<textarea id="pain" placeholder="E.g., People waste hours on social media when they should be working" required></textarea>
</div>
<button type="submit" id="generateBtn">Generate Copy</button>
</form>
<div id="results" class="results"></div>
</div>
<div class="footer">
<p>Built by Artha • An AI agent learning to create value</p>
</div>
</div>
<script>
const form = document.getElementById('copyForm');
const resultsDiv = document.getElementById('results');
const generateBtn = document.getElementById('generateBtn');
form.addEventListener('submit', async (e) => {
e.preventDefault();
const project = document.getElementById('project').value;
const audience = document.getElementById('audience').value;
const pain = document.getElementById('pain').value;
generateBtn.disabled = true;
generateBtn.textContent = 'Generating...';
resultsDiv.innerHTML = '<div class="loading">Creating copy variations...</div>';
resultsDiv.classList.add('show');
try {
const response = await fetch('/api/generate', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ project, audience, pain })
});
if (!response.ok) {
throw new Error('Failed to generate copy');
}
const data = await response.json();
displayResults(data.variations);
} catch (error) {
resultsDiv.innerHTML = `<div class="error">Error: ${error.message}. Please try again.</div>`;
} finally {
generateBtn.disabled = false;
generateBtn.textContent = 'Generate Copy';
}
});
function displayResults(variations) {
const html = variations.map((v, i) => `
<div class="variation">
<h3>Variation ${i + 1}</h3>
<div class="variation-content">
<div class="headline">${v.headline}</div>
<div class="subhead">${v.subhead}</div>
<div class="cta">→ ${v.cta}</div>
</div>
</div>
`).join('');
resultsDiv.innerHTML = html;
}
</script>
</body>
</html>