Add files via upload
This commit is contained in:
parent
c2b23d4696
commit
9ac44e7d11
@ -0,0 +1,20 @@
|
||||
let marker = document.querySelector('#marker');
|
||||
let list = document.querySelectorAll('ul li');
|
||||
|
||||
function moveIndicator(e){
|
||||
marker.style.left = e.offsetLeft+'px';
|
||||
marker.style.width = e.offsetWidth+'px';
|
||||
}
|
||||
list.forEach(link => {
|
||||
link.addEventListener('mousemove', (e) => {
|
||||
moveIndicator(e.target);
|
||||
})
|
||||
})
|
||||
|
||||
function activeLink(){
|
||||
list.forEach((item) =>
|
||||
item.classList.remove('active'));
|
||||
this.classList.add('active');
|
||||
}
|
||||
list.forEach((item) =>
|
||||
item.addEventListener('mouseover', activeLink));
|
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<ul>
|
||||
<li><a href="#"><ion-icon name="home-outline"></ion-icon></a></li>
|
||||
<li><a href="#"><ion-icon name="planet-outline"></ion-icon></a></li>
|
||||
<li class="active"><a href="#"><ion-icon name="chatbox-outline"></ion-icon></a></li>
|
||||
<li><a href="#"><ion-icon name="person-outline"></ion-icon></a></li>
|
||||
<li><a href="#"><ion-icon name="settings-outline"></ion-icon></a></li>
|
||||
<div id="marker"></div>
|
||||
</ul>
|
||||
<script type="module" src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"></script>
|
||||
<script nomodule src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>
|
||||
<script src="app.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,97 @@
|
||||
*{
|
||||
margin:0;
|
||||
padding:0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
background: #1e2759;
|
||||
}
|
||||
ul{
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 5px 25px rgba(0, 0, 0, .2);
|
||||
}
|
||||
ul li{
|
||||
list-style: none;
|
||||
}
|
||||
ul li a{
|
||||
position: relative;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
padding: 10px 20px;
|
||||
z-index: 1000;
|
||||
backdrop-filter: blur(15px);
|
||||
}
|
||||
ul li a ion-icon{
|
||||
font-size: 2.5em;
|
||||
pointer-events: none;
|
||||
opacity: .2;
|
||||
transition: .3s;
|
||||
}
|
||||
ul li.active a ion-icon{
|
||||
opacity: 1;
|
||||
}
|
||||
#marker{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
transition: .5s;
|
||||
z-index: 1;
|
||||
}
|
||||
#marker::before{
|
||||
content: '';
|
||||
position: absolute;
|
||||
top:-10px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 50px;
|
||||
height: 40px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
ul li:nth-child(1).active ~ #marker::before{
|
||||
background: #5da6ff;
|
||||
box-shadow:
|
||||
0 0 30px #5da6ff,
|
||||
0 0 45px #5da6ff,
|
||||
0 0 60px #5da6ff,
|
||||
0 0 15px #5da6ff;
|
||||
}
|
||||
ul li:nth-child(2).active ~ #marker::before{
|
||||
background: #ff0;
|
||||
box-shadow:
|
||||
0 0 30px #ff0,
|
||||
0 0 45px #ff0,
|
||||
0 0 60px #ff0,
|
||||
0 0 15px #ff0;
|
||||
}
|
||||
ul li:nth-child(3).active ~ #marker::before{
|
||||
background: #0f0;
|
||||
box-shadow:
|
||||
0 0 30px #0f0,
|
||||
0 0 45px #0f0,
|
||||
0 0 60px #0f0,
|
||||
0 0 15px #0f0;
|
||||
}
|
||||
ul li:nth-child(4).active ~ #marker::before{
|
||||
background: #f00;
|
||||
box-shadow:
|
||||
0 0 30px #f00,
|
||||
0 0 45px #f00,
|
||||
0 0 60px #f00,
|
||||
0 0 15px #f00;
|
||||
}
|
||||
ul li:nth-child(5).active ~ #marker::before{
|
||||
background: #df2fff;
|
||||
box-shadow:
|
||||
0 0 30px #df2fff,
|
||||
0 0 45px #df2fff,
|
||||
0 0 60px #df2fff,
|
||||
0 0 15px #df2fff;
|
||||
}
|
Loading…
Reference in New Issue
Block a user