cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <div class="wrap">

  <div class="compare">
     <div class="card">
    <h3>Two paths</h3>    
    <svg id="joined" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 84 152.3">
      <path class="rline1 first" d="M51.5,123.5s80.7,7,79-52c-1.5-51.5-79-41-79-41l-1,149" transform="translate(-48.5 -27.6)"/>
      <line class="rline1 second" x1="47.2" y1="91.4" x2="79.5" y2="151.4"/>
    </svg>
    <button class="r1">play</button>
  </div>


  <div class="card">
    <h3>Three paths</h3>
    <svg id="individual_strokes" data-name="individual strokes" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 84 152.3">
  <line class="rline2 first" x1="2" y1="0.9" x2="2" y2="151.9"/>
  <path class="rline2 second" d="M51.5,32.5s77.5-10.5,79,41c1.7,59-79,52-79,52" transform="translate(-48.5 -29.6)"/>
  <line class="rline2 third" x1="47.2" y1="91.4" x2="79.5" y2="151.4"/>
</svg>
  <button class="r2">play</button>
  </div>
</div>
  
 
  
  
  
</div>
            
          
!
            
              body {
  font-family: Dosis, Hevetica, Arial, sans-serif;
  font-size: 120%;
  color: #333;
}

.wrap {
  width: 80%;
  max-width: 900px;
  margin: 1em auto;
}

h1 {
  font-weight: 700;
  font-size: 3rem;
  text-align: center;
  margin-bottom: 1em;
}

h2 {
  text-align: center;
}

h3 {
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
}

.first {
  stroke: #A43442;  
}

.second {
  stroke: #D95B43;
}

.third {
  stroke: #ECD078;
}


.rline1 {
  fill: none;
  stroke-linejoin: round;
  stroke-width: 4px;
}

.rline2 {
  fill: none;

  stroke-linejoin: round;
  stroke-width: 4px;
}


.heartpath1, .heartpath2, .heartpath3{
  fill: none;
  stroke: #00b7f7;
  stroke-width:2;
  stroke-miterlimit: 10;
}

svg {
  width: 150px;
}

svg#heart1, svg#heart2, svg#heart3 {
  width: 300px;
}

.compare {

  margin: auto;
  display:flex;
  justify-content: space-between;
  
  .card {
    text-align: center;
  }
}

button {
  display: block;
  width: 200px;
  margin: 2em auto;
  padding: .5em 5%;
  font-size:1em;
  font-weight: 400;
  background: #333;
  border: none;
  color: white;
}
            
          
!
            
              
var r1lines = document.querySelectorAll('.rline1'),
    r2lines = document.querySelectorAll('.rline2'),
         b1 = document.querySelector('.r1'),
         b2 = document.querySelector('.r2');




var tlr1 = new TimelineMax();
tlr1.add("start");
tlr1.staggerFromTo(r1lines, .6, {drawSVG:"0%"}, {drawSVG:"100%", ease: Power2.easeInOut}, 0.5);
tlr1.seek(1.5);

var tlr2 = new TimelineMax();
tlr2.add("start");
tlr2.staggerFromTo(r2lines, .6, {drawSVG:"0%"}, {drawSVG:"100%", ease: Power2.easeInOut}, 0.4);
tlr2.seek(1.5);


b1.onclick = function() {
  tlr1.play("start");
}

b2.onclick = function() {
  tlr2.play("start");
}
            
          
!
999px
Loading ..................

Console