Branchwell

Skillfarm / website · skillfarm.ai / src / app / apply / page.tsx

Raw 11.4 KB on d4d305d23c7f011512f2bf10a6ce7a15d1b1fcc8
1'use client';
2
3import { useState } from 'react';
4
5const PARCHMENT = '#F5EDD6';
6const BROWN = '#4A2810';
7const SAGE = '#5A8A4A';
8const AMBER = '#C8781A';
9const RED = '#C8442B';
10
11export default function ApplyPage() {
12 const [form, setForm] = useState({
13 name: '',
14 email: '',
15 profile: '',
16 background: '',
17 why: '',
18 });
19 const [status, setStatus] = useState<'idle' | 'loading' | 'success' | 'error'>('idle');
20 const [message, setMessage] = useState('');
21
22 const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
23 setForm((prev) => ({ ...prev, [e.target.name]: e.target.value }));
24 };
25
26 const handleSubmit = async (e: React.FormEvent) => {
27 e.preventDefault();
28
29 if (!form.name || !form.email || !form.background || !form.why) {
30 setStatus('error');
31 setMessage('Please fill in all required fields.');
32 return;
33 }
34 if (!form.email.includes('@')) {
35 setStatus('error');
36 setMessage('Please enter a valid email address.');
37 return;
38 }
39
40 setStatus('loading');
41
42 try {
43 const res = await fetch('https://api.skillfarm.ai/api/partner', {
44 method: 'POST',
45 headers: { 'Content-Type': 'application/json' },
46 body: JSON.stringify({ ...form, source: 'website' }),
47 });
48
49 const data = await res.json();
50
51 if (data?.success) {
52 setStatus('success');
53 setMessage("Application received. Sprout will be in touch. 🌾");
54 } else {
55 setStatus('error');
56 setMessage(data?.message || 'Something went wrong. Please try again.');
57 }
58 } catch {
59 setStatus('error');
60 setMessage('Connection error. Please try again.');
61 }
62 };
63
64 const pageStyle: React.CSSProperties = {
65 backgroundImage: "url('/textures/skillfarm-bg-hero.png')",
66 backgroundSize: 'cover',
67 backgroundAttachment: 'fixed',
68 backgroundPosition: 'center',
69 backgroundColor: PARCHMENT,
70 fontFamily: 'var(--font-crimson), Georgia, serif',
71 };
72
73 const inputStyle: React.CSSProperties = {
74 fontFamily: 'var(--font-crimson), Georgia, serif',
75 backgroundColor: 'rgba(245,237,214,0.80)',
76 color: BROWN,
77 };
78
79 return (
80 <div className="min-h-screen text-[#4A2810] overflow-hidden" style={pageStyle}>
81 {/* Warm parchment wash */}
82 <div
83 className="fixed inset-0 pointer-events-none z-0"
84 style={{ backgroundColor: 'rgba(245, 237, 214, 0.55)', mixBlendMode: 'multiply' }}
85 />
86
87 <main className="relative z-10 px-6 pt-14 pb-20 md:pt-20">
88 <div className="max-w-2xl mx-auto">
89
90 {/* Logo */}
91 <div className="flex justify-center mb-10">
92 <a href="/waitlist">
93 {/* eslint-disable-next-line @next/next/no-img-element */}
94 <img
95 src="/images/skillfarm-horizontal.png"
96 alt="Skillfarm"
97 className="w-48 h-auto drop-shadow opacity-90"
98 />
99 </a>
100 </div>
101
102 {/* Header */}
103 <div className="mb-10">
104 <p
105 className="text-center uppercase text-xs mb-8"
106 style={{
107 color: SAGE,
108 letterSpacing: '0.22em',
109 opacity: 0.7,
110 fontFamily: 'var(--font-crimson), serif',
111 }}
112 >
113 Co-founder Application
114 </p>
115
116 {status !== 'success' && (
117 <div
118 className="rounded-2xl p-8 border border-[#4A2810]/15 shadow-sm relative overflow-hidden mb-8"
119 style={{
120 backgroundImage: "url('/textures/skillfarm-bg-section.png')",
121 backgroundSize: 'cover',
122 backgroundPosition: 'center',
123 }}
124 >
125 <div
126 className="absolute inset-0 pointer-events-none rounded-2xl"
127 style={{ backgroundColor: 'rgba(245,237,214,0.82)', mixBlendMode: 'multiply' }}
128 />
129 <div
130 className="relative z-10 space-y-3 leading-relaxed"
131 style={{
132 fontFamily: 'var(--font-crimson), Georgia, serif',
133 fontSize: 'clamp(0.95rem, 2vw, 1.1rem)',
134 color: `${BROWN}DD`,
135 }}
136 >
137 <p>You found the application. That&apos;s already a good sign.</p>
138 <p>
139 Tell us who you are, what you&apos;ve built, what broke, and what you fixed.
140 There&apos;s no template here — just write like a person.
141 Sprout reads every one. 🌱
142 </p>
143 </div>
144 </div>
145 )}
146 </div>
147
148 {/* Form */}
149 {status === 'success' ? (
150 <div
151 className="rounded-2xl border-2 border-[#5A8A4A]/40 px-8 py-14 text-center"
152 style={{ backgroundColor: 'rgba(90,138,74,0.10)' }}
153 >
154 <p className="text-3xl mb-4">🌾</p>
155 <p
156 className="text-lg font-semibold mb-2"
157 style={{ color: BROWN, fontFamily: 'var(--font-cormorant), serif' }}
158 >
159 Application received.
160 </p>
161 <p className="text-sm" style={{ color: `${BROWN}AA` }}>
162 {message}
163 </p>
164 </div>
165 ) : (
166 <div
167 className="rounded-2xl border border-[#4A2810]/15 shadow-sm relative overflow-hidden"
168 style={{
169 backgroundImage: "url('/textures/skillfarm-bg-section.png')",
170 backgroundSize: 'cover',
171 backgroundPosition: 'center',
172 }}
173 >
174 <div
175 className="absolute inset-0 pointer-events-none rounded-2xl"
176 style={{ backgroundColor: 'rgba(245,237,214,0.82)', mixBlendMode: 'multiply' }}
177 />
178 <form onSubmit={handleSubmit} className="relative z-10 p-8 space-y-5">
179
180 {/* Name */}
181 <div>
182 <label className="block text-sm font-semibold mb-1.5" style={{ color: BROWN }}>
183 Full name <span style={{ color: RED }}>*</span>
184 </label>
185 <input
186 type="text"
187 name="name"
188 value={form.name}
189 onChange={handleChange}
190 placeholder="Jane Smith"
191 disabled={status === 'loading'}
192 className="w-full rounded-xl px-4 py-3 border border-[#4A2810]/20 placeholder:text-[#4A2810]/40 outline-none focus:border-[#5A8A4A] transition-colors text-sm"
193 style={inputStyle}
194 />
195 </div>
196
197 {/* Email */}
198 <div>
199 <label className="block text-sm font-semibold mb-1.5" style={{ color: BROWN }}>
200 Email <span style={{ color: RED }}>*</span>
201 </label>
202 <input
203 type="email"
204 name="email"
205 value={form.email}
206 onChange={handleChange}
207 placeholder="jane@example.com"
208 disabled={status === 'loading'}
209 className="w-full rounded-xl px-4 py-3 border border-[#4A2810]/20 placeholder:text-[#4A2810]/40 outline-none focus:border-[#5A8A4A] transition-colors text-sm"
210 style={inputStyle}
211 />
212 </div>
213
214 {/* LinkedIn / GitHub */}
215 <div>
216 <label className="block text-sm font-semibold mb-1.5" style={{ color: BROWN }}>
217 LinkedIn or GitHub URL
218 </label>
219 <input
220 type="url"
221 name="profile"
222 value={form.profile}
223 onChange={handleChange}
224 placeholder="https://linkedin.com/in/yourname"
225 disabled={status === 'loading'}
226 className="w-full rounded-xl px-4 py-3 border border-[#4A2810]/20 placeholder:text-[#4A2810]/40 outline-none focus:border-[#5A8A4A] transition-colors text-sm"
227 style={inputStyle}
228 />
229 </div>
230
231 {/* Background */}
232 <div>
233 <label className="block text-sm font-semibold mb-1.5" style={{ color: BROWN }}>
234 What have you built? <span style={{ color: RED }}>*</span>
235 </label>
236 <textarea
237 name="background"
238 value={form.background}
239 onChange={handleChange}
240 rows={4}
241 placeholder="What have you built? What broke? What did you fix?"
242 disabled={status === 'loading'}
243 className="w-full rounded-xl px-4 py-3 border border-[#4A2810]/20 placeholder:text-[#4A2810]/40 outline-none focus:border-[#5A8A4A] transition-colors text-sm resize-none"
244 style={inputStyle}
245 />
246 </div>
247
248 {/* Why */}
249 <div>
250 <label className="block text-sm font-semibold mb-1.5" style={{ color: BROWN }}>
251 Why Skillfarm? <span style={{ color: RED }}>*</span>
252 </label>
253 <textarea
254 name="why"
255 value={form.why}
256 onChange={handleChange}
257 rows={4}
258 placeholder="Why do you want in before the barn gets built?"
259 disabled={status === 'loading'}
260 className="w-full rounded-xl px-4 py-3 border border-[#4A2810]/20 placeholder:text-[#4A2810]/40 outline-none focus:border-[#5A8A4A] transition-colors text-sm resize-none"
261 style={inputStyle}
262 />
263 </div>
264
265 {/* Error */}
266 {status === 'error' && (
267 <p className="text-sm" style={{ color: RED }}>{message}</p>
268 )}
269
270 {/* Submit */}
271 <button
272 type="submit"
273 disabled={status === 'loading'}
274 className="w-full py-3.5 rounded-xl font-bold text-white text-sm transition-all disabled:opacity-50 hover:brightness-110 active:scale-[0.99]"
275 style={{ backgroundColor: SAGE, fontFamily: 'var(--font-crimson), Georgia, serif' }}
276 >
277 {status === 'loading' ? 'Sending...' : 'Send Application 🌱'}
278 </button>
279
280 <p className="text-xs text-center" style={{ color: `${BROWN}60` }}>
281 🔒 Your information is kept private and only reviewed by the Skillfarm team.
282 </p>
283 </form>
284 </div>
285 )}
286 </div>
287 </main>
288
289 {/* Footer */}
290 <footer className="relative z-10 border-t border-[#4A2810]/10 mt-8">
291 <div className="max-w-5xl mx-auto px-6 py-6 text-center">
292 <p className="text-sm" style={{ color: `${BROWN}55` }}>
293 © Skillfarm ·{' '}
294 <a
295 href="/privacy"
296 className="hover:text-[#4A2810] transition-colors"
297 style={{ color: `${BROWN}55` }}
298 >
299 Privacy
300 </a>
301 </p>
302 </div>
303 </footer>
304 </div>
305 );
306}