Pen Settings



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


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


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.


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.


                <div id="textWrapper">
  <div id="text">This is my typed text with GSAP :)</div>
    <span id="cursor">|</span>


                #textWrapper {
  width: 650px;
  margin: 20px;
  font-family: Arial, sans-serif;
  font-size: 40px;
  visibility: hidden;
  position: relative;

#text {
  position: absolute;

#text > div:nth-child(7) {
  color:#237F0F; /* makes 7th word green */

#cursor {
  position: absolute;
  color: #111111;
  display: block;
  width:6px; /* controls thickness */
  /*font-family: Times, "Times New Roman", Georgia, serif;*/

.chars {
  visibility: hidden;


                var $cursor = $("#cursor"),
    cursorInterval = 0.1,
    mySplitText = new SplitText("#text", {
       type: "words,chars",
       charsClass: "chars",
       position: "absolute"
    $chars = $(".chars"),
    tl = new TimelineMax({
      delay: 1,      
      // comment out yoyo, repeat, repeatDelay, and onRepeat below if no reverse is needed
      yoyo: true,
      repeat: -1,
      repeatDelay: 2,
      onRepeat: function() {
           //stops blinking
           TweenLite.set($cursor, {
              autoAlpha: 1

TweenLite.set("#textWrapper", {
  visibility: "visible"

//enable the blinking cursor
function blinkingCursor() {
  TweenMax.fromTo($cursor, 0.5, {
    autoAlpha: 0
  }, {
    autoAlpha: 1,
    repeat: -1,
    ease: SteppedEase.config(1)

// this makes the cursor resume blinking after reversing;

// this makes it visible (not blinking) when playing forward
tl.set($cursor, {autoAlpha: 1}, 0.1); 

//loop through all the chars and make them visible AND set cursor to their right at same time
$chars.each(function(i, el) {
  var $char = $(el),
      offset = $char.offset(),
      width = $char.width(),
      leftExtra = 30,
      topExtra = 23;
  // set initial $cursor CSS properties
  // you may have to play with leftExtra and topExtra for alignment
  tl.set($cursor, {
    left: (offset.left + width) - leftExtra,
    top:  ( - topExtra)
  }, (i + 1) * cursorInterval);
  // set initial $char CSS properties
  tl.set($char, {
    autoAlpha: 1
  }, ((i + 1) * cursorInterval));

// re-call blinkingCursor function after the last char is displayed;

// control speed of typing

// start blinkingCursor before playing timeline

// play timleine after 1 second delay
TweenMax.delayedCall(1, function(){