Skip to content

Commit 2699817

Browse files
Merge pull request #307 from shriyadindi/star
Created a new PR for the addition of star rating to the feedback section.
2 parents 4f61601 + 6bccb0b commit 2699817

File tree

2 files changed

+61
-5
lines changed

2 files changed

+61
-5
lines changed

index.html

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
<div class="scrollBar" id="progress_bar"></div> <!--PROGRESS BAR-->
4848
<a href="website/pages/login.html">
4949
<button class="loginSignupbtn">
50-
<span class="button-text">Login</span>
51-
<img src="website/web_images/user.png" alt="User Icon" class="user-icon">
50+
<span class="button-text">Login</span>
51+
<img src="website/web_images/user.png" alt="User Icon" class="user-icon">
5252
</button>
53-
</a>
53+
</a>
5454
</nav>
5555

5656
<button class="burger" id="burger" onclick="show()"></button>
@@ -82,7 +82,8 @@
8282
</td>
8383
</tr>
8484
<tr>
85-
<td><a href="website/pages/codeOfconduct.html" class="table_link" target="_blank">Code of Conduct</a></td>
85+
<td><a href="website/pages/codeOfconduct.html" class="table_link" target="_blank">Code of Conduct</a>
86+
</td>
8687
</tr>
8788
<tr>
8889
<td><a href="website/pages/license.html" class="table_link">License</a></td>
@@ -254,6 +255,18 @@
254255
<input type="text" name="Name" placeholder="Your Name" required>
255256
<input type="email" name="Email" placeholder="Your Email ID" required>
256257
<input name="Message" placeholder="Your Message" required>
258+
<div class="star-rating" style="text-align: center; margin: 10px;">
259+
<input type="radio" id="star5" name="rating" value="5" />
260+
<label for="star5" title="5 star">&#9733;</label>
261+
<input type="radio" id="star4" name="rating" value="4" />
262+
<label for="star4" title="4 stars">&#9733;</label>
263+
<input type="radio" id="star3" name="rating" value="3" />
264+
<label for="star3" title="3 stars">&#9733;</label>
265+
<input type="radio" id="star2" name="rating" value="2" />
266+
<label for="star2" title="2 stars">&#9733;</label>
267+
<input type="radio" id="star1" name="rating" value="1" />
268+
<label for="star1" title="1 stars">&#9733;</label>
269+
</div>
257270
<input type="submit" value="Send" id="send">
258271
</form>
259272
</footer>
@@ -274,6 +287,19 @@
274287
<a href="https://www.linkedin.com/in/tejascodes/"> LinkedIn</a>
275288
</div>
276289
<script>
290+
function validateFeedback() {
291+
var feedback = document.forms["CodeIt Reviews"]["Feedback"];
292+
checkFeedbackLength(feedback);
293+
return feedback.value.length >= 10;
294+
}
295+
function validateForm() {
296+
const rating = document.querySelector('input[name="rating"]:checked');
297+
if (!rating) {
298+
alert("Please select a rating.");
299+
return false; // Prevent form submission
300+
}
301+
return true; // Allow form submission
302+
}
277303
// Delay the execution by 3 seconds
278304
setTimeout(function () {
279305
window.embeddedChatbotConfig = {
@@ -295,7 +321,8 @@
295321
<p class="tejas_credits" style="color:rgb(187, 187, 187); margin-top: 20px;"> Designed & Developed by Tejas
296322
Gupta</p>
297323
<br>
298-
<p style="color:rgb(177, 177, 177);">&copy; <span id="copyright">32949832</span> <a href=".github/404.html">Tejas Gupta</a></p>
324+
<p style="color:rgb(177, 177, 177);">&copy; <span id="copyright">32949832</span> <a
325+
href=".github/404.html">Tejas Gupta</a></p>
299326
</div>
300327
<div class="end_line"></div>
301328
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>

website/styles/style.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,35 @@ body {
5252
transition-duration: 0.2s;
5353
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
5454
}
55+
.star-rating {
56+
display: flex;
57+
justify-content: center;
58+
direction: rtl; /* This reverses the order of the stars */
59+
}
60+
61+
.star-rating input {
62+
display: none;
63+
/* Hide the radio buttons */
64+
}
65+
66+
.star-rating label {
67+
font-size: 2em;
68+
/* Star size */
69+
color: grey;
70+
/* Default star color */
71+
cursor: pointer;
72+
}
73+
74+
.star-rating input:checked~label {
75+
color: gold;
76+
/* Gold color for selected stars */
77+
}
78+
79+
.star-rating label:hover,
80+
.star-rating label:hover~label {
81+
color: gold;
82+
/* Change color on hover */
83+
}
5584

5685
input {
5786
color: white;

0 commit comments

Comments
 (0)