-
Notifications
You must be signed in to change notification settings - Fork 189
/
feedback.html
381 lines (321 loc) · 12.3 KB
/
feedback.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Game Feedback - Alien Invasion Defense</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet" />
<link rel="stylesheet" href="feedback.css" />
</head>
<style>
/* General Body Styling */
body {
cursor: none; /* Hide the default cursor */
}
/* Cursor Tail Effect - the small dots trailing behind */
.cursor-tail {
position: absolute;
width: 11px; /* Small dot */
height: 11px;
background-color: rgba(63, 228, 253, 0.8); /* Neon green tail */
border-radius: 50%;
pointer-events: none; /* Ensure the trail doesn't interfere with clicks */
z-index: 9999;
transform: translate(-50%, -50%);
animation: trail 0.5s forwards;
}
/* Tail Effect Animation - Fades and shrinks */
@keyframes trail {
0% {
transform: scale(1) translate(-50%, -50%);
opacity: 1;
}
100% {
transform: scale(0) translate(-50%, -50%);
opacity: 0;
}
}
/* Sample content to make sure scrolling works */
.content {
height: 200vh; /* Make the page taller to enable scrolling */
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>
<body class="space-bg min-h-screen text-white">
<!-- on scroll progress bar -->
<div class="progress-bar-container">
<div class="progress-bar" id="progress-bar-fb"></div>
</div>
<div class="container mx-auto px-4 py-8">
<!-- Navigation -->
<nav class="mb-8">
<a href="index.html"
class="inline-flex items-center text-indigo-400 hover:text-indigo-300 transition-all duration-300">
<svg class="w-5 h-5 mr-2 transform group-hover:-translate-x-1" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18" />
</svg>
Return to Battle
</a>
</nav>
<div class="gtranslate_wrapper"></div>
<script>
window.gtranslateSettings = {
default_language: "en",
native_language_names: true,
languages: ["en", "fr", "de", "it", "es", "pl", "hi"],
wrapper_selector: ".gtranslate_wrapper",
alt_flags: { en: "usa" },
};
</script>
<script src="https://cdn.gtranslate.net/widgets/latest/float.js" defer></script>
<!-- Main Content -->
<div class="max-w-4xl mx-auto">
<div class="glassmorphism rounded-xl p-8">
<!-- Header -->
<div class="text-center mb-12">
<h1
class="text-4xl font-bold bg-gradient-to-r from-indigo-400 to-purple-400 bg-clip-text text-transparent mb-4">
we'd love you Feedback!
</h1>
<p class="text-indigo-200">
Your tactical insights shape our defense strategy
</p>
</div>
<!-- Feedback Form -->
<form id="feedbackForm" class="space-y-8">
<!-- Personal Information -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-indigo-300 text-sm font-medium mb-2">Commander ID</label>
<input type="text" required class="form-input w-full px-4 py-3 rounded-lg text-white"
placeholder="Enter your ID" />
</div>
<div>
<label class="block text-indigo-300 text-sm font-medium mb-2">Email</label>
<input type="email" required id="email" class="form-input w-full px-4 py-3 rounded-lg text-white"
placeholder="Enter your email" />
</div>
</div>
<!-- Categories -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="custom-select">
<label class="block text-indigo-300 text-sm font-medium mb-2">Mission Type</label>
<select required class="form-input w-full px-4 py-3 rounded-lg text-white cursor-pointer">
<option value="" class="bg-gray-900">
Select mission type
</option>
<option value="combat" class="bg-gray-900">
Orbital Defense
</option>
<option value="recon" class="bg-gray-900">
Reconnaissance
</option>
<option value="escort" class="bg-gray-900">
Fleet Escort
</option>
<option value="assault" class="bg-gray-900">
Planetary Assault
</option>
<option value="special" class="bg-gray-900">
Special Operations
</option>
</select>
</div>
<div class="custom-select">
<label class="block text-indigo-300 text-sm font-medium mb-2">Combat Experience</label>
<select required class="form-input w-full px-4 py-3 rounded-lg text-white cursor-pointer">
<option value="" class="bg-gray-900">
Select experience
</option>
<option value="cadet" class="bg-gray-900">
Cadet (< 10 hours) </option>
<option value="pilot" class="bg-gray-900">
Combat Pilot (10-50 hours)
</option>
<option value="veteran" class="bg-gray-900">
Veteran (50-100 hours)
</option>
<option value="ace" class="bg-gray-900">
Space Ace (100+ hours)
</option>
</select>
</div>
</div>
<!-- Rating -->
<div class="space-y-4">
<label class="block text-indigo-300 text-sm font-medium mb-2">Mission Effectiveness Rating</label>
<div class="feedback-box">
<form id="feedback-form" action="#" method="post">
<div class="star-rating" aria-label="Rating" role="radiogroup">
<input type="radio" id="star5" name="rating" value="5">
<label for="star5" title="5 stars">★</label>
<input type="radio" id="star4" name="rating" value="4">
<label for="star4" title="4 stars">★</label>
<input type="radio" id="star3" name="rating" value="3">
<label for="star3" title="3 stars">★</label>
<input type="radio" id="star2" name="rating" value="2">
<label for="star2" title="2 stars">★</label>
<input type="radio" id="star1" name="rating" value="1">
<label for="star1" title="1 star">★</label>
</div>
</div>
</div>
<!-- Feedback Areas -->
<div class="space-y-6">
<div>
<label class="block text-indigo-300 text-sm font-medium mb-2">Tactical Achievements</label>
<textarea class="form-input w-full px-4 py-3 rounded-lg text-white h-24"
placeholder="Describe your successful strategies..."></textarea>
</div>
<div>
<label class="block text-indigo-300 text-sm font-medium mb-2">Battle Improvements</label>
<textarea class="form-input w-full px-4 py-3 rounded-lg text-white h-24"
placeholder="Suggest tactical improvements..."></textarea>
</div>
<div>
<label class="block text-indigo-300 text-sm font-medium mb-2">System Issues</label>
<textarea class="form-input w-full px-4 py-3 rounded-lg text-white h-24"
placeholder="Report any technical issues..."></textarea>
</div>
</div>
<!-- Submit Button -->
<div class="flex justify-center pt-6">
<button type="submit"
class="submit-btn px-8 py-4 rounded-lg font-semibold text-white shadow-lg hover:shadow-indigo-500/30 transform hover:scale-105 transition-all duration-300">
Submit Mission Report
</button>
</div>
</form>
</div>
</div>
<!-- Footer -->
<footer class="mt-8 text-center text-indigo-300">
<p>© <span id="currentYear"></span> Alien-Invasion-Defense. All rights reserved.</p>
</footer>
</div>
<!-- Scroll to top button -->
<button id="scrollUpBtn-fb" onclick="scrollToTop()">↑</button>
<script>
document.getElementById("currentYear").textContent = new Date().getFullYear();
const trustedDomains = [
'gmail.com',
'outlook.com',
'yahoo.com',
'protonmail.com',
'icloud.com',
'tutanota.com',
'hotmail.com',
'live.com',
'mail.com',
'zoho.com',
'gmx.com',
'aol.com',
'fastmail.com',
'yandex.com',
'*.edu',
'*.ac.uk',
'*.edu.in',
'*.edu.au',
'examplecompany.com',
'mailfence.com',
'posteo.de',
'runbox.com',
'countermail.com',
'hushmail.com',
'inbox.com',
'mail.ru',
'rediffmail.com',
'seznam.cz'
];
function validateEmail(email) {
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; // Basic email format validation
const domain = email.split('@')[1];
return (
emailPattern.test(email) &&
trustedDomains.some((trusted) =>
trusted.includes('*') ? domain.endsWith(trusted.slice(1)) : domain === trusted
)
);
}
document
.getElementById("feedbackForm")
.addEventListener("submit", function (e) {
e.preventDefault();
const email = document.getElementById('email').value.trim();
const button = e.target.querySelector("button");
const originalText = button.textContent;
if (!validateEmail(email)) {
alert('Please enter a valid email address from a trusted provider.');
return;
}
button.textContent = "Transmitting...";
button.disabled = true;
setTimeout(() => {
const successMessage = document.createElement("div");
successMessage.className =
"fixed top-4 right-4 bg-gradient-to-r from-indigo-500 to-purple-500 text-white px-6 py-3 rounded-lg shadow-lg success-message";
successMessage.innerHTML = "Mission report received, Commander!";
document.body.appendChild(successMessage);
e.target.reset();
button.textContent = originalText;
button.disabled = false;
setTimeout(() => {
successMessage.style.transform = "translateY(-100%)";
successMessage.style.opacity = "0";
setTimeout(() => successMessage.remove(), 500);
}, 3000);
}, 1500);
});
window.onscroll = function () {
const scrollUpBtn = document.getElementById("scrollUpBtn-fb");
if (
document.body.scrollTop > 100 ||
document.documentElement.scrollTop > 100
) {
scrollUpBtn.style.display = "block";
} else {
scrollUpBtn.style.display = "none";
}
const totalHeight = document.documentElement.scrollHeight - window.innerHeight;
const scrollPosition = window.pageYOffset;
const scrollPercentage = (scrollPosition / totalHeight) * 100;
document.getElementById(
"progress-bar-fb"
).style.width = `${scrollPercentage}%`;
};
function scrollToTop() {
window.scrollTo({
top: 0,
behavior: "smooth",
});
}
</script>
<script>
// Create a trailing dot element dynamically
function createTrailDot(x, y) {
const trailDot = document.createElement('div');
trailDot.classList.add('cursor-tail');
trailDot.style.left = `${x}px`;
trailDot.style.top = `${y}px`;
document.body.appendChild(trailDot);
// Remove the trail dot after the animation completes (0.5s)
setTimeout(() => {
trailDot.remove();
}, 500); // Match the duration of the animation in CSS
}
// Function to move the cursor and generate trailing dots
function moveCursor(event) {
const x = event.pageX;
const y = event.pageY;
// Create a new trail dot at the cursor position
createTrailDot(x, y);
}
// Listen to mousemove event to trigger the cursor and trail
document.addEventListener('mousemove', moveCursor);
</script>
</body>
</html>