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

              
                <link href='//fonts.googleapis.com/css?family=Signika+Negative:300,400' rel='stylesheet' type='text/css'>

<div class="feature" id="featureGSDevTools">
  
  <!-- scene 1 -->
  <div class="scene scene1">
    
      <nobr><img class="dev-logo" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/logo-man.svg" width="100" />
        <div class="headline">GSDevTools</div></nobr>
   
    <div class="tagline">&gt; advanced playback controls for <a href="https://greensock.com/gsap/">GSAP</a></div>
      
  </div>
  <svg id="dev-arrow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 347 220" style="width:125px; height: 60px; position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%); opacity: 0;"><defs><style>.cls-1{fill:#999;}</style></defs><path class="cls-1" d="M281.51,87.62V6.29A6.29,6.29,0,0,0,275.21,0H71.8a6.29,6.29,0,0,0-6.29,6.29V87.62H6.3A6.29,6.29,0,0,0,2.62,99l167.2,120.63a6.29,6.29,0,0,0,7.36,0L344.39,99a6.29,6.29,0,0,0-3.68-11.39Z"/></svg>
  
  <!-- SCENE 2 -->
  <div class="scene scene2" style="background-color:#724493; padding-bottom:8px;">
    Features <span style="opacity: 0.5;padding: 0 15px;">&gt;</span>
    <ul class="dev-flipping-text">
      <li>visual &amp; programmatic controls</li>
      <li>in &amp; out points</li>
      <li>keyboard shortcuts</li>
      <li>time scale (slow/fast motion)</li>
      <li>looping</li>
      <li>minimal / responsive mode</li>
    </ul>
  </div>
  
  <!-- SCENE 3 -->
  <div class="scene scene3" style="background-color:#0f8eba; padding-bottom:8px;">
    <ul class="dev-sliding-text">
      <li>Jump to any animation with&nbsp;an&nbsp;ID...</li>
      <li>...and everything remains&nbsp;synchronized!</li>
    </ul>
  </div>
  
  
  <!-- SCENE 4 -->
  <div class="scene scene4" style="background-color:#ba6d0f; padding-bottom:8px;">
    <ul class="dev-sliding-text">
      <li>Speed up your animation workflow.</li>
      <li>Great for client reviews too!</li>
    </ul>
  </div>
  
</div>
              
            
!

CSS

              
                body {
  background-color:#444;
  font-family: "Signika Negative", sans-serif;
  font-weight: 300;
  color: white;
}

.scene {
  display: flex;
  justify-content: center;
  flex-direction: row;
  flex-wrap: wrap;
  flex-basis: content;
  align-items: center;
  align-self: center;
  align-content: center;
  height: calc(100% - 51px);
  font-size: 50px;
  font-weight: 400;
  line-height: 52px;
  position: absolute;
  width: 100%;
  text-align: center;
  top:0;
  left: 0;
  visibility: hidden;
}

.scene1 img, .scene1 div {
  display: inline-block;
}
.scene1 {
  text-align: center;
  vertical-align: middle;
}

.scene1 .headline {
  margin: 0 10px 0 4px;
}

.scene1 .tagline {
  font-size:34px;
  font-weight:300;
  color:#aaa;
}
.dev-logo {
  vertical-align: middle;
}

.dev-flipping-text {
  display: inline-block;
  padding: 0;
  margin: 0;
  font-weight: 300;
  list-style: none;
  position: relative;
  text-align: left;
}
.dev-flipping-text li {
  position: relative;
  margin-top: -64px;
}

.dev-flipping-text li:first-child, .dev-sliding-text li:first-child {
  height: auto; 
  margin-top: 0;
}

.dev-sliding-text {
  padding: 0;
  margin: 0;
  list-style: none;
  text-align: center;
}

.dev-sliding-text li {
  margin-top: -52px;
}


#featureGSDevTools {
  background-color:#000;
  height: 300px;
  overflow:hidden;
  position:relative;
  max-width: 1200px;
  margin: auto;
}
a {
  color: #91e600;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.text-lines {
  overflow: hidden;
  padding: 6px 0;
}

@media only screen and (max-width : 767px) {
  #featureGSDevTools .scene {
    font-size: 28px;
    line-height: 30px; 
  }
  .scene1 .headline {
    font-size: 40px;
    line-height: 52px;
  }
  .scene1 .tagline {
    display: none;
  }
  .dev-flipping-text li {
    margin-top: -42px;
  }
  .dev-sliding-text li {
    margin-top: -30px;
  }
  
}

@media only screen and (max-width : 950px) {
  .scene1 .tagline {
    font-size: 20px;
  }
}

@media only screen and (max-width : 500px) {
  .dev-flipping-text {
    text-align: center;
  }
}


              
            
!

JS

              
                TweenLite.set(".scene", {visibility:"inherit"});

var master = new TimelineMax();
master.add(scene1())
      .add(scene2(), "-=0.4")
      .add(scene3(), "-=0.7")
      .add(scene4(), "-=0.5");

GSDevTools.create({
  container:"#featureGSDevTools",
  loop:true
});


function scene1() {
  var tl = wordReveal(".scene1", {delayFirst:1, slide:true, exit:2, extraElements:".dev-logo"}),
      arrow = new TimelineLite();
  tl.vars.id = "Scene 1";
  TweenLite.set("#dev-arrow", {y:-70});
  arrow.to("#dev-arrow", 0.3, {autoAlpha:1, y:0});
  arrow.to("#dev-arrow", 0.2, {y:-15, repeat:7, yoyo:true, ease:Power1.easeInOut})
  arrow.to("#dev-arrow", 0.4, {autoAlpha:0}, "-=0.4");
  tl.add(arrow, "exit-=1");
  tl.fromTo(".headline", 0.3, {autoAlpha:0}, {autoAlpha:1}, 0);
  return tl;
}

function scene2() {
  var tl = new TimelineLite({id:"Scene 2"}),
      features = document.querySelectorAll("#featureGSDevTools .scene2 .dev-flipping-text li"),
      i;
  tl.from(".scene2", 0.5, {yPercent:100, autoAlpha:0});
  for (i = 0; i < features.length; i++) {
    tl.add(wordReveal(features[i], {exit: (i < features.length - 1 ? 0.9 : 0)}), "-=0.2");
  }
  tl.to(".scene2", 0.5, {yPercent:100, ease:Power2.easeInOut}, "+=0.8");
  tl.to(".scene2", 0.2, {autoAlpha:0})
  return tl;
}

function scene3() {
  var tl = new TimelineLite({id:"Scene 3"});
  tl.from(".scene3", 0.5, {yPercent:-100, ease:Power2.easeInOut});
  tl.add(wordDrop(".scene3 li"), 0.3);
  tl.to(".scene3", 0.5, {yPercent:100, autoAlpha:0, ease:Power2.easeInOut}, "-=0.1");
  return tl;
}

function scene4() {
  var tl = new TimelineLite({id:"Scene 4"});
  tl.from(".scene4", 0.5, {yPercent:-100, ease:Power2.easeInOut});
  tl.add(wordSlide(".scene4 li"), 0.3);
  tl.to(".scene4", 0.8, {autoAlpha:0}, "-=0.3");
  return tl;
}


// --- HELPER FUNCTIONS ---

function wordReveal(selector, vars) {
  vars = vars || {};
  var split = new SplitText(selector, {linesClass:"text-lines", type:"words,lines"}), 
      tl = new TimelineLite(), 
      l = split.words.length,
      stagger = vars.stagger || 0.1,
      duration = vars.duration || 0.7,
      delayFirst = vars.delayFirst || 0,
      extraElements = vars.extraElements,
      totalShift = 0,
      start = 0,
      width, i;
  if (extraElements) {
    tl.from(extraElements, duration / 2, {opacity:0, yPercent:30});
  }
  for (i = 0; i < l; i++) {
    width = split.words[i].offsetWidth / 2;
    totalShift += width;
    tl.from(split.words[i], duration, {yPercent:150, ease:Power3.easeOut}, start);    
    start += ((split.words[i].textContent + "").length / 4) * stagger;
    if (!i && delayFirst) {
      start += delayFirst;
      totalShift -= width;
    }
  }
  if (vars.slide) {
    tl.from(selector, tl.duration() - delayFirst * 0.8, {x:totalShift, ease:Power2.easeInOut}, delayFirst * 0.8);
  }
  if (vars.exit) {
    tl.add("exit", "+=" + vars.exit);
    if (extraElements) {
      tl.to(extraElements, duration / 2, {opacity:0}, "exit");
    }
    tl.staggerTo(split.words, duration * 0.7, {yPercent:-150, ease:Power2.easeIn}, stagger, "exit");
  }
  return tl;
}
  
function wordSlide(selector, vars) {
    vars = vars || {};
    var elements = document.querySelectorAll(selector),
        tl = new TimelineLite(), 
        stagger = vars.stagger || 0.1,
        duration = vars.duration || 0.6,
        gap = vars.gap || 0.3,
        exit = vars.exit || 1.4,
        i, split;
    for (i = 0; i < elements.length; i++) {
      split = new SplitText(elements[i], {type:"words"});
      tl.staggerFrom(split.words, duration, {x:200, autoAlpha:0, ease:Power2.easeOut}, stagger, "-=" + (i ? gap : 0));
      tl.staggerTo(split.words, duration * 0.7, {x:-200, autoAlpha:0, ease:Power2.easeIn}, stagger * 0.7, "+=" + exit);
    }
    return tl;
}

function wordDrop(selector, vars) {
  vars = vars || {};
  var elements = document.querySelectorAll(selector),
      tl = new TimelineLite(), 
      stagger = vars.stagger || 0.07,
      duration = vars.duration || 1.2,
      gap = vars.gap || 0.4,
      exit = vars.exit || 1.4,
      i, split;
  for (i = 0; i < elements.length; i++) {
    split = new SplitText(elements[i], {type:"words"});
    tl.staggerFrom(split.words, duration, {y:-70, autoAlpha:0, ease:Elastic.easeOut}, stagger, "-=" + (i ? gap : 0));
    tl.staggerTo(split.words, duration * 0.3, {y:80, autoAlpha:0, ease:Back.easeIn}, stagger * 0.7, "+=" + exit);
  }
  return tl;
}

              
            
!
999px

Console