Skip to content

Commit

Permalink
Added Rate us Option (Anishkagupta04#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
sailaja-adapa authored Jun 14, 2024
1 parent 1c097e6 commit 94ce46a
Show file tree
Hide file tree
Showing 4 changed files with 225 additions and 93 deletions.
29 changes: 14 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<meta content="width=device-width, initial-scale=1.0" name="viewport">

<link rel="icon" type="image/x-icon" href="favicon.png">


<!-- Bootstrap Icons CDN link -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="./style.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
<script src="https://kit.fontawesome.com/b08b6de27e.js" crossorigin="anonymous"></script>
Expand Down Expand Up @@ -339,20 +340,18 @@
</div>
<nav class="nav_menu">
<ul class="nav_link">
<li><a href="index.html">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="Html-Files/news.html">News</a></li>
<li><a href="dex.html">Service</a></li>
<li><a href="#patient-portal">Patient Portal</a></li>
<li><a href="#doctors">Doctor</a></li>
<li><a href="Html-Files/contact.html">Contact us</a></li>

<a href="login.html">Sign in/Sign up</a>
<a href="./Html-Files/Doctor Experience.html"><button>Find a Doctor</button></a>

</ul>
<li><a href="index.html"><i class="bi bi-house-door-fill"></i> Home</a></li>
<li><a href="#about"><i class="bi bi-info-circle-fill"></i> About</a></li>
<li><a href="Html-Files/news.html"><i class="bi bi-newspaper"></i> News</a></li>
<li><a href="dex.html"><i class="bi bi-gear"></i> Service</a></li>
<li><a href="#patient-portal"><i class="bi bi-person"></i> Patient Portal</a></li>
<li><a href="#doctors"><i class="bi bi-person-circle"></i> Doctor</a></li>
<li><a href="Html-Files/contact.html"><i class="bi bi-telephone"></i>Contact us</a></li>
<li><a href="rateus.html"><i class="bi bi-star"></i>Rate Us</a></li>
<li><a href="login.html"><i class="bi bi-box-arrow-right"></i> Sign in/Sign up</a></li>
<a href="./Html-Files/Doctor Experience.html"><button>Find a Doctor</button></a>
</ul>
</nav>
</div>
</header>

<!-- ############# Header ############# -->
Expand Down
109 changes: 109 additions & 0 deletions rateus.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
body {
font-family: Arial, sans-serif;
background-color: black;
color: #fff;
margin: 0;
padding: 0;
}

.header_container {
background-color: #022a2d;
opacity: 0.9;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 85px;
margin: auto;
margin-top: 5px;
}

.img {
flex: 0 0 auto;
}

.nav_link li {
margin-right: 1px;
padding: 4px 6px;
display: inline-block;
}

.nav_link li a {
transition: all 0.3s ease 0s;
color: white;
text-decoration: none;
}

.container {
background-color: #022a2d;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
width: 450px;
margin: 20px auto;
transition: box-shadow 0.3s, transform 0.3s;
position: relative;
}

.container:hover {
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2), 0 0 30px rgba(255, 255, 255, 0.6);
transform: scale(1.05);
}

.container h2 {
color: white;
}

.rating {
margin: 20px 0;
}

.rating .star {
cursor: pointer;
font-size: 30px;
color: #ccc;
transition: color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.rating .star.selected {
color: #f7d32e;
transform: scale(1.2);
font-size: 33px;

}

.rating .star:hover {
color: #f7d32e;
}

textarea {
width: 90%;
height: 110px;
margin: 20px auto;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
transition: box-shadow 0.3s, transform 0.3s;
background-color: #fff;
color: #333;
}

textarea:hover {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
transform: scale(1.02);
}

button {
background-color: #4bb6b7;
color: white;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}

button:hover {
background-color: #3aa5a6;
}
94 changes: 94 additions & 0 deletions rateus.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rate Us</title>
<link rel="stylesheet" href="rateus.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.8.1/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css">
</head>
<body>
<header class="header_container">
<div class="img">
<img id="rd-logo" style="width: 90px; height: auto;" src="images/rd.png">
</div>
<nav class="nav_menu">
<ul class="nav_link">
<li><a href="index.html"><i class="bi bi-house-door-fill"></i> Home</a></li>
<li><a href="#about"><i class="bi bi-info-circle-fill"></i> About</a></li>
<li><a href="Html-Files/news.html"><i class="bi bi-newspaper"></i> News</a></li>
<li><a href="dex.html"><i class="bi bi-gear"></i> Service</a></li>
<li><a href="#patient-portal"><i class="bi bi-person"></i> Patient Portal</a></li>
<li><a href="#doctors"><i class="bi bi-person-circle"></i> Doctor</a></li>
<li><a href="Html-Files/contact.html"><i class="bi bi-telephone"></i> Contact us</a></li>
<li><a href="Html-Files/rateus.html"><i class="bi bi-star"></i> Rate Us</a></li>
<li><a href="login.html"><i class="bi bi-box-arrow-right"></i> Sign in/Sign up</a></li>
<li><a href="./Html-Files/Doctor Experience.html"><button>Find a Doctor</button></a></li>
</ul>
</nav>
</header>

<div class="container">
<h2>Rate Us</h2>
<div class="rating">
<span class="star" data-value="1">&#9733;</span>
<span class="star" data-value="2">&#9733;</span>
<span class="star" data-value="3">&#9733;</span>
<span class="star" data-value="4">&#9733;</span>
<span class="star" data-value="5">&#9733;</span>
</div>
<textarea id="comment" placeholder="Give Us Your Feedback :) "></textarea>
<button onclick="submitRating()">Submit</button>
</div>

<script src="https://cdn.jsdelivr.net/npm/toastify-js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const stars = document.querySelectorAll('.star');

stars.forEach(star => {
star.addEventListener('click', () => {
const value = star.getAttribute('data-value');
highlightStars(value);
});
});

function highlightStars(value) {
stars.forEach((star, index) => {
if (index < value) {
star.classList.add('selected');
} else {
star.classList.remove('selected');
}
});
}
});

function submitRating() {
const selectedStars = document.querySelectorAll('.star.selected');
const comment = document.getElementById('comment').value;

if (selectedStars.length > 0 && comment.trim() !== '') {
Toastify({
text: "Thanks For Your Feedback :)",
duration: 3000,
close: true,
gravity: "top",
position: "center",
backgroundColor: "#4CAF50",
}).showToast();
} else {
Toastify({
text: "Please Fill All The Details :(",
duration: 3000,
close: true,
gravity: "top",
position: "center",
backgroundColor: "#FF0000",
}).showToast();
}
}
</script>
</body>
</html>
Loading

0 comments on commit 94ce46a

Please sign in to comment.