css

mail@pastecode.io avatar
unknown
css
2 years ago
4.6 kB
2
Indexable
Never
@import url('https://fonts.googleapis.com/css2?family=Poppins&family=Righteous&display=swap');
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins';
}
:root{
    --bg: #2f323f
}
body{
    min-height: 100vh;
    background: var(--bg);
}
#navigation{
    position: fixed;
    inset: 40px 0 40px 20px;
    background: #fff;
    width: 75px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.5s;
}
.nav-hidden{
    display: none;
    transition: all 0.5s ease-in-out;
}
#navigation.active{
    width: 225px;
}

.menutoggle{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    padding: 0 23px;
    border-bottom: 1px solid rgba(0,0,0,0.25);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    cursor: pointer;
}


.menutoggle::before{
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background: #333;
    transform: translateY(-8px);
    transition: 0.5s;
}
#navigation.active .menutoggle::before{
    transform: translateY(0) rotate(45deg);
}
.menutoggle::after{
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background: #333;
    transform: translateY(8px);
    box-shadow: 0 -8px 0 #333;
    transition: 0.5s;
}
#navigation.active .menutoggle::after{
    transform: translateY(0) rotate(-45deg);
    box-shadow: 0 0 0 #333;
}
#navigation ul{
    display: flex;
    flex-direction: column;
    width: 100%;
}
#navigation ul li{
    list-style: none;
    position: relative;
    width: 100%;
    height: 76px;
    border-radius: 12px;
    border: 8px solid transparent;
    transition: 0.5s;
}
#navigation ul li.active{
    transform: translateX(30px);
    background: var(--bg);
}
#navigation ul li::before{
    content: '';
    position: absolute;
    top: -28px;
    right: -10px;
    width: 20px;
    height: 20px;
    background: transparent;
    border-bottom-right-radius: 20px;
    box-shadow: 6px 5px 0 5px var(--bg);
    transform: scale(0);
    transform-origin: bottom right;
    transition: 0.5s;
}
#navigation ul li.active::before{
    right: 22px;
    transform: scale(1);
}
#navigation ul li::after{
    content: '';
    position: absolute;
    bottom: -28px;
    right: -10px;
    width: 20px;
    height: 20px;
    background: transparent;
    border-top-right-radius: 20px;
    box-shadow: 6px -3px 0 3px var(--bg);
    transform: scale(0);
    transform-origin: bottom right;
    transition: 0.5s;
}
#navigation ul li.active::after{
    right: 22px;
    transform: scale(1);
}
#navigation ul li a{
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    text-align: center;
    text-decoration: none;
    z-index: 1000;
}
#navigation ul li a .icon{
    position: relative;
    display: block;
   
    min-width: 60px;
    height: 60px;
    border-radius:10px ;
    background: #fff;
    font-size: 1.75rem;
    line-height: 50px;
    border: 6px solid transparent;
    transition: 0.5s;
}
#navigation ul li.active a .icon{
    color: #fff;
    background: var(--clr);
}
#navigation ul li.active a .icon::before{
    content: "";
    position: absolute;
    top: 12px;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--clr);
    filter: blur(8px);
    opacity: 0;
    transform: 0.5s;
}
#navigation ul li.active a .icon::after{
    content: '';
    position: absolute;
    top: 10px;
    left: -60px;
    width: 15px;
    height: 15px;
    background: var(--clr);
    border: 8px solid var(--bg);
    border-radius: 50%;
    
}
#navigation ul li a .text{
    position: relative;
    padding: 0 15px;
    color: #333;
    display: flex;
    align-items: center;
    height: 60px;
    opacity: 0;
    visibility: hidden;
    transition: 0.5s;

}
#navigation.active ul li a .text{
    visibility: visible;
    opacity: 1;
}
#navigation ul li.active a .text{
    color: #fff;
}
#opentoggle{
    visibility: hidden;
}

  
@media only screen and (max-width: 600px){
.nav-hidden{
    visibility: hidden;
}


#opentoggle button{
    float: right;
    background-color: #fff;
    margin: 30px;
    margin-top: 45px;
    padding-top: 5px;
    box-shadow: #333;
    cursor: pointer;
    visibility: visible;
    
}
#opentoggle ion-icon{
   width: 50px;
   height: 30px;
}
}