forked from ML-Fusion-Lab/ML-Fusion-Lab-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
feedback.html
167 lines (143 loc) · 4.82 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Feedback Page</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #9d73ca, #8ea6d1);
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
background-color: white;
padding: 20px;
border-radius: 12px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 400px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
margin-bottom: 20px;
}
h2 {
position: absolute;
left: 50%;
transform: translateX(-50%);
text-align: center;
margin: 0;
font-size: 1.5em;
font-weight: bold;
}
label {
display: block;
text-align: left;
margin-top: 10px;
}
input, select, textarea {
width: 100%;
padding: 8px;
margin: 10px 0;
border-radius: 4px;
border: 1px solid #ccc;
}
button {
background-color: #a94cb9;
color: white;
padding: 10px 15px;
border: none;
border-radius: 4px;
cursor: pointer;
margin: 5px;
}
button:hover {
background-color: #216988;
}
.hidden {
display: none;
}
#feedbackResponse h3 {
color: #28a745;
margin-bottom: 10px;
}
.back-link {
display: inline-block;
background-color: #a94cb9;
color: white;
padding: 8px 10px;
text-decoration: none;
border-radius: 10px;
font-size: 0.9em;
}
.back-link:hover {
background-color: #216988;
}
#feedbackForm, #feedbackResponse {
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<a href="index.html" class="back-link">←</a>
<h2>Feedback Form</h2>
</div>
<form id="feedbackForm" onsubmit="return submitFeedback()">
<label for="name">Name:</label>
<input type="text" id="name" name="name" placeholder="Enter Name">
<label for="email">Email:</label>
<input type="email" id="email" name="email" placeholder="Enter Email id" required>
<label for="rating">Rating:</label>
<select id="rating" name="rating" required>
<option value="" disabled selected>Select rating</option>
<option value="1">1 - Poor</option>
<option value="2">2 - Fair</option>
<option value="3">3 - Good</option>
<option value="4">4 - Very Good</option>
<option value="5">5 - Excellent</option>
</select>
<label for="comments">Comments:</label>
<textarea id="comments" name="comments" placeholder="Enter comment" required></textarea>
<button type="submit">Submit Feedback</button>
</form>
<div id="feedbackResponse" class="hidden">
<h3>Thank you for your feedback!</h3>
<p id="responseMessage"></p>
<button onclick="resetForm()">Submit another feedback</button>
</div>
</div>
<script>
function submitFeedback() {
const name = document.getElementById("name").value;
const email = document.getElementById("email").value;
const rating = document.getElementById("rating").value;
const comments = document.getElementById("comments").value;
const form = document.getElementById("feedbackForm");
const response = document.getElementById("feedbackResponse");
const responseMessage = document.getElementById("responseMessage");
form.classList.add("hidden");
response.classList.remove("hidden");
responseMessage.innerHTML = `Thank you, <strong>${name}</strong>, for rating us ${rating}/5. We appreciate your feedback!`;
return false;
}
function resetForm() {
document.getElementById("feedbackForm").reset();
document.getElementById("feedbackForm").classList.remove("hidden");
document.getElementById("feedbackResponse").classList.add("hidden");
}
</script>
</body>
</html>