<link href='https://fonts.googleapis.com/css?family=Roboto:400,700' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<section class="section-notification">
<ul class="nav">
<li><i class="material-icons">home</i></li>
<li><i class="material-icons">search</i></li>
<li class="is-active"><i class="material-icons">star
<ul class="notifications">
<li><i class="material-icons">remove_red_eye</i><span>9</span></li>
<li><i class="material-icons">comment</i><span>4</span></li>
<li><i class="material-icons">account_circle</i><span>6</span></li>
</ul></i></li>
<li><i class="material-icons">face</i></li>
</ul>
</section>
body {
font-family: 'Roboto', sans-serif;
font-smoothing: antialiased;
height: 100vh;
}
section {
background: #01cfa9;
height: 100vh;
margin: 0 auto;
display: box;
display: flex;
display: flexbox;
display: box;
display: flex;
box-pack: center;
box-pack: center;
flex-pack: center;
justify-content: center;
justify-content: center;
box-align: center;
box-align: center;
flex-align: center;
align-items: center;
align-items: center;
}
.section-notification .nav {
display: box;
display: flex;
display: flexbox;
display: box;
display: flex;
background: #fff;
color: #333;
border-radius: 5px;
box-shadow: 0px 23px 30px -20px rgba(0,0,0,0.3);
padding: 0;
}
.section-notification .nav > li {
padding: 20px 30px;
width: 24px;
height: 24px;
cursor: pointer;
list-style: none;
color: rgba(0,0,0,0.5);
position: relative;
perspective: 1000px;
perspective: 1000px;
perspective: 1000px;
}
.section-notification .nav > li:hover {
background: #eee;
}
.section-notification .nav > li.is-active {
box-shadow: 0px -7px 0px #05a285 inset;
background: #dfdfdf;
color: #333;
transition: 0.3s ease;
transition: 0.3s ease;
}
.section-notification .nav > li.is-active .notifications {
display: box;
display: flex;
display: flexbox;
display: box;
display: flex;
animation: note 0.7s ease-in-out forwards;
animation: note 0.7s ease-in-out forwards;
transform-origin: center 60px;
transform-origin: center 60px;
}
@-webkit-keyframes note {
0% {
opacity: 0;
filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
transform: scale(0.1) rotate(30deg) translateY(50px);
transform: scale(0.1) rotate(30deg) translateY(50px);
}
50% {
transform: rotate(-10deg);
transform: rotate(-10deg);
opacity: 1;
filter: none;
filter: none;
filter: none;
}
70% {
transform: rotate(5deg);
transform: rotate(5deg);
}
100% {
transform: scale(1);
transform: scale(1);
}
}
@keyframes note {
0% {
opacity: 0;
filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
transform: scale(0.1) rotate(30deg) translateY(50px);
transform: scale(0.1) rotate(30deg) translateY(50px);
}
50% {
transform: rotate(-10deg);
transform: rotate(-10deg);
opacity: 1;
filter: none;
filter: none;
filter: none;
}
70% {
transform: rotate(5deg);
transform: rotate(5deg);
}
100% {
transform: scale(1);
transform: scale(1);
}
}
.section-notification .notifications {
list-style: none;
background: #05a285;
display: none;
border-radius: 4px;
position: absolute;
bottom: 100%;
left: 50%;
padding: 0px 10px;
margin: 0 0 10px -88px;
cursor: default;
color: #fff;
}
.section-notification .notifications:after {
position: absolute;
top: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
border-top-color: #05a285;
border-width: 16px;
margin-left: -16px;
pointer-events: none;
}
.section-notification li {
padding: 6px;
font-family: 'Roboto', sans-serif;
color: #fff;
font-size: 0.6em;
}
.section-notification li .material-icons {
font-size: 24px;
}
.section-notification li span {
display: inline-block;
vertical-align: top;
margin: 4px;
}
var elems = document.getElementsByClassName("nav")[0].getElementsByTagName("li");
for (var i = 0; i < elems.length; i++) {
elems[i].addEventListener("click", function(e) {
for (var i = 0; i < elems.length; i++) {
elems[i].className = "";
};
this.className = "is-active";
});
}