Repository navigation
Expand file tree
/
Copy pathscript.min.js
More file actions
1358 lines (1358 loc) · 53.3 KB
/
Copy pathscript.min.js
File metadata and controls
1358 lines (1358 loc) · 53.3 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
(window.addEventListener("load", function () {
const e = document.getElementById("pageLoader");
e &&
setTimeout(function () {
e.classList.add("hidden");
}, 800);
}),
setTimeout(function () {
const e = document.getElementById("pageLoader");
e && !e.classList.contains("hidden") && e.classList.add("hidden");
}, 2e3),
document.addEventListener("DOMContentLoaded", function () {
const e = document.getElementById("calculatorModal"),
t = document.getElementById("openCalculatorModal"),
n = document.getElementById("closeCalculatorModal"),
o = document.querySelector(".calculator-modal-overlay");
function a() {
e && (e.classList.remove("active"), (document.body.style.overflow = ""));
}
(t &&
t.addEventListener("click", function (t) {
(t.preventDefault(),
e &&
(e.classList.add("active"),
(document.body.style.overflow = "hidden")));
}),
n && n.addEventListener("click", a),
o && o.addEventListener("click", a),
document.addEventListener("keydown", function (t) {
"Escape" === t.key && e && e.classList.contains("active") && a();
}));
}),
document.addEventListener("DOMContentLoaded", function () {
const e = document.querySelectorAll(".hero-slide"),
t = document.querySelectorAll(".indicator");
let n,
o = 0;
if (0 === e.length) return void console.error("No slides found!");
function a(n) {
(e.forEach((e) => {
e.classList.remove("active");
}),
t.forEach((e) => {
e.classList.remove("active");
}),
e[n].classList.add("active"),
t[n] && t[n].classList.add("active"));
}
function i() {
((o = (o + 1) % e.length),
a(o),
console.log("Moved to slide " + (o + 1)));
}
(console.log("Slideshow initialized with " + e.length + " slides"),
t.forEach((e, t) => {
e.addEventListener("click", () =>
(function (e) {
((o = e), a(o), clearInterval(n), (n = setInterval(i, 5e3)));
})(t),
);
}),
(n = setInterval(i, 5e3)));
const r = document.querySelector(".slideshow-container");
r &&
(r.addEventListener("mouseenter", () => {
clearInterval(n);
}),
r.addEventListener("mouseleave", () => {
n = setInterval(i, 5e3);
}));
}),
document.addEventListener("DOMContentLoaded", function () {
const e = new IntersectionObserver(
function (e) {
e.forEach((e) => {
e.isIntersecting && e.target.classList.add("is-visible");
});
},
{ threshold: 0.1, rootMargin: "0px 0px -50px 0px" },
);
document
.querySelectorAll(
"\n section:not(.hero-slideshow),\n .service-card,\n .feature-card,\n .calc-feature,\n .plan-card,\n .faq-item,\n .driver-card,\n .testimonial-card\n ",
)
.forEach((t) => {
(t.classList.add("fade-in-section"), e.observe(t));
});
document
.querySelectorAll(".service-card, .feature-card, .calc-feature")
.forEach((e, t) => {
e.style.transitionDelay = 0.1 * t + "s";
});
}),
window.addEventListener("scroll", function () {
const e = window.pageYOffset;
document.querySelectorAll(".phone-mockup, .slide-phone").forEach((t) => {
if (t) {
const n = 0.3;
t.style.transform = `translateY(${e * n}px)`;
}
});
}),
document.addEventListener("click", function (e) {
const t = e.target.closest("button, .btn, a.btn-primary, a.btn-secondary");
if (t && !t.querySelector(".ripple-effect")) {
const n = document.createElement("span");
n.classList.add("ripple-effect");
const o = t.getBoundingClientRect(),
a = Math.max(o.width, o.height),
i = e.clientX - o.left - a / 2,
r = e.clientY - o.top - a / 2;
((n.style.cssText = `\n width: ${a}px;\n height: ${a}px;\n left: ${i}px;\n top: ${r}px;\n position: absolute;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.5);\n pointer-events: none;\n animation: rippleAnimation 0.6s ease-out;\n `),
t.appendChild(n),
setTimeout(() => n.remove(), 600));
}
}));
const style = document.createElement("style");
function animateValue(e, t, n, o) {
let a = null;
const i = (r) => {
a || (a = r);
const s = Math.min((r - a) / o, 1),
c = Math.floor(s * (n - t) + t);
((e.textContent = c.toLocaleString()),
s < 1 && window.requestAnimationFrame(i));
};
window.requestAnimationFrame(i);
}
((style.textContent =
"\n @keyframes rippleAnimation {\n from {\n transform: scale(0);\n opacity: 1;\n }\n to {\n transform: scale(2);\n opacity: 0;\n }\n }\n \n button, .btn, a.btn-primary, a.btn-secondary {\n position: relative;\n overflow: hidden;\n }\n"),
document.head.appendChild(style));
const statObserver = new IntersectionObserver(
(e) => {
e.forEach((e) => {
if (e.isIntersecting && !e.target.dataset.animated) {
const t = e.target,
n =
parseInt(t.dataset.count) ||
parseInt(t.textContent.replace(/[^0-9]/g, ""));
(animateValue(t, 0, n, 2e3), (t.dataset.animated = "true"));
}
});
},
{ threshold: 0.5 },
);
document.querySelectorAll(".stat-number, .count-up").forEach((e) => {
statObserver.observe(e);
});
const toggleStoreBtn = document.getElementById("toggleStoreButtons");
function animateCounter(e, t, n = 2e3) {
let o = 0;
const a = t / (n / 16),
i = setInterval(() => {
((o += a),
o >= t
? ((e.textContent = t.toLocaleString() + (e.dataset.suffix || "")),
clearInterval(i))
: (e.textContent =
Math.floor(o).toLocaleString() + (e.dataset.suffix || "")));
}, 16);
}
(toggleStoreBtn &&
toggleStoreBtn.addEventListener("click", function () {
const e = document.getElementById("heroStoreButtons");
e &&
("none" !== e.style.display && e.classList.contains("show")
? ((e.style.display = "none"),
e.classList.remove("show"),
(toggleStoreBtn.innerHTML =
'<svg width="24" height="24" viewBox="0 0 24 24" fill="white"><path d="M17,3H7A2,2 0 0,0 5,5V21L12,18L19,21V5C19,3.89 18.1,3 17,3Z"/></svg>Get the App'))
: ((e.style.display = "flex"),
e.classList.add("show"),
(toggleStoreBtn.innerHTML =
'<svg width="24" height="24" viewBox="0 0 24 24" fill="white"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"/></svg>Hide Options')));
}),
window.addEventListener("scroll", function () {
const e = document.getElementById("scrollProgress");
if (e) {
const t =
((document.documentElement.scrollTop || document.body.scrollTop) /
(document.documentElement.scrollHeight -
document.documentElement.clientHeight)) *
100;
e.style.width = t + "%";
}
}),
window.addEventListener("scroll", function () {
const e = document.querySelector(".hero-section");
if (e) {
const t = window.pageYOffset;
e.querySelectorAll(".hero-content, .hero-images").forEach((e, n) => {
const o = 0 === n ? 0.3 : 0.5;
e.style.transform = `translateY(${t * o}px)`;
});
}
}));
const statsObserver = new IntersectionObserver(
(e) => {
e.forEach((e) => {
if (e.isIntersecting && !e.target.classList.contains("counted")) {
e.target.classList.add("counted");
e.target.querySelectorAll(".stat-number").forEach((e) => {
animateCounter(e, parseInt(e.dataset.count));
});
}
});
},
{ threshold: 0.3 },
);
function createRipple(e) {
const t = e.currentTarget,
n = document.createElement("span"),
o = t.getBoundingClientRect(),
a = Math.max(o.width, o.height),
i = e.clientX - o.left - a / 2,
r = e.clientY - o.top - a / 2;
((n.style.width = n.style.height = a + "px"),
(n.style.left = i + "px"),
(n.style.top = r + "px"),
n.classList.add("ripple"),
t.appendChild(n),
setTimeout(() => {
n.remove();
}, 600));
}
function initMagneticButtons() {
document
.querySelectorAll(
".btn-primary, .btn-secondary, .btn-hero-download, .floating-app-btn, .btn-primary-large",
)
.forEach((e) => {
(e.addEventListener("mousemove", (t) => {
const n = e.getBoundingClientRect(),
o = t.clientX - n.left - n.width / 2,
a = t.clientY - n.top - n.height / 2;
e.style.transform = `translate(${0.2 * o}px, ${0.2 * a}px)`;
}),
e.addEventListener("mouseleave", () => {
e.style.transform = "translate(0, 0)";
}));
});
}
function initStaggerAnimation() {
document
.querySelectorAll(".service-card, .feature-item, .step")
.forEach((e, t) => {
e.style.animationDelay = 0.1 * t + "s";
});
}
function recordVisit() {
try {
const e = parseInt(localStorage.getItem("jelogaVisitCount") || "0", 10) + 1;
localStorage.setItem("jelogaVisitCount", String(e));
const t = JSON.parse(localStorage.getItem("jelogaVisitEvents") || "[]"),
n = {
type: "visit",
page: window.location.pathname,
timestamp: new Date().toISOString(),
};
(t.push(n), localStorage.setItem("jelogaVisitEvents", JSON.stringify(t)));
const o = document.getElementById("heroLeadForm"),
a = o && o.getAttribute("data-sheet-url");
a &&
fetch(a, {
method: "POST",
mode: "no-cors",
body: JSON.stringify({ type: "visit", data: n }),
}).catch((e) => console.warn("Visit post failed", e));
} catch (e) {
console.warn("recordVisit failed", e);
}
}
function togglePlatforms(e) {
const t = document.getElementById("platformsGroup");
t && (t.style.display = "yes" === e ? "block" : "none");
}
function toggleLoanDetails(e) {
const t = document.getElementById("loanDetailsGroup");
t && (t.style.display = "yes" === e ? "block" : "none");
}
function acceptCookies() {
const e = new Date();
(e.setFullYear(e.getFullYear() + 1),
(document.cookie = `cookieConsent=accepted; expires=${e.toUTCString()}; path=/; SameSite=Strict; Secure`),
localStorage.setItem("cookieConsent", "accepted"),
document.getElementById("cookieConsent").classList.remove("show"));
}
function declineCookies() {
const e = new Date();
(e.setFullYear(e.getFullYear() + 1),
(document.cookie = `cookieConsent=declined; expires=${e.toUTCString()}; path=/; SameSite=Strict; Secure`),
localStorage.setItem("cookieConsent", "declined"),
document.getElementById("cookieConsent").classList.remove("show"));
}
(document.addEventListener("DOMContentLoaded", () => {
const e = document.querySelector(".stats-section");
e && statsObserver.observe(e);
}),
document.addEventListener("DOMContentLoaded", function () {
document
.querySelectorAll(
"button, .btn-primary, .btn-secondary, .btn-hero-download, .service-card, .driver-app-btn, .btn-primary-large",
)
.forEach((e) => {
((e.style.position = "relative"),
(e.style.overflow = "hidden"),
e.addEventListener("click", createRipple));
});
}),
document.addEventListener("DOMContentLoaded", function () {
(initMagneticButtons(), initStaggerAnimation());
const e = document.getElementById("menuBtn"),
t = document.getElementById("closeBtn"),
n = document.getElementById("fullscreenMenu");
(e
? e.addEventListener("click", function (e) {
(e.preventDefault(),
console.log("Menu button clicked"),
n
? (n.classList.add("active"),
(document.body.style.overflow = "hidden"),
console.log("Menu should be visible now"))
: console.log("fullscreenMenu not found"));
})
: console.log("menuBtn not found"),
t
? t.addEventListener("click", function (e) {
(e.preventDefault(),
console.log("Close button clicked"),
n &&
(n.classList.remove("active"),
(document.body.style.overflow = "")));
})
: console.log("closeBtn not found"),
document.querySelectorAll('a[href^="#"]').forEach((e) => {
e.addEventListener("click", function (e) {
e.preventDefault();
const t = document.querySelector(this.getAttribute("href"));
t &&
(t.scrollIntoView({ behavior: "smooth", block: "start" }),
n &&
n.classList.contains("active") &&
(n.classList.remove("active"),
(document.body.style.overflow = "")));
});
}));
const o = document.getElementById("appModal"),
a = document.getElementById("modalClose"),
i = document.getElementById("floatingAppBtn"),
r = document.getElementById("navAppBtn"),
s = document.getElementById("menuAppBtn"),
c = document.querySelector(".btn-hero-download");
function l() {
o &&
(o.classList.add("active"), (document.body.style.overflow = "hidden"));
}
function d() {
o &&
(o.classList.remove("active"), (document.body.style.overflow = "auto"));
}
(i && i.addEventListener("click", l),
r && r.addEventListener("click", l),
s &&
s.addEventListener("click", () => {
(l(),
n && n.classList.remove("active"),
(document.body.style.overflow = "hidden"));
}),
c && c.addEventListener("click", l),
a && a.addEventListener("click", d),
o &&
o.addEventListener("click", (e) => {
(e.target === o ||
e.target.classList.contains("app-modal-overlay")) &&
d();
}),
document.addEventListener("keydown", (e) => {
"Escape" === e.key && o && o.classList.contains("active") && d();
}));
const u = document.querySelector(".navbar");
let m = 0;
window.addEventListener("scroll", () => {
const e = window.pageYOffset;
(u &&
(e > 50 ? u.classList.add("scrolled") : u.classList.remove("scrolled")),
(m = e));
});
const g = document.getElementById("whatsappBtn");
let p = !1;
window.addEventListener("scroll", () => {
window.pageYOffset > 400 && !p
? (i && i.classList.add("show"), g && g.classList.add("show"), (p = !0))
: window.pageYOffset <= 400 &&
p &&
(i && i.classList.remove("show"),
g && g.classList.remove("show"),
(p = !1));
});
const f = new IntersectionObserver(
(e) => {
e.forEach((e) => {
e.isIntersecting &&
(e.target.classList.add("animate-in"), f.unobserve(e.target));
});
},
{ threshold: 0.15, rootMargin: "0px 0px -80px 0px" },
);
([
{ selector: ".service-card", direction: "up" },
{ selector: ".step", direction: "up" },
{ selector: ".feature-item", direction: "left" },
{ selector: ".feature-img", direction: "right" },
{ selector: ".driver-showcase", direction: "right" },
{ selector: "section h2", direction: "up" },
{ selector: ".city-rides-text", direction: "left" },
{ selector: ".city-rides-img", direction: "right" },
].forEach(({ selector: e, direction: t }) => {
document.querySelectorAll(e).forEach((e, n) => {
(e.classList.add("animate-element", `animate-${t}`),
(e.style.animationDelay = 0.1 * n + "s"),
f.observe(e));
});
}),
console.log("Jeloga - Your Journey...OUR DRIVE 🚗"));
const h = {
rideshare: {
title: "RideShare",
description:
"Save money while traveling with Jeloga RideShare. Share your ride with others going in the same direction.",
howItWorks: [
"Open the Jeloga app and select RideShare",
"Enter your pickup and destination locations",
"Get matched with other riders heading the same way",
"Split the fare and enjoy an affordable ride",
"Rate your experience after the trip",
],
features: [
"Save up to 50% on fares",
"Meet new people",
"Eco-friendly travel",
"Safe and verified riders",
],
},
delivery: {
title: "Delivery",
description:
"Send packages, documents, or food across town quickly and reliably with Jeloga Delivery.",
howItWorks: [
"Select Delivery in the app",
"Enter pickup and dropoff locations",
"Take a photo of your package",
"Track your delivery in real-time",
"Confirm successful delivery",
],
features: [
"Same-day delivery",
"Real-time tracking",
"Insured packages",
"Affordable rates",
],
},
decorator: {
title: "Decorator",
description:
"Professional decoration services for events, homes, and offices. Transform any space beautifully.",
howItWorks: [
"Select Decorator service in the app",
"Describe your decoration needs",
"Get matched with a professional decorator",
"Discuss design and confirm booking",
"Decorator arrives at scheduled time",
],
features: [
"Event decoration",
"Home styling",
"Office makeovers",
"Affordable packages",
],
},
appliance: {
title: "Appliance Repair",
description:
"Expert appliance repair for all your home appliances. Fast, reliable, and affordable service.",
howItWorks: [
"Select Appliance Repair in the app",
"Describe the appliance issue",
"Get matched with a certified technician",
"Technician arrives with tools",
"Pay after successful repair",
],
features: [
"Same-day service",
"Certified technicians",
"Warranty on repairs",
"All brands supported",
],
},
computer: {
title: "Computer & Laptop Repair",
description:
"Professional computer and laptop repair services. We fix hardware and software issues quickly.",
howItWorks: [
"Book Computer Repair in the app",
"Describe your tech problem",
"Get matched with IT expert",
"Technician diagnoses and repairs",
"Data backup and security included",
],
features: [
"Hardware repairs",
"Software troubleshooting",
"Virus removal",
"Data recovery",
],
},
tv: {
title: "TV Technician",
description:
"Professional TV installation, mounting, and repair services for all TV brands and sizes.",
howItWorks: [
"Select TV Technician in the app",
"Specify TV brand and issue",
"Get matched with TV specialist",
"Technician brings necessary equipment",
"Quality service guaranteed",
],
features: [
"Wall mounting",
"Repair all brands",
"Cable management",
"Home theater setup",
],
},
gas: {
title: "Gas Technician",
description:
"Safe and certified gas appliance installation and repair. Your safety is our priority.",
howItWorks: [
"Book Gas Technician service",
"Describe gas appliance issue",
"Certified gas expert assigned",
"Safety inspection included",
"Professional installation or repair",
],
features: [
"Licensed professionals",
"Safety certified",
"All gas appliances",
"Emergency service",
],
},
cleaning: {
title: "Cleaning Services",
description:
"Professional cleaning services for homes, offices, and commercial spaces. Spotless results guaranteed.",
howItWorks: [
"Select Cleaning Service in the app",
"Choose cleaning package",
"Schedule your preferred time",
"Professional cleaners arrive",
"Enjoy your clean space",
],
features: [
"Deep cleaning",
"Eco-friendly products",
"Flexible scheduling",
"Trained professionals",
],
},
tiler: {
title: "Tiler",
description:
"Expert tiling services for floors, walls, bathrooms, and kitchens. Quality workmanship guaranteed.",
howItWorks: [
"Book Tiler service in the app",
"Describe your tiling project",
"Get matched with expert tiler",
"Discuss materials and design",
"Professional installation begins",
],
features: [
"Floor tiling",
"Wall tiling",
"Bathroom renovation",
"Kitchen backsplash",
],
},
construction: {
title: "Construction",
description:
"Professional construction and renovation services for residential and commercial projects.",
howItWorks: [
"Select Construction service",
"Describe your project scope",
"Get matched with contractors",
"Receive quote and timeline",
"Construction work begins",
],
features: [
"New construction",
"Renovations",
"Extensions",
"Commercial projects",
],
},
removals: {
title: "Removals",
description:
"Professional moving and removals service. Safe, efficient, and stress-free relocations.",
howItWorks: [
"Book Removals in the app",
"List items to be moved",
"Get matched with moving team",
"Pack and load assistance",
"Deliver to new location",
],
features: [
"Home relocations",
"Office moving",
"Packing service",
"Insured moves",
],
},
gardening: {
title: "Gardening",
description:
"Professional gardening and landscaping services. Keep your outdoor space beautiful year-round.",
howItWorks: [
"Select Gardening service",
"Describe garden maintenance needs",
"Get matched with gardener",
"Schedule regular or one-time service",
"Enjoy your beautiful garden",
],
features: [
"Lawn maintenance",
"Landscaping",
"Tree trimming",
"Garden design",
],
},
carrepair: {
title: "Car Repair",
description:
"Professional car repair and maintenance services. Keep your vehicle running smoothly.",
howItWorks: [
"Book Car Repair in the app",
"Describe vehicle issue",
"Get matched with mechanic",
"Mechanic arrives with tools",
"Professional repair on-site",
],
features: [
"Mobile mechanics",
"All car brands",
"Fair pricing",
"Quality parts",
],
},
locksmith: {
title: "Lock Smith",
description:
"Professional locksmith services available 24/7. Emergency lockout assistance and security solutions.",
howItWorks: [
"Select Lock Smith service",
"Describe your lock issue",
"Get matched with locksmith",
"Fast emergency response",
"Professional lock service",
],
features: [
"24/7 emergency service",
"Lock installation",
"Key duplication",
"Security upgrades",
],
},
handyman: {
title: "Handyman Services",
description:
"Select handyman service of your choice and download the app to enjoy our services. We provide professional handyman services to make your life easier.",
features: [
"Professional and verified service providers",
"Wide range of home and office services",
"Flexible scheduling",
"Transparent pricing",
"Quality guaranteed work",
"Quick response time",
],
howItWorks: [
"Download the Jeloga app",
"Browse available handyman services",
"Select your desired service",
"Choose a convenient time",
"Get matched with a professional",
"Enjoy quality service",
],
},
},
y = document.getElementById("serviceModal"),
v = document.getElementById("closeServiceModal"),
E = document.getElementById("serviceModalBody");
function b() {
(y.classList.remove("active"), (document.body.style.overflow = "auto"));
}
(document.querySelectorAll(".service-card").forEach((e) => {
e.addEventListener("click", function () {
const e = this.getAttribute("data-service");
e &&
h[e] &&
(function (e) {
const t = h[e];
if (!t) return;
let n = "";
t.howItWorks &&
(n = `\n <h3>How It Works</h3>\n <ul>\n ${t.howItWorks.map((e) => `<li>${e}</li>`).join("")}\n </ul>\n `);
let o = "";
t.features &&
(o = `\n <h3>Features</h3>\n <ul>\n ${t.features.map((e) => `<li>${e}</li>`).join("")}\n </ul>\n `);
((E.innerHTML = `\n <h2>${t.title}</h2>\n <p>${t.description}</p>\n ${n}\n ${o}\n `),
y.classList.add("active"),
(document.body.style.overflow = "hidden"));
})(e);
});
}),
v && v.addEventListener("click", b),
y &&
y.addEventListener("click", (e) => {
(e.target === y ||
e.target.classList.contains("service-modal-overlay")) &&
b();
}),
document.addEventListener("keydown", (e) => {
"Escape" === e.key && y && y.classList.contains("active") && b();
}));
const L = document.getElementById("driverRegistrationForm"),
I = document.getElementById("successMessage");
L &&
L.addEventListener("submit", async function (e) {
e.preventDefault();
const t = new FormData(L),
n = t.get("fullName"),
o = t.get("email"),
a = t.get("phone"),
i = t.get("city"),
r = t.get("licenseNumber"),
s = t.get("experience"),
c = t.get("carInterest"),
l = t.get("message") || "N/A",
d = new Date().toLocaleString(),
u = L.querySelector(".btn-submit-form"),
m = u.querySelector(".btn-text"),
g = u.querySelector(".btn-loading");
((u.disabled = !0),
(m.style.display = "none"),
(g.style.display = "flex"));
const p =
`\nNew Driver Registration - JELOGA\n\nDriver Information:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nFull Name: ${n}\nEmail: ${o}\nPhone: ${a}\nCity: ${i}\n\nLicense Information:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nLicense Number: ${r}\nDriving Experience: ${s}\n\nCar Hire Purchase:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nInterest: ${c}\n\nAdditional Information:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n${l}\n\nSubmitted: ${d}\n `.trim();
try {
const e = encodeURIComponent(`New Driver Registration - ${n}`),
t = `mailto:support@jeloga.com?subject=${e}&body=${encodeURIComponent(p)}`;
(await new Promise((e) => setTimeout(e, 1500)),
(window.location.href = t),
(L.style.display = "none"),
(I.style.display = "block"),
L.reset(),
setTimeout(() => {
((u.disabled = !1),
(m.style.display = "inline"),
(g.style.display = "none"));
}, 2e3));
} catch (e) {
(console.error("Form submission error:", e),
alert(
"There was an error submitting the form. Please try again or contact us directly.",
),
(u.disabled = !1),
(m.style.display = "inline"),
(g.style.display = "none"));
}
});
const w = document.querySelector(".driver-signup-btn");
w &&
w.addEventListener("click", function () {
const e = document.getElementById("register-driver");
e && e.scrollIntoView({ behavior: "smooth", block: "start" });
});
const S = document.getElementById("rentalModal"),
k = document.querySelector(".rent-car-btn"),
B = document.getElementById("rentalModalClose"),
A = document.getElementById("hirePurchaseForm"),
C = document.getElementById("rentalSuccessMessage");
function N() {
S &&
(S.classList.remove("active"), (document.body.style.overflow = "auto"));
}
(k &&
k.addEventListener("click", function () {
S &&
(S.classList.add("active"),
(document.body.style.overflow = "hidden"));
}),
B && B.addEventListener("click", N),
S &&
S.addEventListener("click", (e) => {
(e.target === S ||
e.target.classList.contains("rental-modal-overlay")) &&
N();
}),
document.addEventListener("keydown", (e) => {
"Escape" === e.key && S && S.classList.contains("active") && N();
}),
A &&
A.addEventListener("submit", async function (e) {
e.preventDefault();
const t = new FormData(A),
n = t.get("dateOfBirth");
if (n) {
const e = new Date(n),
t = new Date();
let o = t.getFullYear() - e.getFullYear();
const a = t.getMonth() - e.getMonth();
if (
((a < 0 || (0 === a && t.getDate() < e.getDate())) && o--, o < 18)
)
return void alert(
"❌ ELIGIBILITY ERROR\n\nYou must be at least 18 years old to apply for hire purchase.\n\nCurrent Age: " +
o +
" years\nRequired: 18+ years",
);
}
const o = t.get("idNumber");
if (t.getAll("idType").includes("NIN") && o) {
if (!/^\d{11}$/.test(o.replace(/\s/g, "")))
return void alert(
"❌ NIN FORMAT ERROR\n\nNational Identity Number (NIN) must be exactly 11 digits.\n\nExample: 12345678901\n\nPlease check and correct your NIN.",
);
}
const a = t.get("phoneNumber");
if (a && !/^(070|080|081|090|091)\d{8}$/.test(a.replace(/\s/g, "")))
return void alert(
"❌ PHONE NUMBER ERROR\n\nPlease enter a valid Nigerian phone number.\n\nFormat: 0801234567 or 0701234567\n\nYour number: " +
a,
);
const i = t.get("email");
if (i) {
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i))
return void alert(
"❌ EMAIL FORMAT ERROR\n\nPlease enter a valid email address.\n\nExample: yourname@gmail.com",
);
}
const r = t.get("accountNumber");
if (r) {
if (!/^\d{10}$/.test(r.replace(/\s/g, "")))
return void alert(
"❌ ACCOUNT NUMBER ERROR\n\nNigerian bank account numbers must be exactly 10 digits.\n\nExample: 0123456789\n\nYour input: " +
r,
);
}
const s = t.get("licenseNumber");
if (s && s.length < 5)
return void alert(
"❌ LICENSE NUMBER ERROR\n\nPlease enter a valid driver license number.",
);
const c = t.get("licenseExpiry");
if (c) {
const e = new Date(c);
if (e < new Date())
return void alert(
"❌ EXPIRED LICENSE\n\nYour driver license has expired.\n\nExpiry Date: " +
e.toLocaleDateString() +
"\n\nPlease renew your license before applying.",
);
}
const l = [];
t.getAll("idType").forEach((e) => l.push(e));
const d = [];
t.getAll("platforms").forEach((e) => d.push(e));
const u = t.get("fullName"),
m = t.get("otherNames"),
g = t.get("gender"),
p = t.get("dateOfBirth"),
f = t.get("maritalStatus"),
h = t.get("nationality"),
y = t.get("stateOfOrigin"),
v = t.get("lga"),
E = t.get("permanentAddress"),
b = t.get("currentAddress"),
L = t.get("phoneNumber"),
I = t.get("altPhone"),
w = t.get("email"),
S = l.join(", "),
k = t.get("idNumber"),
B = t.get("licenseNumber"),
$ = t.get("licenseExpiry"),
x = t.get("drivingExperience"),
O = t.get("previousJobs"),
T = t.get("rideHailingExp"),
M = d.join(", "),
D = t.get("existingLoan"),
R = t.get("loanDetails"),
P = t.get("bankName"),
F = t.get("accountName"),
q = t.get("accountNumber"),
W = t.get("weeklyIncome"),
G = t.get("otherIncome"),
j = t.get("nextOfKinName"),
V = t.get("nextOfKinRelation"),
Y = t.get("nextOfKinPhone"),
H = t.get("nextOfKinAddress"),
U = t.get("nextOfKinWorkplace"),
J = t.get("guarantor1Name"),
K = t.get("guarantor1Relation"),
X = t.get("guarantor1Phone"),
Q = t.get("guarantor1Address"),
z = t.get("guarantor1Workplace"),
_ = t.get("guarantor2Name"),
Z = t.get("guarantor2Relation"),
ee = t.get("guarantor2Phone"),
te = t.get("guarantor2Address"),
ne = t.get("guarantor2Workplace"),
oe = t.get("hearAbout"),
ae = new Date().toLocaleString(),
ie = A.querySelector(".btn-submit-form"),
re = ie.querySelector(".btn-text"),
se = ie.querySelector(".btn-loading");
((ie.disabled = !0),
(re.style.display = "none"),
(se.style.display = "flex"));
const ce =
`\nJELOGA CAR HIRE PURCHASE APPLICATION\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n📋 SECTION A: APPLICANT PERSONAL INFORMATION\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nFull Name: ${u}\nOther Names: ${m || "N/A"}\nGender: ${g}\nDate of Birth: ${p}\nMarital Status: ${f}\nNationality: ${h}\nState of Origin: ${y}\nLGA: ${v}\nPermanent Address: ${E}\nCurrent Address: ${b}\nPhone Number: ${L}\nAlternative Phone: ${I || "N/A"}\nEmail: ${w || "N/A"}\n\n🆔 SECTION B: IDENTIFICATION & VERIFICATION\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nID Types: ${S}\nID Number: ${k}\nLicense Number: ${B}\nLicense Expiry: ${$}\n\n🚗 SECTION C: DRIVING & WORK HISTORY\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nDriving Experience: ${x}\nPrevious Jobs: ${O || "N/A"}\nRide-hailing Experience: ${T}\nPlatforms: ${M || "N/A"}\nExisting Loan: ${D}\nLoan Details: ${R || "N/A"}\n\n💰 SECTION D: FINANCIAL DETAILS\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nBank Name: ${P}\nAccount Name: ${F}\nAccount Number: ${q}\nWeekly Income: ₦${W}\nOther Income: ${G || "N/A"}\n\n👨👩👧 SECTION E: NEXT OF KIN\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nName: ${j}\nRelationship: ${V}\nPhone: ${Y}\nAddress: ${H}\nWorkplace: ${U || "N/A"}\n\n🤝 SECTION F: GUARANTOR 1\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nName: ${J}\nRelationship: ${K}\nPhone: ${X}\nAddress: ${Q}\nWorkplace: ${z}\n\n🤝 SECTION G: GUARANTOR 2\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nName: ${_}\nRelationship: ${Z}\nPhone: ${ee}\nAddress: ${te}\nWorkplace: ${ne}\n\n📢 HOW DID YOU HEAR ABOUT US\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nSource: ${oe || "N/A"}\n\n⏰ SUBMISSION TIME\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n${ae}\n\n⚠️ NOTE: Applicant has uploaded ID cards, passport photo, and guarantor documents. Please retrieve these files from the form submission system.\n `.trim();
try {
const e = encodeURIComponent(
`NEW HIRE PURCHASE APPLICATION - ${u}`,
),
t = encodeURIComponent(ce),
n = `mailto:${"support@jeloga.com"}?subject=${e}&body=${t}`;
(await new Promise((e) => setTimeout(e, 1500)),
(window.location.href = n),
(A.style.display = "none"),
(C.style.display = "block"),
A.reset(),
setTimeout(() => {
((ie.disabled = !1),
(re.style.display = "inline"),
(se.style.display = "none"),
(A.style.display = "flex"),
(C.style.display = "none"),
N());
}, 4e3));
} catch (e) {
(console.error("Form submission error:", e),
alert(
"There was an error submitting the form. Please try again or contact us directly at support@jeloga.com",
),
(ie.disabled = !1),
(re.style.display = "inline"),
(se.style.display = "none"));
}
}));
}),
document.addEventListener("DOMContentLoaded", function () {
const e = document.getElementById("heroLeadForm");
e &&
e.addEventListener("submit", async function (t) {
t.preventDefault();
const n = document.getElementById("leadName").value.trim(),
o =
(document.getElementById("leadEmail") &&
document.getElementById("leadEmail").value.trim()) ||
"",
a = document.getElementById("leadPhone").value.trim();
if (!a) return void alert("Please enter a phone number");
const i = {
name: n || "-",
email: o || "-",
phone: a,
page: window.location.pathname,
timestamp: new Date().toISOString(),
};
try {
const e = JSON.parse(localStorage.getItem("jelogaLeads") || "[]");
(e.push(i), localStorage.setItem("jelogaLeads", JSON.stringify(e)));
} catch (e) {
console.warn("Local save failed", e);
}
const r = e.getAttribute("data-sheet-url");
if (r)
try {
await fetch(r, {
method: "POST",
mode: "no-cors",
body: JSON.stringify({ type: "lead", data: i }),
});
} catch (e) {
console.warn("Posting to sheet failed", e);
}
const s = e.getAttribute("action");
if (s && s.includes("formsubmit.co"))
try {