Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
sadafhukkeri committed Oct 7, 2024
1 parent d4a716d commit fe5671d
Showing 1 changed file with 92 additions and 1 deletion.
93 changes: 92 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,87 @@

<title>BuddyTrail</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

.container {
display: flex;
align-items: flex-start; /* Align items at the start of the container */
justify-content: space-between; /* Space between elements */
gap: 20px; /* Optional gap between form and rating section */
height: auto; /* Adjust height if necessary */
}
.form-section {
width: 70%; /* Adjust width as needed */
}
.rating-wrap {
width: 30%; /* Adjust width as needed */
text-align: left;
}

.center {
width: auto;
display: inline-flex; /* Align stars and rating count in a row */
align-items: center;
gap: 10px; /* Add some space between the stars and the count */
}


#rating-value {
font-size: 1.2rem; /* Adjust font size */
font-weight: bold;
color: black; /* Optional: change the color to match the theme */
}

.rating {
border: none;
float:right;
}

.rating > input {
display: none;
}

.rating > label:before {
content: '\f005';
font-family: FontAwesome;
margin: 5px;
font-size: 1.5rem;
display: inline-block;
cursor: pointer;
}

.rating > .half:before {
content: '\f089';
position: absolute;
cursor: pointer;
}

.rating > label {
color: #ddd; /* Empty stars initially */
float: right;
cursor: pointer;
}

/* Filled stars on hover and selection */
.rating > input:checked ~ label,
.rating:not(:checked) > label {
color: #ddd; /* Keep stars empty until interaction */
}

.rating > input:checked ~ label,
.rating > input:checked ~ label:hover,
.rating > input:checked ~ label:hover ~ label {
color: rgb(230, 166, 17); /* Green for filled stars */
}

.rating > label:hover ~ label,
.rating > label:hover {
color:rgb(230, 166, 17); /* Green hover effect */
}
.chatbot-container {
position: fixed;
bottom: 20px; /* Adjust as needed */
Expand Down Expand Up @@ -565,7 +646,17 @@ <h2>Ratings:</h2>
</div>
</div>
</div>
<script src="star-rating.js"></script>
<script>
let star = document.querySelectorAll('input');
let showValue = document.querySelector('#rating-value');

for(let i = 0; i < star.length; i++) {
star[i].addEventListener('click', function() {
let selectedRating = this.value;
showValue.innerHTML = selectedRating; // Only show the rating value
});
}
</script>
<label for="review">Your Review:</label>
<textarea id="review" name="review" rows="4" required></textarea>
<label for="complaint">Complaint (if any):</label>
Expand Down

0 comments on commit fe5671d

Please sign in to comment.