Skip to main content

#1 Best Gsap animation tutorial coding || javascript animation tutorial SOURCE CODE










SOURCE CODE




HTML SOURCE_CODE:-

<!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'>
    <link rel='stylesheet' type='text/css' media='screen' href='style.css'>
    
</head>
<body>
    <div class="container">
        <div class="card" >
         
          <div class="imgBx sh1">
            <img src="img/kisspng-nike-free-sneakers-air-force-nike-air-max-shoe-5b01c152eba9e8.9763145815268416829653.png" alt="">
          </div>
          <div class="imgBx sh2">
            <img src="img/kisspng-nike-free-sneakers-nike-air-max-nike-flywire-nike-women-5b629d03577a04.6930883815331893793583.png" alt="">
          </div>
          <div class="imgBx sh3">
            <img src="img/kisspng-sneakers-air-force-nike-air-max-nike-free-nike-air-force-5b1771bdbbc553.0731025715282631017691.png" alt="">
          </div>
          <div class="imgBx sh4">
            <img src="img/kisspng-nike-free-nike-air-max-shoe-sneakers-men-shoes-5abc7cf3ebfd90.5501549415223021959666.png" alt="">
          </div>
          <div class="contentBx co-text1">
            <h2>Nike Air Max Impact<br>
              Flyknit 3</h2>
            <div class="size">
              <h3>Size:</h3>
              <span>5</span>
              <span>5.5</span>
              <span>6</span>
              <span>6.5</span>
            </div>
            <div class="color">
              <h3>Color:</h3>
              <span class="butt" id="c1"></span>
              <span class="butt" id="c2"></span>
              <span class="butt"  id="c3"></span>
              <span class="butt" id="c4"></span>
            </div>
            <a href="#">Buy Now</a>
          </div>
          <div class="contentBx co-text2">
            <h2>Nike Air Max 95 <br>
              Flyknit 1</h2>
            <div class="size">
              <h3>Size:</h3>
              <span>5</span>
              <span>5.5</span>
              <span>6</span>
              <span>6.5</span>
            </div>
            <div class="color">
              <h3>Color:</h3>
              <span class="butt" id="c1"></span>
              <span class="butt" id="c2"></span>
              <span class="butt"  id="c3"></span>
              <span class="butt" id="c4"></span>
            </div>
            <a href="#">Buy Now</a>
          </div>
          <div class="contentBx co-text3">
            <h2>Nike Air Force 1 '07 <br>
              Flyknit 3</h2>
            <div class="size">
              <h3>Size:</h3>
              <span>5</span>
              <span>5.5</span>
              <span>6</span>
              <span>6.5</span>
            </div>
            <div class="color">
              <h3>Color:</h3>
              <span class="butt" id="c1"></span>
              <span class="butt" id="c2"></span>
              <span class="butt"  id="c3"></span>
              <span class="butt" id="c4"></span>
            </div>
            <a href="#">Buy Now</a>
          </div>
          <div class="contentBx co-text4">
            <h2>Nike Air VaporMax <br>
              Flyknit 3</h2>
            <div class="size">
              <h3>Size:</h3>
              <span>5</span>
              <span>5.5</span>
              <span>6</span>
              <span>6.5</span>
            </div>
            <div class="color">
              <h3>Color:</h3>
              <span class="butt" id="c1"></span>
              <span class="butt" id="c2"></span>
              <span class="butt"  id="c3"></span>
              <span class="butt" id="c4"></span>
            </div>
            <a href="#">Buy Now</a>
          </div>
          <div class="co"></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 {
    displayflex;
    justify-contentcenter;
    align-itemscenter;
    min-height100vh;
    background#070114;
    colorwhite;
    font-family"poppins"sans-serif;
  }
  
  .container {
    positionrelative;
  }
  
  .container .card {
    positionrelative;
    width320px;
    height550px;
    background:rgb(595959);
    border-radius20px;
    overflowhidden;
    box-shadow0 14px 28px rgba(0000.25), 0 10px 10px rgba(0000.22);
  }
  
 
  .co{
    positionabsolute;
    top0;
    left0;
    width100%;
    height100%;
    background-color#f63f08;
    clip-pathcircle(150px at 80% 20%);
  }
  .container .card:after {
    content"Nike";
    positionabsolute;
    top30%;
    left-20%;
    font-size12em;
    font-weight800;
    font-styleitalic;
    colorrgba(2552552550.1);
  }
  
  .container .card .imgBx {
    positionabsolute;
    top50%;
    transformtranslateY(-50%);
    z-index1000;
    width100%;
    height200px;
    transition0.5s;
  }
  
  .container .card:hover .imgBx {
    top30%;
    transformtranslateY(0%);
  }
  
  .container .card .imgBx img {
    positionabsolute;
    top50%;
    left50%;
    transformtranslate(-55%-60%rotate(-20deg);
    widthcover;
    height300px;
  }
  
  .container .card .contentBx {
    positionabsolute;
    bottom0;
    width100%;
    height100px;
    text-aligncenter;
    transition1s;
    z-index10;
  }
  
  .container .card:hover .contentBx {
    height210px;
  }
  
  .container .card .contentBx h2 {
    positionrelative;
    font-weight600;
    letter-spacing1;
  }
  
  .container .card .contentBx .size,
  .container .card .contentBx .color {
    displayflex;
    justify-contentcenter;
    align-itemscenter;
    padding8px 20px;
    transition0.5s;
    opacity0;
    visibilityhidden;
  }
  
  .container .card:hover .contentBx .size {
    opacity1;
    visibilityvisible;
    transition-delay0.5s;
  }
  
  .container .card:hover .contentBx .color {
    opacity1;
    visibilityvisible;
    transition-delay0.5s;
  }
  
  .container .card .contentBx .size h3,
  .container .card .contentBx .color h3 {
    font-weight300;
    font-size14px;
    text-transformuppercase;
    letter-spacing2px;
    margin-right10px;
  }
  
  .container .card .contentBx .size span {
    width26px;
    height26px;
    text-aligncenter;
    line-height26px;
    font-size14px;
    displayinline-block;
    color#fff;
    background#5f5d52;
    margin0 5px;
    transition0.5s;
    color#fff;
  }
  
  .container .card .contentBx .size span:hover {
    background#807775;
  }
  
  .container .card .contentBx .color span {
    width20px;
    height20px;
    backgroundrgb(101010);
    border-radius50%;
    margin0 5px;
    cursorpointer;
  }
  
  .container .card .contentBx .color span:nth-child(2) {
    background#ff5100;
  }
  .container .card .contentBx .color span:nth-child(3) {
    background#ffffff;
  }
  .container .card .contentBx .color span:nth-child(4) {
    background#f6b855;
  }
  
  .container .card .contentBx a {
    displayinline-block;
    padding10px 20px;
    background#575652;
    border-radius24px;
    margin-top5px;
    text-decorationnone;
    font-weight600;
    opacity0;
    color#fff;
    transformtranslateY(50px);
    transition0.5s;
  }
  
  .container .card:hover .contentBx a {
    opacity1;
    transformtranslateY(0px);
    transition-delay0.75s;
  }
  img {
    height320px;
  }
  


Javascript (.js file) SOURCE_CODE:-








$(".butt").click(function() {
    $('.container').attr("color-center"this.id);
    if (this.id == "c1"shoes1();
    if (this.id == "c2"shoes2();
    if (this.id == "c3"shoes3();
    if (this.id == "c4"shoes4();
   
 
 });



 function shoes1() { 
    var tl = new TimelineMax()
    .to(".sh2",0.1,{xPercent:100,},0)
    .to(".sh3",0.1,{xPercent:100},0)
    .to(".sh4",0.1,{xPercent:100},0)
    .to(".sh1",0.1,{xPercent:0,},0)
    .to(".co",0.1,{backgroundColor:"#f76b2a"})
    .to("body",0.1,{backgroundColor:"#f76b2a"},0)
    .from(".co",1,{xPercent:100,yPercent:-100})
    .to(".co-text1",0.1,{yPercent:-3},0)
    .to(".co-text2",0.1,{yPercent:900},0)
    .to(".co-text3",0.1,{yPercent:950},0)
    .to(".co-text4",0.1,{yPercent:950},0)
    ;

 }
 
 function shoes2() {
    var tl = new TimelineMax()
    .to(".sh1",0.1,{xPercent:100},0)
    .to(".sh3",0.1,{xPercent:100},0)
    .to(".sh4",0.1,{xPercent:100},0)
    .to(".sh2",0.1,{xPercent:0,yPercent:-60},0)
    .to(".co",0.1,{backgroundColor:"#eeeeee"})
    .to("body",0.1,{backgroundColor:"#eeeeee"},0)
    .from(".co",1,{xPercent:100,yPercent:-100})
    .to(".co-text2",0.1,{yPercent:-3},0)
    .to(".co-text1",0.1,{yPercent:900},0)
    .to(".co-text3",0.1,{yPercent:950},0)
    .to(".co-text4",0.1,{yPercent:950},0);
 }
 
 function shoes3() {
    var tl = new TimelineMax()
    .to(".sh2",0.1,{xPercent:100},0)
    .to(".sh1",0.1,{xPercent:100},0)
    .to(".sh4",0.1,{xPercent:100},0)
    .to(".sh3",0.1,{xPercent:0},0)
    .to(".co",0.1,{backgroundColor:"#f6b855"})
    .to("body",0.1,{backgroundColor:"#f6b855"},0)
    .from(".co",1,{xPercent:100,yPercent:-100})
    .to(".co-text3",0.1,{yPercent:-3},0)
    .to(".co-text1",0.1,{yPercent:900},0)
    .to(".co-text2",0.1,{yPercent:950},0)
    .to(".co-text4",0.1,{yPercent:950},0);
 }
 function shoes4() {
   var tl = new TimelineMax()
  
   .to(".sh2",0.1,{xPercent:100},0)
    .to(".sh3",0.1,{xPercent:100},0)
    .to(".sh1",0.1,{xPercent:100},0)
    .to(".sh4",0.1,{xPercent:0},0)
    .to(".co",0.1,{backgroundColor:"#999999"})
    .to("body",0.1,{backgroundColor:"#999999"},0)
    .from(".co",1,{xPercent:100,yPercent:-100})
    .to(".co-text4",0.1,{yPercent:-3},0)
    .to(".co-text1",0.1,{yPercent:900},0)
    .to(".co-text3",0.1,{yPercent:950},0)
    .to(".co-text2",0.1,{yPercent:950},0);
}
 
 

   

 $(function() {
    shoes1();
 })



web design video


































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...

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

 Create Page transition animation by Greensock (gsap) 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 >  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 = "#" >         ...