-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathtestimonial.html
776 lines (704 loc) · 28 KB
/
testimonial.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Testimonials</title>
<link rel="stylesheet" href="testimonial.css">
<link rel="stylesheet" href="styles.css" />
<link rel="stylesheet" href="navbar.css" />
<link rel="stylesheet" href="cssfiles/Scroll.css">
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css"
/>
<script
src="https://kit.fontawesome.com/a076d05399.js"
crossorigin="anonymous"
></script>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
/>
</head>
<style>
body.dark .testimonial-container {
background: #121212;
box-shadow: 0 4px 8px rgba(255, 166, 0, 0.2);
border: 1px solid #9b907fa6
}
body.dark .testimonial-form-title {
color: #ffcc00;
}
body.dark .testimonial-label {
color: #f1f1f1;
}
body.dark .testimonial-input,
body.dark .testimonial-textarea,
body.dark .testimonial-select,
body.dark .testimonial-file {
background: #1e1e1e;
color: #ffcc00;
border: 1px solid #9b907fa6
}
body.dark .testimonial-input:focus,
body.dark .testimonial-textarea:focus,
body.dark .testimonial-select:focus {
border-color: #ffcc00;
box-shadow: 0 0 8px rgba(255, 204, 0, 0.8);
}
body.dark .testimonial-submit-btn {
background-color: #f39c12;
color: #121212;
font-weight: 700;
text-transform: uppercase;
box-shadow: 0 4px 6px rgba(255, 204, 0, 0.3);
}
body.dark .testimonial-submit-btn:hover {
background-color: #ffcc00;
box-shadow: 0 6px 10px rgba(255, 204, 0, 0.5);
}
.add-testimonial-section {
padding: 3rem 1rem;
display: flex;
justify-content: center;
align-items: center;
}
.testimonial-container {
max-width: 600px;
width: 100%;
background-color: var(--Tcard-bg);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
border-radius: 16px;
padding: 2rem;
text-align: center;
}
.testimonial-form-title {
font-size: 1.5rem;
font-weight: 700;
color: var(--heading-color);
margin-bottom: 1rem;
}
.testimonial-label {
display: block;
font-size: 1rem;
font-weight: 500;
color: var(--quote-color);
margin-bottom: 0.5rem;
text-align: left;
}
.testimonial-input,
.testimonial-textarea,
.testimonial-select,
.testimonial-file {
width: 100%;
padding: 0.75rem;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 1rem;
color: var(--name-color);
background-color: var(--Tcard-bg);
transition: all 0.3s ease;
}
.testimonial-input:focus,
.testimonial-textarea:focus,
.testimonial-select:focus {
border-color: var(--heading-color);
outline: none;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}
.testimonial-textarea {
height: 120px;
resize: none;
}
.testimonial-submit-btn {
width: 100%;
padding: 0.75rem;
font-size: 1rem;
font-weight: 700;
color: white;
background-color: var(--heading-color);
border: none;
border-radius: 8px;
cursor: pointer;
margin-top: 1rem;
transition: background-color 0.3s ease, transform 0.2s ease-in-out;
}
.testimonial-submit-btn:hover {
background-color: #000;
transform: scale(1.05);
}
@media (max-width: 768px) {
.testimonial-container {
padding: 1.5rem;
}
}
</style>
<body>
<div id="cursor"></div>
<!-- Navigation -->
<nav class="navbar">
<div class="logo">
<button class="image-button1">
<img src="./AJIVIKA2.svg" alt="Image Button1" class="image-icon1" />
</button>
</div>
<!-- Floating Image Button -->
<!-- hamburger menu -->
<button class="hamburger" onclick="toggleMenu()">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</button>
<!-- Navigation Links -->
<ul class="nav-links">
<li>
<a href="./index.html"
><i class="fas fa-home"></i><span>Home</span></a
>
</li>
<li>
<a href="./about.html"
><i class="fas fa-address-card"></i> <span>About Us</span></a
>
</li>
<li>
<a href="./contact.html"
><i class="fas fa-envelope"></i> <span>Contact Us</span></a
>
</li>
<li>
<a href="./pricing.html"
><i class="fas fa-comments"></i><span>Go Pro</span></a
>
</li>
<li>
<a href="./contributors/contributor.html"
><i class="fas fa-users"></i><span>Contributors</span></a
>
</li>
<!-- <li><a href="./login.html"><i class="fas fa-sign-in-alt"></i><span>Log In</span></a></li> -->
<li>
<a href="./register.html"
><i class="fas fa-user-plus"></i> <span>Register</span></a
>
</li>
<li>
<button class="translate-button" onclick="toggleTranslate()">
🌐
</button>
<div id="google_translate_element" style="display: none;"></div>
</li>
<li>
<label class="theme-switch">
<input type="checkbox" class="theme-switch__checkbox" />
<div class="theme-switch__container">
<div class="theme-switch__clouds"></div>
<div class="theme-switch__stars-container">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 144 55"
fill="none"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M135.831 3.00688C135.055 3.85027 134.111 4.29946 133 4.35447C134.111 4.40947 135.055 4.85867 135.831 5.71123C136.607 6.55462 136.996 7.56303 136.996 8.72727C136.996 7.95722 137.172 7.25134 137.525 6.59129C137.886 5.93124 138.372 5.39954 138.98 5.00535C139.598 4.60199 140.268 4.39114 141 4.35447C139.88 4.2903 138.936 3.85027 138.16 3.00688C137.384 2.16348 136.996 1.16425 136.996 0C136.996 1.16425 136.607 2.16348 135.831 3.00688ZM31 23.3545C32.1114 23.2995 33.0551 22.8503 33.8313 22.0069C34.6075 21.1635 34.9956 20.1642 34.9956 19C34.9956 20.1642 35.3837 21.1635 36.1599 22.0069C36.9361 22.8503 37.8798 23.2903 39 23.3545C38.2679 23.3911 37.5976 23.602 36.9802 24.0053C36.3716 24.3995 35.8864 24.9312 35.5248 25.5913C35.172 26.2513 34.9956 26.9572 34.9956 27.7273C34.9956 26.563 34.6075 25.5546 33.8313 24.7112C33.0551 23.8587 32.1114 23.4095 31 23.3545ZM0 36.3545C1.11136 36.2995 2.05513 35.8503 2.83131 35.0069C3.6075 34.1635 3.99559 33.1642 3.99559 32C3.99559 33.1642 4.38368 34.1635 5.15987 35.0069C5.93605 35.8503 6.87982 36.2903 8 36.3545C7.26792 36.3911 6.59757 36.602 5.98015 37.0053C5.37155 37.3995 4.88644 37.9312 4.52481 38.5913C4.172 39.2513 3.99559 39.9572 3.99559 40.7273C3.99559 39.563 3.6075 38.5546 2.83131 37.7112C2.05513 36.8587 1.11136 36.4095 0 36.3545ZM56.8313 24.0069C56.0551 24.8503 55.1114 25.2995 54 25.3545C55.1114 25.4095 56.0551 25.8587 56.8313 26.7112C57.6075 27.5546 57.9956 28.563 57.9956 29.7273C57.9956 28.9572 58.172 28.2513 58.5248 27.5913C58.8864 26.9312 59.3716 26.3995 59.9802 26.0053C60.5976 25.602 61.2679 25.3911 62 25.3545C60.8798 25.2903 59.9361 24.8503 59.1599 24.0069C58.3837 23.1635 57.9956 22.1642 57.9956 21C57.9956 22.1642 57.6075 23.1635 56.8313 24.0069ZM81 25.3545C82.1114 25.2995 83.0551 24.8503 83.8313 24.0069C84.6075 23.1635 84.9956 22.1642 84.9956 21C84.9956 22.1642 85.3837 23.1635 86.1599 24.0069C86.9361 24.8503 87.8798 25.2903 89 25.3545C88.2679 25.3911 87.5976 25.602 86.9802 26.0053C86.3716 26.3995 85.8864 26.9312 85.5248 27.5913C85.172 28.2513 84.9956 28.9572 84.9956 29.7273C84.9956 28.563 84.6075 27.5546 83.8313 26.7112C83.0551 25.8587 82.1114 25.4095 81 25.3545ZM136 36.3545C137.111 36.2995 138.055 35.8503 138.831 35.0069C139.607 34.1635 139.996 33.1642 139.996 32C139.996 33.1642 140.384 34.1635 141.16 35.0069C141.936 35.8503 142.88 36.2903 144 36.3545C143.268 36.3911 142.598 36.602 141.98 37.0053C141.372 37.3995 140.886 37.9312 140.525 38.5913C140.172 39.2513 139.996 39.9572 139.996 40.7273C139.996 39.563 139.607 38.5546 138.831 37.7112C138.055 36.8587 137.111 36.4095 136 36.3545ZM101.831 49.0069C101.055 49.8503 100.111 50.2995 99 50.3545C100.111 50.4095 101.055 50.8587 101.831 51.7112C102.607 52.5546 102.996 53.563 102.996 54.7273C102.996 53.9572 103.172 53.2513 103.525 52.5913C103.886 51.9312 104.372 51.3995 104.98 51.0053C105.598 50.602 106.268 50.3911 107 50.3545C105.88 50.2903 104.936 49.8503 104.16 49.0069C103.384 48.1635 102.996 47.1642 102.996 46C102.996 47.1642 102.607 48.1635 101.831 49.0069Z"
fill="currentColor"
></path>
</svg>
</div>
<div class="theme-switch__circle-container">
<div class="theme-switch__sun-moon-container">
<div class="theme-switch__moon">
<div class="theme-switch__spot"></div>
<div class="theme-switch__spot"></div>
<div class="theme-switch__spot"></div>
</div>
</div>
</div>
</div>
</label>
</li>
</ul>
</nav>
<!-- Home Page Content -->
<script>
// hamburger menu js
function toggleMenu() {
const navLinks = document.querySelector(".nav-links");
navLinks.classList.toggle("active");
}
</script>
<!-- Google Translate Script -->
<!-- <script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> -->
<script>
// Initialize Google Translate
function googleTranslateElementInit() {
new google.translate.TranslateElement(
{
pageLanguage: "en",
includedLanguages: "en,hi,es,fr,de,it,ja,zh-CN",
layout: google.translate.TranslateElement.InlineLayout.SIMPLE,
autoDisplay: false,
},
"google_translate_element"
);
}
// Show or hide the Google Translate options
function toggleTranslate() {
const translateElement = document.getElementById(
"google_translate_element"
);
if (
translateElement.style.display === "none" ||
translateElement.style.display === ""
) {
translateElement.style.display = "block";
} else {
translateElement.style.display = "none";
}
}
</script>
<button class="back-button" onclick="window.history.back();">
<i class="fas fa-arrow-left"></i>
</button>
<section class="testimonial-section">
<div class="container">
<div class="flex flex-col items-center">
<div class="text-center">
<h2 class="main-heading">Our happy clients say about us</h2>
</div>
<div class="cta-container">
<a href="#" class="cta-link">Check all <span id="testimonialCount">0</span> reviews</a>
</div>
<div class="relative-container">
<div class="background-gradient"></div>
<div class="grid-container" id="testimonialGrid">
<!-- Dynamically populated testimonials will appear here -->
</div>
</div>
</div>
</div>
</section>
<!-- Add Testimonial Form -->
<section class="add-testimonial-section">
<div class="testimonial-container">
<form id="testimonialForm" class="testimonial-form">
<h3 class="testimonial-form-title">Add Your Testimonial</h3>
<label for="name" class="testimonial-label">Name:</label>
<input type="text" id="name" name="name" class="testimonial-input" required />
<label for="profession" class="testimonial-label">Profession:</label>
<input type="text" id="profession" name="profession" class="testimonial-input" required />
<label for="review" class="testimonial-label">Review:</label>
<textarea id="review" name="review" class="testimonial-textarea" required></textarea>
<label for="stars" class="testimonial-label">Rating:</label>
<select id="stars" name="stars" class="testimonial-select" required>
<option value="1">1 Star</option>
<option value="2">2 Stars</option>
<option value="3">3 Stars</option>
<option value="4">4 Stars</option>
<option value="5">5 Stars</option>
</select>
<label for="image" class="testimonial-label">Upload Image (optional):</label>
<input type="file" id="image" name="image" class="testimonial-file" accept="image/*" />
<button type="submit" class="testimonial-submit-btn">Submit Testimonial</button>
</form>
</div>
</section>
<!-- Footer -->
<footer style="background-color: #222; color: #fff; padding: 20px 10px">
<div
class="footer-container"
style="
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 20px;
max-width: 1200px;
margin: auto;
"
>
<!-- About Section -->
<div class="footer-section" style="flex: 1; min-width: 200px">
<h3>About Ajivika</h3>
<p style="font-size: 14px; line-height: 1.6">
Ajivika is your one-stop destination for career growth and learning.
From creating professional resumes to applying for top jobs, we
provide tools and resources for every career stage.
</p>
</div>
<!-- Quick Links -->
<div
class="footer-section quick-link"
style="flex: 1; min-width: 200px"
>
<h3>Quick Links</h3>
<ul
style="
list-style: none;
padding: 0;
font-size: 14px;
line-height: 1.8;
"
>
<li>
<a href="./index.html" style="color: #fff; text-decoration: none"
>Home</a
>
</li>
<li>
<a href="./about.html" style="color: #fff; text-decoration: none"
>About Us</a
>
</li>
<li>
<a
href="./contact.html"
style="color: #fff; text-decoration: none"
>Contact</a
>
</li>
<li>
<a
href="./pricing.html"
style="color: #fff; text-decoration: none"
>Go Pro</a
>
</li>
</ul>
</div>
<!-- Resources -->
<div class="footer-section resources" style="flex: 1; min-width: 200px">
<h3>Resources</h3>
<ul
style="
list-style: none;
padding: 0;
font-size: 14px;
line-height: 1.8;
"
>
<li>
<a href="./blog.html" style="color: #fff; text-decoration: none"
>Blog</a
>
</li>
<li>
<a
href="./testimonial.html"
style="color: #fff; text-decoration: none"
>Testimonial</a
>
</li>
<li>
<a href="./faq.html" style="color: #fff; text-decoration: none"
>FAQs</a
>
</li>
<li>
<a href="./terms.html" style="color: #fff; text-decoration: none"
>Terms & Conditions</a
>
</li>
<li>
<a
href="./privacy.html"
style="color: #fff; text-decoration: none"
>Privacy Policy</a
>
</li>
</ul>
</div>
<!-- Social Media -->
<div
class="footer-section social-icons"
style="flex: 1; min-width: 200px"
>
<h3>Follow Us</h3>
<div
style="
display: flex;
justify-content: center;
gap: 10px;
font-size: 20px;
"
>
<a
href="https://facebook.com"
target="_blank"
style="color: #fff; text-decoration: none"
>
<i class="fab fa-facebook-f"></i>
</a>
<a
href="https://twitter.com"
target="_blank"
style="color: #fff; text-decoration: none"
>
<i class="fab fa-twitter"></i>
</a>
<a
href="https://linkedin.com"
target="_blank"
style="color: #fff; text-decoration: none"
>
<i class="fab fa-linkedin-in"></i>
</a>
<a
href="https://instagram.com"
target="_blank"
style="color: #fff; text-decoration: none"
>
<i class="fab fa-instagram"></i>
</a>
</div>
<!--payment options-->
<div class="payments">
<h3>
<i class="fa-solid fa-credit-card" style="color: #d6a52b; margin-right: 8px; padding-top: 15px;"></i>we accept</h3>
<a href="https://www.apple.com/apple-pay/" target="_blank" style="color:#fff;"><i class="fab fa-apple-pay" style="font-size: 40px;"></i></a>
<a href="https://pay.google.com/intl/en_in/about/" style="color:#fff;"><i class="fa-brands fa-google-pay" style="font-size: 40px;"></i></a>
<a href="https://redemption.mastercard.com/#/user/login?language=en-US" style="color:#fff;"><i class="fa-brands fa-cc-mastercard" style="font-size: 30px;"></i></a>
<a href="https://www.visa.com.au/en_au/account/login" style="color:#fff;"><i class="fa-brands fa-cc-visa" style="font-size: 30px;"></i></a>
</div>
</div>
<!-- Subscribe Section -->
<div
class="footer-section subscribe-section"
style="flex: 1; min-width: 200px"
>
<h3>Subscribe to Our Newsletter</h3>
<form
action="#"
method="POST"
style="
display: flex;
flex-direction: column;
gap: 10px;
align-items: center;
"
>
<input
id="email"
type="email"
name="email"
placeholder="Enter your email"
/>
</button>
<button type="submit" class="subscribe-button">Subscribe</button>
</form>
</div>
</div>
<hr style="margin: 20px 0; border: 0; border-top: 1px solid #444" />
<div class="imf">
<img src="./AJIVIKA2.svg" alt="" height="58px">
<div style="text-align: center; font-size: 14px; color: #aaa">
<p>© 2025 Ajivika™. All rights reserved.</p>
<p>Designed and developed with ❤️ by the Ajivika Team.</p>
</div>
</div>
</footer>
<!-- Floating Chat Button -->
<a href="chatbot.html">
<button class="image-button" fdprocessedid="pv3d3b" style="border-radius: 50%; background-color: #f5a623; padding: 0px; border: none;">
<!-- Font Awesome chat icon -->
<i class="fas fa-comment-dots" style="border-radius: 50%; background-color: #f5a623; padding: 10px; border: none; font-size: 30px;"></i>
</button>
</a>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"
integrity="sha512-7eHRwcbYkK4d9g/6tD/mhkf++eoTHwpNM9woBxtPUBWm67zeAfFC+HrdoE2GanKeocly/VxeLvIqwvCdk7qScg=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script src="index.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const themeToggle = document.querySelector('.theme-switch__checkbox');
const currentTheme = localStorage.getItem('theme');
if (currentTheme === 'dark') {
document.body.classList.add('dark');
document.body.classList.remove('light');
themeToggle.checked = true;
} else {
document.body.classList.add('light');
document.body.classList.remove('dark');
}
themeToggle.addEventListener('change', () => {
if (themeToggle.checked) {
document.body.classList.add('dark');
document.body.classList.remove('light');
localStorage.setItem('theme', 'dark');
} else {
document.body.classList.remove('dark');
document.body.classList.add('light');
localStorage.setItem('theme', 'light');
}
});
});
</script>
<script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement(
{
pageLanguage: 'en',
includedLanguages: 'en,hi,es,fr,de,it,ja,zh-CN',
layout: google.translate.TranslateElement.InlineLayout.SIMPLE,
autoDisplay: false,
},
'google_translate_element'
);
}
function toggleTranslate() {
const translateElement = document.getElementById('google_translate_element');
if (translateElement.style.display === 'none' || translateElement.style.display === '') {
translateElement.style.display = 'block';
} else {
translateElement.style.display = 'none';
}
}
</script>
<!-- Top scroll button -->
<div id="scrollButton" class="hidden">
<div class="outer-circle">
<div class="inner-circle">
<div class="arrow">↑</div>
</div>
</div>
</div>
<script src="js/Scroll.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const themeToggle = document.querySelector('.theme-switch__checkbox');
const currentTheme = localStorage.getItem('theme');
if (currentTheme === 'dark') {
document.body.classList.add('dark');
document.body.classList.remove('light');
themeToggle.checked = true;
} else {
document.body.classList.add('light');
document.body.classList.remove('dark');
}
themeToggle.addEventListener('change', () => {
if (themeToggle.checked) {
document.body.classList.add('dark');
document.body.classList.remove('light');
localStorage.setItem('theme', 'dark');
} else {
document.body.classList.remove('dark');
document.body.classList.add('light');
localStorage.setItem('theme', 'light');
}
});
});
</script>
<script>
document.querySelector('.image-button1').addEventListener('click', function() {
window.location.href = 'index.html';
});
</script>
<script>
const apiEndpoint = 'http://127.0.0.1:5000/api/v1/testimonials/all';
// Function to fetch testimonials data
async function fetchTestimonials() {
try {
const response = await fetch(apiEndpoint);
const data = await response.json();
// Check if data is available
if (data && data.length > 0) {
// Get the container elements
const testimonialGrid = document.getElementById('testimonialGrid');
const testimonialCount = document.getElementById('testimonialCount');
// Update testimonial count
testimonialCount.textContent = data.length;
// Clear existing testimonials
testimonialGrid.innerHTML = '';
// Loop through each testimonial and create the HTML for it
data.forEach(testimonial => {
const testimonialCard = document.createElement('div');
testimonialCard.classList.add('testimonial-card', 'pulse-effect');
// Create the card content
testimonialCard.innerHTML = `
<div class="card-content">
<div class="rating">
${generateStars(testimonial.stars)}
</div>
<p class="quote">${testimonial.review}</p>
</div>
<div class="profile">
<img src="${testimonial.image}" alt="Client Image" class="avatar">
<div class="profile-details">
<p class="name">${testimonial.name}</p>
<p class="role">${testimonial.profession}</p>
</div>
</div>
`;
// Append the card to the container
testimonialGrid.appendChild(testimonialCard);
});
} else {
console.error('No testimonials found.');
}
} catch (error) {
console.error('Error fetching testimonials:', error);
}
}
// Function to generate star ratings based on the testimonial rating
function generateStars(rating) {
let stars = '';
// Generate stars (assumes rating is between 1 and 5)
for (let i = 0; i < rating; i++) {
stars += `
<svg class="star" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"/>
</svg>
`;
}
return stars;
}
// Call the function to fetch and display testimonials
fetchTestimonials();
</script>
<script>
document.getElementById('testimonialForm').addEventListener('submit', async (e) => {
e.preventDefault();
const formData = new FormData();
// Get values from the form inputs
const name = document.getElementById('name').value;
const profession = document.getElementById('profession').value;
const review = document.getElementById('review').value;
const stars = document.getElementById('stars').value;
// Append the data to the FormData object
formData.append('name', name);
formData.append('profession', profession);
formData.append('review', review);
formData.append('stars', stars);
// If there's an image, append it as well
const imageFile = document.getElementById('image').files[0];
if (imageFile) {
formData.append('image', imageFile);
}
try {
// Send POST request to API
const response = await fetch('http://127.0.0.1:5000/api/v1/testimonials/add', {
method: 'POST',
body: formData,
});
const result = await response.json();
console.log("result------> "+result)
if (response.ok) {
alert('Testimonial added successfully!');
console.log(result);
} else {
alert('Error adding testimonial: ' + result.error);
}
} catch (error) {
console.error('Error:', error);
alert('There was an error. Please try again.');
}
});
</script>
</body>
</html>