-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1481 lines (1290 loc) · 56.5 KB
/
index.html
File metadata and controls
1481 lines (1290 loc) · 56.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
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Making with Tink ✨</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: #333;
line-height: 1.6;
overflow-x: hidden;
}
.navbar {
position: fixed;
top: 0;
width: 100%;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
padding: 1rem 0;
z-index: 1000;
box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}
.nav-container {
max-width: 1200px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 2rem;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: #667eea;
text-decoration: none;
}
.nav-links {
display: flex;
list-style: none;
gap: 2rem;
}
.nav-links a {
text-decoration: none;
color: #333;
font-weight: 500;
transition: color 0.3s ease;
}
.nav-links a:hover {
color: #667eea;
}
.mobile-menu {
display: none;
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 2rem;
}
.section {
min-height: 100vh;
padding: 6rem 0;
display: flex;
align-items: center;
}
.hero {
text-align: center;
color: white;
}
.hero h1 {
font-size: 3.5rem;
margin-bottom: 1rem;
animation: float 3s ease-in-out infinite;
}
.hero p {
font-size: 1.3rem;
margin-bottom: 2rem;
opacity: 0.9;
}
.fairy-icon {
font-size: 4rem;
margin-bottom: 1rem;
animation: sparkle 2s ease-in-out infinite alternate;
}
@keyframes float {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-10px); }
}
@keyframes sparkle {
0% { opacity: 0.7; transform: scale(1); }
100% { opacity: 1; transform: scale(1.1); }
}
.cta-button {
display: inline-block;
padding: 1rem 2rem;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
color: white;
text-decoration: none;
border-radius: 50px;
border: 2px solid rgba(255, 255, 255, 0.3);
font-weight: 600;
transition: all 0.3s ease;
}
.cta-button:hover {
background: rgba(255, 255, 255, 0.3);
transform: translateY(-2px);
box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.content-section {
background: white;
border-radius: 20px;
padding: 3rem;
margin: 2rem auto;
box-shadow: 0 10px 40px rgba(0,0,0,0.1);
max-width: 800px;
}
.section-title {
font-size: 2.5rem;
margin-bottom: 2rem;
color: #667eea;
text-align: center;
}
.gallery-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 2rem;
margin: 2rem 0;
}
.project-card {
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
border-radius: 15px;
padding: 2rem;
text-align: center;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
transform: translateY(-5px);
box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}
.project-icon {
font-size: 3rem;
margin-bottom: 1rem;
}
.project-card h3 {
color: #333;
margin-bottom: 1rem;
}
.chat-container {
background: transparent;
border-radius: 20px;
padding: 0;
box-shadow: none;
max-width: 100%;
margin: 0;
}
.chat-header {
text-align: center;
margin-bottom: 2rem;
}
.chat-messages {
height: 400px;
overflow-y: auto;
border: 1px solid #e1e5e9;
border-radius: 15px;
padding: 1rem;
margin-bottom: 1rem;
background: #f8f9fa;
}
.message {
margin: 1rem 0;
padding: 1rem;
border-radius: 15px;
max-width: 80%;
}
.user-message {
background: #667eea;
color: white;
margin-left: auto;
}
.tink-message {
background: #e9ecef;
color: #333;
margin-right: auto;
}
.chat-input-container {
display: flex;
gap: 1rem;
align-items: center;
}
.image-upload-button {
background: #f8f9fa;
border: 2px solid #e1e5e9;
border-radius: 50%;
width: 50px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 1.2rem;
transition: all 0.3s ease;
flex-shrink: 0;
}
.image-upload-button:hover {
background: #667eea;
color: white;
border-color: #667eea;
}
.image-preview {
margin-top: 1rem;
position: relative;
display: inline-block;
}
.image-preview img {
max-width: 200px;
max-height: 150px;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.remove-image {
position: absolute;
top: -8px;
right: -8px;
background: #ff4757;
color: white;
border: none;
border-radius: 50%;
width: 24px;
height: 24px;
font-size: 12px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.message img {
max-width: 100%;
border-radius: 10px;
margin: 0.5rem 0;
}
.chat-input {
flex: 1;
padding: 1rem;
border: 2px solid #e1e5e9;
border-radius: 25px;
font-size: 1rem;
outline: none;
transition: border-color 0.3s ease;
}
.chat-input:focus {
border-color: #667eea;
}
.send-button {
padding: 1rem 2rem;
background: #667eea;
color: white;
border: none;
border-radius: 25px;
cursor: pointer;
font-weight: 600;
transition: background 0.3s ease;
}
.send-button:hover {
background: #5a6fd8;
}
.contact-form {
max-width: 600px;
margin: 0 auto;
}
.form-group {
margin-bottom: 1.5rem;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
color: #333;
font-weight: 500;
}
.form-group input,
.form-group textarea {
width: 100%;
padding: 1rem;
border: 2px solid #e1e5e9;
border-radius: 10px;
font-size: 1rem;
transition: border-color 0.3s ease;
}
.form-group input:focus,
.form-group textarea:focus {
outline: none;
border-color: #667eea;
}
.submit-button {
width: 100%;
padding: 1rem;
background: #667eea;
color: white;
border: none;
border-radius: 10px;
font-size: 1.1rem;
font-weight: 600;
cursor: pointer;
transition: background 0.3s ease;
}
.submit-button:hover {
background: #5a6fd8;
}
.footer {
background: #333;
color: white;
text-align: center;
padding: 2rem 0;
}
.thinking-process {
background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
border-radius: 15px;
padding: 2rem;
margin: 2rem 0;
transition: all 0.3s ease;
overflow: hidden;
}
.design-thinking-toggle {
text-align: center;
margin: 2rem 0 1rem 0;
}
.toggle-button {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
padding: 1rem 2rem;
border-radius: 25px;
font-size: 1.1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
.toggle-button:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
#toggleIcon {
display: inline-block;
transition: transform 0.3s ease;
margin-left: 0.5rem;
}
.rotated {
transform: rotate(180deg);
}
.project-share-form {
background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
border-radius: 15px;
padding: 2rem;
margin: 1rem 0;
border: 2px solid #f0ad4e;
box-shadow: 0 4px 15px rgba(240, 173, 78, 0.3);
}
.project-share-button {
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
color: white;
border: none;
padding: 0.8rem 1.5rem;
border-radius: 25px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
margin: 0.5rem 0;
}
.project-share-button:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}
.project-form-group {
margin-bottom: 1.5rem;
}
.project-form-group label {
display: block;
margin-bottom: 0.5rem;
color: #8b4513;
font-weight: 600;
}
.project-form-group input,
.project-form-group textarea {
width: 100%;
padding: 0.8rem;
border: 2px solid #deb887;
border-radius: 10px;
font-size: 1rem;
background: rgba(255, 255, 255, 0.9);
}
.project-form-group input:focus,
.project-form-group textarea:focus {
outline: none;
border-color: #ff6b6b;
}
.project-image-upload {
border: 2px dashed #deb887;
border-radius: 10px;
padding: 2rem;
text-align: center;
cursor: pointer;
transition: all 0.3s ease;
background: rgba(255, 255, 255, 0.5);
}
.project-image-upload:hover {
border-color: #ff6b6b;
background: rgba(255, 255, 255, 0.8);
}
.project-image-preview {
margin-top: 1rem;
text-align: center;
}
.project-image-preview img {
max-width: 200px;
max-height: 150px;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.community-project {
border: 2px solid #667eea;
background: linear-gradient(135deg, #f0f4ff 0%, #e6eeff 100%);
}
.community-project .project-icon {
color: #667eea;
}
.user-projects-header {
grid-column: 1 / -1;
text-align: center;
margin-bottom: 2rem;
}
.project-image img {
transition: transform 0.3s ease;
}
.project-image img:hover {
transform: scale(1.05);
}
.project-date {
font-size: 0.8rem;
color: #666;
margin-top: 0.5rem;
}
.step-icon {
font-size: 2rem;
margin-right: 1rem;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.mobile-menu {
display: block;
}
.hero h1 {
font-size: 2.5rem;
}
.hero p {
font-size: 1.1rem;
}
.content-section {
padding: 1.5rem 1rem !important; /* Reduced from 2rem */
margin: 1rem 0.5rem !important; /* Reduced horizontal margin */
}
.section-title {
font-size: 2rem;
}
.gallery-grid {
grid-template-columns: 1fr;
}
.container { padding: 0 0.5rem !important; /* Reduced from 1rem */ }
/* Chat mobile fixes */
.chat-input-container {
gap: 0.4rem !important; /* Reduced from 0.5rem */
padding: 0 0.25rem !important; /* Reduced from 0.5rem */
width: 100%;
box-sizing: border-box;
}
.image-upload-button {
width: 38px !important; /* Reduced from 40px */
height: 38px !important;
font-size: 0.9rem !important;
flex-shrink: 0;
}
.chat-input {
padding: 0.7rem !important; /* Reduced from 0.75rem */
font-size: 0.9rem;
min-width: 0;
flex: 1;
}
.send-button {
padding: 0.7rem 0.9rem !important; /* Reduced from 0.75rem 1rem */
font-size: 0.9rem;
flex-shrink: 0;
}
.chat-messages {
padding: 0.75rem;
box-sizing: border-box;
}
.message {
max-width: 85%;
padding: 0.75rem;
word-wrap: break-word;
overflow-wrap: break-word;
}
}
@media (max-width: 480px) {
.content-section {
padding: 1rem 0.5rem !important;
margin: 0.5rem 0.25rem !important;
}
.chat-input-container {
gap: 0.25rem !important;
padding: 0 0.125rem !important;
}
.image-upload-button {
width: 35px !important;
height: 35px !important;
}
.send-button {
padding: 0.6rem 0.8rem !important;
font-size: 0.85rem;
}
}
</style>
</head>
<body>
<nav class="navbar">
<div class="nav-container">
<a href="#home" class="logo">✨ Making with Tink</a>
<ul class="nav-links">
<li><a href="#home">Home</a></li>
<li><a href="#chat">Chat with Tink</a></li>
<li><a href="#gallery">Gallery</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
<button class="mobile-menu">☰</button>
</div>
</nav>
<section id="home" class="section hero">
<div class="container">
<div class="fairy-icon">🧚♀️</div>
<h1>Making with Tink</h1>
<p>Your friendly maker fairy is here to help you bring ideas to life!</p>
<p>From dreams to prototypes, let's design thinking together ✨</p>
<a href="#chat" class="cta-button">Start Creating</a>
</div>
</section>
<section id="chat" class="section">
<div class="container">
<div class="content-section">
<h2 class="section-title">Chat with Tink 💭</h2>
<div class="chat-container">
<div class="chat-header">
<h3>Ready to start your making journey? 🚀</h3>
<p>Tink will guide you through the design thinking process step by step!</p>
<p>When you finish a project, let Tink know so we can share it with the community.</p>
</div>
<div class="chat-messages" id="chatMessages">
<div class="message tink-message">
<strong>Tink 🧚♀️:</strong> Hello there, creative maker! I'm Tink, your friendly design thinking companion. I'm here to help you turn your ideas into amazing hands-on solutions!
<br><br>
What would you like to make today? Tell me about the idea that's sparkling in your mind! ✨
</div>
</div>
<div class="chat-input-container">
<label for="imageUpload" class="image-upload-button" title="Share a photo with Tink!">
📷
</label>
<input type="file" id="imageUpload" accept="image/*" style="display: none;">
<input type="text" class="chat-input" id="chatInput" placeholder="Share your making idea with Tink...">
<button class="send-button" onclick="sendMessage()">Send ✨</button>
</div>
<div id="imagePreview" class="image-preview" style="display: none;">
<img id="previewImg" src="" alt="Preview">
<button class="remove-image" onclick="removeImage()">✕</button>
</div>
</div>
<div class="design-thinking-toggle">
<button class="toggle-button" onclick="toggleDesignThinking()">
🌟 Learn about Design Thinking <span id="toggleIcon">▼</span>
</button>
</div>
<div class="thinking-process" id="designThinkingProcess" style="display: none;">
<h3 style="text-align: center; margin-bottom: 1rem;">🌟 Design Thinking Journey</h3>
<div class="process-step">
<div class="step-icon">💝</div>
<div>
<strong>Empathy:</strong> Who are you making this for? What do they need?
</div>
</div>
<div class="process-step">
<div class="step-icon">🎯</div>
<div>
<strong>Define:</strong> What's the real problem we're solving?
</div>
</div>
<div class="process-step">
<div class="step-icon">💡</div>
<div>
<strong>Ideate:</strong> Let's brainstorm creative solutions together!
</div>
</div>
<div class="process-step">
<div class="step-icon">🔨</div>
<div>
<strong>Prototype:</strong> Time to build and test your ideas!
</div>
</div>
<div class="process-step">
<div class="step-icon">🧪</div>
<div>
<strong>Test:</strong> How did it work? What can we improve?
</div>
</div>
</div>
</div>
</div>
</section>
<section id="gallery" class="section">
<div class="container">
<div class="content-section">
<h2 class="section-title">Project Gallery 🎨</h2>
<p style="text-align: center; margin-bottom: 2rem;">Explore amazing projects created by our maker community!</p>
<div class="gallery-grid">
</div>
<div style="text-align: center; margin-top: 2rem;">
<p><em>Want to share your project? <a href="#contact" style="color: #667eea;">Get in touch!</a></em></p>
</div>
</div>
</div>
</section>
<section id="contact" class="section">
<div class="container">
<div class="content-section">
<h2 class="section-title">Get in Touch 📬</h2>
<p style="text-align: center; margin-bottom: 2rem;">Have questions, want to share your project, or just say hello?</p>
<div class="contact-form">
<form id="contactForm" name="contact" method="POST" data-netlify="true">
<input type="hidden" name="form-name" value="contact">
<div class="form-group">
<label for="name">Your Name</label>
<input type="text" id="name" name="name" required>
</div>
<div class="form-group">
<label for="email">Email Address</label>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="age">Age (optional - helps us personalize our response!)</label>
<input type="number" id="age" name="age" min="1" max="120">
</div>
<div class="form-group">
<label for="project">What are you working on or dreaming about?</label>
<textarea id="project" name="project" rows="4" placeholder="Tell us about your making journey!"></textarea>
</div>
<div class="form-group">
<label for="message">Message</label>
<textarea id="message" name="message" rows="5" required placeholder="How can Tink help you today?"></textarea>
</div>
<button type="submit" class="submit-button">Send Message ✨</button>
</form>
</div>
</div>
</div>
</section>
<footer class="footer">
<div class="container">
<p>© 2025 Making with Tink. Spreading maker magic everywhere! ✨</p>
<p>Designed with 💜 for makers of all ages</p>
</div>
</footer>
<!-- Hidden Netlify form for project submissions -->
<form name="project-submissions" netlify netlify-honeypot="bot-field" hidden>
<input type="text" name="project-name" />
<textarea name="learning"></textarea>
<input type="text" name="maker-name" />
<input type="text" name="maker-age" />
<input type="url" name="image-url" />
<input type="text" name="submission-date" />
</form>
<script>
// Smooth scrolling for navigation links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});
// Toggle Design Thinking section
function toggleDesignThinking() {
const process = document.getElementById('designThinkingProcess');
const icon = document.getElementById('toggleIcon');
if (process.style.display === 'none') {
process.style.display = 'block';
icon.textContent = '▲';
icon.classList.add('rotated');
} else {
process.style.display = 'none';
icon.textContent = '▼';
icon.classList.remove('rotated');
}
}
// Conversation history storage
let conversationHistory = [];
let currentImage = null;
let projectImage = null;
// Project sharing functionality
function showProjectShareForm() {
const messages = document.getElementById('chatMessages');
const formContainer = document.createElement('div');
formContainer.className = 'project-share-form';
formContainer.innerHTML = `
<h3 style="color: #8b4513; text-align: center; margin-bottom: 1rem;">✨ Share Your Project! ✨</h3>
<p style="text-align: center; margin-bottom: 1.5rem;">Help inspire other makers by sharing what you've created!</p>
<form id="projectShareForm">
<div class="project-form-group">
<label for="projectPhoto">📷 Photo of Your Project *</label>
<div class="project-image-upload" onclick="document.getElementById('projectPhotoInput').click()">
<div>📸 Click here to upload a photo of your creation!</div>
<small style="color: #666;">JPG, PNG, or WebP formats</small>
</div>
<input type="file" id="projectPhotoInput" accept="image/*" style="display: none;">
<div id="projectImagePreview" class="project-image-preview" style="display: none;"></div>
</div>
<div class="project-form-group">
<label for="projectName">🛠️ What did you make? *</label>
<input type="text" id="projectName" placeholder="e.g., Smart Plant Watering System" required>
</div>
<div class="project-form-group">
<label for="projectLearning">💡 What's one thing you learned? *</label>
<textarea id="projectLearning" rows="3" placeholder="Share your biggest learning or insight from this project..." required></textarea>
</div>
<div class="project-form-group">
<label for="makerName">✨ Your Name (optional)</label>
<input type="text" id="makerName" placeholder="How should we credit you?">
</div>
<div class="project-form-group">
<label for="makerAge">🎂 Your Age (optional)</label>
<input type="number" id="makerAge" min="1" max="120" placeholder="Helps us celebrate makers of all ages!">
</div>
<button type="submit" class="project-share-button" style="width: 100%;">
🌟 Share My Project! 🌟
</button>
</form>
`;
messages.appendChild(formContainer);
messages.scrollTop = messages.scrollHeight;
// Set up form handling
setupProjectForm();
}
function setupProjectForm() {
// Handle image upload
document.getElementById('projectPhotoInput').addEventListener('change', function(e) {
const file = e.target.files[0];
if (file && file.type.startsWith('image/')) {
const reader = new FileReader();
reader.onload = function(e) {
projectImage = {
data: e.target.result,
type: file.type,
name: file.name
};
const preview = document.getElementById('projectImagePreview');
preview.innerHTML = `<img src="${e.target.result}" alt="Project preview">`;
preview.style.display = 'block';
// Update upload area
const uploadArea = document.querySelector('.project-image-upload');
uploadArea.innerHTML = '<div style="color: #28a745;">✅ Photo uploaded! Click to change</div>';
};
reader.readAsDataURL(file);
}
});
// Handle form submission
document.getElementById('projectShareForm').addEventListener('submit', async function(e) {
e.preventDefault();
const submitButton = this.querySelector('.project-share-button');
const originalText = submitButton.textContent;
submitButton.textContent = 'Sharing... ✨';
submitButton.disabled = true;
// Get form data
const projectData = {
photo: projectImage,
name: document.getElementById('projectName').value,
learning: document.getElementById('projectLearning').value,
makerName: document.getElementById('makerName').value || 'Anonymous Maker',
makerAge: document.getElementById('makerAge').value || 'Not specified'
};
if (!projectImage) {
alert('Please upload a photo of your project!');
submitButton.textContent = originalText;
submitButton.disabled = false;
return;
}
try {
// Submit to Google Form (you'll need to set up the form)
const success = await submitProjectToGoogleForm(projectData);
if (success) {
// Show success message
const successMsg = document.createElement('div');
successMsg.style.cssText = `
background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
color: #155724;
padding: 2rem;
border-radius: 15px;
margin-top: 1rem;
text-align: center;
border: 2px solid #b8dacc;
`;
successMsg.innerHTML = `
<div style="font-size: 2rem; margin-bottom: 1rem;">🎉🧚♀️</div>
<h3 style="margin-bottom: 1rem;">Project Shared Successfully!</h3>
<p>Thank you for sharing your amazing creation! Your project will inspire other makers in our community. Keep making magic! ✨</p>
`;
this.parentNode.appendChild(successMsg);
this.style.display = 'none';
// Add Tink's response
setTimeout(() => {
const messages = document.getElementById('chatMessages');
const tinkResponse = document.createElement('div');
tinkResponse.className = 'message tink-message';
tinkResponse.innerHTML = `<strong>Tink 🧚♀️:</strong> Wonderful! Your project has been shared with our maker community! I'm so proud of what you've accomplished. Your creation will inspire others to start their own making journeys. Keep dreaming, designing, and creating! ✨🌟`;
messages.appendChild(tinkResponse);
messages.scrollTop = messages.scrollHeight;
}, 1000);
}
} catch (error) {
console.error('Project submission error:', error);
alert('Oops! There was an issue sharing your project. Please try again.');
submitButton.textContent = originalText;
submitButton.disabled = false;
}
});
}
async function submitProjectToGoogleForm(projectData) {
console.log('🧚♀️ Starting project submission...', projectData);
try {
const formData = new FormData();
// Your actual form entry IDs
formData.append('entry.542386460', projectData.name); // Project Name
formData.append('entry.1071470430', projectData.learning); // What I Learned
formData.append('entry.877515072', projectData.makerName); // Maker Name
formData.append('entry.1323240392', projectData.makerAge); // Maker Age
console.log('📝 Added text fields to form data');
// Upload image to Imgur first, then submit the URL to Google Forms
if (projectData.photo) {
console.log('📷 Uploading image to Imgur...');
try {
const imageUrl = await uploadImageToImgur(projectData.photo);
console.log('✅ Imgur upload successful:', imageUrl);
formData.append('entry.121330878', imageUrl);
} catch (imgurError) {
console.error('❌ Imgur upload failed:', imgurError);
formData.append('entry.121330878', 'Image upload failed - please try again');
}
} else {
console.log('ℹ️ No image provided');
formData.append('entry.121330878', 'No image provided');
}