-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsurvey.html
More file actions
642 lines (574 loc) · 28.5 KB
/
survey.html
File metadata and controls
642 lines (574 loc) · 28.5 KB
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Survey | Gregory George</title>
<!-- Bootstrap 5 -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;900&family=Playfair+Display:wght@400;700;900&display=swap" rel="stylesheet">
<link rel="icon" href="images/about.ico">
<style>
:root {
--primary: #840808;
--secondary: #55A37C;
--accent1: #506858;
--accent2: #CDCDBF;
--accent3: #68A04D;
--dark: #1a1a1a;
--light: #f8f9fa;
}
body {
font-family: 'Montserrat', sans-serif;
background-color: var(--light);
color: var(--dark);
overflow-x: hidden;
position: relative;
}
body::before {
content: "";
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient(circle at 20% 30%, rgba(104, 160, 77, 0.1) 0%, transparent 30%),
radial-gradient(circle at 80% 70%, rgba(132, 8, 8, 0.1) 0%, transparent 30%);
z-index: -1;
pointer-events: none;
}
.navbar {
background: rgba(248, 249, 250, 0.95);
backdrop-filter: blur(10px);
box-shadow: 0 2px 30px rgba(0, 0, 0, 0.1);
padding: 1rem 2rem;
transition: all 0.3s ease;
}
.navbar-brand {
font-family: 'Playfair Display', serif;
font-weight: 900;
font-size: 1.8rem;
color: var(--primary) !important;
position: relative;
}
.navbar-brand::after {
content: "";
position: absolute;
bottom: -5px;
left: 0;
width: 50%;
height: 3px;
background: linear-gradient(90deg, var(--primary), var(--secondary));
border-radius: 3px;
transition: all 0.3s ease;
}
.navbar-brand:hover::after {
width: 100%;
}
.nav-link {
font-weight: 600;
margin: 0 0.5rem;
position: relative;
color: var(--dark) !important;
}
.nav-link::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 2px;
background: var(--primary);
transition: all 0.3s ease;
}
.nav-link:hover::after {
width: 100%;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Playfair Display', serif;
font-weight: 700;
}
/* Survey Page Specific Styles */
.survey-hero {
min-height: 40vh;
display: flex;
align-items: center;
background: linear-gradient(135deg, rgba(248, 249, 250, 0.9) 0%, rgba(205, 205, 191, 0.7) 100%);
}
.survey-section {
padding: 5rem 0;
position: relative;
}
.survey-section::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2355A37C' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
z-index: -1;
opacity: 0.3;
}
.survey-form {
background-color: white;
padding: 3rem;
border-radius: 15px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.form-group {
margin-bottom: 2rem;
}
.form-label {
font-weight: 600;
margin-bottom: 0.5rem;
display: block;
}
.required-field::after {
content: " *";
color: #dc3545;
}
.form-control {
border: 1px solid var(--accent2);
padding: 1rem;
border-radius: 8px;
width: 100%;
}
textarea.form-control {
min-height: 150px;
}
.form-control:focus {
border-color: var(--primary);
box-shadow: 0 0 0 0.25rem rgba(132, 8, 8, 0.25);
}
.radio-group, .checkbox-group {
display: flex;
flex-direction: column;
gap: 0.8rem;
}
.radio-option, .checkbox-option {
display: flex;
align-items: center;
gap: 0.8rem;
}
.radio-option input, .checkbox-option input {
width: 1.2rem;
height: 1.2rem;
}
.submit-btn {
background: linear-gradient(45deg, var(--primary), var(--secondary));
color: white;
border: none;
padding: 1rem 2rem;
font-weight: 600;
border-radius: 50px;
transition: all 0.3s ease;
width: 100%;
cursor: pointer;
}
.submit-btn:hover {
transform: translateY(-3px);
box-shadow: 0 10px 20px rgba(132, 8, 8, 0.2);
}
.error-message {
color: #dc3545;
font-size: 0.875rem;
margin-top: 0.5rem;
display: none;
}
.form-group.invalid .error-message {
display: block;
}
.form-group.invalid .form-control,
.form-group.invalid .radio-group,
.form-group.invalid .checkbox-group {
border-color: #dc3545;
}
/* Dark Mode Styles */
.dark-mode {
background-color: var(--dark);
color: var(--light);
}
.dark-mode .survey-form {
background-color: rgba(26, 26, 26, 0.9);
}
.dark-mode .form-control {
background-color: #333;
border-color: #444;
color: white;
}
.dark-mode .form-control:focus {
background-color: #333;
color: white;
}
#backToTopBtn {
position: fixed;
bottom: 40px;
right: 40px;
display: none;
background-color: #333;
color: white;
border: none;
padding: 10px 15px;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
box-shadow: 0 4px 6px rgba(0,0,0,0.3);
z-index: 1000;
}
#backToTopBtn:hover {
background-color: #555;
}
</style>
</head>
<body>
<button onclick="scrollToTop()" id="backToTopBtn">↑ Back To Top</button>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-light fixed-top">
<div class="container">
<a class="navbar-brand" href="index.html"><i class="fas fa-user-gear"></i> Gregory</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="index.html"><i class="fas fa-house"></i> Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.html"><i class="fas fa-graduation-cap"></i> About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="projects.html"><i class="fas fa-desktop"></i> Projects</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html"><i class="fas fa-phone"></i> Contact</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="survey.html"><i class="fas fa-clipboard"></i> Survey</a>
</li>
<li class="nav-item">
<button id="theme-toggle" class="btn btn-sm btn-outline-secondary ms-2">
<i class="fas fa-moon"></i>
</button>
</li>
</ul>
</div>
</div>
</nav>
<!-- Hero Section -->
<section class="survey-hero">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-8 mx-auto text-center">
<h1 class="display-3 fw-bold mb-4">Client Survey</h1>
<p class="lead">Help me improve my services by sharing your feedback. It should take less than 2 minutes.</p>
</div>
</div>
</div>
</section>
<!-- Survey Section -->
<section class="survey-section">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-8">
<div class="survey-form">
<form id="surveyForm" novalidate>
<!-- Personal Information -->
<fieldset class="mb-5">
<legend class="h4 mb-4">Personal Information</legend>
<div class="form-group">
<label for="fullName" class="form-label required-field">Full Name</label>
<input type="text" class="form-control" id="fullName" name="fullName" placeholder="Enter your full name" required>
<div class="error-message" id="nameError">Please enter your full name</div>
</div>
<div class="form-group">
<label for="email" class="form-label required-field">Email Address</label>
<input type="email" class="form-control" id="email" name="email" placeholder="eg, customer@gmail.com" required>
<div class="error-message" id="emailError">Please enter a valid email address</div>
</div>
<div class="form-group">
<label for="age" class="form-label">Age Group</label>
<select class="form-control" id="age" name="age">
<option value="">Select your age group</option>
<option value="18-24">18-24 years</option>
<option value="25-34">25-34 years</option>
<option value="35-44">35-44 years</option>
<option value="45-54">45-54 years</option>
<option value="55+">55+ years</option>
</select>
</div>
</fieldset>
<!-- Survey Questions -->
<fieldset class="mb-5">
<legend class="h4 mb-4">Survey Questions</legend>
<div class="form-group">
<p class="form-label required-field">How did you hear about my services?</p>
<div class="radio-group" id="hearAboutGroup">
<div class="radio-option">
<input type="radio" id="hearAbout1" name="hearAbout" value="Social Media" required>
<label for="hearAbout1">Social Media</label>
</div>
<div class="radio-option">
<input type="radio" id="hearAbout2" name="hearAbout" value="Search Engine">
<label for="hearAbout2">Search Engine</label>
</div>
<div class="radio-option">
<input type="radio" id="hearAbout3" name="hearAbout" value="Friend/Colleague">
<label for="hearAbout3">Friend/Colleague</label>
</div>
<div class="radio-option">
<input type="radio" id="hearAbout4" name="hearAbout" value="Other">
<label for="hearAbout4">Other</label>
</div>
</div>
<div class="error-message" id="hearAboutError">Please select an option</div>
</div>
<div class="form-group">
<p class="form-label required-field">What types of services are you interested in? (Select all that apply)</p>
<div class="checkbox-group" id="servicesGroup">
<div class="checkbox-option">
<input type="checkbox" id="service1" name="services" value="Web Design">
<label for="service1">Web Design</label>
</div>
<div class="checkbox-option">
<input type="checkbox" id="service2" name="services" value="Frontend Development">
<label for="service2">Frontend Development</label>
</div>
<div class="checkbox-option">
<input type="checkbox" id="service3" name="services" value="UI/UX Design">
<label for="service3">UI/UX Design</label>
</div>
<div class="checkbox-option">
<input type="checkbox" id="service4" name="services" value="Website Maintenance">
<label for="service4">Website Maintenance</label>
</div>
<div class="checkbox-option">
<input type="checkbox" id="service5" name="services" value="Other">
<label for="service5">Other</label>
</div>
</div>
<div class="error-message" id="servicesError">Please select at least one option</div>
</div>
<div class="form-group">
<label for="satisfaction" class="form-label required-field">How satisfied are you with my portfolio?</label>
<select class="form-control" id="satisfaction" name="satisfaction" required>
<option value="">Select your satisfaction level</option>
<option value="5">Very Satisfied</option>
<option value="4">Satisfied</option>
<option value="3">Neutral</option>
<option value="2">Dissatisfied</option>
<option value="1">Very Dissatisfied</option>
</select>
<div class="error-message" id="satisfactionError">Please select your satisfaction level</div>
</div>
<div class="form-group">
<label for="feedback" class="form-label">Additional Feedback</label>
<textarea class="form-control" id="feedback" name="feedback" placeholder="What can I improve? What did you like?"></textarea>
<small class="text-muted">Maximum 500 characters <500></small>
</div>
</fieldset>
<!-- Terms and Submit -->
<div class="form-group">
<div class="checkbox-option">
<input type="checkbox" id="agreeTerms" name="agreeTerms" required>
<label for="agreeTerms" class="required-field">I agree to the terms and conditions</label>
</div>
<div class="error-message" id="termsError">You must agree to the terms</div>
</div>
<button type="submit" class="submit-btn">
<i class="fas fa-paper-plane me-2"></i> Submit Survey
</button>
</form>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="bg-dark text-light py-5">
<div class="container">
<div class="row">
<div class="col-md-6">
<h3 class="mb-3">Follow Me</h3>
<p>Stay updated with my latest projects and insights.</p>
<div class="social-links mt-3">
<a href="https://github.com/X50C137Y" class="text-light me-3"><i class="fab fa-github"></i></a>
<a href="https://www.linkedin.com/in/gregory-george-843829322?utm_source=share&utm_campaign=share_via&utm_content=profile&utm_medium=android_app" class="text-light me-3"><i class="fab fa-linkedin"></i></a>
<a href="https://x.com/@gregootz_" class="text-light me-3"><i class="fab fa-twitter"></i></a>
<a href="https://instagram.com/gregootz_" class="text-light me-3"><i class="fab fa-instagram"></i></a>
</div>
</div>
<div class="col-md-3">
<h5 class="mb-3">Quick Links</h5>
<ul class="list-unstyled">
<li class="mb-2"><i class="fas fa-house"></i> <a href="index.html" class="text-light">Home</a></li>
<li class="mb-2"><i class="fas fa-graduation-cap"></i> <a href="about.html" class="text-light">About</a></li>
<li class="mb-2"><i class="fas fa-desktop"></i> <a href="projects.html" class="text-light">Projects</a></li>
<li class="mb-2"><i class="fas fa-phone"></i> <a href="contact.html" class="text-light">Contact</a></li>
</ul>
</div>
<div class="col-md-3">
<h5 class="mb-3">Contact Me</h5>
<ul class="list-unstyled">
<li class="mb-2"><i class="fas fa-envelope"></i> <a href="mailto:xsociety@gmail.com" class="text-light">xsociety@gmail.com</a></li>
<li class="mb-2"><i class="fab fa-whatsapp"></i> <a href="https://wa.me/+255654765617?text=Hello%20Gregory" class="text-light">+255654765617</a></li>
</ul>
</div>
</div>
<hr class="my-4">
<div class="text-center">
<p>© 2025<br> All rights reserved</p>
</div>
</div>
</footer>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script>
// Form Validation
document.getElementById('surveyForm').addEventListener('submit', function(e) {
e.preventDefault();
// Reset form state
const formGroups = document.querySelectorAll('.form-group');
formGroups.forEach(group => group.classList.remove('invalid'));
let isValid = true;
// Validate Full Name
const fullName = document.getElementById('fullName');
if (!fullName.value.trim()) {
document.getElementById('nameError').textContent = 'Please enter your full name';
fullName.closest('.form-group').classList.add('invalid');
isValid = false;
}
// Validate Email
const email = document.getElementById('email');
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!email.value.trim()) {
document.getElementById('emailError').textContent = 'Please enter your email';
email.closest('.form-group').classList.add('invalid');
isValid = false;
} else if (!emailRegex.test(email.value)) {
document.getElementById('emailError').textContent = 'Please enter a valid email address';
email.closest('.form-group').classList.add('invalid');
isValid = false;
}
// Validate Radio Buttons (How did you hear about us)
const hearAboutSelected = document.querySelector('input[name="hearAbout"]:checked');
if (!hearAboutSelected) {
document.getElementById('hearAboutError').textContent = 'Please select an option';
document.getElementById('hearAboutGroup').closest('.form-group').classList.add('invalid');
isValid = false;
}
// Validate Checkboxes (Services interested in)
const servicesSelected = document.querySelectorAll('input[name="services"]:checked');
if (servicesSelected.length === 0) {
document.getElementById('servicesError').textContent = 'Please select at least one option';
document.getElementById('servicesGroup').closest('.form-group').classList.add('invalid');
isValid = false;
}
// Validate Satisfaction
const satisfaction = document.getElementById('satisfaction');
if (!satisfaction.value) {
document.getElementById('satisfactionError').textContent = 'Please select your satisfaction level';
satisfaction.closest('.form-group').classList.add('invalid');
isValid = false;
}
// Validate Terms Checkbox
const agreeTerms = document.getElementById('agreeTerms');
if (!agreeTerms.checked) {
document.getElementById('termsError').textContent = 'You must agree to the terms';
agreeTerms.closest('.form-group').classList.add('invalid');
isValid = false;
}
// If form is valid, submit it
if (isValid) {
// Here you would typically send the form data to a server
alert('Thank you for your feedback! Your survey has been submitted.');
this.reset();
}
});
// Real-time validation
document.getElementById('fullName').addEventListener('input', function() {
if (this.value.trim()) {
this.closest('.form-group').classList.remove('invalid');
}
});
document.getElementById('email').addEventListener('input', function() {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (this.value.trim() && emailRegex.test(this.value)) {
this.closest('.form-group').classList.remove('invalid');
}
});
document.querySelectorAll('input[name="hearAbout"]').forEach(radio => {
radio.addEventListener('change', function() {
if (document.querySelector('input[name="hearAbout"]:checked')) {
document.getElementById('hearAboutGroup').closest('.form-group').classList.remove('invalid');
}
});
});
document.querySelectorAll('input[name="services"]').forEach(checkbox => {
checkbox.addEventListener('change', function() {
if (document.querySelectorAll('input[name="services"]:checked').length > 0) {
document.getElementById('servicesGroup').closest('.form-group').classList.remove('invalid');
}
});
});
document.getElementById('satisfaction').addEventListener('change', function() {
if (this.value) {
this.closest('.form-group').classList.remove('invalid');
}
});
document.getElementById('agreeTerms').addEventListener('change', function() {
if (this.checked) {
this.closest('.form-group').classList.remove('invalid');
}
});
// Dark Mode Toggle
document.getElementById('theme-toggle').addEventListener('click', function() {
document.body.classList.toggle('dark-mode');
// Change icon
const icon = this.querySelector('i');
if (document.body.classList.contains('dark-mode')) {
icon.classList.remove('fa-moon');
icon.classList.add('fa-sun');
localStorage.setItem('theme', 'dark');
} else {
icon.classList.remove('fa-sun');
icon.classList.add('fa-moon');
localStorage.setItem('theme', 'light');
}
});
// Check for saved theme preference
if (localStorage.getItem('theme') === 'dark') {
document.body.classList.add('dark-mode');
const icon = document.querySelector('#theme-toggle i');
icon.classList.remove('fa-moon');
icon.classList.add('fa-sun');
}
// Navbar scroll effect
window.addEventListener('scroll', function() {
const navbar = document.querySelector('.navbar');
if (window.scrollY > 50) {
navbar.style.padding = '0.5rem 2rem';
navbar.style.boxShadow = '0 2px 20px rgba(0, 0, 0, 0.1)';
} else {
navbar.style.padding = '1rem 2rem';
navbar.style.boxShadow = '0 2px 30px rgba(0, 0, 0, 0.1)';
}
});
// Show button when user scrolls down 200px
window.onscroll = function() {
const btn = document.getElementById("backToTopBtn");
btn.style.display = (document.body.scrollTop > 200 || document.documentElement.scrollTop > 200)
? "block" : "none";
};
// Scroll smoothly to top
function scrollToTop() {
window.scrollTo({ top: 0, behavior: 'smooth' });
}
</script>
</body>
</html>