<!-- Design by Ildiesign - https://dribbble.com/shots/7292664-Survey-UI-Design -->
<!-- Icons by - https://www.flaticon.com/authors/roundicons -->
<div id="panel" class="panel-container">
<strong>How satisfied 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>
<!-- SOCIAL PANEL HTML -->
<div class="social-panel-container">
<div class="social-panel">
<p>Created with <i class="fa fa-heart"></i> by
<a target="_blank" href="https://florin-pop.com">Florin Pop</a></p>
<button class="close-btn"><i class="fas fa-times"></i></button>
<h4>Get in touch on</h4>
<ul>
<li>
<a href="https://www.patreon.com/florinpop17" target="_blank">
<i class="fab fa-discord"></i>
</a>
</li>
<li>
<a href="https://twitter.com/florinpop1705" target="_blank">
<i class="fab fa-twitter"></i>
</a>
</li>
<li>
<a href="https://linkedin.com/in/florinpop17" target="_blank">
<i class="fab fa-linkedin"></i>
</a>
</li>
<li>
<a href="https://facebook.com/florinpop17" target="_blank">
<i class="fab fa-facebook"></i>
</a>
</li>
<li>
<a href="https://instagram.com/florinpop17" target="_blank">
<i class="fab fa-instagram"></i>
</a>
</li>
</ul>
</div>
</div>
<button class="floating-btn">
Get in Touch
</button>
<div class="floating-text">
Part of <a href="https://florin-pop.com/blog/2019/09/100-days-100-projects" target="_blank">#100Days100Projects</a>
</div>
@import url('https://fonts.googleapis.com/css?family=Muli&display=swap');
@import url('https://fonts.googleapis.com/css?family=Monserrat&display=swap');
* {
box-sizing: border-box;
}
body {
background-color: #FEF9F2;
font-family: 'Monserrat', sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.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;
}
.panel-container p {
margin: 25px 0;
line-height: 20px;
}
.ratings-container {
display: flex;
margin: 20px 0;
}
.rating {
cursor: pointer;
flex: 1;
padding: 20px;
margin: 10px 5px;
}
.rating.active, .rating:hover {
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.active small, .rating:hover small {
color: #111;
}
.btn {
background-color: #302D2B;
border: 0;
border-radius: 4px;
color: #fff;
cursor: pointer;
padding: 12px 30px;
}
.fa-heart {
color: red;
font-size: 30px;
margin-bottom: 10px;
}
/* SOCIAL PANEL CSS */
.social-panel-container {
position: fixed;
right: 0;
bottom: 80px;
transform: translateX(100%);
transition: transform 0.4s ease-in-out;
}
.social-panel-container.visible {
transform: translateX(-10px);
}
.social-panel {
background-color: #fff;
border-radius: 16px;
box-shadow: 0 16px 31px -17px rgba(0,31,97,0.6);
border: 5px solid #001F61;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-family: 'Muli';
position: relative;
height: 169px;
width: 370px;
max-width: calc(100% - 10px);
}
.social-panel button.close-btn {
border: 0;
color: #97A5CE;
cursor: pointer;
font-size: 20px;
position: absolute;
top: 5px;
right: 5px;
}
.social-panel button.close-btn:focus {
outline: none;
}
.social-panel p {
background-color: #001F61;
border-radius: 0 0 10px 10px;
color: #fff;
font-size: 14px;
line-height: 18px;
padding: 2px 17px 6px;
position: absolute;
top: 0;
left: 50%;
margin: 0;
transform: translateX(-50%);
text-align: center;
width: 235px;
}
.social-panel p i {
margin: 0 5px;
}
.social-panel p a {
color: #FF7500;
text-decoration: none;
}
.social-panel h4 {
margin: 20px 0;
color: #97A5CE;
font-family: 'Muli';
font-size: 14px;
line-height: 18px;
text-transform: uppercase;
}
.social-panel ul {
display: flex;
list-style-type: none;
padding: 0;
margin: 0;
}
.social-panel ul li {
margin: 0 10px;
}
.social-panel ul li a {
border: 1px solid #DCE1F2;
border-radius: 50%;
color: #001F61;
font-size: 20px;
display: flex;
justify-content: center;
align-items: center;
height: 50px;
width: 50px;
text-decoration: none;
}
.social-panel ul li a:hover {
border-color: #FF6A00;
box-shadow: 0 9px 12px -9px #FF6A00;
}
.floating-btn {
border-radius: 26.5px;
background-color: #001F61;
border: 1px solid #001F61;
box-shadow: 0 16px 22px -17px #03153B;
color: #fff;
cursor: pointer;
font-size: 16px;
line-height: 20px;
padding: 12px 20px;
position: fixed;
bottom: 20px;
right: 20px;
z-index: 999;
}
.floating-btn:hover {
background-color: #ffffff;
color: #001F61;
}
.floating-btn:focus {
outline: none;
}
.floating-text {
background-color: #001F61;
border-radius: 10px 10px 0 0;
color: #fff;
font-family: 'Muli';
padding: 7px 15px;
position: fixed;
bottom: 0;
left: 50%;
transform: translateX(-50%);
text-align: center;
z-index: 998;
}
.floating-text a {
color: #FF7500;
text-decoration: none;
}
@media screen and (max-width: 480px) {
.social-panel-container.visible {
transform: translateX(0px);
}
.floating-btn {
right: 10px;
}
}
const ratingsEl = document.querySelectorAll('.rating');
const sendBtn = document.querySelector('#send');
const panel = document.querySelector('#panel');
ratingsEl.forEach(el => {
el.addEventListener('click', () => {
ratingsEl.forEach(innerEl => {
innerEl.classList.remove('active');
});
el.classList.add('active');
});
});
sendBtn.addEventListener('click', () => {
panel.innerHTML = `
<i class="fas fa-heart"></i>
<strong>Thank you, Florin!</strong>
<p>We'll use your feedback to improve our customer support performance.</p>
<button class="btn">Done</button>
`;
});
// SOCIAL PANEL JS
const floating_btn = document.querySelector('.floating-btn');
const close_btn = document.querySelector('.close-btn');
const social_panel_container = document.querySelector('.social-panel-container');
floating_btn.addEventListener('click', () => {
social_panel_container.classList.toggle('visible')
});
close_btn.addEventListener('click', () => {
social_panel_container.classList.remove('visible')
});
This Pen doesn't use any external JavaScript resources.