-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.html
205 lines (179 loc) · 5.61 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Us - RealSurveys</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f9f9f9;
margin: 0;
padding: 0;
color: #333;
}
header {
background-color: #2e8b57;
color: #fff;
padding: 20px;
text-align: center;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
header h1 a {
text-decoration: none;
color: #fff;
font-size: 36px;
}
header nav ul {
list-style: none;
padding: 0;
margin: 20px 0 0 0;
display: flex;
justify-content: center;
gap: 20px;
}
header nav ul li a {
color: #fff;
text-decoration: none;
font-size: 16px;
padding: 10px 20px;
border-radius: 5px;
transition: background-color 0.3s;
}
header nav ul li a:hover {
background-color: #3a9f6f;
}
.main-content {
padding: 60px 20px;
text-align: center;
background-color: #ffffff;
}
.main-content h2 {
font-size: 36px;
color: #2e8b57;
margin-bottom: 20px;
}
.main-content p {
font-size: 20px;
color: #666;
margin-bottom: 30px;
}
form {
max-width: 600px;
margin: 0 auto;
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}
form input, form textarea {
width: 100%;
padding: 12px;
margin-bottom: 15px;
border: 1px solid #ddd;
border-radius: 5px;
box-sizing: border-box;
}
form button {
background-color: #2e8b57;
color: #fff;
padding: 15px;
border: none;
border-radius: 5px;
font-size: 18px;
cursor: pointer;
text-transform: uppercase;
transition: background-color 0.3s;
}
form button:hover {
background-color: #3a9f6f;
}
footer {
background-color: #2e8b57;
color: #fff;
text-align: center;
padding: 30px;
margin-top: 40px;
}
footer p {
margin: 0;
font-size: 14px;
}
@media (max-width: 768px) {
header nav ul {
flex-direction: column;
align-items: center;
}
form {
padding: 15px;
}
}
/* Confirmation message styles */
.confirmation-message {
display: none;
margin: 20px auto;
padding: 15px;
background-color: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
border-radius: 5px;
max-width: 600px;
}
</style>
</head>
<body>
<header>
<h1><a href="index.html">RealSurveys</a></h1>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="contact.html">Contact</a></li>
<li><a href="register.html">Register</a></li>
<li><a href="login.html">Login</a></li>
</ul>
</nav>
</header>
<div class="main-content">
<h2>Contact Us</h2>
<p>If you have any questions or need assistance, feel free to reach out to us using the form below:</p>
<form id="contactForm">
<input type="text" id="name" placeholder="Name" required>
<input type="email" id="email" placeholder="Email" required>
<textarea id="message" placeholder="Your message" rows="5" required></textarea>
<button type="submit">Send</button>
</form>
<div id="confirmationMessage" class="confirmation-message">
Your message has been sent. We will get back to you at <span id="userEmail"></span> as soon as possible.
</div>
</div>
<footer>
<p>© 2024 RealSurveys. All rights reserved.</p>
</footer>
<script type="module">
import { getAuth, onAuthStateChanged } from 'https://www.gstatic.com/firebasejs/9.22.0/firebase-auth.js';
import { initializeApp } from 'https://www.gstatic.com/firebasejs/9.22.0/firebase-app.js';
const firebaseConfig = {
apiKey: "AIzaSyA7GP-4bnijUNXGBti2nCOJF9iwusuL7c4",
authDomain: "real-surveys.firebaseapp.com",
projectId: "real-surveys",
storageBucket: "real-surveys.appspot.com",
messagingSenderId: "1024139519354",
appId: "1:1024139519354:web:a0b11a5a0560ab02ee22c3"
};
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
onAuthStateChanged(auth, (user) => {
if (!user && window.location.pathname !== '/contact.html') {
window.location.href = 'login.html';
}
});
document.getElementById('contactForm').addEventListener('submit', function(event) {
event.preventDefault(); // Prevents the default form submission
const email = document.getElementById('email').value;
document.getElementById('userEmail').innerText = email;
document.getElementById('confirmationMessage').style.display = 'block';
document.getElementById('contactForm').reset(); // Resets the form fields
});
</script>
</body>
</html>