Here is my one more UI experiment.
Here i have created this vertical scroll animated widget and with the help of this widget i have created my portfolio.
Do u wanna try Source Code link is down there
index.html
<!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">
<title>Vertical Scroll Widget Without Scrollbar</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<main>
<div class="container">
<div class="content content-1"><h1>Content 1</h1></div>
<div class="content content-2"><h1>Content 2</h1></div>
<div class="content content-3"><h1>Content 3</h1></div>
<div class="content content-4"><h1>Content 4</h1></div>
</div>
<div class="widget">
<a href="#" data="1" class="btn"></a>
<a href="#" data="2" class="btn"></a>
<a href="#" data="3" class="btn"></a>
<a href="#" data="4" class="btn"></a>
</div>
</main>
<script src="./index.js"></script>
</body>
</html>
style.css
*{
margin: 0;
padding: 0;
}
body{
overflow: hidden;
}
.container{
position: relative;
top: 0;
transition: top 2s cubic-bezier(0,.97,.12,1);
}
.content{
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.content-1{
background: orange;
}
.content-2{
background: skyblue;
}
.content-3{
background: violet;
}
.content-4{
background: purple;
}
.widget{
height: 100vh;
position: fixed;
top: 0;
display: flex;
flex-direction: column;
justify-content: center;
right: 20px;
}
.widget a{
display: block;
width: 10px;
height: 10px;
border: 1px solid #333;
border-radius: 50%;
margin: 10px;
background: rgba(0, 0, 0, 0.3);
box-shadow: 0 0 10px 0 grey;
cursor: pointer;
}
index.js
const container = document.querySelector(".container");
const widget = document.querySelector(".widget");
widget.addEventListener("click", function (e) {
const data = e.target.getAttribute("data");
const containerShiftByTop = parseInt(data) * 100 - 100;
container.style.top = `-${containerShiftByTop}vh`;
console.log(data);
});