Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="main">
  <div class="section"><h1>ONE</h1></div>
  <div class="section"><h1>TWO</h1></div>
  <div class="section"><h1>THREE</h1></div>
  <div class="section"><h1>FOUR</h1></div>
</div>

<div class="end"><h1>The End</h1></div>


  <div class="blobsWrapper">
    <svg  id="theBlobs" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 400">
      <g id="Blobs" fill="#009000" transform="translate(0 -652.362)">
        <path id="Blob1" d="M191.565 102.606c175.492 18.55 96.557-26.859 168.79-28.132 82.684-1.457 184.51-52.023 223.716 56.264C603.11 183.322 686.257 207.093 663.108 258c-37.22 81.857-157.93-1.208-243.81 25.453-69.394 21.543-231.505 51.453-274.62 14.735-42.53-36.218-8.666-201.455 46.887-195.583z" transform="translate(0 652.362)"/>
        <path id="Blob2" d="M282.658 212.454c3.371-45.015-83.009-83.732-58.943-121.923 57.85-91.803 221.964-120.939 325.526 1.34 41.665 49.193-137.336 77.835-131.282 142.017 4.746 50.308 139.32 42.676 121.905 90.112-36.708 99.99-272.312 74.388-318.828-21.434-15.891-32.735 58.905-53.824 61.622-90.112z" transform="translate(0 652.362)"/>
        <path id="Blob3" d="M57.603 177.624C70.718 103.34 171.996 72.11 243.81 49.021c96.089-30.892 215.627-56.317 302.752-5.358 77.952 45.594 176.732 162.039 128.603 238.451-54.562 86.624-207.127-38.222-306.771-14.736-65.772 15.503-110.907 113.976-176.83 99.132-37.622-8.472-44.619-62.914-66.928-94.37-22.345-31.505-73.748-56.48-67.033-94.516z" transform="translate(0 652.362)"/>
      </g>
    </svg>
  </div>



              
            
!

CSS

              
                
@import url("https://fonts.googleapis.com/css?family=Lato:400,400i,700");

body{
  background-color: #123417;
  margin: 0;
  font-family: 'Lato Sans', sans-serif;
  color:#c1d6c2;
}

h1{
  position: relative;
  top: 33%;
  font-family: 'Lato Sans', sans-serif;
  font-size:15vw;
  margin: 0;
  text-align: center;
  visibility:hidden;
}

.main{
  position: relative;
  z-index: 2;
}
.section{
  position: relative;
  width: 100%;
  height: 200vh;
  text-align: center;
}
.blobsWrapper {
  position:fixed;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  margin:0;
}
#theBlobs {
  position:absolute;
  width: 90vw;
  overflow:visible;
}
#Blob2, #Blob3{
    visibility:hidden;
  }
.end{
  position: relative;
  width: 300px;
  left: 50%;
  top:50%;
  border-top: 1px solid white;
  visibility:hidden;
  z-index: 6;
}
.end h1{
  position:absolute;
  font-size: 50px;
  background: green;
  width: fit-content;
  padding: 0 10px;
  left: 50%;
}
              
            
!

JS

              
                console.clear();

TweenMax.set("h1",{yPercent:-50, autoAlpha:1});
TweenMax.set(".end h1",{xPercent:-50, autoAlpha:1});
TweenMax.set(".end",{xPercent:-50, y:-120});
TweenLite.defaultEase = Sine.easeInOut;

// === The sections will appear at a smaller distance (= faster) ===
//TweenLite.set('.section',{height:'150vh'});
//TweenLite.set('h1',{top:'50%'});
 
// === Continuous animation of the blobs =================
//TweenMax.to("#Blobs",1,{scaleX:0.95,transformOrigin:"center",repeat:-1,yoyo:true});
TweenMax.to("#Blobs",1.5,{skewX:-10,scaleX:0.95,transformOrigin:"center",repeat:-1,yoyo:true});

// === Once at the beginning ========================
TweenLite.to('#Blob1',2,{scale:1.5, transformOrigin:"center", ease: Bounce.easeOut,vdelay:0.5});

// === The Blob Timeline =============================
// with a variety of adjusting screws for timing.
// timing and position of each tween
// labels with position parameter e.g. "+=4" which act as "pause" here.
// plus general timing (see above)

var blob = new TimelineMax({paused:true})
  .to("#Blob1", 1, { morphSVG: "#Blob2"})
  .to("#Blob1", 1, {x:'+200'}, '-=0.5')

  .addLabel('second',"+=4")
  .set("#Blob1",{fill:'red'},'second')
  .to("#Blob1",1.5,{rotation:180, x:'-300',transformOrigin:"center", ease: Bounce.easeOut},'second')
  
  .addLabel('third',"+=3")
  .to("#Blob1", 0.6, { scale: 4,repeat:3,yoyo:true,transformOrigin:"center" },'third')
  
  .addLabel('fourth',"+=3")
  .to("#Blob1", 1, { morphSVG: "#Blob3",x:'+100'},'fourth')

  .addLabel('fifthly',"+=3")
  .to("#Blob1", 0, { fill: "green" },'fifthly')
  .to("#Blob1",1.5,{rotation:220, scale:1.5, transformOrigin:"center", x:'-100', ease: Bounce.easeOut}, 'fifthly')
  .set(".blobsWrapper",{zIndex:5},'+=1')
  .to("#Blob1",1,{scale:8, transformOrigin:"center"})
  .to('.end',0.5,{autoAlpha:1})


// === scrolling sync =========================
var lastScrollTop = 0;

$(window).scroll(function(e) {
  var scrollNum = $(window).scrollTop();
  scrollPercent = $(window).scrollTop() / ($(document).height() - $(window).height());
  
  var progressBlobs = scrollPercent*1; 
  
  if (scrollNum > lastScrollTop) {  // downscroll
    TweenLite.to(blob, 1, {progress:progressBlobs, ease: Sine.easeOut});
  } else {    //upscroll
    TweenLite.to(blob, 1, {progress:progressBlobs, ease: Sine.easeOut});
  }
  
  lastScrollTop = scrollNum;
  
});

              
            
!
999px

Console