-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.html
229 lines (186 loc) · 5.48 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Restaurant Rating</title>
<script src="6.js"></script>
<style>
/* Gradient pastel background */
body {
background: linear-gradient(135deg, #f781d6, #a6c1ee);
font-family: 'Poppins', sans-serif;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
margin: 0;
padding: 0;
}
/* Button to open the rating pop-up */
.rate-btn {
padding: 15px 30px;
background-color: #ffb6b9; /* Soft pink */
color: white;
font-size: 18px;
border: none;
border-radius: 30px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
cursor: pointer;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rate-btn:hover {
transform: scale(1.05);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
/* Pop-up menu */
.popup {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: white;
padding: 40px;
width: 320px;
border-radius: 15px;
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
text-align: center;
z-index: 10;
}
/* Gradient background for pop-up */
.popup h2 {
background: -webkit-linear-gradient(45deg, #ffb6b9, #fae3d9);
/* -webkit-background-clip: text;
-webkit-text-fill-color: transparent;*/
margin-bottom: 20px;
}
/* Stars */
.stars {
display: flex;
justify-content: center;
gap: 8px;
margin-bottom: 20px;
}
.stars input {
display: none;
}
.stars label {
font-size: 35px;
color: #ccc;
cursor: pointer;
transition: color 0.2s ease;
}
.stars input:checked ~ label,
.stars label:hover,
.stars label:hover ~ label {
color: gold;
}
/* Comment section */
.comment-section {
margin-top: 15px;
}
.comment-section textarea {
width: 100%;
height: 80px;
padding: 10px;
border-radius: 10px;
border: 1px solid #ddd;
font-size: 14px;
outline: none;
resize: none;
transition: border-color 0.3s;
}
.comment-section textarea:focus {
border-color: #ffb6b9; /* Soft pink */
}
/* Close button */
.close-btn {
padding: 12px 25px;
background-color: #6d83f2; /* Soft blue */
color: white;
border: none;
border-radius: 30px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
margin-top: 20px;
}
.close-btn:hover {
background-color: #5067e8;
transform: scale(1.05);
}
.popup.active {
display: block;
animation: popupFadeIn 0.3s ease-out forwards;
}
@keyframes popupFadeIn {
0% {
opacity: 0;
transform: translate(-50%, -60%);
}
100% {
opacity: 1;
transform: translate(-50%, -50%);
}
}
/* Dark overlay for the background */
.overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 5;
}
.overlay.active {
display: block;
}
</style>
</head>
<body>
<!-- Button to trigger the pop-up -->
<button class="rate-btn" onclick="openPopup()">Rate Restaurant</button>
<!-- Pop-up for rating -->
<div class="popup" id="ratingPopup">
<h2>Rate this Restaurant</h2>
<!-- Star rating system -->
<div class="stars">
<input type="radio" id="star5" name="rating" value="5">
<label for="star5">★</label>
<input type="radio" id="star4" name="rating" value="4">
<label for="star4">★</label>
<input type="radio" id="star3" name="rating" value="3">
<label for="star3">★</label>
<input type="radio" id="star2" name="rating" value="2">
<label for="star2">★</label>
<input type="radio" id="star1" name="rating" value="1">
<label for="star1">★</label>
</div>
<!-- Optional Comment Section -->
<div class="comment-section">
<textarea id="comment" placeholder="Leave a comment (optional)..."></textarea>
</div>
<!-- Submit Button -->
<button class="close-btn" onclick="submitRating()">Submit Rating</button>
</div>
<!-- Dark overlay for pop-up effect -->
<div class="overlay" id="overlay"></div>
<script>
// Open the pop-up
function openPopup() {
document.getElementById('ratingPopup').classList.add('active');
document.getElementById('overlay').classList.add('active');
}
// Close the pop-up
function closePopup() {
document.getElementById('ratingPopup').classList.remove('active');
document.getElementById('overlay').classList.remove('active');
}
// Close popup when clicking outside
document.getElementById('overlay').addEventListener('click', closePopup);
</script>
</body>
</html>