-
Notifications
You must be signed in to change notification settings - Fork 289
/
nearby.html
816 lines (713 loc) · 27.1 KB
/
nearby.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="src/css/navbar.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css">
<!-- Added Favicon -->
<link rel="shortcut icon" href="ambulance.png" type="image/x-icon" />
<title>Find Nearby Hospital</title>
<div class="gtranslate_wrapper"></div>
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
background-color: #f7f7f7;
}
h1 {
text-align: center;
margin-bottom: 10px;
}
h2 {
text-align: center;
font-size: 18px;
color: #555;
margin-bottom: 30px;
}
.main_container {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 20px;
margin-bottom: 20px;
}
.search-container {
text-align: center;
margin-bottom: 20px;
}
.button {
background-color: #259ee9;
border: none;
border-radius: 5px;
color: white;
padding: 10px 15px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.button:hover {
background-color: #00BFFF;
}
#searchInput {
width: 300px;
padding: 10px;
font-size: 16px;
border: 1px solid #ddd;
border-radius: 4px;
}
.hospital-card {
background-color: #e7f3fe;
padding: 10px;
border-radius: 8px;
text-align: center;
transition: transform 0.3s ease, box-shadow 0.3s ease;
font-size: large;
}
.hospital-card:hover {
transform: scale(1.05);
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
color: rgb(178, 233, 233);
}
.hospital-card img {
width: 100%;
height: 180px;
object-fit: cover;
border-radius: 8px;
}
.hospital-card a {
display: block;
margin: 10px 0 5px 0;
text-decoration: none;
color: #050505;
font-weight: bold;
font-size: 16px;
}
.hospital-card p {
color: #676262;
}
.dark-mode .logo img {
filter: brightness(10);
/* Inverts the color to make it white */
}
.dark-mode h1,
.dark-mode h2 {
color: #e7f3fe;
}
footer {
background-color: #C4D7FF;
color: #f3f4f6;
text-align: center;
padding: 15px 0;
width: 100%;
}
footer a{
text-decoration: none;
color: #f3f4f6;
}
.checkbtn {
font-size: 30px;
color: #333;
float: right;
line-height: 80px;
margin-right: 40px;
cursor: pointer;
display: none;
}
#check {
display: none;
}
/* Added the hover animation on the footer social icons */
.social-icon {
transition: transform 0.3s ease;
/* Smooth transition effect */
}
.social-icon:hover {
transform: scale(1.3);
/* Scale the element to 1.3 times its size */
}
.fa-facebook:hover {
color: blue;
/* Icon color change to blue on hover */
}
.fa-x-twitter:hover {
color: black;
/* Icon color change to black on hover */
}
.fa-instagram:hover {
color: orangered;
/* Icon color change to orangered on hover */
}
.fa-linkedin-in:hover {
color: rgb(16, 13, 195);
/* Icon color change to rgb(16, 13, 195) on hover */
}
.feature p {
color: #555;
}
.team-feature {
background-color: #e7ffe7;
padding: 20px;
display: flex;
align-items: center;
text-align: left;
border-radius: 10px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
grid-column: 1 / -1;
}
.team-feature img {
width: 150px;
height: auto;
margin-right: 20px;
border-radius: 10px;
}
.contact-feature {
background-color: #f2e4aa;
padding: 20px;
display: flex;
align-items: center;
text-align: left;
border-radius: 10px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
grid-column: 1 / -1;
}
.contact-feature img {
width: 150px;
height: auto;
margin-right: 20px;
border-radius: 10px;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.container {
width: 98vw;
}
#contact-hvr:hover {
background: none;
}
</style>
</head>
<body>
<!-- pre loader -->
<div id="preloader">
<div class="wrapper">
<div class="box-wrap">
<div class="box one"></div>
<div class="box two"></div>
<div class="box three"></div>
<div class="box four"></div>
<div class="box five"></div>
<div class="box six"></div>
</div>
</div>
</div>
<div class="container" id="container">
<div class="logo">
<div class="brand-name">
<span class="letter red" style="--letter-index: 1;">A</span>
<span class="letter red" style="--letter-index: 2;">m</span>
<span class="letter red" style="--letter-index: 3;">b</span>
<span class="letter red" style="--letter-index: 4;">u</span>
<span class="letter" style="--letter-index: 5;">F</span>
<span class="letter" style="--letter-index: 6;">l</span>
<span class="letter" style="--letter-index: 7;">o</span>
<span class="letter" style="--letter-index: 8;">w</span>
</div>
<img src="images/logo2-w.webp" alt="Ambulance Monitoring System Logo" style="width: 80px; height: auto" />
</div>
<nav class="menu">
<ul>
<li>
<a href="#container" style="color: #333;">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.34314 11.5858L12 5.92893M12 5.92893L17.6568 11.5858M12 5.92893V18.0711"
stroke="currentColor">
</path>
</svg>
</a>
</li>
<li>
<a href="index.html" id="home-link" class="menu_links" data-link="Home">
<span>Home</span>
</a>
</li>
<li>
<a href="features.html" id="features-link" class="menu_links" data-link="Features">
<span>Features</span></a>
</li>
<li>
<a href="team.html" id="team-link" class="menu_links" data-link="Team">
<span>Team</span></a>
</li>
<li>
<a href="contact.html" id="contact-link" class="menu_links" data-link="Contact">
<span>Contact</span></a>
</li>
<li>
<a href="Feedback.html" id="feedback-link" class="menu_links" data-link="Feedback">
<span>Feedback</span></a>
</li>
<li>
<a href="nearby.html" id="nearby-link" class="menu_links" data-link="Nearby">
<span>Nearby</span></a>
</li>
</ul>
</nav>
</div>
<a href="chatbot.html">
<div class="fixed bottom-0 right-2 chatbot-container">
<button class="chatbot-button group">
<img class="h-20" src="chatbot.gif" alt="chatbot" />
<span class="tooltip-text">
Welcome to AmbuFlow!<br />
How can I help You?
</span>
</button>
</div>
</a>
<button class="light-dark-btn dark-mode-toggle" id="dark-mode-button">
<i class="fa-solid fa-moon"></i>
</button>
<script>
// Select the button by its ID
const darkModeButton = document.getElementById('dark-mode-button');
// Add an event listener for the 'click' event
darkModeButton.addEventListener('click', () => {
// Toggle the 'dark-mode' class on the body element
document.body.classList.toggle('dark-mode');
// Save the dark mode preference in localStorage
if (document.body.classList.contains('dark-mode')) {
localStorage.setItem('theme', 'dark');
} else {
localStorage.setItem('theme', 'light');
}
});
// Check localStorage for saved theme preference on page load
document.addEventListener('DOMContentLoaded', () => {
if (localStorage.getItem('theme') === 'dark') {
document.body.classList.add('dark-mode');
}
});
</script>
<h1>Find Nearby Hospital</h1>
<h2>Track or call an ambulance and check nearby hospitals for emergency services</h2>
<div class="search-container">
<input type="text" id="searchInput" placeholder="Search hospitals by name or location...">
</div>
<div class="main_container" id="hospitalContainer">
<!-- Hospital cards will be dynamically added here -->
</div>
<script>
// Hospital data
const hospitals = [
{
name: "AIIMS Delhi",
location: "Ansari Nagar, New Delhi",
image: "https://lh5.googleusercontent.com/p/AF1QipP9JGi6pake5Zae72zMqWgYhakGZTnP1KMkEoMI=w408-h306-k-no",
link: "https://www.google.com/maps/place/All+India+Institute+Of+Medical+Sciences+Delhi/@28.5671821,77.2074702,17z/data=!3m1!4b1!4m6!3m5!1s0x390ce26f903969d7:0x8367180c6de2ecc2!8m2!3d28.5671774!4d77.2100451!16s%2Fm%2F0lq5p3v?entry=ttu&g_ep=EgoyMDI0MTAwOC4wIKXMDSoASAFQAw%3D%3D",
phone: "+911345678901"
},
{
name: "Fortis Escorts Heart Institute",
location: "Okhla Road, New Delhi",
image: "https://lh5.googleusercontent.com/p/AF1QipO_LJoTauSAwR0RaSEco9DpYYfVjcBL6oMwZlGM=w480-h240-k-no",
link: "https://www.google.com/maps/place/Fortis+Escorts+Heart+Institute/@28.5605979,77.2714045,17z/data=!3m1!4b1!4m6!3m5!1s0x390ce392b869bbaf:0x865db71ba6f271b2!8m2!3d28.5605932!4d77.2739794!16s%2Fg%2F1tyzxc62?entry=ttu&g_ep=EgoyMDI0MTAwOC4wIKXMDSoASAFQAw%3D%3D",
phone: "+911345678901"
},
{
name: "Max Super Speciality Hospital",
location: "Saket, New Delhi",
image: "https://lh5.googleusercontent.com/p/AF1QipMHbDvRM2SnP15JEFiHHU3BkbeMyILB4Fe_9vb_=w408-h272-k-no",
link: "https://www.google.com/maps/place/Max+Super+Speciality+Hospital,+Saket+(Max+Saket)/@28.5275537,77.2094197,17z/data=!3m1!4b1!4m6!3m5!1s0x390ce1f427d4c5fb:0x582d47bbf4970bc1!8m2!3d28.527549!4d77.2119946!16s%2Fm%2F0nhgv9_?entry=ttu&g_ep=EgoyMDI0MTAwOC4wIKXMDSoASAFQAw%3D%3D",
phone: "+911345678901"
},
{
name: "BLK Super Speciality Hospital",
location: "Pusa Road, New Delhi",
image: "https://lh5.googleusercontent.com/p/AF1QipOOE3FO4yP5Th80bikVNoZbSmhNUgZz8baujSsJ=w427-h240-k-no",
link: "https://www.google.com/maps/place/BLK-Max+Super+Speciality+Hospital+Delhi/@28.6433081,77.1771302,17z/data=!3m1!4b1!4m6!3m5!1s0x390d029633b6af21:0x9a67323b63bcc188!8m2!3d28.6433034!4d77.1797051!16s%2Fg%2F1tfzvwkd?entry=ttu&g_ep=EgoyMDI0MTAwOC4wIKXMDSoASAFQAw%3D%3D",
phone: "+911345678901"
},
{
name: "Sir Ganga Ram Hospital",
location: "Rajinder Nagar, New Delhi",
image: "https://lh5.googleusercontent.com/p/AF1QipPge4AJnRsJww6qZfswWAL9LBfd1iDCBM-hpCzW=w408-h544-k-no",
link: "https://www.google.com/maps/place/SIR+GANGA+RAM+HOSPITAL,+Sir+Ganga+Ram+Hospital+Marg,+Old+Rajinder+Nagar,+New+Rajinder+Nagar,+Delhi,+110060/@28.6385473,77.1894559,17z/data=!3m1!4b1!4m6!3m5!1s0x390d02a17c4ab835:0xdee61a9d767b964b!8m2!3d28.6384582!4d77.1895559!16s%2Fg%2F11bytpc110?entry=ttu&g_ep=EgoyMDI0MTAwOC4wIKXMDSoASAFQAw%3D%3D",
phone: "+911345678901"
},
{
name: "Apollo Hospitals Delhi",
location: "Karol Bagh, New Delhi",
image: "https://lh5.googleusercontent.com/p/AF1QipNUO3hhiOSgCnWYou3qHm0SQTlKaM0wIfiG_OaU=w408-h270-k-no",
link: "#",
phone: "+911345678901"
},
{
name: "Holy Family Hospital",
location: "Okhla, New Delhi",
image: "https://lh5.googleusercontent.com/p/AF1QipMpQ-20kn_yH0AtOS1fl7o9fhVcdPZIs4ncO5fU=w408-h306-k-no",
link: "https://www.google.com/maps/place/Holy+Family+Hospital/@28.5618161,77.2751113,17z/data=!4m15!1m8!3m7!1s0x390ce3929e6d3319:0xcd2355b56b80d9cf!2sHoly+Family+Hospital!8m2!3d28.5618161!4d77.2751113!10e5!16s%2Fm%2F0n46sgy!3m5!1s0x390ce3929e6d3319:0xcd2355b56b80d9cf!8m2!3d28.5618161!4d77.2751113!16s%2Fm%2F0n46sgy?entry=ttu&g_ep=EgoyMDI0MTAwOC4wIKXMDSoASAFQAw%3D%3D",
phone: "+911345678901"
},
{
name: "Safdarjung Hospital",
location: "Safdarjung Enclave, New Delhi",
image: "https://lh5.googleusercontent.com/p/AF1QipNrfGkAU1lF3dJVwnJZpLFNrRbzmksWyRDJmvwy=w408-h489-k-no",
link: "https://www.google.com/maps/place/Safdarjung+Hospital+New+Emergency+Block/@28.5686945,77.2069167,17z/data=!3m1!4b1!4m6!3m5!1s0x390ce3c788fcae8f:0x2db4a8bddc6eae25!8m2!3d28.5686945!4d77.2069167!16s%2Fg%2F11f66b854r?entry=ttu&g_ep=EgoyMDI0MTAwOC4wIKXMDSoASAFQAw%3D%3D",
},
{
name: "Moolchand Medcity",
location: "Lajpat Nagar, New Delhi",
image: "https://lh5.googleusercontent.com/p/AF1QipO3wxKBu2OTky8xeC5ML8UrgN-ddnaxTqyKuHzr=w408-h368-k-no",
link: "https://www.google.com/maps/place/Moolchand+Hospital/@28.566167,77.2331993,17z/data=!4m10!1m2!2m1!1smoolchand+medcity!3m6!1s0x390ce3c849a0fecd:0x309c4e9de4e2aff3!8m2!3d28.566167!4d77.235388!15sChFtb29sY2hhbmQgbWVkY2l0eZIBEHByaXZhdGVfaG9zcGl0YWzgAQA!16s%2Fg%2F11j0045tc5?entry=ttu&g_ep=EgoyMDI0MTAwOC4wIKXMDSoASAFQAw%3D%3D",
phone: "+911345678901"
},
{
name: "Deen Dayal Upadhyay Hospital",
location: "Hari Nagar, New Delhi",
image: "https://lh5.googleusercontent.com/p/AF1QipOwiTt3QQ-u0vkOmn0njbkwESBmspr82g_wF4Er=w427-h240-k-no",
link: "https://www.google.com/maps/place/Deen+Dayal+Upadhyay+Hospital/@28.628017,77.1122963,17z/data=!3m1!4b1!4m6!3m5!1s0x390cfd309eebed77:0xc8559980f0b50535!8m2!3d28.628017!4d77.1122963!16s%2Fg%2F1tf1m64n?entry=ttu&g_ep=EgoyMDI0MTAwOC4wIKXMDSoASAFQAw%3D%3D",
phone: "+911345678901"
},
{
name: "Artemis Hospitals",
location: "Dwarka, New Delhi",
image: "https://lh5.googleusercontent.com/p/AF1QipO4FfTa6lmb3Hncw3WgwGt-4n-4qcv6NDMVeUfh=w408-h306-k-no",
link: "https://www.google.com/maps/place/Artemis+Hospitals+Dwarka/@28.5709273,77.0593246,17z/data=!3m1!4b1!4m6!3m5!1s0x390d1b03c0000001:0x3eb1330d284a7209!8m2!3d28.5709273!4d77.0593246!16s%2Fg%2F11g_yrth5?entry=ttu&g_ep=EgoyMDI0MTAwOC4wIKXMDSoASAFQAw%3D%3D",
phone: "+911345678901"
},
{
name: "Venkateshwar Hospital",
location: "Sector 18A, Dwarka, New Delhi",
image: "https://lh5.googleusercontent.com/p/AF1QipPfqqxb8Yu1rfBbEWDzom0Gb1mfY7R8zohuCym1=w408-h544-k-no",
link: "https://www.google.com/maps/place/Venkateshwar+Hospital/@28.5885973,77.0380428,17z/data=!3m1!4b1!4m6!3m5!1s0x390d1ac3e8a4b27b:0x218f945a11993663!8m2!3d28.5885973!4d77.0380428!16s%2Fg%2F11b7y83nv6?entry=ttu&g_ep=EgoyMDI0MTAwOC4wIKXMDSoASAFQAw%3D%3D",
phone: "+911345678901"
}
];
function createHospitalCard(hospital) {
return `
<div class="hospital-card">
<a href="${hospital.link}" target="_blank">
<img src="${hospital.image}" alt="${hospital.name}">
</a>
<a href="${hospital.link}" target="_blank">${hospital.name}</a>
<p>Location: ${hospital.location}</p>
<button class="button" onclick="window.location.href='tel:${hospital.phone}'">Call Now</button>
</div>
`;
}
function renderHospitals(hospitalsToRender) {
const container = document.getElementById('hospitalContainer');
container.innerHTML = hospitalsToRender.map(createHospitalCard).join('');
}
function filterHospitals(searchTerm) {
return hospitals.filter(hospital =>
hospital.name.toLowerCase().includes(searchTerm.toLowerCase()) ||
hospital.location.toLowerCase().includes(searchTerm.toLowerCase())
);
}
document.getElementById('searchInput').addEventListener('input', function (e) {
const searchTerm = e.target.value;
const filteredHospitals = filterHospitals(searchTerm);
renderHospitals(filteredHospitals);
});
// Initial render
renderHospitals(hospitals);
</script>
<!-- footer start here -->
<footer class="fot">
<div class="l1">
<h2>About</h2>
<p>AmbuFlow is ambulance tracking site which helps you to find the nearest hospitals and get access to nearest
ambulances and save lives</p>
</div>
<div class="l2">
<div>
<h2 style="margin-left: 1vw;">Useful link</h2>
<p><a href="index.html">Home</a></p>
<p style="margin-left: 1.3vw;"><a href="features.html">Features</a></p>
<p><a href="team.html">Team</a></p>
<p style="margin-left: 3.5vw;"><a href="privacy.html">Privacy Policy</a></p>
<p style="margin-left: 4.5vw;"><a href="terms.html">Terms of Service</a></p>
</div>
<div class="l21">
<h2>Help Desk</h2>
<p><a href="contact.html">Support</a></p>
<p><a href="Contactus.html">Contact Us</a></p>
<p><a href="#faq-section">FAQ</a></p>
<p><a href="nearby.html">Near by</a></p>
<p><a href="contact.html">Phone</a></p>
</div>
</div>
<!-- Newsletter Subscription -->
<div style="min-width: 200px; margin-bottom: 20px;">
<h3 style="font-size: 1.5rem; margin-bottom: 10px; color: darkorange;">
Subscribe to Our Newsletter</h3>
<form id="newsletter-form" novalidate>
<i class="fas fa-envelope" style="position: absolute; bottom: -142.6rem; right: 18.3rem; color: rgb(129, 128, 128); font-size: 13px;"></i>
<input type="email" placeholder="Your Email" style="padding: 10px; width: 80%; border: none; border-radius: 7px; padding-left: 27px;"
required><br><br>
<button type="submit"
style="background-color: #e81a1a; color: white; padding: 10px 20px; border: none; cursor: pointer; border-radius: 5px;">Subscribe</button>
</form>
<!-- Toast Notification -->
<div id="toast"
style="display: none; position: fixed; bottom: 20px; right: 60px; background-color: #333; color: white; padding: 10px; border-radius: 5px; z-index: 1000;">
</div>
</div>
</div>
<script>
function showToast(message,type) {
const toast = document.getElementById('toast');
toast.textContent = message;
toast.style.display = "block"; // Show the toast
toast.style.backgroundColor = type==='success' ? 'green':'red'
toast.style.color = 'white';
setTimeout(() => {
toast.style.display = "none"; // Hide after 3 seconds
}, 3000);
}
document.getElementById('newsletter-form').addEventListener('submit', function (event) {
event.preventDefault(); // Prevent form submission
const emailInput = this.querySelector('input[type="email"]');
const email = emailInput.value;
// Basic email validation
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (emailPattern.test(email)) {
showToast("Thank you for subscribing!",'success'); // Show success message
emailInput.value = ""; // Clear the input field
} else {
showToast("Please enter a valid email address.",'error'); // Show error message
}
});
</script>
</footer>
<style>
.fot {
display: flex;
height: 40vh;
width: 100%;
background-color: #25242a;
}
.l1 {
width: 30vw;
}
.l2 {
display: flex;
width: 40vw;
margin-left: 8vw;
}
.l21 {
margin-left: 9vw;
}
h2 {
color: darkorange;
}
.l1 p {
font-size: 1vw;
padding: 1vw;
color: white;
}
.l2 p {
font-size: 1vw;
padding: .5vw;
color: white;
justify-content: first baseline;
margin-top: -1vw;
}
.con {
margin-left: .9vw;
}
.l21 p {
font-size: 1vw;
padding: .5vw;
color: white;
justify-content: first baseline;
margin-top: -1vw;
}
.social-icons a {
background: darkorange;
width: 40px;
height: 40px;
display: inline-block;
margin-right: 4px;
}
.social-icons a i {
color: #e7f2f4;
padding: 13px 12px;
height: 20px;
}
@media (max-width: 768px) {
.fot {
display: flex;
flex-direction: column;
height: 100vh;
margin-right: 12vw;
}
.l1 h2 {
font-size: 10vw;
margin-left: 33vw;
margin-top: -1vw;
}
.l1 p {
font-size: 4vw;
width: 90vw;
padding: 5vw;
margin-right: 5vw;
margin-top: -8vw;
}
.l2 {
display: flex;
flex-direction: row;
}
.l2 h2 {
font-size: 5vw;
width: 30vw;
}
.l2 p {
font-size: 3vw;
}
.l21 {
margin-left: 19vw;
}
.l3 {
margin-left: -17vw;
}
}
</style>
<button id="scrollToTopBtn" class="scroll-top" aria-label="Scroll to top">
<div class="scroll-top-icon">
<i class="fa-solid fa-arrow-up"></i>
</div>
<svg class="progress-ring" width="60" height="60">
<circle class="progress-ring__circle" stroke="#ffffff" stroke-width="4" fill="transparent" r="28" cx="30"
cy="30"></circle>
</svg>
</button>
<style>
.scroll-top {
position: fixed;
right: 1.6%;
background: linear-gradient(100deg, #1ca6f0, #3c7aff, #05deff);
color: white;
width: 60px;
height: 60px;
border-radius: 50%;
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
box-shadow: 0 5px 15px rgba(255, 69, 159, 0.4);
overflow: visible;
z-index: 10;
bottom: 75px;
/* Ensure button is on top */
}
.scroll-top.show {
opacity: 1;
visibility: visible;
}
.scroll-top:hover {
transform: scale(1.1);
/* Subtle scaling instead of expanding */
box-shadow: 0 8px 20px rgba(255, 69, 159, 0.6);
/* Slightly larger shadow */
}
.scroll-top:active {
transform: scale(1.05);
/* Minor scale reduction on click */
}
.scroll-top-icon {
position: relative;
z-index: 2;
transition: transform 0.3s ease;
}
.scroll-top:hover .scroll-top-icon {
transform: translateY(-3px);
}
/* Progress Ring Styling */
.progress-ring {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
transform: rotate(-90deg);
/* To start from the top */
}
.progress-ring__circle {
transition: stroke-dashoffset 0.35s;
transform-origin: 50% 50%;
}
/* Pulse Animation */
@keyframes pulse {
0% {
box-shadow: 0 5px 15px rgba(255, 69, 159, 0.4);
}
50% {
box-shadow: 0 5px 15px rgba(255, 69, 159, 0.7);
}
100% {
box-shadow: 0 5px 15px rgba(255, 69, 159, 0.4);
}
}
.scroll-top:hover {
animation: pulse 1.5s infinite;
}
.scroll-top.show {
animation: none;
/* No animation when showing the button */
}
.scroll-top.show:hover {
animation: pulse 1.5s infinite;
/* Pulse on hover */
}
</style>
<script>
// Get the button
const scrollToTopBtn = document.getElementById("scrollToTopBtn");
const progressCircle = document.querySelector(".progress-ring__circle");
const radius = progressCircle.r.baseVal.value;
const circumference = 2 * Math.PI * radius;
// Set the circle progress properties
progressCircle.style.strokeDasharray = `${circumference} ${circumference}`;
progressCircle.style.strokeDashoffset = circumference;
// Function to show or hide the button based on scroll position
function toggleScrollButton() {
if (window.scrollY > 100) {
scrollToTopBtn.classList.add("show");
} else {
scrollToTopBtn.classList.remove("show");
}
}
// Function to set the scroll progress on the button ring
function setProgress(percent) {
const offset = circumference - (percent / 100) * circumference;
progressCircle.style.strokeDashoffset = offset;
}
// Listen for scroll events to update button visibility and progress
window.addEventListener("scroll", () => {
toggleScrollButton();
const scrollPercent = (window.scrollY / (document.documentElement.scrollHeight - window.innerHeight)) * 100;
setProgress(scrollPercent);
});
// Smooth scroll to top when the button is clicked
scrollToTopBtn.addEventListener("click", () => {
window.scrollTo({
top: 0,
behavior: "smooth"
});
});
</script>
</body>
</html>