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>
  <svg id="design" viewBox="0 0 300 200">
    <path class="motion" d="
      M  0,  0
      C  0,  0  99,  1  99, 89
      L 99,111
      C 99,130  75,112  99,112
      C103,112 100,112 106,112
      C121,112 121, 89 105, 89
      C 88, 89 102, 89  99, 89
      C  0, 89  80,103 123,103
      C128,103 135,103 136,103
      C155,103 137,140 137,103
      C137, 92 123, 93 123,103
      C123,115 135,113 137,110
      C152, 86 103, 87 143,110
      C152,116 157,106 147,103
      C140,102 143, 93 152, 96
      C206,118 159.5,50 159,89
      L159,112
      C159,180 117, 93 168,118
      C176,122 180,116 180,115
      C183,107 169,101 168, 90
      C167, 77 180, 67 180, 95
      L180,103
      C180,115 166,115 166,103
      C166, 92 180, 94 180,102
      C180,180 188,125 188,112
      C188,110 188,100 188, 96
      C188, 91 189, 80 194, 91
      C200,101 186,134 188,106
      C189, 93 201, 93 201,100
      C201,105 201,105 201,112
      C201,130 220,160 300, 80
    "></path>
  </svg>
</div> 


<!-- dribbble - twitter -->
<a class="dribbble" href="https://dribbble.com/TaminoMartinius" target="_blank">
  <img src="https://cdn.dribbble.com/assets/dribbble-ball-mark-2bd45f09c2fb58dbbfb44766d5d1d07c5a12972d602ef8b32204d28fa3dda554.svg" alt=""/>
</a>
<a class="twitter" target="_top" href="https://twitter.com/TaminoMartinius">
  <svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72">
    <path d="M67.812 16.141a26.246 26.246 0 0 1-7.519 2.06 13.134 13.134 0 0 0 5.756-7.244 26.127 26.127 0 0 1-8.313 3.176A13.075 13.075 0 0 0 48.182 10c-7.229 0-13.092 5.861-13.092 13.093 0 1.026.118 2.021.338 2.981-10.885-.548-20.528-5.757-26.987-13.679a13.048 13.048 0 0 0-1.771 6.581c0 4.542 2.312 8.551 5.824 10.898a13.048 13.048 0 0 1-5.93-1.638c-.002.055-.002.11-.002.162 0 6.345 4.513 11.638 10.504 12.84a13.177 13.177 0 0 1-3.449.457c-.846 0-1.667-.078-2.465-.231 1.667 5.2 6.499 8.986 12.23 9.09a26.276 26.276 0 0 1-16.26 5.606A26.21 26.21 0 0 1 4 55.976a37.036 37.036 0 0 0 20.067 5.882c24.083 0 37.251-19.949 37.251-37.249 0-.566-.014-1.134-.039-1.694a26.597 26.597 0 0 0 6.533-6.774z"/>
  </svg>    
</a>
              
            
!

CSS

              
                @import "nib"

easeInOutSine = cubic-bezier(0.445, 0.050, 0.550, 0.950)
easeOutBack   = cubic-bezier(0.250,-0.250, 0.750, 1.250)
easing = easeInOutSine
duration = 5.5s

back-color = #5677FC
fore-color = #F5F6F7

body
html
div
  background back-color
  margin 0
  padding 0
  width 100%
  height 100%
  text-align center

#design
  width 600px
  height 400px
  cursor pointer
  transform translate3d(0,0,0)

path
  fill none
  transition stroke-dashoffset duration easing, stroke-dasharray duration easing
  stroke-width 2px
  stroke-linecap round
  stroke fore-color
  stroke-dashoffset 0px
  stroke-dasharray 0px 1180px

.text path
  &.d-1
    stroke-dashoffset -149px
    stroke-dasharray 22px 1180px
  &.d-2
    stroke-dashoffset -201.3px
    stroke-dasharray 49px 1180px
  &.e-1
    stroke-dashoffset -377.5px
    stroke-dasharray 14px 1180px
  &.e-2
    stroke-dashoffset -431.2px
    stroke-dasharray 43px 1180px
  &.s-1
    stroke-dashoffset -526px
    stroke-dasharray 37px 1180px
  &.i-1
    stroke-dashoffset -631px
    stroke-dasharray 0.1px 1180px
  &.i-2
    stroke-dashoffset -637.5px
    stroke-dasharray 16px 1180px
  &.g-1
    stroke-dashoffset -732.5px
    stroke-dasharray 15px 1180px
  &.g-2
    stroke-dashoffset -812px
    stroke-dasharray 69px 1180px
  &.n-1
    stroke-dashoffset -941px
    stroke-dasharray 17px 1180px
  &.n-2
    stroke-dashoffset -1013px
    stroke-dasharray 33.5px 1180px

    
/* dribbble - twitter */
.dribbble {
  position: fixed;
  display: block;
  right: 20px;
  bottom: 20px;
  img {
    display: block;
    height: 28px;
  }
}
.twitter {
  position: fixed;
  display: block;
  right: 64px;
  bottom: 14px;
  svg {
    width: 32px;
    height: 32px;
    path {    
      fill: #1da1f2;
      stroke: none;
    }
  }
}

              
            
!

JS

              
                charParts = [
  "d-1"
  "d-2"
  "e-1"
  "e-2"
  "s-1"
  "i-1"
  "i-2"
  "g-1"
  "g-2"
  "n-1"
  "n-2"
]

partElem = $(".motion")
for part in charParts
  $("#design").append partElem.clone().attr("class", part)

i = setInterval ->
  $("div").toggleClass "text"
, 7000

setTimeout ->
  $("div").toggleClass "text"
, 100

$("div").click ->
  clearInterval i
  $("div").toggleClass "text"

resize = ->
  $("body").css
    "margin-top": ~~((window.innerHeight - 400) / 2) + "px"
    
$(window).resize resize
resize()

#get the line lengths
#$("path").each (i) -> console.log @getTotalLength()

              
            
!
999px

Console