-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact-page.html
64 lines (50 loc) · 2.12 KB
/
contact-page.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Form</title>
<link rel="stylesheet" href="contact-page.css">
</head>
<body>
<div id="navbar"></div>
<div class="contact-body">
<div class="contact-form-container">
<h2>Contact Us</h2>
<form action="#" method="post">
<label for="name">Name</label>
<input type="text" id="name" name="name" required>
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
<label for="subject">Subject</label>
<input type="text" id="subject" name="subject" required>
<label for="message">Message</label>
<textarea id="message" name="message" rows="5" required></textarea>
<button type="submit">Send Message</button>
</form>
</div>
</div>
<div id="footer"></div>
<script>
// JavaScript to load the navbar
fetch("navbar.html")
.then(response => response.text())
.then(data => {
document.getElementById("navbar").innerHTML = data;
// Change navbar color based on the page after navbar is loaded
const currentPage = window.location.pathname; // Current page path
if (currentPage.includes("contact-page.html") || currentPage.includes("/contact-page")) {
document.getElementById("navbar").style.backgroundColor = "#1e3a6e"; // Different color for Page 2
}
})
.catch(error => console.error('Error loading navbar:', error)); // Error handling
// Load the footer
fetch("footer.html")
.then(response => response.text())
.then(data => {
document.getElementById("footer").innerHTML = data;
})
.catch(error => console.error('Error loading footer:', error)); // Error handling
</script>
</body>
</html>