forked from vishanurag/Canvas-Editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.html
287 lines (247 loc) · 7.72 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Us</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
:root {
--primary-color: #ff007f; /* Accent color */
--secondary-color: #f2f2f2;
--background-gradient: linear-gradient(135deg, #6a11cb, #2575fc); /* Gradient background */
--highlight-gradient: linear-gradient(135deg, #ff007f, #ff007f);
--shadow-color: rgba(0, 0, 0, 0.15);
--input-hover-bg: #d0eaff;
--btn-hover-bg: #e60064;
}
.circle {
height: 24px;
width: 24px;
border-radius: 50%;
background-color: black;
position: fixed;
top: 0;
left: 0;
pointer-events: none;
z-index: 99999999;
transition: transform 0.1s ease-out;
}
/* Hide cursor when the 'hidden' class is applied */
.cursor.hidden {
visibility: hidden;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Poppins', sans-serif;
line-height: 1.6;
background: var(--background-gradient);
color: #fff;
padding: 0 10px;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
.contact-container {
background: #fff;
padding: 30px;
max-width: 600px;
width: 100%;
border-radius: 12px;
box-shadow: 0 4px 30px var(--shadow-color);
transition: all 0.3s ease;
}
h1 {
text-align: center;
color: var(--primary-color);
font-size: 32px;
margin-bottom: 20px;
animation: fadeInDown 1s ease;
}
.form-group {
margin-bottom: 25px;
}
label {
display: block;
margin-bottom: 8px;
font-weight: 500;
color: var(--primary-color);
}
input, textarea {
width: 100%;
padding: 12px;
border: 1px solid #ddd;
border-radius: 8px;
font-size: 16px;
background-color: #f8f8f8;
transition: background-color 0.3s ease, border-color 0.3s ease;
}
input:focus, textarea:focus {
outline: none;
border-color: var(--primary-color);
background-color: var(--input-hover-bg);
}
textarea {
height: 150px;
resize: none;
}
button {
background-color: var(--primary-color);
color: white;
padding: 14px 20px;
border: none;
border-radius: 8px;
font-size: 18px;
font-weight: 600;
cursor: pointer;
width: 100%;
transition: background-color 0.3s ease;
}
button:hover {
background-color: var(--btn-hover-bg);
transform: scale(1.05);
}
@keyframes fadeInDown {
0% { transform: translateY(-20px); opacity: 0; }
100% { transform: translateY(0); opacity: 1; }
}
/* Responsive Design */
@media (max-width: 768px) {
body {
padding: 20px;
}
.contact-container {
padding: 20px;
max-width: 100%;
}
h1 {
font-size: 28px;
}
}
</style>
</head>
<body>
<!-- Circles for cursor effect -->
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="contact-container">
<h1>Contact Us</h1>
<form id="contact-form">
<div class="form-group">
<label for="name">Your Name</label>
<input type="text" id="name" name="name" placeholder="Enter your name" required>
</div>
<div class="form-group">
<label for="email">Your Email</label>
<input type="email" id="email" name="email" placeholder="Enter your email" required>
</div>
<div class="form-group">
<label for="subject">Subject</label>
<input type="text" id="subject" name="subject" placeholder="Enter subject" required>
</div>
<div class="form-group">
<label for="message">Message</label>
<textarea id="message" name="message" placeholder="Write your message" required></textarea>
</div>
<button type="submit">Send Message</button>
</form>
</div>
<script>
document.getElementById('contact-form').addEventListener('submit', function(event) {
event.preventDefault(); // Prevent the form from submitting normally
const name = document.getElementById('name').value;
const email = document.getElementById('email').value;
const subject = document.getElementById('subject').value;
const message = document.getElementById('message').value;
if (name && email && subject && message) {
alert(`Thank you, ${name}! Your message has been sent.`);
} else {
alert('Please fill in all the fields.');
}
});
// Coordinates for the cursor
const coords = { x: 0, y: 0 };
const circles = document.querySelectorAll(".circle");
// Colors for the circles
const colors = [
"#ffb56b", "#fdaf69", "#f89d63", "#f59761", "#ef865e", "#ec805d",
"#e36e5c", "#df685c", "#d5585c", "#d1525c", "#c5415d", "#c03b5d",
"#b22c5e", "#ac265e", "#9c155f", "#950f5f", "#830060", "#7c0060",
"#680060", "#60005f", "#48005f", "#3d005e"
];
// Assign colors and initial position to each circle
circles.forEach(function (circle, index) {
circle.x = 0;
circle.y = 0;
circle.style.backgroundColor = colors[index % colors.length];
});
// Update the coordinates when the mouse moves
document.addEventListener("mousemove", function (e) {
coords.x = e.clientX;
coords.y = e.clientY;
// Update the position of each circle
circles.forEach(function (circle, index) {
circle.style.left = coords.x - 12 + "px";
circle.style.top = coords.y - 12 + "px";
circle.style.scale = (circles.length - index) / circles.length;
});
});
// Add mouseleave event to hide cursor
document.addEventListener("mouseleave", () => {
circles.forEach(circle => circle.classList.add("hidden"));
});
// Add mouseenter event to show cursor
document.addEventListener("mouseenter", () => {
circles.forEach(circle => circle.classList.remove("hidden"));
});
// Add focus and blur events to hide/show cursor
document.addEventListener("focus", () => {
circles.forEach(circle => circle.classList.remove("hidden"));
});
document.addEventListener("blur", () => {
circles.forEach(circle => circle.classList.add("hidden"));
});
// Animation function to move the circles
function animateCircles() {
let x = coords.x;
let y = coords.y;
circles.forEach(function (circle, index) {
circle.x = x;
circle.y = y;
// Get the next circle in the sequence
const nextCircle = circles[index + 1] || circles[0];
x += (nextCircle.x - x) * 0.3;
y += (nextCircle.y - y) * 0.3;
});
// Repeat the animation
requestAnimationFrame(animateCircles);
}
// Start the animation
animateCircles();
</script>
</body>
</html>