Skip to content

Commit

Permalink
Merge pull request #172 from Sneha6003/rate
Browse files Browse the repository at this point in the history
FEAT: Addition of star rating #150
  • Loading branch information
Priyanshi662 authored Jan 25, 2024
2 parents 7ec8f5f + 6d1f141 commit 139aab5
Show file tree
Hide file tree
Showing 10 changed files with 347 additions and 1 deletion.
21 changes: 20 additions & 1 deletion Assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.rate-us-btn {
color: #4caf50;
background-color:#fff;
padding: 10px 15px;
border-radius: 5px;
text-decoration: none;
transition: background-color 0.3s ease;
}

.rate-us-btn:hover {
background-color: #03b300;
color:#fff;
}

#toggelBtn {
cursor: pointer;
font-size: 20px;
}


.card {
background: linear-gradient(to bottom, #45a049, #acf7af);
Expand Down Expand Up @@ -167,4 +186,4 @@
}
.line{
margin: 0px 50px;
}
}
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<div class="Header">
<h1>Fun Fusion</h1>
<a href="./rate/index.html" class="rate-us-btn">&#9733; Rate Us</a>
<div id="toggelBtn" onclick="openSidebar()">&#9776;</div>
</div>
<a href="contributor.html">Contributors</a>
Expand Down
Binary file added rate/emojis/emoji-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rate/emojis/emoji-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rate/emojis/emoji-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rate/emojis/emoji-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rate/emojis/emoji-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions rate/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Emoji Stars Rating</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
</head>
<body>

<div class="wrapper">
<input type="radio" name="rate" id="star-1">
<input type="radio" name="rate" id="star-2">
<input type="radio" name="rate" id="star-3">
<input type="radio" name="rate" id="star-4">
<input type="radio" name="rate" id="star-5">
<div class="content">
<div class="outer">
<div class="emojis">
<li class="slideImg"><img src="emojis/emoji-1.png" alt=""></li>
<li><img src="emojis/emoji-2.png" alt=""></li>
<li><img src="emojis/emoji-3.png" alt=""></li>
<li><img src="emojis/emoji-4.png" alt=""></li>
<li><img src="emojis/emoji-5.png" alt=""></li>
</div>
</div>
<div class="stars">
<label for="star-1" class="star-1 fas fa-star"></label>
<label for="star-2" class="star-2 fas fa-star"></label>
<label for="star-3" class="star-3 fas fa-star"></label>
<label for="star-4" class="star-4 fas fa-star"></label>
<label for="star-5" class="star-5 fas fa-star"></label>
<form action="#">
<header></header>
<div class="textarea">
<textarea cols="30" placeholder="Describe your experience.."></textarea>
</div>
<div class="btn">
<button type="submit"><a href="thank-you.html"> Post</a></button>
</div>
</form>
</div>
</div>
<div class="footer">
<span class="text"></span>
<span class="numb"></span>

</div>
</div>



</body>
</html>
207 changes: 207 additions & 0 deletions rate/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body{
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background: linear-gradient(#FED151, #DE981F);
}
.wrapper{
background: #f6f6f6;
max-width: 360px;
width: 100%;
border-radius: 10px;
box-shadow: 0px 10px 15px rgba(0,0,0,0.1);
}
.wrapper .content{
padding: 30px;
display: flex;
align-items: center;
flex-direction: column;
}
.wrapper .outer{
height: 135px;
width: 135px;
overflow: hidden;
}
.outer .emojis{
height: 500%;
display: flex;
flex-direction: column;
}
.outer .emojis li{
height: 20%;
width: 100%;
list-style: none;
transition: all 0.3s ease;
}
.outer li img{
height: 100%;
width: 100%;
}
#star-2:checked ~ .content .emojis .slideImg{
margin-top: -135px;
}
#star-3:checked ~ .content .emojis .slideImg{
margin-top: -270px;
}
#star-4:checked ~ .content .emojis .slideImg{
margin-top: -405px;
}
#star-5:checked ~ .content .emojis .slideImg{
margin-top: -540px;
}
.wrapper .stars{
margin-top: 30px;
}
.stars label{
font-size: 30px;
margin: 0 3px;
color: #ccc;
}
#star-1:hover ~ .content .stars .star-1,
#star-1:checked ~ .content .stars .star-1,

#star-2:hover ~ .content .stars .star-1,
#star-2:hover ~ .content .stars .star-2,
#star-2:checked ~ .content .stars .star-1,
#star-2:checked ~ .content .stars .star-2,

#star-3:hover ~ .content .stars .star-1,
#star-3:hover ~ .content .stars .star-2,
#star-3:hover ~ .content .stars .star-3,
#star-3:checked ~ .content .stars .star-1,
#star-3:checked ~ .content .stars .star-2,
#star-3:checked ~ .content .stars .star-3,

#star-4:hover ~ .content .stars .star-1,
#star-4:hover ~ .content .stars .star-2,
#star-4:hover ~ .content .stars .star-3,
#star-4:hover ~ .content .stars .star-4,
#star-4:checked ~ .content .stars .star-1,
#star-4:checked ~ .content .stars .star-2,
#star-4:checked ~ .content .stars .star-3,
#star-4:checked ~ .content .stars .star-4,

#star-5:hover ~ .content .stars .star-1,
#star-5:hover ~ .content .stars .star-2,
#star-5:hover ~ .content .stars .star-3,
#star-5:hover ~ .content .stars .star-4,
#star-5:hover ~ .content .stars .star-5,
#star-5:checked ~ .content .stars .star-1,
#star-5:checked ~ .content .stars .star-2,
#star-5:checked ~ .content .stars .star-3,
#star-5:checked ~ .content .stars .star-4,
#star-5:checked ~ .content .stars .star-5{
color: #fd4;
}
.wrapper .footer{
border-top: 1px solid #ccc;
background: #f2f2f2;
width: 100%;
height: 55px;
padding: 0 20px;
border-radius: 0 0 10px 10px;
display: flex;
align-items: center;
justify-content: space-between;
}
.footer span{
font-size: 17px;
font-weight: 400;
}
.footer .text::before{
content: "Rate your experience";
}
.footer .numb::before{
content: "0 out of 5";
}
#star-1:checked ~ .footer .text::before{
content: "I just hate it";
}
#star-1:checked ~ .footer .numb::before{
content: "1 out of 5";
}
#star-2:checked ~ .footer .text::before{
content: "I don't like it";
}
#star-2:checked ~ .footer .numb::before{
content: "2 out of 5";
}
#star-3:checked ~ .footer .text::before{
content: "This is awesome";
}
#star-3:checked ~ .footer .numb::before{
content: "3 out of 5";
}
#star-4:checked ~ .footer .text::before{
content: "I just like it";
}
#star-4:checked ~ .footer .numb::before{
content: "4 out of 5";
}
#star-5:checked ~ .footer .text::before{
content: "I just love it";
}
#star-5:checked ~ .footer .numb::before{
content: "5 out of 5";
}
input[type="radio"]{
display: none;
}
form header{
width: 100%;
font-size: 25px;
color: #fe7;
font-weight: 500;
margin: 5px 0 20px 0;
text-align: center;
transition: all 0.2s ease;
}
form .textarea{
height: 100px;
width: 100%;
overflow: hidden;
}
form .textarea textarea{
height: 100%;
width: 100%;
outline: none;
color: #a11818;
border: 1px solid #333;
background: #f4e49b;
padding: 10px;
font-size: 17px;
resize: none;
}
.textarea textarea:focus{
border-color: #444;
}
form .btn{
height: 45px;
width: 100%;
margin: 15px 0;
}
form .btn button{
height: 100%;
width: 100%;
border: 1px solid #444;
outline: none;
background: #f4e49b;
color: #999;
font-size: 17px;
font-weight: 500;
text-transform: uppercase;
cursor: pointer;
transition: all 0.3s ease;
}
form .btn button:hover{
background: #1b1b1b;
}

64 changes: 64 additions & 0 deletions rate/thank-you.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Thank You for Rating Us</title>
<style>
body {
font-family: 'Arial', sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}

.container {
text-align: center;
padding: 50px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
max-width: 600px;
margin: 50px auto;
}

h1 {
color: #007BFF;
}

p {
font-size: 18px;
color: #333;
margin-bottom: 20px;
}

.back-button {
display: inline-block;
padding: 10px 20px;
background-color: #007BFF;
color: #fff;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s ease;
}

.back-button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<h1>Thank You for Rating Us!</h1>
<p>Your feedback is valuable to us.</p>
<a href="../index.html" class="back-button" onclick="goBack()">Back</a>
</div>

<script>
function goBack() {
window.history.back();
}
</script>
</body>
</html>

0 comments on commit 139aab5

Please sign in to comment.