forked from ANSHIKA-26/WordWise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact_us.html
118 lines (107 loc) · 4.56 KB
/
contact_us.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Us</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./contact_us.css">
</head>
<body>
<header class="navbar">
<div class="logo">
<h2>WordWise</h2>
</div>
<nav class="nav-menu">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="blog.html">Leading Blog</a></li>
<!-- <li><a href="#start-writing">Start Writing</a></li> -->
<li><a href="category.html">Categories</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact_us.html">Contact Us</a></li>
<li><a href="contact_us.html">Give Feedback</a></li>
</ul>
</nav>
<div class="auth-buttons">
<a href="#login" class="login-btn">Login</a>
<a href="#signup" class="signup-btn">Signup</a>
</div>
<div class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox">
<div class="slider"></div>
</label>
<span id="mode-label">Light Mode</span>
</div>
</header>
<div class="container">
<h2>Get in Touch</h2>
<p>Whether you have questions, feedback, or need assistance, our team is here to help. Please fill out the form below, and we'll get back to you as soon as possible.</p>
<form id="contactForm">
<div class="form-group">
<label for="firstName">First Name</label>
<input type="text" id="firstName" name="firstName" required>
</div>
<div class="form-group">
<label for="lastName">Last Name</label>
<input type="text" id="lastName" name="lastName" 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="phone">Phone Number</label>
<input type="tel" id="phone" name="phone" required>
</div>
<div class="form-group">
<label for="message">Message</label>
<textarea id="message" name="message" rows="4" required></textarea>
</div>
<button type="submit">Send</button>
</form>
<div class="message" id="responseMessage"></div>
</div>
<script>
const form = document.getElementById('contactForm');
form.addEventListener('submit', function(event) {
event.preventDefault();
document.getElementById('responseMessage').textContent = "Thank you for contacting us!";
form.reset();
});
</script>
<script>
form.addEventListener('submit', function(event) {
event.preventDefault();
const formData = {
firstName: document.getElementById('firstName').value,
lastName: document.getElementById('lastName').value,
email: document.getElementById('email').value,
phone: document.getElementById('phone').value,
message: document.getElementById('message').value
};
// Send form data to the backend via fetch
fetch('http://localhost:3000/send-email', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(formData)
})
.then(response => response.json())
.then(data => {
// Display success message
document.getElementById('responseMessage').textContent = "Thank you for contacting us!";
form.reset(); // Reset form after submission
})
.catch(error => {
document.getElementById('responseMessage').textContent = "There was an error sending your message. Please try again.";
console.error('Error:', error);
});
});
</script>
<script src="./darkMode.js"></script>
</body>
</html>