-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfooter.js
40 lines (33 loc) · 1.2 KB
/
footer.js
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
document.addEventListener("DOMContentLoaded", () => {
const feedbackBtn = document.getElementById('feedback-btn');
const complaintsBtn = document.getElementById('complaints-btn');
const deliveryBtn = document.getElementById('delivery-btn');
// Action URLs
const feedbackFormURL = 'https://www.google.com/';
const complaintsFormURL = 'https://www.google.com/';
const deliveryEmail = '[email protected]';
// Event Listeners
feedbackBtn.addEventListener('click', () => {
// Open Feedback Form
window.open(feedbackFormURL, '_blank');
});
complaintsBtn.addEventListener('click', () => {
// Open Complaints Form
window.open(complaintsFormURL, '_blank');
});
deliveryBtn.addEventListener('click', () => {
// Open Email Client with Pre-filled Template
const subject = encodeURIComponent("Food Delivery Request");
const body = encodeURIComponent(`
Hi,
I would like to request food delivery to the following address:
Name:
Address:
Contact Number:
Special Instructions:
Regards,
[Your Name]
`);
window.location.href = `mailto:${deliveryEmail}?subject=${subject}&body=${body}`;
});
});