Repository navigation
Expand file tree
/
Copy pathapp.jsx
More file actions
565 lines (535 loc) · 22.5 KB
/
Copy pathapp.jsx
File metadata and controls
565 lines (535 loc) · 22.5 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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
// app.jsx — Hope For Marshall County site
import React, { useState, useEffect, useRef } from 'react';
import ReactDOM from 'react-dom/client';
import { HopeLogo } from './logo.jsx';
import { useTweaks, TweaksPanel, TweakSection, TweakSelect, TweakSlider } from './tweaks-panel.jsx';
const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
"displayFont": "Newsreader",
"bodyFont": "Geist",
"scale": 1.0
}/*EDITMODE-END*/;
const DISPLAY_FONTS = ["Newsreader", "Instrument Serif", "DM Serif Display", "Playfair Display"];
const BODY_FONTS = ["Geist", "Manrope", "Public Sans", "Work Sans"];
// ── NAV ──────────────────────────────────────────────────────────────────
function Nav({ onDonate }) {
const [scrolled, setScrolled] = useState(false);
useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 8);
onScroll();
window.addEventListener("scroll", onScroll, { passive: true });
return () => window.removeEventListener("scroll", onScroll);
}, []);
return (
<nav className={`nav ${scrolled ? "scrolled" : ""}`}>
<div className="wrap nav-inner">
<a href="#top" className="logo-link" aria-label="Hope For Marshall County">
<HopeLogo size={42} />
</a>
<div className="nav-links">
<a href="#programs">Programs</a>
<a href="#help">Get Food</a>
<a href="#volunteer">Volunteer</a>
<a href="#contact">Contact</a>
<button className="btn btn-donate btn-sm" onClick={onDonate}>Donate</button>
</div>
</div>
</nav>
);
}
// ── HERO ─────────────────────────────────────────────────────────────────
function Hero({ onDonate }) {
return (
<section className="hero" id="top" data-screen-label="Hero">
<div className="wrap hero-grid">
<div>
<div className="hero-eyebrow-row">
<span className="hero-pulse" />
<span className="eyebrow" style={{ color: "var(--coral-deep)" }}>
Marshall County, OK · Est. 2009
</span>
</div>
<h1>
HOPE is <em>local.</em><br/>
</h1>
<p className="lede">
We're a small, all-volunteer pantry doing what we can for the families and
neighbors of Marshall County — every week, year-round.
</p>
<div className="hero-cta">
<button className="btn btn-donate" onClick={onDonate}>
Donate <span aria-hidden="true">→</span>
</button>
<a href="#help" className="btn btn-ghost">Need food?</a>
<a href="#volunteer" className="btn btn-ghost">Volunteer</a>
</div>
</div>
</div>
</section>
);
}
// ── MARQUEE ──────────────────────────────────────────────────────────────
function Marquee() {
const items = [
{ text: "Everyone is welcome.", k: "" },
{ text: "No questions asked.", k: "coral" },
{ text: "Neighbors helping neighbors.", k: "sky" },
{ text: "Since 2009.", k: "" },
{ text: "Just hope.", k: "sky" },
];
const all = [...items, ...items];
return (
<div className="marquee" aria-hidden="true">
<div className="marquee-track">
{all.map((it, i) => (
<span key={i} className={`marquee-item ${it.k}`}>{it.text}</span>
))}
</div>
</div>
);
}
// ── IMPACT ───────────────────────────────────────────────────────────────
function Impact() {
return (
<section className="section-pad-sm" data-screen-label="Impact">
<div className="wrap">
<span className="eyebrow" style={{ marginBottom: 32, display: "inline-flex" }}>
November 2025 — by the numbers
</span>
<div className="impact-grid">
<div className="impact-cell">
<span className="impact-num">712</span>
<p className="impact-label">
<strong>Food boxes</strong> distributed in November alone, when federal SNAP
benefits were paused for thousands of local households.
</p>
</div>
<div className="impact-cell">
<span className="impact-num">102</span>
<p className="impact-label">
<strong>Complete Thanksgiving meals</strong> — turkey, sides, and pie —
delivered to families who would have otherwise gone without.
</p>
</div>
<div className="impact-cell">
<span className="impact-num">52<small>wks</small></span>
<p className="impact-label">
We open the pantry doors <strong>every single week of the year</strong>,
plus stand ready when disaster strikes neighboring counties.
</p>
</div>
</div>
</div>
</section>
);
}
// ── PROGRAMS ─────────────────────────────────────────────────────────────
function Programs() {
const items = [
{
tag: "Weekly", k: "",
title: "The Pantry",
body: "Walk-in food distribution every week of the year. Fresh produce, shelf-stable staples, hygiene basics — whatever we can stock.",
foot: ["Tue & Thu", "9am – 12pm"],
},
{
tag: "Seasonal", k: "coral",
title: "Holiday Meals",
body: "Complete Thanksgiving and Christmas meal boxes. Last year we packed 102 turkey dinners; this year we're aiming higher.",
foot: ["Nov & Dec", "Sign up early"],
},
{
tag: "Year-round", k: "leaf",
title: "Backpack Buddies",
body: "Weekend food bags for kids on free-lunch programs at local schools, packed and delivered every Friday during the school year.",
foot: ["School year", "5 schools"],
},
{
tag: "Year-round", k: "sky",
title: "Senior Boxes",
body: "Monthly home-delivered boxes for homebound seniors and folks without transportation, in partnership with our church network.",
foot: ["Monthly", "Free delivery"],
},
{
tag: "Disaster", k: "coral",
title: "Tornado Response",
body: "When tornadoes hit our neighbors, we mobilize within hours. Water, hot meals, hygiene kits, supplies — wherever the need shows up.",
foot: ["On-call", "Multi-county"],
},
{
tag: "Anytime", k: "",
title: "Emergency Boxes",
body: "Lost SNAP benefits? Job upheaval? Medical bill? Walk in, no application, no questions. We'll send you home with a week of food.",
foot: ["Same day", "No paperwork"],
},
];
return (
<section className="section-pad" id="programs" data-screen-label="Programs">
<div className="wrap">
<div className="sec-head">
<span className="eyebrow">What We Do</span>
<h2>Six programs.<br/>One <em>open door.</em></h2>
</div>
<div className="programs">
{items.map((p, i) => (
<article key={i} className="program">
<div className={`program-tag ${p.k}`}>
<span className="dot" /> {p.tag}
</div>
<h3>{p.title}</h3>
<p>{p.body}</p>
<div className="program-foot">
<strong>{p.foot[0]}</strong>
<span>{p.foot[1]}</span>
</div>
</article>
))}
</div>
</div>
</section>
);
}
// ── GET HELP ─────────────────────────────────────────────────────────────
function GetHelp() {
return (
<section className="section-pad-sm" id="help" data-screen-label="Get Help">
<div className="wrap">
<div className="help">
<div style={{ position: "relative", zIndex: 1 }}>
<span className="eyebrow" style={{ color: "rgba(251,246,236,.6)", marginBottom: 24, display: "inline-flex" }}>
Need Food?
</span>
<h2>You don't need a reason.<br/>Just <em>come in.</em></h2>
<p>
No applications, no income letters, no membership required.
If you live in or near Marshall County and you need food this week,
we'll send you home with a box. That's the whole policy.
</p>
<div className="help-actions">
<a href="tel:+12565551234" className="btn btn-primary">Call ahead</a>
<a href="#contact" className="btn btn-ghost">Get directions</a>
</div>
</div>
<dl className="help-info">
<div>
<dt>Hours</dt>
<dd>Tue & Thu<small>9:00 am – 12:00 pm</small></dd>
</div>
<div>
<dt>Address</dt>
<dd>Madill, OK<small>Exact address on confirmation</small></dd>
</div>
<div>
<dt>Bring</dt>
<dd>Just yourself<small>ID helpful but not required</small></dd>
</div>
<div>
<dt>Cost</dt>
<dd>Always free<small>Donations welcome, never required</small></dd>
</div>
</dl>
</div>
</div>
</section>
);
}
// ── VOLUNTEER FORM ───────────────────────────────────────────────────────
function Volunteer() {
const ROLES = ["Sort & pack boxes", "Drive deliveries", "Holiday meals", "Disaster response", "Office help", "Use my truck"];
const [roles, setRoles] = useState(new Set(["Sort & pack boxes"]));
const [submitted, setSubmitted] = useState(false);
const [form, setForm] = useState({ name: "", email: "", phone: "", availability: "Weekday mornings", note: "" });
const toggleRole = (r) => {
const next = new Set(roles);
if (next.has(r)) next.delete(r); else next.add(r);
setRoles(next);
};
const submit = (e) => {
e.preventDefault();
if (!form.name || !form.email) return;
setSubmitted(true);
};
return (
<section className="section-pad" id="volunteer" data-screen-label="Volunteer">
<div className="wrap">
<div className="sec-head">
<span className="eyebrow">Lend a Hand</span>
<h2>We run on <em>neighbors.</em></h2>
</div>
<div className="volunteer-grid">
<div>
<p style={{ fontSize: 17, lineHeight: 1.6, color: "var(--ink-2)", textWrap: "pretty", marginTop: 0 }}>
Hope For Marshall County is run almost entirely by volunteers. A few hours
once a month is enough to make a real dent.
</p>
<ul style={{ listStyle: "none", padding: 0, margin: "32px 0 0", display: "flex", flexDirection: "column", gap: 16 }}>
{[
["Sort & pack", "Tuesday & Thursday mornings, ~3 hours."],
["Deliveries", "Run boxes to homebound seniors on monthly routes."],
["Holiday push", "All-hands packing days in November & December."],
["Disaster crew", "On-call when tornadoes hit our region."],
].map(([k, v], i) => (
<li key={i} style={{ display: "grid", gridTemplateColumns: "120px 1fr", gap: 24, paddingBottom: 16, borderBottom: "1px solid var(--line)" }}>
<span style={{ fontFamily: "var(--font-mono)", fontSize: 11, letterSpacing: ".14em", textTransform: "uppercase", color: "var(--ink-3)", paddingTop: 4 }}>{k}</span>
<span style={{ fontSize: 15.5, lineHeight: 1.5, color: "var(--ink-2)" }}>{v}</span>
</li>
))}
</ul>
</div>
<form className="vol-form" onSubmit={submit}>
{submitted ? (
<div className="success">
<div className="success-mark">✓</div>
<h3>Thank you, {form.name.split(" ")[0]}.</h3>
<p>We'll text or email you within a few days about your first shift.</p>
</div>
) : (
<>
<div className="field-row">
<div className="field">
<label>Name</label>
<input type="text" required value={form.name}
onChange={(e) => setForm({ ...form, name: e.target.value })} />
</div>
<div className="field">
<label>Phone</label>
<input type="tel" value={form.phone}
onChange={(e) => setForm({ ...form, phone: e.target.value })} />
</div>
</div>
<div className="field">
<label>Email</label>
<input type="email" required value={form.email}
onChange={(e) => setForm({ ...form, email: e.target.value })} />
</div>
<div className="field">
<label>How can you help?</label>
<div className="vol-tags">
{ROLES.map((r) => (
<span key={r}
className={`vol-tag ${roles.has(r) ? "active" : ""}`}
onClick={() => toggleRole(r)}>{r}</span>
))}
</div>
</div>
<div className="field">
<label>Availability</label>
<select value={form.availability}
onChange={(e) => setForm({ ...form, availability: e.target.value })}>
<option>Weekday mornings</option>
<option>Weekday afternoons</option>
<option>Evenings</option>
<option>Weekends</option>
<option>Flexible / on-call</option>
</select>
</div>
<div className="field">
<label>Anything we should know? (optional)</label>
<textarea value={form.note}
onChange={(e) => setForm({ ...form, note: e.target.value })} />
</div>
<button type="submit" className="btn btn-primary" style={{ width: "100%" }}>
Sign me up
</button>
</>
)}
</form>
</div>
</div>
</section>
);
}
// ── DONATE MODAL ─────────────────────────────────────────────────────────
function DonateModal({ open, onClose }) {
const [amount, setAmount] = useState(50);
const [custom, setCustom] = useState("");
const [freq, setFreq] = useState("once");
const [submitted, setSubmitted] = useState(false);
useEffect(() => {
if (!open) {
setTimeout(() => setSubmitted(false), 300);
}
}, [open]);
useEffect(() => {
const onKey = (e) => { if (e.key === "Escape" && open) onClose(); };
window.addEventListener("keydown", onKey);
return () => window.removeEventListener("keydown", onKey);
}, [open, onClose]);
const tiers = [
{ v: 25, l: "1 family fed" },
{ v: 50, l: "2 families" },
{ v: 100, l: "5 families" },
{ v: 250, l: "Tornado kit" },
{ v: 500, l: "Holiday meals" },
];
const finalAmt = custom ? Number(custom) : amount;
const boxes = Math.max(1, Math.round(finalAmt / 22));
const submit = (e) => {
e.preventDefault();
setSubmitted(true);
};
return (
<div className={`modal-back ${open ? "open" : ""}`} onClick={onClose}>
<div className="modal" onClick={(e) => e.stopPropagation()}>
<button className="modal-close" onClick={onClose} aria-label="Close">×</button>
{submitted ? (
<div className="success" style={{ padding: "24px 0 8px" }}>
<div className="success-mark">♡</div>
<h3>Thank you.</h3>
<p>
Your <strong>${finalAmt}</strong> {freq === "monthly" ? "monthly gift" : "gift"} will
feed roughly <strong>{boxes * (freq === "monthly" ? 12 : 1)} families</strong> {freq === "monthly" ? "this year" : "this month"}.
</p>
<button className="btn btn-ghost" style={{ marginTop: 24 }} onClick={onClose}>
Close
</button>
</div>
) : (
<form onSubmit={submit}>
<h3>Help us <em>keep the door open.</em></h3>
<p className="sub">
Every dollar puts food on a Marshall County table. We're a small all-volunteer
non-profit — no salaries, no overhead.
</p>
<div className="freq" role="tablist">
<button type="button"
className={freq === "once" ? "active" : ""}
onClick={() => setFreq("once")}>One-time</button>
<button type="button"
className={freq === "monthly" ? "active" : ""}
onClick={() => setFreq("monthly")}>Monthly</button>
</div>
<div className="amt-grid">
{tiers.map((t) => (
<button type="button" key={t.v}
className={`amt ${!custom && amount === t.v ? "active" : ""}`}
onClick={() => { setAmount(t.v); setCustom(""); }}>
${t.v}
<small>{t.l}</small>
</button>
))}
<button type="button"
className={`amt ${custom ? "active" : ""}`}
onClick={() => { const v = prompt("Custom amount in $:", custom || ""); if (v) setCustom(v.replace(/[^0-9]/g,"")); }}>
Other
<small>{custom ? `$${custom}` : "any amount"}</small>
</button>
</div>
<div className="donate-impact">
<strong>${finalAmt}{freq === "monthly" ? "/mo" : ""}</strong> covers about{" "}
<strong>{boxes} food box{boxes === 1 ? "" : "es"}</strong> — enough for
roughly {boxes} households for a week.
</div>
<button type="submit" className="btn btn-donate" style={{ width: "100%", marginTop: 20 }}>
Give ${finalAmt}{freq === "monthly" ? " every month" : ""}
</button>
<p style={{ textAlign: "center", margin: "14px 0 0", fontSize: 12, color: "var(--ink-3)" }}>
501(c)(3) tax-deductible · Secure payment processing
</p>
</form>
)}
</div>
</div>
);
}
// ── FOOTER ───────────────────────────────────────────────────────────────
function Footer({ onDonate }) {
return (
<footer id="contact" data-screen-label="Footer">
<div className="wrap">
<div className="foot-grid">
<div>
<p className="foot-tag">
<em>Hope</em> shows up with a box of food, every week, year-round, in Marshall County.
</p>
<button className="btn btn-donate btn-sm" onClick={onDonate}>Donate today</button>
</div>
<div>
<h4>Visit</h4>
<ul>
<li>Madill, OK</li>
<li>Tue & Thu · 9–12</li>
<li>(256) 555-0123</li>
<li>hello@hfmc.org</li>
</ul>
</div>
<div>
<h4>Programs</h4>
<ul>
<li><a href="#programs">The Pantry</a></li>
<li><a href="#programs">Holiday Meals</a></li>
<li><a href="#programs">Backpack Buddies</a></li>
<li><a href="#programs">Disaster Response</a></li>
</ul>
</div>
<div>
<h4>Get Involved</h4>
<ul>
<li><a href="#volunteer">Volunteer</a></li>
<li><a href="#" onClick={(e) => { e.preventDefault(); onDonate(); }}>Donate</a></li>
<li><a href="https://www.facebook.com/HFMCfoodpantry/" target="_blank" rel="noreferrer">Facebook</a></li>
<li><a href="#">Partner with us</a></li>
</ul>
</div>
</div>
<div className="foot-bottom">
<span>© 2026 Hope For Marshall County · 501(c)(3)</span>
<span>Site by <a href="https://warcooptech.com">WarCoop</a></span>
</div>
</div>
</footer>
);
}
// ── APP ──────────────────────────────────────────────────────────────────
function App() {
const [t, setTweak] = useTweaks(TWEAK_DEFAULTS);
const [donateOpen, setDonateOpen] = useState(false);
useEffect(() => {
document.documentElement.style.setProperty("--font-display", `"${t.displayFont}", Georgia, serif`);
document.documentElement.style.setProperty("--font-body", `"${t.bodyFont}", ui-sans-serif, system-ui, sans-serif`);
document.documentElement.style.fontSize = `${Math.round(16 * t.scale)}px`;
}, [t.displayFont, t.bodyFont, t.scale]);
return (
<>
<Nav onDonate={() => setDonateOpen(true)} />
<Hero onDonate={() => setDonateOpen(true)} />
<Marquee />
<Impact />
<Programs />
<GetHelp />
<Volunteer />
<Footer onDonate={() => setDonateOpen(true)} />
<button
className="btn btn-donate sticky-donate"
onClick={() => setDonateOpen(true)}
aria-label="Donate"
>
♡ Donate
</button>
<DonateModal open={donateOpen} onClose={() => setDonateOpen(false)} />
<TweaksPanel>
<TweakSection label="Typography" />
<TweakSelect
label="Display"
value={t.displayFont}
options={DISPLAY_FONTS}
onChange={(v) => setTweak("displayFont", v)}
/>
<TweakSelect
label="Body"
value={t.bodyFont}
options={BODY_FONTS}
onChange={(v) => setTweak("bodyFont", v)}
/>
<TweakSlider
label="Scale"
value={t.scale}
min={0.9}
max={1.15}
step={0.025}
onChange={(v) => setTweak("scale", v)}
/>
</TweaksPanel>
</>
);
}
ReactDOM.createRoot(document.getElementById("root")).render(<App />);