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

              
                <div class="draw -wave">Lorem Ipsum</div>
<div class="draw -wave">Quos fugiat</div>
<div class="draw -wave -small">Et fuga voluptate eaque magni</div>
<div class="draw -small" delay="2.5">Ipsam distinctio?</div>
<!--
.draw      : Makes a block effect
   -wave   : Adds a .25s delay per line
   -small  : Small text
   -do     : Starts the animations when the page is ready, 
             equally you can add this when the element comes into view
   [delay] : Adds a custom delay in 0.1 increments up to 3s (editable in SCSS line 46)
-->
              
            
!

CSS

              
                body {
   display:flex;
   flex-direction:column;
   justify-content:center;
   align-items:center;
   
   height:100vh;
   .draw {
      position: relative;
      
      padding:3px 20px;
      margin:2px 0;
         
      color:transparent;
      
      font-size:32px;
      font-family: 'Montserrat', sans-serif;
      
      
      &.-small {
         padding:2px 10px;
         
         font-size:14px;
      }
      &:before {
         position: absolute;
         top:0px;
         bottom:0px;
         left:0%;
         right:100%;
         
         background-color:black;
         
         content: '';
      }
      &.-do {
         animation:show 2.5s forwards;
         &:before {
            animation:intro 2.5s ease-in-out;
         }
      }
      
      //I have added an extra 0.5s on top of document ready because I kept getting it slightly juttering
      @for $i from 1 through 8 { //Add the class '-wave' to make each line add .25s delay per line
         &.-wave:nth-child(#{$i}) {
            &, &::before {
               animation-delay: #{0.5 + $i/4}s;
            }
         }
      }
      @for $i from 1 through 30 { //add the attribute 'delay="1"' for a 1 second delay
         &[delay="#{$i/10}"] {
            &, &::before {
               animation-delay: #{0.5 + $i/10}s;
            }
         }
      }
      
      @keyframes intro {
         0% {
            left:0%;
            right:100%;
         }
         50% {
            left:0%;
            right:0%;
         }
         100% {
            left:100%;
            right:0%;
         }
      }
      @keyframes show {
         0%, 50% {
            color:transparent;
         }
         50.00001%, 100% {
            color:black;
         }
      }
   }
}
              
            
!

JS

              
                $(function() {
   $(".draw").addClass("-do"); //Don't do animations until the page is ready to do them smoothly
});
              
            
!
999px

Console