css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div id="ps4">
  
<svg version="1.1" viewBox="0 0 1280 668" class="line-animated">
  <path 
      d="
M 155 313 L 161.667 236.333
M 161.667 236.333 L 538.333 236.333
M 538.333 236.333 L 538.333 313
M 538.333 313 L 155 313
M 538.333 241 L 550.333 241.666
M 550.333 236.333 L 550.333 313
M 550.333 236.333 L 1140 236.333
M 1140 236.333 L 1147 313
M 1147 313 L 550.333 313
M 1109 313 L 1109 345
M 550.333 345 L 1147 345
M 1147 345 L 1156 423
M 1156 423 L 550.333 423
M 550.333 423 L 550.333 345
M 550.333 423 L 538.333 423
M 538.333 423 L 146 423
M 146 423 L 155 345
M 155 345 L 538.333 345
M 538.333 345 L 538.333 423
M 194 313 L 194 345
M 983.667 264.667 L 1014.333 264.667
M 1014.333 264.667 L 1014.333 274.667
M 1014.333 274 L 983.667 274
M 983.667 274 L 983.667 282.333
M 1019 282.333 L 1037 282.333
M 1037 282.333 L 1037 264.667
M 1037 264.667 L 1054 264.667
M 1085.333 264.667 L 1056.333 279.667
M 1056.333 279.667 L 1090.667 279.667
M 1085.333 264.667 L 1085.333 282.333
" 
      stroke="#fff" 
      stroke-width="2" 
      fill="none" 
      stroke-dasharray="988.01 988.01"
      stroke-dashoffset="0" /*set to 0 so that if JS is off the image will still appear (Progressive Enhancement Son!)*/
      >
  </path>
</svg>
  
</div>


            
          
!
            
              body{
  width: 100%;
  background: #337BC5;
  height: 100%;
}
h1{
  font-family: Gotham, Helvetica, san-serif;
  color: #fff;
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 2em 0;
}
div{
  width: 90%;
  margin: 0 auto;
}
svg{
  width: 100%;
  height: 75%;
}
path{ 
  
-webkit-transition: stroke-dashoffset 2s ease-in-out; 
  transition: stroke-dashoffset 2s ease-in-out;
}       
            
          
!
            
              window.onload = function(){
  lineDraw();
  //repeat for demo purposes
  setInterval(lineDraw, 5000);
  
};
function lineDraw(){
var path = document.querySelector('.line-animated path');
var length = path.getTotalLength();
// Clear any previous transition
path.style.transition = path.style.WebkitTransition =
  'none';

// Set up the starting positions
path.style.strokeDasharray = length + ' ' + length; 
path.style.strokeDashoffset = length;
// Trigger a layout so styles are calculated & the browser 
// picks up the starting position before animating
path.getBoundingClientRect();
// Define our transition
path.style.transition = path.style.WebkitTransition =
  'stroke-dashoffset 7s ease-in-out';
// Go!
path.style.strokeDashoffset = '0';
  //0 is the image fully animated, 988.01 is the starting point.
};




            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console