CodeAntidote commited on
Commit
879b520
·
verified ·
1 Parent(s): aa77f73

Upgrade UI and conversational opener generation

Browse files
Files changed (1) hide show
  1. index.html +538 -61
index.html CHANGED
@@ -1,70 +1,547 @@
1
  <!doctype html>
2
  <html lang="en">
3
  <head>
4
- <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
5
- <title>FaithMatch Copilot</title>
 
 
 
6
  <style>
7
- :root{font-family:Inter,system-ui,sans-serif;color:#26342d;background:#f4f1ed}
8
- *{box-sizing:border-box} body{margin:0}.wrap{max-width:980px;margin:auto;padding:34px 20px}
9
- .hero{background:#496556;color:white;padding:28px;border-radius:24px}.hero h1{margin:0 0 8px;font-size:34px}
10
- .card{background:white;margin-top:18px;padding:22px;border-radius:20px;box-shadow:0 6px 22px #0000000d}
11
- textarea{width:100%;min-height:220px;border:1px solid #d8d8d2;border-radius:14px;padding:14px;font-size:15px;resize:vertical}
12
- button,select{border:0;border-radius:12px;padding:12px 16px;font-size:15px}
13
- button{background:#496556;color:white;font-weight:700;cursor:pointer}button.secondary{background:#eeeae5;color:#26342d}
14
- .row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.result{white-space:pre-wrap;background:#f7f5f2;padding:16px;border-radius:14px;min-height:80px}
15
- .small{font-size:13px;color:#6b746f}.chips span{display:inline-block;background:#edf2ee;padding:7px 10px;border-radius:99px;margin:4px 4px 0 0}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  </style>
17
  </head>
18
- <body><div class="wrap">
19
- <div class="hero"><h1>FaithMatch Copilot</h1><div>Free local-first opener assistant. You choose what to send.</div></div>
20
- <div class="card"><h2>1. Paste profile text</h2><textarea id="profile" placeholder="Paste the About Me, interests, qualities and other visible profile text here..."></textarea></div>
21
- <div class="card"><h2>2. Choose style</h2><div class="row">
22
- <select id="style"><option value="natural">Natural</option><option value="playful">Playful</option><option value="faith">Faith & values</option></select>
23
- <button onclick="analyze()">Generate opener</button></div></div>
24
- <div class="card"><h2>Profile signals</h2><div id="signals" class="chips"></div></div>
25
- <div class="card"><h2>Suggested opener</h2><div id="result" class="result">Your message will appear here.</div>
26
- <div class="row" style="margin-top:12px"><button onclick="copyMsg()">Copy message</button><button class="secondary" onclick="analyze(true)">Try another</button><span id="count" class="small"></span></div></div>
27
- <div class="card small">This free version runs entirely in your browser and does not request dating-site credentials. It does not send messages automatically.</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  <script>
30
- const hooks=[
31
- ["children",["children","kids","child","teacher","teaching"],"working with children"],
32
- ["music",["music","concert","concerts","singing","songs"],"music and concerts"],
33
- ["travel",["travel","traveling","travelling","places","adventure"],"travel and new experiences"],
34
- ["faith",["jesus","christ","christian","church","faith","god"],"faith"],
35
- ["family",["family","family-oriented","family oriented"],"family"],
36
- ["communication",["communication","honesty","consistent","consistency"],"honesty and communication"],
37
- ["outdoors",["hiking","outdoors","camping","nature"],"the outdoors"],
38
- ["food",["food","cooking","restaurant","coffee"],"food and trying new places"],
39
- ["animals",["dog","dogs","cat","cats","animals","horse","horses"],"animals"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  ];
41
- let variant=0;
42
- function scan(t){t=t.toLowerCase();return hooks.filter(h=>h[1].some(k=>t.includes(k))).map(h=>h[2]);}
43
- function nameFrom(t){let m=t.match(/^\s*([A-ZÀ-ÖØ-Þ][A-Za-zÀ-ÿ'’-]{1,20})(?:\s*,?\s*\d{2})?/m);return m?m[1]:"there";}
44
- function analyze(again=false){
45
- const t=document.getElementById("profile").value.trim(); if(!t){alert("Paste profile text first.");return}
46
- if(again) variant++;
47
- const sig=scan(t), name=nameFrom(t), style=document.getElementById("style").value;
48
- document.getElementById("signals").innerHTML=(sig.length?sig:["substantive profile"]).slice(0,6).map(x=>`<span>✓ ${x}</span>`).join("");
49
- const a=sig[0]||"what you shared in your profile", b=sig[1];
50
- let msgs=[];
51
- if(style==="faith") msgs=[
52
- `Hey ${name}! I liked what you shared about ${a}${b?` and ${b}`:""}. Faith is important to me too, and I appreciate profiles that say something meaningful. What has been most important to you in your faith lately?`,
53
- `Hey ${name}! Your profile caught my attention, especially the part about ${a}. I’m involved in my church community too. What’s something you really enjoy doing outside of your usual week?`
54
- ];
55
- else if(style==="playful") msgs=[
56
- `Hey ${name}! ${a.charAt(0).toUpperCase()+a.slice(1)} caught my attention${b?`, and ${b} definitely gave me another reason to say hi`:""}. What’s one thing you could happily talk about way too long?`,
57
- `Hey ${name}! You gave me an easy conversation starter with ${a}. I have to ask—what’s your current favorite thing about it?`
58
- ];
59
- else msgs=[
60
- `Hey ${name}! I liked what you shared about ${a}${b?` and ${b}`:""}. It felt genuine, so I wanted to say hi. What’s something you’ve been enjoying lately?`,
61
- `Hey ${name}! The part about ${a} caught my attention. I appreciate someone who puts some thought into their profile. What got you interested in it?`
62
- ];
63
- let msg=msgs[variant%msgs.length];
64
- if(/profile is (ran|run|managed) by (her|his|their) sister/i.test(t)) msg=`Hey ${name}! I read the note that your sister is helping with the profile, and I appreciated the honesty. The part about ${a} caught my attention too. What’s something you personally enjoy doing when you have a free weekend?`;
65
- if(msg.length>400) msg=msg.slice(0,397)+"...";
66
- document.getElementById("result").textContent=msg;
67
- document.getElementById("count").textContent=`${msg.length} / 400 characters`;
68
- }
69
- async function copyMsg(){await navigator.clipboard.writeText(document.getElementById("result").textContent);document.getElementById("count").textContent+=" • Copied";}
70
- </script></body></html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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">
6
+
7
+ <title>SparkScript - AI Dating Opener</title>
8
+
9
  <style>
10
+ :root{
11
+ font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
12
+ color:#26342d;
13
+ background:#f5f1ed;
14
+ }
15
+
16
+ *{box-sizing:border-box}
17
+
18
+ body{
19
+ margin:0;
20
+ background:
21
+ radial-gradient(circle at top right,#f3ddd7 0,transparent 35%),
22
+ #f5f1ed;
23
+ }
24
+
25
+ .wrap{
26
+ max-width:980px;
27
+ margin:auto;
28
+ padding:36px 20px 70px;
29
+ }
30
+
31
+ .hero{
32
+ background:linear-gradient(135deg,#496556,#607d6d);
33
+ color:white;
34
+ padding:34px;
35
+ border-radius:26px;
36
+ box-shadow:0 14px 35px rgba(0,0,0,.08);
37
+ }
38
+
39
+ .brand{
40
+ font-size:14px;
41
+ opacity:.8;
42
+ margin-bottom:5px;
43
+ }
44
+
45
+ .hero h1{
46
+ margin:0;
47
+ font-size:38px;
48
+ }
49
+
50
+ .hero p{
51
+ margin:9px 0 0;
52
+ font-size:17px;
53
+ opacity:.92;
54
+ }
55
+
56
+ .card{
57
+ background:white;
58
+ margin-top:18px;
59
+ padding:24px;
60
+ border-radius:21px;
61
+ box-shadow:0 7px 24px rgba(0,0,0,.045);
62
+ }
63
+
64
+ h2{
65
+ margin-top:0;
66
+ margin-bottom:14px;
67
+ }
68
+
69
+ textarea{
70
+ width:100%;
71
+ min-height:220px;
72
+ border:1px solid #ddd8d2;
73
+ border-radius:15px;
74
+ padding:16px;
75
+ font-size:15px;
76
+ line-height:1.5;
77
+ resize:vertical;
78
+ outline:none;
79
+ }
80
+
81
+ textarea:focus{
82
+ border-color:#607d6d;
83
+ }
84
+
85
+ .row{
86
+ display:flex;
87
+ gap:10px;
88
+ flex-wrap:wrap;
89
+ align-items:center;
90
+ }
91
+
92
+ select,
93
+ button{
94
+ border:0;
95
+ border-radius:12px;
96
+ padding:12px 17px;
97
+ font-size:15px;
98
+ }
99
+
100
+ select{
101
+ background:#f4f1ed;
102
+ }
103
+
104
+ button{
105
+ background:#496556;
106
+ color:white;
107
+ font-weight:700;
108
+ cursor:pointer;
109
+ }
110
+
111
+ button:hover{
112
+ opacity:.92;
113
+ }
114
+
115
+ button.secondary{
116
+ background:#eeeae5;
117
+ color:#26342d;
118
+ }
119
+
120
+ .chips span{
121
+ display:inline-block;
122
+ background:#edf2ee;
123
+ padding:8px 11px;
124
+ border-radius:999px;
125
+ margin:4px 5px 3px 0;
126
+ font-size:14px;
127
+ }
128
+
129
+ .result{
130
+ white-space:pre-wrap;
131
+ background:#f8f6f3;
132
+ border:1px solid #ebe6df;
133
+ padding:18px;
134
+ border-radius:15px;
135
+ min-height:110px;
136
+ font-size:16px;
137
+ line-height:1.55;
138
+ }
139
+
140
+ .counter{
141
+ font-size:13px;
142
+ color:#69736d;
143
+ margin-left:auto;
144
+ }
145
+
146
+ .tip{
147
+ color:#6b746f;
148
+ font-size:13px;
149
+ line-height:1.5;
150
+ }
151
+
152
+ .badge{
153
+ display:inline-block;
154
+ background:#ffffff22;
155
+ padding:6px 10px;
156
+ border-radius:999px;
157
+ margin-top:15px;
158
+ font-size:13px;
159
+ }
160
  </style>
161
  </head>
162
+
163
+ <body>
164
+
165
+ <div class="wrap">
166
+
167
+ <div class="hero">
168
+
169
+ <div class="brand">AI DATING OPENER</div>
170
+
171
+ <h1>✨ SparkScript</h1>
172
+
173
+ <p>
174
+ Turn something from their profile into a conversation
175
+ that actually sounds like you.
176
+ </p>
177
+
178
+ <div class="badge">
179
+ Free • Local-first • You decide what gets sent
180
+ </div>
181
+
182
+ </div>
183
+
184
+
185
+ <div class="card">
186
+
187
+ <h2>1. Drop in the profile</h2>
188
+
189
+ <textarea
190
+ id="profile"
191
+ placeholder="Paste their About Me, interests, qualities, faith, hobbies or other profile text here..."
192
+ ></textarea>
193
+
194
+ </div>
195
+
196
+
197
+ <div class="card">
198
+
199
+ <h2>2. Pick your vibe</h2>
200
+
201
+ <div class="row">
202
+
203
+ <select id="style">
204
+ <option value="natural">🙂 Natural & Catchy</option>
205
+ <option value="playful">😄 Playful</option>
206
+ <option value="faith">🙏 Faith & Values</option>
207
+ </select>
208
+
209
+ <button onclick="generateMessage()">
210
+ ✨ Write My Opener
211
+ </button>
212
+
213
+ </div>
214
+
215
+ </div>
216
+
217
+
218
+ <div class="card">
219
+
220
+ <h2>What caught our attention</h2>
221
+
222
+ <div id="signals" class="chips">
223
+
224
+ <span>Waiting for profile...</span>
225
+
226
  </div>
227
+
228
+ </div>
229
+
230
+
231
+ <div class="card">
232
+
233
+ <h2>Your opener</h2>
234
+
235
+ <div id="result" class="result">
236
+ Your message will appear here.
237
+ </div>
238
+
239
+ <div class="row" style="margin-top:14px">
240
+
241
+ <button onclick="copyMessage()">
242
+ 📋 Copy
243
+ </button>
244
+
245
+ <button class="secondary" onclick="anotherMessage()">
246
+ ↻ Try Another
247
+ </button>
248
+
249
+ <span id="counter" class="counter">
250
+ 0 / 399
251
+ </span>
252
+
253
+ </div>
254
+
255
+ </div>
256
+
257
+
258
+ <div class="card tip">
259
+
260
+ <strong>How SparkScript works</strong><br><br>
261
+
262
+ SparkScript looks for genuine conversation hooks in the
263
+ profile and turns them into a casual opener.
264
+
265
+ It doesn't send anything automatically. Read the suggestion,
266
+ change anything you want, copy it and decide whether you
267
+ want to send it.
268
+
269
+ </div>
270
+
271
+ </div>
272
+
273
+
274
  <script>
275
+
276
+ let variant = 0;
277
+
278
+ const hooks = [
279
+
280
+ {
281
+ words:["children","kids","child","teacher","teaching"],
282
+ label:"Working with children"
283
+ },
284
+
285
+ {
286
+ words:["concert","concerts","music","songs","singing"],
287
+ label:"Music & concerts"
288
+ },
289
+
290
+ {
291
+ words:["travel","traveling","travelling","adventure","new places"],
292
+ label:"Travel & experiences"
293
+ },
294
+
295
+ {
296
+ words:["jesus","christ","christian","church","faith","god"],
297
+ label:"Faith"
298
+ },
299
+
300
+ {
301
+ words:["family","family oriented","family-oriented"],
302
+ label:"Family"
303
+ },
304
+
305
+ {
306
+ words:["honesty","communication","consistency","consistent"],
307
+ label:"Communication & honesty"
308
+ },
309
+
310
+ {
311
+ words:["hiking","outdoors","nature","camping"],
312
+ label:"Outdoors"
313
+ },
314
+
315
+ {
316
+ words:["coffee","food","cooking","restaurants"],
317
+ label:"Food & coffee"
318
+ },
319
+
320
+ {
321
+ words:["dog","dogs","cat","cats","animals","horse","horses"],
322
+ label:"Animals"
323
+ }
324
+
325
+ ];
326
+
327
+
328
+ function findSignals(text){
329
+
330
+ const lower=text.toLowerCase();
331
+
332
+ return hooks
333
+ .filter(h=>h.words.some(w=>lower.includes(w)))
334
+ .map(h=>h.label);
335
+
336
+ }
337
+
338
+
339
+ function findName(text){
340
+
341
+ const lines=text.split("\n");
342
+
343
+ for(const line of lines){
344
+
345
+ const cleaned=line.trim();
346
+
347
+ const match=cleaned.match(
348
+ /^([A-ZÀ-ÖØ-Þ][A-Za-zÀ-ÿ'’.-]{1,25})(?:\s*,?\s*\d{2})?$/
349
+ );
350
+
351
+ if(match){
352
+ return match[1];
353
+ }
354
+
355
+ }
356
+
357
+ return "";
358
+
359
+ }
360
+
361
+
362
+ function createNatural(name,a,b){
363
+
364
+ const greeting=name ? `Hey ${name}!` : "Hey!";
365
+
366
+ const options=[
367
+
368
+ `${greeting} I actually enjoyed reading your profile. The part about ${a.toLowerCase()}${b ? ` and ${b.toLowerCase()}` : ""} caught my attention. You seem like someone who'd be fun to actually talk to, so I figured I'd say hi instead of just leaving a like. What's something you've been really enjoying lately?`,
369
+
370
+ `${greeting} Your profile actually gave me something better to say than the usual “hey, how are you?” 😄 I noticed the part about ${a.toLowerCase()}${b ? ` and ${b.toLowerCase()}` : ""}. So I'll start with something real—what's something you could happily talk about for way too long?`,
371
+
372
+ `${greeting} Something about what you wrote about ${a.toLowerCase()} caught my attention. I like when a profile gives you an actual glimpse of someone's personality instead of three random answers 😂 What's something about you that probably doesn't come across very well on a dating profile?`
373
+
374
+ ];
375
+
376
+ return options[variant % options.length];
377
+
378
+ }
379
+
380
+
381
+ function createPlayful(name,a,b){
382
+
383
+ const greeting=name ? `Hey ${name}!` : "Hey!";
384
+
385
+ const options=[
386
+
387
+ `${greeting} Okay, your profile actually made me stop scrolling 😄 The part about ${a.toLowerCase()}${b ? ` plus ${b.toLowerCase()}` : ""} caught my attention. I'm skipping the boring interview questions though—if you suddenly had a completely free Saturday with zero responsibilities, what are we most likely finding you doing?`,
388
+
389
+ `${greeting} I was going to come up with an unnecessarily clever opening line, but your profile gave me an easier option 😂 You mentioned ${a.toLowerCase()}, so now I'm curious—what's something you're into right now that you could probably convince someone else to try?`,
390
+
391
+ `${greeting} You actually gave me enough in your profile to avoid sending the world's most boring “hey” 😄 I noticed ${a.toLowerCase()}. So here's my slightly better question: what's something you've done once and immediately thought, “yeah, I'm definitely doing that again”?`
392
+
393
  ];
394
+
395
+ return options[variant % options.length];
396
+
397
+ }
398
+
399
+
400
+ function createFaith(name,a){
401
+
402
+ const greeting=name ? `Hey ${name}!` : "Hey!";
403
+
404
+ const options=[
405
+
406
+ `${greeting} I liked reading your profile, especially what you shared about ${a.toLowerCase()}. Faith is important in my life too, and I appreciate when someone can talk about what matters to them without making it feel forced. Outside of the normal Sunday answer 😄 what's something that's really strengthened your faith?`,
407
+
408
+ `${greeting} Your profile caught my attention, especially the part about ${a.toLowerCase()}. I'm involved in my church community too, so I figured I'd actually say hi instead of quietly leaving a like 😄 What part of your faith or church life do you genuinely enjoy the most?`,
409
+
410
+ `${greeting} I liked that your profile actually says something about what matters to you. The part about ${a.toLowerCase()} stood out to me because faith is a big part of my life too. I'm curious—what's one thing you've learned through your faith that has genuinely changed how you look at life?`
411
+
412
+ ];
413
+
414
+ return options[variant % options.length];
415
+
416
+ }
417
+
418
+
419
+ function sisterProfile(name,a){
420
+
421
+ const greeting=name ? `Hey ${name}!` : "Hey!";
422
+
423
+ return `${greeting} I noticed the part about your sister helping with your profile and honestly that made me smile 😄 definitely not something you see every day. I also noticed ${a.toLowerCase()}, which gave me another reason to say hi. Since she handled the introduction, I'll let you handle this part 😂 what's something about you she probably forgot to mention?`;
424
+
425
+ }
426
+
427
+
428
+ function generateMessage(){
429
+
430
+ const text=document
431
+ .getElementById("profile")
432
+ .value
433
+ .trim();
434
+
435
+ if(!text){
436
+
437
+ alert("Paste the profile text first.");
438
+
439
+ return;
440
+
441
+ }
442
+
443
+ const signals=findSignals(text);
444
+
445
+ const name=findName(text);
446
+
447
+ const a=signals[0] || "what you wrote in your profile";
448
+
449
+ const b=signals[1] || "";
450
+
451
+ const style=document
452
+ .getElementById("style")
453
+ .value;
454
+
455
+
456
+ document.getElementById("signals").innerHTML=
457
+
458
+ (signals.length ? signals : ["Thoughtful profile"])
459
+
460
+ .slice(0,6)
461
+
462
+ .map(x=>`<span>✓ ${x}</span>`)
463
+
464
+ .join("");
465
+
466
+
467
+ let message;
468
+
469
+
470
+ if(
471
+ /profile is (ran|run|managed) by (her|his|their) sister/i
472
+ .test(text)
473
+ ){
474
+
475
+ message=sisterProfile(name,a);
476
+
477
+ }
478
+
479
+ else if(style==="playful"){
480
+
481
+ message=createPlayful(name,a,b);
482
+
483
+ }
484
+
485
+ else if(style==="faith"){
486
+
487
+ message=createFaith(
488
+ name,
489
+ signals.includes("Faith") ? "your faith" : a
490
+ );
491
+
492
+ }
493
+
494
+ else{
495
+
496
+ message=createNatural(name,a,b);
497
+
498
+ }
499
+
500
+
501
+ /* Absolute Christian Mingle limit */
502
+
503
+ if(message.length>399){
504
+
505
+ message=message.substring(0,396).trim()+"...";
506
+
507
+ }
508
+
509
+
510
+ document
511
+ .getElementById("result")
512
+ .textContent=message;
513
+
514
+
515
+ document
516
+ .getElementById("counter")
517
+ .textContent=
518
+ message.length+" / 399";
519
+
520
+ }
521
+
522
+
523
+ function anotherMessage(){
524
+
525
+ variant++;
526
+
527
+ generateMessage();
528
+
529
+ }
530
+
531
+
532
+ async function copyMessage(){
533
+
534
+ const message=
535
+ document.getElementById("result").textContent;
536
+
537
+ await navigator.clipboard.writeText(message);
538
+
539
+ document.getElementById("counter").textContent =
540
+ message.length+" / 399 • Copied ✓";
541
+
542
+ }
543
+
544
+ </script>
545
+
546
+ </body>
547
+ </html>