<div class="container">
<div class="screen">
<div class="header">
<div class="wrap">
<div class="navbar">
<div class="menu__icon">
<i class="fas fa-bars"></i>
</div>
<div class="menu__cart">
<i class="fas fa-shopping-bag"></i>
</div>
</div>
<div class="container_navBar">
<h1>Music</h1>
<div class="mainNav">
<ul>
<li>Popular</li>
<li>Paylist</li>
</ul>
</div>
</div>
</div>
</div>
<div id="home">
<div class="content">
</div>
</div>
</div>
</div>
<!-- ignore -->
<a href="https://youtu.be/F5pOKlC55cg" target="_blank"><footer>
<div class="texto">
<span>
<i class="fab fa-youtube"></i>
watch on youtube</span>
</div>
</footer>
</a>
@import url('https://fonts.googleapis.com/css?family=Lato:300,400|Poppins:300,400,800&display=swap');
* {
margin: 0;
padding: 0;
}
body {
font-family: 'Poppins';
}
.container {
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: #F1edee;
.screen {
width: 480px;
height: 550px;
background: #FFF;
display: flex;
flex-direction: column;
border-radius: 20px;
position: relative;
.header {
width: inherit;
height: 30%;
background: #C2CADE;
display: flex;
justify-content: center;
align-items: flex-end;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
position: fixed;
transition: ease-in-out 200ms;
.wrap {
width: 90%;
height: 80%;
display: flex;
flex-direction: column;
padding: 0px 50px;
.navbar {
width: 100%;
display: flex;
justify-content: space-between;
.menu__icon, .menu__cart {
color: #FFF;
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
cursor: pointer;
border-radius: 50%;
&:before {
content: '';
width: 10px;
height: 10px;
border-radius: 50%;
position: absolute;
transition: ease-in-out 120ms;
}
&:hover:before {
content: '';
width: 50px;
height: 50px;
border-radius: 50%;
background: rgba(0, 0, 0, .5);
z-index: -1;
}
}
}
.container_navBar {
width: 100%;
height: inherit;
position: relative;
display: flex;
align-items: flex-end;
h1 {
font-size: 32px;
color: #FFFFFF;
display: flex;
align-self: center;
transition: ease-in-out 200ms;
}
.mainNav {
width: 100%;
height: 80px;
background: #FFF;
border-radius: 15px;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
bottom: -65px;
box-shadow: 0px 10px 20px rgba(0, 0, 0, .2);
transition: ease-in-out 200ms;
ul {
width: 60%;
display: flex;
justify-content: space-between;
li {
list-style: none;
font-size: 14px;
font-weight: bold;
cursor: pointer;
color: #737887;
}
}
}
}
}
}
#home {
width: inherit;
height: 100%;
overflow: scroll;
overflow-x: hidden;
margin-top: 30%;
display: flex;
justify-content: center;
align-items: center;
&::-webkit-scrollbar {
display: none;
}
.content {
width: 80%;
height: inherit;
display: flex;
flex-direction: column;
margin-top: 93%;
}
}
}
}
/* other styles */
.header.stick {
height: 17%!important;
.container_navBar {
h1 {
font-size: 26px!important;
}
.mainNav {
height: 60px!important;
bottom: -40px!important;
}
}
}
/*ignore*/
footer {
width: 350px;
height: 80px;
background:#C2CADE;
position: absolute;
right: 0;
bottom: -80px;
display: flex;
justify-content: center;
align-items: center;
animation: top 0.8s forwards;
span {
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
color: #fff;
font-family: 'Poppins';
i {
margin-right: 25px;
font-size: 22px;
color: #fff;
animation: icon 2s forwards;
opacity: 0;
}
}
}
@keyframes top {
0% {
opacity: 0;
bottom: -80px
}
100% {
opacity: 1;
bottom: 0px
}
}
@keyframes icon {
0% {
opacity: 0;
transform: scale(0.0);
}
50% {
opacity: 1;
transform: scale(1.3) rotate(-02deg);
}
100% {
opacity: 1;
bottom: 0px;
}
}
View Compiled
$('#home').scroll(function() {
if($(this).scrollTop() > 0) {
$('.header').addClass('stick')
} else {
$('.header').removeClass('stick')
}
})
This Pen doesn't use any external CSS resources.