forked from aditya-bhaumik/Pathsphere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.html
245 lines (219 loc) · 8.35 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="styles.css">
<link rel="icon" type="image/x-icon" href="images\pathsphere.png">
<style>
.contact{
display: flex;
align-items: center;
justify-content: center;
}
.contact-form-container {
background-color:var(--primary-color);
margin: 50px 0px;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px var(--seconday-color) ;
max-width: 600px;
width: 100%;
}
h1 {
margin-top: 0;
color:var(--seconday-color);
text-align: center;
}
.form-group {
margin-bottom: 1rem;
}
label {
display: block;
margin-bottom: 0.5rem;
font-weight: bold;
color:var(--seconday-color);
}
input, textarea {
width: 100%;
padding: 0.8rem;
border: 1px solid var(--primary-color);
border-radius: 4px;
box-sizing: border-box;
font-size: 1rem;
}
textarea {
resize: vertical;
}
.error-message {
color: red;
font-size: 0.875rem;
display: none; /* Hidden by default */
}
.submit-button {
background-color: #28a745;
color: var(--primary-color);
border: none;
padding: 0.75rem;
border-radius: 4px;
font-size: 1rem;
cursor: pointer;
width: 100%;
transition: background-color 0.3s;
}
.submit-button:hover {
background-color: #218838;
}
</style>
</head>
<body>
<header>
<nav id="navbar"> <!-- Add an ID to the nav -->
<a href="index.html" class="logo"><img src="logo.png" alt="PathSphere Logo"> PathSphere</a>
<button class="hamburger">
<span></span>
<span></span>
<span></span>
</button>
<nav class="menu">
<ul id="tabs">
<li class="tab"><a href="index.html">Home</a></li>
<li class="tab"><a href="scholarships.html">Scholarships</a></li>
<li class="tab"><a href="jobs.html">Jobs</a></li>
<li class="tab"><a href="forum.html">Forum</a></li>
<li class="tab"><a href="faqs.html">FAQs</a></li>
<li class="tab"><a href="blog.html">Blog</a></li>
</ul>
</nav>
<div class="cursor"></div>
<img src="images/dark.png" id="icon" alt="">
</nav>
</header>
<main>
<section class="hero">
<h1>Contact Us</h1>
<p>Fill the below form,we will reach you out</p>
</section>
<section class="contact">
<div class="contact-form-container">
<h1>Submit your Details</h1>
<form id="contactForm">
<div class="form-group">
<label for="name">Name</label>
<input type="text" id="name"
name="name"
placeholder="Your Name" required>
<span class="error-message" id="nameError"></span>
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email"
name="email"
placeholder="Your Email" required>
<span class="error-message" id="emailError"></span>
</div>
<div class="form-group">
<label for="phone">Phone</label>
<input type="tel" id="phone"
name="phone"
placeholder="Your Phone Number" required>
<span class="error-message" id="phoneError"></span>
</div>
<div class="form-group">
<label for="message">Message</label>
<textarea id="message"
name="message"
placeholder="Your Message"
rows="5" required></textarea>
<span class="error-message"
id="messageError"></span>
</div>
<button type="submit"
class="submit-button">
Send Message
</button>
</form>
</div>
</section>
</main>
<div class="footer-container">
<div class="footer-description">
<h3>PathSphere</h3>
<p>PathSphere is a comprehensive platform designed to connect students with scholarship opportunities and
educators with job openings. It features dynamic search tools and community discussions to enhance
access to educational and career resources.</p>
</div>
<div class="footer-list">
<h3>Quick links</h3>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="scholarships.html">Scholarships</a></li>
<li><a href="jobs.html">Jobs</a></li>
<li><a href="forum.html">Forum</a></li>
</ul>
</div>
<div class="footer-list">
<h3>Follow us on</h3>
<ul class="social-icons">
<li><a href="https://github.com" target="_blank"><i class="fa-brands fa-github"></i></a></li>
<li><a href="https://instagram.com" target="_blank"><i class="fab fa-instagram"></i></a></li>
<li><a href="https://x.com" target="_blank"><i class="fa-brands fa-x-twitter"></i></a></li>
<li><a href="https://facebook.com" target="_blank"><i class="fab fa-facebook"></i></a></li>
<li><a href="https://linkedin.com" target="_blank"><i class="fab fa-linkedin"></i></a></li>
</ul>
</div>
</div>
<div class="copyright">© 2024 PathSphere. All rights reserved.</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js" integrity="sha512-7eHRwcbYkK4d9g/6tD/mhkf++eoTHwpNM9woBxtPUBWm67zeAfFC+HrdoE2GanKeocly/VxeLvIqwvCdk7qScg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="script.js"></script>
<script>
document.getElementById('contactForm').addEventListener('submit', function (event) {
event.preventDefault();
const errorElements = document.querySelectorAll('.error-message');
errorElements.forEach(el => el.style.display = 'none');
// Get form values
const name = document.getElementById('name').value.trim();
const email = document.getElementById('email').value.trim();
const phone = document.getElementById('phone').value.trim();
const message = document.getElementById('message').value.trim();
// Validation flags
let isValid = true;
// Name validation
if (name === '') {
document.getElementById('nameError').textContent = 'Name is required';
document.getElementById('nameError').style.display = 'block';
isValid = false;
}
// Email validation
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (email === '' || !emailPattern.test(email)) {
document.getElementById('emailError').textContent = 'Valid email is required';
document.getElementById('emailError').style.display = 'block';
isValid = false;
}
// Phone validation
const phonePattern = /^[0-9]{10}$/;
if (phone === '' || !phonePattern.test(phone)) {
document.getElementById('phoneError').textContent = 'Valid phone number is required';
document.getElementById('phoneError').style.display = 'block';
isValid = false;
}
// Message validation
if (message === '') {
document.getElementById('messageError').textContent = 'Message is required';
document.getElementById('messageError').style.display = 'block';
isValid = false;
}
// If form is valid, you can submit it or perform any other action
if (isValid) {
alert('Form submitted successfully!');
// You can also submit the form here using AJAX or similar methods
}
});
</script>
</body>
</html>