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

              
                <h1>My SplitText Pen</h1>
<div>Working fine...</div>
<div class="demo">
  <div id="quote">The quick brown fox jumped over the lazy <span style="color:#ff0000;">dog</span>. The quick brown fox jumped over the lazy dog.</div>
<div class="nav">
  <button id="restart">restart</button> 
</div>
</div>

<div>Not working fine...</div>
<div class="demo">
  <div id="quote2">TheQuickBrownFoxJumpedOverTheLazy<span style="color:#ff0000;">Dog</span>.TheQuickBrownFoxJumpedOverTheLazyDog.</div>
</div>
<div class="nav">
  <button id="restart2">restart</button> 
</div>

</div>



  
  
  
  
  
  
  
  
  
              
            
!

CSS

              
                body{
 font-family:sans-serif;
}
h1 {
  margin: 5px 0;
}
h3 {
  margin:0;
  font-size:16px;
}
.demo {
  width:600px;
  background-color:black;
  word-break: break-all;
}

#quote, #quote2{
  font-size:36px;
  background-color:black;
  color:#91e600;
  padding:25px;
}

.nav {
  width:600px;
  background-color:#ccc;
  text-align:right;
}

button {
  padding:10px;
  margin:10px;
}

              
            
!

JS

              
                /*
See https://www.greensock.com/splittext/ for details. 
This demo uses SplitText which is a membership benefit of Club GreenSock, https://www.greensock.com/club/
*/

var tl = new TimelineLite(), 
    mySplitText = new SplitText("#quote", {type:"lines"});

TweenLite.set("#quote", {perspective:400});

tl.staggerFrom(mySplitText.lines, 0.4, {opacity:0, rotationX:-120, force3D:true, transformOrigin:"top center -50" }, 0.3, "", function()
{
  mySplitText.revert();  
});

tl.play();

$("#restart").on("click", function(){
  tl.restart();
})

var tl = new TimelineLite(), 
    mySplitText = new SplitText("#quote2", {type:"lines"});

TweenLite.set("#quote2", {perspective:400});

tl.staggerFrom(mySplitText.lines, 0.4, {opacity:0, rotationX:-120, force3D:true, transformOrigin:"top center -50" }, 0.3, "", function()
{
  mySplitText.revert();  
});

tl.play();

              
            
!
999px

Console