-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.html
120 lines (113 loc) Β· 3.16 KB
/
contact.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"
defer
></script>
<link href="styles.css" rel="stylesheet" />
<script src="app.js" defer></script>
<title>Contact Me</title>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<div class="container text-uppercase">
<a class="navbar-brand fs-4">My Page</a>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarNav"
aria-label="Toggle navigation"
>
<i class="navbar-toggler-icon"></i>
</button>
<div class="collapse navbar-collapse fs-5" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.html">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<h1 class="text-center mt-5">Contact</h1>
<p class="text-center mb-5">
Please fill out the form below to get in touch with us:
</p>
<div class="container text-dark" id="contact-container">
<form class="form-horizontal">
<div class="form-floating mb-3">
<input
type="text"
id="name"
name="name"
class="form-control"
placeholder="Name:"
required
/>
<label for="name" class="form-label">Name:</label>
</div>
<div class="form-floating mb-3">
<input
type="email"
id="email"
name="email"
class="form-control"
placeholder="Email:"
required
/>
<label for="email" class="form-label">Email:</label>
</div>
<div class="form-floating mb-3">
<textarea
id="message"
name="message"
class="form-control"
placeholder="Message:"
required
></textarea>
<label for="message" class="form-label">Message:</label>
</div>
<button
type="submit"
class="btn btn-primary mb-5"
id="contact-submit"
>
Send
</button>
</form>
</div>
<script>
const contactFormContainer =
document.getElementById("contact-container");
contactFormContainer.addEventListener("submit", (e) => {
const message = "Thank you for your message!";
const wrapper = document.createElement("div");
wrapper.innerHTML =
'<div class="alert alert-success' +
' alert-dismissible" role="alert">' +
message +
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></div>';
contactFormContainer.append(wrapper);
e.preventDefault();
});
</script>
</body>
</html>