Skip to main content

How to create Page transition animation by Greensock (gsap)?

 Create Page transition animation by Greensock (gsap)





SOURCE CODE




HTML SOURCE_CODE:-
index .html

👇

<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <title> index Page </title>
    <meta name='viewport' content='width=device-width, initial-scale=1'>
    <link rel='stylesheet' type='text/css' media='screen' href='main.css'>
    
</head>
<body>
    <div class="header">
        <a href="#">
          <img class="logo"   src="img/Untitled-1.png" alt="">
        </a>
        <div class="loc">
        <ul>
          <li><a href="#" id="bu1" class="butt">Home</a></li>
          <li><a href="about.html" id="bu2" class="butt">About</a></li>
          
         
          
        </ul>
      
      </div>
    </div>
    <div class="cover">
      <div class="contan3"></div>
      <div class="contan4"></div>
<div class="contan">
    <div class="text">
        <p class="t1">
            Page transition 
        </p>
        <p>animation by GSAP</p>
    </div>
    <div class="text1">
      <p class="content__text">animation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAPanimation by GSAP</p>
    </div>
    <img class="img1" src="img/integration-5192458_1920.jpg" alt="">
    <div class="button" >
     button
  </div>
    </div>
    
     
       </div>
      </div>
    
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.0/gsap.min.js" integrity="sha512-JO6JyFPJupQKZf7icgZkHwuq/rAQxH7COqvEd4WdK52AtHPedwHog05T69pIelI69jVN/zZbW6TuHfH2mS8j/Q==" crossorigin="anonymous"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.0/CSSRulePlugin.min.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.0/EaselPlugin.min.js"></script>
<script src='main.js'></script>
</html>

about.html

👇


<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <title>about page</title>
    <meta name='viewport' content='width=device-width, initial-scale=1'>
    <link rel='stylesheet' type='text/css' media='screen' href='main.css'>
    
</head>
<body>
    <div class="header">
        <a href="#">
          <img class="logo"   src="img/Untitled-1.png" alt="">
        </a>
        <div class="loc">
        <ul>
          <li><a href="index.html" id="bu1" class="butt">Home</a></li>
          <li><a href="#" id="bu2" class="butt">About</a></li>
          
         
          
        </ul>
      
      </div>
    </div>
    <div class="cover">
      <div class="contan3"></div>
      <div class="contan4"></div>

    <div class="contan2">
      <div class="about">
<p class="about_text">about</p>

      </div>
     
       </div>
      </div>
    
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.0/gsap.min.js" integrity="sha512-JO6JyFPJupQKZf7icgZkHwuq/rAQxH7COqvEd4WdK52AtHPedwHog05T69pIelI69jVN/zZbW6TuHfH2mS8j/Q==" crossorigin="anonymous"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.0/CSSRulePlugin.min.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.0/EaselPlugin.min.js"></script>
<script src='main.js'></script>
</html>


CSS SOURCE_CODE:-


*{
    padding0;
    margin0;
    box-sizingborder-box;
}
body{
  
    font-familysans-serif;
    font-weight500;
}

.logo{
    positionrelative;
    max-width60px;
   transition0.4s;
border-radius50%;

  }
 
.header{
    positionabsolute;
    top0;
    left0;
 width100%;
    padding:10px 100px;
    displayflex;
    justify-content:space-between;
    align-itemscenter;
    z-index400;
    background-color:transparent;
    border-bottomsolid 1px #000000;
   
  
  }
 
 
  .header ul{
    positionrelative;
    displayflex;
  }
  .header ul li{
    list-stylenone;
  }
  .header ul li a{
  displayinline-block;
  colorrgb(255255255);
  font-weight400;
  margin-left40px;
  text-decorationnone;
  font-size15px;
  font-familysans-serif;
  transition.5s;
  }
  .header ul li a:hover{
    
    colorrgb(000);
   
    }
    .text{
        positionabsolute;
        top20%;
        left5%;
        font-size70px;
        colorrgb(255248248);
    }

   .contan img{
        positionabsolute;
        left60%;
        top25%;
       height350px;
    }
    .text .t1{
      colorrgb(25524258);
      font-size79px;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans''Helvetica Neue'sans-serif;
    }
    .text1{
      positionrelative;
      top55%;
      left5%;
      width50%;
      font-size10px;
      colorrgb(255248248);
  }
  .contan{
    width100%;
    height:100%;
    z-index100;
    background-colorrgb(113144201);
    positionabsolute;
    displayflex;
    justify-contentspace-between;
   
  }
  .contan2{
    width100%;
    height100%;
    background-colorrgb(199201212);
    positionabsolute;
    displayflex;
    justify-contentspace-between;
   
  }
  .contan3{
    width100%;
    height100%;
    background-colorrgb(25521165);
    positionabsolute;
    displayflex;
    justify-contentspace-between;
   z-index800;
 
  }
  .contan4{
    width100%;
    height100%;
    background-colorrgb(7543255);
    positionabsolute;
    displayflex;
    justify-contentspace-between;
   z-index700;
  }
  .about{
    top30%;
left5%;
    width500px;
    height100px;

    positionabsolute;
    displayflex;
    justify-contentcenter;
    align-itemscenter;
    font-size150px;
    text-transformuppercase;
    -webkit-text-stroke2px #000;
    text-stroke: 2px #000;
    -webkit-text-fill-colortransparent;
    text-fill-color: transparent;
    colortransparent;

  }
  .about_text{
opacity1;
  }
 .cover{
   overflowhidden;
  positionabsolute;
  height100%;
  width100%;
 }
 .button{
  positionabsolute;
  padding15px 26px;
  background-colorrgb(3232241);
 transition0.5s;
  top450px;
  left5%;
  font-size13px;
  font-familysans-serif;
  cursorpointer;
  coloraliceblue;

}
.button:hover{
  box-shadow0 10px 9px  rgb(3232241) ;
  top445px;
  border-radius25px;
  background-colorrgb(4962250);
  color#e4f00b;
}

Javascript (.js file) SOURCE_CODE:-




$(".butt").click(function() {
    $('.container').attr("color-center"this.id);
    if (this.id == "bu1"page1();
    if (this.id == "bu2"page2();
   
   
   
 
 });

 function page1() { 
    var tl = new TimelineMax()
   .to(".contan2",1,{xPercent:0,},0)
   .to(".contan",1,{xPercent:0,},0)
   .from(".contan3",2,{xPercent:100,},0)
   .to(".contan3",1,{xPercent:-100,},)
   .from(".contan4",1,{xPercent:100,},0)
   .to(".contan4",1,{xPercent:-100,},1)
   .from(".contan",1,{ opacity: "0",yPercent:10 },3)
   .from(".contan2",1,{ opacity: "0",yPercent:10 },3)
   .from(".header",1,{ opacity: "0",yPercent:-50 },4)
   .from(".text1",1,{ opacity: "0",yPercent:10 },6)
   .from(".text",1,{ opacity: "0",yPercent:10 },5)
   .from(".img1",1,{ opacity: "0",xPercent:10 },7)
   .from(".button",1,{ opacity: "0",yPercent:20 },8)
   .from(".about_text",1,{ opacity: "0",yPercent:10 },5)

 }
 
 
 
 

   

 $(function() {
    page1();
 })

web design video My YOUTUBE channel






 

Comments

Popular posts from this blog

Create A Pizza Website Using HTML And CSS and GSAP| Page transition animation by gsap. Artspider

https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js SOURCE CODE HTML  SOURCE_CODE:- index .html 👇 <! DOCTYPE   html > < html > < head >      < meta   charset = 'utf-8' >      < meta   http-equiv = 'X-UA-Compatible'   content = 'IE=edge' >      < title > home page transion </ title >      < meta   name = 'viewport'   content = 'width=device-width, initial-scale=1' >      < link   rel = 'stylesheet'   type = 'text/css'   media = 'screen'   href = 'main.css' >      </ head > < body   >          < div   class = "cover" >          < img   src = "img/logo.png"   alt = ""   class = "logo" >      ...

How To Make A Website Using HTML CSS & Bootstrap | Personal Portfolio Website Design Tutorial

How To Make A Website Using HTML CSS & Bootstrap | Personal Portfolio Website Design Tutorial SOURCE CODE HTML  SOURCE_CODE:- index .html 👇 <!DOCTYPE html> <html> <head>     <meta charset='utf-8'>     <meta http-equiv='X-UA-Compatible' content='IE=edge'>     <title>Page Title</title>     <meta name='viewport' content='width=device-width, initial-scale=1'>     <!-- Google Fonts -->   <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">   <!-- Vendor CSS Files -->   <link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">   <link href="assets/vendor/icofont/icofont.min.css" rel="stylesheet">   <link href="assets/v...