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

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="https://fonts.googleapis.com/css?family=Roboto:700" rel="stylesheet">

<div id='container'></div>

<button id="play">PLAY</button>
              
            
!

CSS

              
                body
  background: #ffffff
  font-family: 'Roboto', sans-serif
#container
  width: 800px
  height: 400px
  position: relative
  overflow: hidden
  display: flex
  flex-flow: row nowrap
  justify-content: center
  align-items: center
  background: #111111
  .sign
    font-family: 'Roboto', sans-serif
    position: absolute
    text-align: center
    transform-origin: 50% 50%
    overflow: auto
    color: #000000
    background: #91E600
    padding: 20px 20px
    font-size: 60px

button
  font-size: 16px
  background: green
  padding: 10px 22px
  color: white
  border: none
  margin: 5px 0 0
  border-radius: 5px
  
@-moz-document url-prefix()
  .sign
    top: 30%
    left: 30%
              
            
!

JS

              
                // custom ease created using the awesome GSAP Ease Visualizer
// https://greensock.com/ease-visualizer?CustomEase=M0,0 C0.128,0.572 0.052,1.374 0.15,1.374 0.28,1.374 0.226,0.528 0.358,0.528 0.466,0.528 0.442,1.164 0.552,1.164 0.694,1.164 0.62,0.764 0.736,0.764 0.788,0.764 0.798,1.044 0.856,1.044 0.88,1.044 0.924,0.948 0.94,0.948 0.961,0.948 0.993,1 1,1

var words = ['LET THIS','BE A SIGN','UNTO YOU!'],
    masterTL = new TimelineMax({paused:true}),
    container = $('#container'),
    wordCnt = 1;

function createWordSequence() {
    for ( let word of words ) {
    newDiv = document.createElement('div');
    newDiv.setAttribute('id',`word-${wordCnt}`);
    newDiv.setAttribute('class','sign');
    container.append($(newDiv));
    swing($(newDiv),word);
    wordCnt++;
  }
}

createWordSequence();

$('#play').on("click", function(){
  masterTL.seek(0).kill().play();
});

function swing(target,word) {

  var tl = new TimelineMax({
    onStart: function(){ target.html(word); }, 
    onComplete: function(){ TweenMax.to(target,0.5,{autoAlpha: 0, rotationX: 0}); }
  });

  var vars = {
    overlap: 0.5, // start the next word in this much earlier
    origin: 'top center',   // transformOrigin
    perspective: 700,       // transformPerspective
    ease: CustomEase.create("custom", "M0,0 C0.128,0.572 0.052,1.374 0.15,1.374 0.28,1.374 0.226,0.528 0.358,0.528 0.466,0.528 0.442,1.164 0.552,1.164 0.694,1.164 0.62,0.764 0.736,0.764 0.788,0.764 0.798,1.044 0.856,1.044 0.88,1.044 0.924,0.948 0.94,0.948 0.961,0.948 0.993,1 1,1"), 
    power: 1,               // multiplier for the effect that is reduced to 0 over the duration
    duration: 2,          // total length of the effect
    rotation: -90          // start rotation
  };
  
  var startAt = masterTL.duration() == 0 ? 0 : vars.overlap;
  tl.set(target,{autoAlpha: 1, transformOrigin: vars.origin, transformPerspective: vars.perspective});
  tl.fromTo(target, vars.duration, {rotationX: vars.rotation, power: vars.power}, {rotationX: 0,  power: 0, ease: vars.ease});
  masterTL.add(tl,masterTL.duration()-startAt);
}

              
            
!
999px

Console