Skip to content

Commit

Permalink
page transition done
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishektyagi2912 committed Dec 20, 2023
1 parent 3f10a35 commit d2fd227
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 5 deletions.
11 changes: 7 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

<body>
<div id="main" class="smooth-scroll">
<div class="transition">
<div class="cover cover1"></div>
<div class="cover cover2"></div>
</div>
<div id="home">
<div id="nav-container">
<div id="nav">
Expand Down Expand Up @@ -177,11 +181,10 @@ <h1>
</div>
<div id="work">
<div class="workcontent">
<img src="./assests/img/android.png"
alt="">
<img src="./assests/img/android.png" alt="">
<h1>E-commerce <span>Website</span></h1>
<div class="page4btn">
<a href="">View More</a>
<a class="link" href="./pages/expresschat.html">View More</a>
</div>
</div>
<div class="workcontent">
Expand Down Expand Up @@ -228,7 +231,7 @@ <h1>Inetersted in</h1>
<h2>Working Together</h2>
</div>
<div id="connectbtn" class="magnet">
<a href="#">Start a project</a>
<a class="link" href="./pages/projects.html ">Start a project</a>
</div>
</div>
</div>
Expand Down
12 changes: 11 additions & 1 deletion javascript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,14 @@ function isOverPage4Btn(details, elem) {

function sendEmail() {
window.location.href = "mailto:your-abhishekpersonal2912@gmail.com?subject=I%20want%20to%20work%20with%20you";
}
}

const link = document.querySelector(".link");
const transition = document.querySelector(".transition");
link.addEventListener("click", (e) => {
e.preventDefault();
transition.classList.add("slide"); // Use the correct class name "slide" here
setTimeout(() => {
window.location = link.href;
}, 900);
});
11 changes: 11 additions & 0 deletions pages/expresschat.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Express Chat it is</h1>
</body>
</html>
11 changes: 11 additions & 0 deletions pages/projects.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Hi</h1>
</body>
</html>
30 changes: 30 additions & 0 deletions stylesheet/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -623,4 +623,34 @@ hr {
border-radius: 70px;
font-weight: 600;
color: #000;
}

.cover {
position: fixed;
height: 100%;
width: 100%;
top: 0;
left: -100vw;
z-index: 1000;
}

.transition.slide .cover1 {
background-color: #a1936f;
animation: slide 0.3s ease-in-out forwards;
}

.transition.slide .cover2 {
background-color: #D6D1C5;
animation: slide 0.3s ease-in-out forwards;
animation-delay: 0.3s;
}

@keyframes slide {
from {
left: -100vw;
}

to {
left: 0;
}
}

0 comments on commit d2fd227

Please sign in to comment.