-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const ratings = document.querySelectorAll(".rating"); | ||
const ratingsContainer = document.querySelector(".ratings-container"); | ||
const sendBtn = document.querySelector("#send"); | ||
const panel = document.querySelector("#panel"); | ||
let selectedRating = "Satisfide"; | ||
|
||
ratingsContainer.addEventListener("click", (e) => { | ||
if (e.target.parentNode.classList.contains("rating")) { | ||
removeActive(); | ||
e.target.parentNode.classList.add("active"); | ||
selectedRating = e.target.nextElementSibling.innerHTML; | ||
} | ||
}); | ||
|
||
sendBtn.addEventListener("click", (e) => { | ||
panel.innerHTML = ` | ||
<i class="fas fa-heart"></i> | ||
<strong>Thank You!</strong> | ||
<br> | ||
<strong>Feedback: ${selectedRating}</strong> | ||
<p>We'll use your feedback to improve our customer support.</p> | ||
`; | ||
}); | ||
|
||
function removeActive() { | ||
for (let i = 0; i < ratings.length; i++) { | ||
ratings[i].classList.remove("active"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" | ||
integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" | ||
crossorigin="anonymous" | ||
referrerpolicy="no-referrer" | ||
/> | ||
<link rel="stylesheet" href="./style.css" /> | ||
<title>Feedback UI Design</title> | ||
</head> | ||
<body> | ||
<div class="panel-container" id="panel"> | ||
<strong | ||
>How satisfide are you with our <br /> | ||
customer support performance? | ||
</strong> | ||
<div class="ratings-container"> | ||
<div class="rating"> | ||
<img | ||
src="https://image.flaticon.com/icons/svg/187/187150.svg" | ||
alt="" | ||
/> | ||
<small>Unhappy</small> | ||
</div> | ||
|
||
<div class="rating"> | ||
<img | ||
src="https://image.flaticon.com/icons/svg/187/187136.svg" | ||
alt="" | ||
/> | ||
<small>Neutral</small> | ||
</div> | ||
|
||
<div class="rating active"> | ||
<img | ||
src="https://image.flaticon.com/icons/svg/187/187133.svg" | ||
alt="" | ||
/> | ||
<small>Satisfied</small> | ||
</div> | ||
</div> | ||
|
||
<button class="btn" id="send">Send Review</button> | ||
</div> | ||
|
||
<script src="./app.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
*::after, | ||
*::before { | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
body { | ||
font-family: "Montserrat", sans-serif; | ||
background-color: #fef9f2; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100vh; | ||
overflow: hidden; | ||
margin: 0; | ||
} | ||
|
||
.panel-container { | ||
background-color: #fff; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); | ||
border-radius: 4px; | ||
font-size: 90%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 30px; | ||
max-width: 400px; | ||
text-align: center; | ||
} | ||
|
||
.panel-container strong { | ||
line-height: 20px; | ||
} | ||
|
||
.ratings-container { | ||
display: flex; | ||
margin: 20px 0; | ||
} | ||
|
||
.rating { | ||
flex: 1; | ||
cursor: pointer; | ||
padding: 20px; | ||
margin: 10px 5px; | ||
} | ||
|
||
.rating:hover, | ||
.rating:active { | ||
border-radius: 4px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
.rating img { | ||
width: 40px; | ||
} | ||
|
||
.rating small { | ||
color: #555; | ||
display: inline-block; | ||
margin: 10px 0 0; | ||
} | ||
|
||
.rating:hover small, | ||
.rating:active small { | ||
color: #111; | ||
} | ||
|
||
.btn { | ||
background-color: #302d2b; | ||
color: #fff; | ||
border: 0; | ||
border-radius: 4px; | ||
padding: 12px 30px; | ||
cursor: pointer; | ||
} | ||
|
||
.btn:focus { | ||
outline: 0; | ||
} | ||
|
||
.btn:active { | ||
transform: scale(0.98); | ||
} | ||
|
||
.fa-heart { | ||
color: red; | ||
font-size: 30px; | ||
margin-bottom: 10px; | ||
} |