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

              
                <svg viewBox="0 0 800 120" width="800" height="120">
    <defs>
        <pattern id="water" width=".25" height="1.1" patternContentUnits="objectBoundingBox">
            <path fill="white" d="M0.25,1H0c0,0,0-0.659,0-0.916c0.083-0.303,0.158,0.334,0.25,0C0.25,0.327,0.25,1,0.25,1z" />
        </pattern>
        <text id="text" font-size="150">LOADING</text>
        <mask id="mask-text">
            <use x="50%" y="95%" text-anchor="middle" xlink:href="#text" fill="white" />
        </mask>
    </defs>
    <use xlink:href="#text" x="50%" y="95%" text-anchor="middle" fill="#333" />
    <rect id="water-fall" mask="url(#mask-text)" fill="url(#water)" x="-400" y="0" width="1600" height="120" />
</svg>
              
            
!

CSS

              
                *,*:before,*:after{
  box-sizing:border-box;
}
html,body{
  height:100%;
  font-family: helvetica;
  font-size: 10px;
  text-transform: uppercase;
  background: black;
}
svg{
  position:absolute;
  left:50%;
  top:50%;
  margin:-60px 0 0 -400px;
}
              
            
!

JS

              
                /*
TweenMax.fromTo( target:Object, duration:Number, fromVars:Object, toVars:Object ) : TweenMax
[static] Static method for creating a TweenMax instance that allows you to define both the starting and ending values (as opposed to to() and from() tweens which are based on the target's current values at one end or the other).
*/
document.addEventListener("DOMContentLoaded",function(){
    var fall = document.querySelector("#water-fall");
    TweenMax.fromTo(fall,0.8,
        {attr:{x:-400}},
        {
            attr:{x:0},
            repeat:-1,
            ease:Linear.easeNone
        }
        );
    TweenMax.fromTo(fall,10,
        {attr:{y:130,height:0}},
        {
            attr:{y:-30,height:160},//高度越大,波纹越大
            repeat:-1,
            yoyo:true,//alternate-reverse
            ease:Linear.easeNone
        }
        )
})
              
            
!
999px

Console