Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

Save Automatically?

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="container">
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In  -->
<svg version="1.1"
	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
	 x="0px" y="0px" width="600px" height="600px" viewBox="0 0 600 600" enable-background="new 0 0 600 600" xml:space="preserve">
<defs>
</defs>
  <g class="wholeUmbrella">
  <g class="tipGroup">
<line class="thinTip" fill="none" stroke="#44434F" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" x1="300" y1="211.7" x2="300" y2="193.2"/>
<line class="fatTip" fill="none" stroke="#F3E5C8" stroke-width="4" stroke-linecap="round" stroke-miterlimit="10" x1="300" y1="211.7" x2="300" y2="205.2"/>
  </g>
  
<path class="handle" fill="none" stroke="#944F1D" stroke-width="9" stroke-linecap="round" stroke-miterlimit="10" d="M276.2,380
	c0,6.6,5.4,11.9,11.9,11.9h0c6.6,0,11.9-5.4,11.9-11.9v-82.7"/>
<line class="shaft" fill="none" stroke="#F3E5C8" stroke-width="6" stroke-linecap="round" stroke-miterlimit="10" x1="300" y1="373" x2="300" y2="280"/>
  <g class="topGroup">
<path class="topMid" fill="#41404C" d="M300,208.7c-5.6,2.2-29.5,18-33,97.4c4.7-8.8,40.6-31.5,65.7,0
	C331,250.5,314,215.6,300,208.7z"/>  
<path class="topRight" fill="#111017" d="M300,208.7c23.5,1.6,89.8,16.1,97.5,97.4c-4.7-8.8-40.3-32.4-65.7,0
	C331.8,306,332.8,231.8,300,208.7z"/>
<path class="topLeft" fill="#717081" d="M299.5,208.7c-23.5,1.6-89.8,16.1-97.5,97.4c4.7-8.8,40.3-32.4,65.7,0
	C267.7,306,266.8,231.8,299.5,208.7z"/>
  </g>
    </g>
</svg>
 <div class="info"><h1>ScrubGSAPTimeline</h1><h2>This script allows you to scrub through a <a href="https://greensock.com/timelinelite">GreenSock</a> TimelineLite/Max timeline simply by moving your mouse left to right. It also displays your timeline's current time. It's particularly useful if you create long timelines and need to quickly and accurately preview certain points in your animation.</h2><strong>To use it:</strong><ul><li>Get the JS script<br><span><a href="https://github.com/chrisgannon/ScrubGSAPTimeline">https://github.com/chrisgannon/ScrubGSAPTimeline</a></span></li><li>In the JS panel, add the line <code>ScrubGSAPTimeline();</code> and pass in the TimelineLite/Max instance.</li><li>So if your instance is called <code>umbrellaTimeline</code> you would write:<br> <code>ScrubGSAPTimeline(umbrellaTimeline);</code></li><li>To let the timeline play automatically, move your mouse away from the document.</li><li>Add multiple timelines as an array like this: <code>ScrubGSAPTimeline([umbrellaTimeline, fadeTimeline]);</code></li><li>Double click to pause/unpause</li></ul><div class="update"><strong><br>Get the file on GitHub <a href="https://github.com/chrisgannon/ScrubGSAPTimeline" target="_blank">here</a></div></div>
   
</div>
 
              
            
!

CSS

              
                body{
  background-color:#578BAA;
  overflow:hidden;
}
body, html {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

.container{
  position:absolute;
  width:50vw;
  
  height:100vh;
  
  display: flex;
  align-content: center;
  justify-content: center;
}

svg{
  position:absolute;
  left:35%;
  visibility:hidden;
  
}
.info{
  position:absolute;
  font-family:Helvetica, Arial, sans-serif;
  color:#ededed;
  font-size:13px;
  top:20px;
  line-height:23px;
  width:100%;
  
  margin: 20px;
}
h1{
  font-size:20px;

}
h2{
  font-size:15px;
  width:96%;
  font-weight:normal;
}

span{
  font-style:italic;
}
a {
  color:#FFF;
  font-weight:700;
}
ul{
  margin-top:0;
  padding-left:15px;
  width:80%;
}
.update{
  color:#FFDC7B;
}
              
            
!

JS

              
                var xmlns="http://www.w3.org/2000/svg", select = function(s) {
      return document.querySelector(s);
    }, selectAll = function(s) {
      return document.querySelectorAll(s);
    }, container = select('.container'), handle = select('.handle'), shaft = select('.shaft'), topLeft = select('.topLeft'), topMid = select('.topMid'), topRight = select('.topRight'), topGroup = select('.topGroup'), tipGroup = select('.tipGroup')

//center the container cos it's pretty an' that
TweenMax.set([container], {
  position:'absolute',
 top:'0%',
  left:'50%',
  xPercent:-50,
  yPercent:0
})

TweenMax.set([handle], {
  drawSVG:'100% 100%'
})
TweenMax.set([shaft], {
  drawSVG:'66% 66%',
  alpha:0
})

TweenMax.set(topLeft, {
  transformOrigin:'101% 0%'
})
TweenMax.set(topMid, {
  transformOrigin:'50% 0%'
})
TweenMax.set(topRight, {
  transformOrigin:'-1% 0%'
})
TweenMax.set(topGroup, {
  transformOrigin:'50% 80%'
})
TweenMax.set(tipGroup, {
  transformOrigin:'50% 100%'
})

TweenMax.set([topLeft, topMid, topRight], {
  scaleX:0.1,
  scaleY:1.8
})

TweenMax.set(topGroup, {
  scale:0
})
var myTimeline = new TimelineMax({repeat:0, repeatDelay:1});
myTimeline.timeScale(1)
myTimeline.to(handle, 0.2, {
  drawSVG:'90% 100%',
  ease:Linear.easeNone
} )
.to(handle, 0.6, {
  drawSVG:'20% 90%',
  ease:Linear.easeNone
} )
.to(handle, 0.6, {
  drawSVG:'0% 40%',
  ease:Power1.easeOut
} )
.to(shaft, 0.4, {
  drawSVG:'8% 100%'
}, '-=0.55')
.set(shaft, {
  alpha:1
},'-=0.55')
.to(topGroup, 1,{
  scale:1
},'-=0.8')
.to([topLeft, topMid, topRight], 1, {
  scaleX:1,
  scaleY:1,
  ease:Anticipate.easeIn
})
.from(tipGroup, 0.6, {
  scaleY:0,
  ease:Anticipate.easeIn
},'-=1.2')

TweenMax.set('svg', {
  visibility:'visible',
  x:'+=100'
})

var fadeTl = new TimelineMax();
fadeTl.to('.wholeUmbrella', 1, {
  alpha:0,
  delay:4,
  y:-500,
  x:600,
  rotation:183,
  transformOrigin:'50% 0%',
  ease:Expo.easeIn
})
ScrubGSAPTimeline([fadeTl,myTimeline]);
              
            
!
999px

Console