<div class="buttons-container">
<ul>
<li class="active"><a href="#" class="active-text"><i class="fa fa-codepen" aria-hidden="true"></i></a></li>
<li><a href="#"><i class="fa fa-coffee" aria-hidden="true"></i></a></li>
<li><a href="#"><i class="fa fa-rocket" aria-hidden="true"></i></a></li>
<li><a href="#"><i class="fa fa-user-circle" aria-hidden="true"></i></a></li>
</ul>
</div>
<div class="created-by">
<p>Created by</p>
<a href="https://codepen.io/AlbertFeynman/" target="_blank">Albert Feynman</a>
</div>
@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
width: 100%;
height: 100%;
}
body {
background: #202020;
font-family: 'Source Sans Pro', sans-serif;
}
.buttons-container {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 395px;
height: 100px;
border-radius: 45px;
background: #151515;
box-shadow: inset 0 0 2px 2px rgba(0, 0, 0, 0.5);
}
ul {
list-style: none;
width: inherit;
height: inherit;
display: flex;
align-items: center;
justify-content: center;
li {
display: flex;
align-items: center;
justify-content: center;
margin: 1px;
height: 90px;
width: 95px;
background: #202020;
border-top: 1px solid #353535;
box-shadow: 0 15px 20px 0 rgba(0, 0, 0, 0.5);
transition: all .5s;
&:nth-of-type(1) {
border-top-left-radius: 40px;
border-bottom-left-radius: 40px;
}
&:last-of-type {
border-top-right-radius: 40px;
border-bottom-right-radius: 40px;
}
&:hover {
cursor: pointer;
}
a {
display: inline-block;
color: gray;
text-decoration: none;
font-size: 40px;
transition: all .5s;
}
}
}
.created-by {
position: absolute;
margin: auto;
left: 0;
right: 0;
bottom: 10%;
width: 200px;
text-align: center;
font-size: 10px;
letter-spacing: 0.5em;
text-transform: uppercase;
p {
color: white;
}
a {
color: crimson;
text-shadow: 0 0 15px rgba(244, 0, 0, 0.71);
text-decoration: none;
font-weight: 700;
&:hover {
text-decoration: underline;
}
}
}
.active {
background: #151515;
border-top: none;
border-bottom: 1px solid #252525;
box-shadow: inset 0 0 10px 1px rgba(0, 0, 0, 0.8);
}
.active-text {
color: crimson;
text-shadow: 0 0 15px rgba(220, 10, 10, 0.5);
}
View Compiled
const lis = document.querySelectorAll("li");
const a = document.querySelectorAll("li a");
for (let i = 0; i < lis.length; i++) {
lis[i].addEventListener("click", function() {
for (let i = 0; i < lis.length; i++) {
lis[i].classList.remove("active");
a[i].classList.remove("active-text");
}
this.classList.add("active");
a[i].classList.add("active-text");
});
}
This Pen doesn't use any external JavaScript resources.