-
Notifications
You must be signed in to change notification settings - Fork 749
/
contactus1.html
128 lines (108 loc) · 4.42 KB
/
contactus1.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Us Form</title>
</head>
<style>
form {
flex: 1;
margin-right: 20px;
background-color: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
max-width: 600px;
width: 100%;
}
h2 {
color: #333;
margin-bottom: 20px;
text-align: center;
}
label {
font-weight: bold;
color: #333;
}
input, select, textarea {
width: 100%;
padding: 10px;
margin: 10px 0 20px;
border: 1px solid #ccc;
border-radius: 5px;
transition: border-color 0.3s, box-shadow 0.3s;
}
input:hover,
input:focus,
select:hover,
select:focus,
textarea:hover,
textarea:focus {
border-color: #d985b9;
box-shadow: 0 0 15px rgba(217, 133, 185, 0.5);
outline: none; /* Remove default outline */
}
button {
background-color: #d985b9;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s;
}
button:hover {
background-color: rgb(156, 5, 116); /* Darker shade on hover */
}
</style>
<body style="background-color: #fdd7db; font-family: Arial, sans-serif; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh;">
<!-- Contact Form Container -->
<div style="display: flex; align-items: center; justify-content: center;background-color: white; padding: 20px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); width: 60%; max-width: 800px;">
<!-- Form Section -->
<form id="contactForm" style="align-items: center;justify-content: center;">
<h2>Contact Us</h2>
<label for="name">Name</label><br>
<input type="text" id="name" name="name" placeholder="Your Name" required>
<label for="email">Email</label><br>
<input type="email" id="email" name="email" placeholder="Your Email" required>
<label for="subject">Subject</label><br>
<select id="subject" name="subject" required>
<option value="" disabled selected>Select a subject</option>
<option value="general">General Inquiry</option>
<option value="support">Support Request</option>
<option value="feedback">Feedback</option>
<option value="collaboration">Collaboration</option>
<option value="other">Other</option>
</select>
<label for="message">Message</label><br>
<textarea id="message" name="message" placeholder="Your Message" required rows="5"></textarea>
<button type="submit">Send Message</button>
</form>
</div>
<!-- Confirmation Message -->
<div id="confirmationMessage" style="display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: #d985b9; color: white; padding: 20px; border-radius: 5px; text-align: center; box-shadow: 0 4px 8px rgba(0,0,0,0.1);">
Thank you for your message! We'll get back to you soon.
</div>
<script>
document.getElementById('contactForm').addEventListener('submit', function(e) {
e.preventDefault();
// Perform form validation
if (this.checkValidity()) {
// Show confirmation message
document.getElementById('confirmationMessage').style.display = 'block';
// Hide confirmation message after 3 seconds
setTimeout(function() {
document.getElementById('confirmationMessage').style.display = 'none';
}, 3000);
// Reset form
this.reset();
} else {
// If the form is invalid, trigger the browser's default validation UI
this.reportValidity();
}
});
</script>
</body>
</html>