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 class="relative">
<div class="horizontal" id="map-wrapper">
  <svg xmlns="http://www.w3.org/2000/svg"
		   xmlns:xlink="http://www.w3.org/1999/xlink"
			style="position:absolute;width:100%;height:100%;z-index:0"> <path id="solid-line" fill="none" stroke="white" stroke-width="1px"/>
        <animate attributeType="XML" attributeName="bezcurve" from="-200" to="220"
        dur="10s" repeatCount="indefinite"/>
					</svg>
 <div class ="horizontal">
    <div class="point start">
      <button>START</button>
    </div>
    <div class="point one">
      <button>One</button>
    </div>
    <div class="point two">
      <button>Two</button>
    </div>
    <div class="point three">
      <button>Three</button>
    </div>
    <div class="point four">
      <button>Four</button>
    </div>
    <div class="point five">
      <button>Five</button>
    </div>
  </div>
  
  <div class="end"></div>
   <div class="end-2"></div>
  </div>
            
          
!
            
              
body {
  background: #f4f4f4;
  font-family: 'Open Sans', sans-serif;
  margin: 0 auto;
  padding: 0;
  min-height:100%;
  overflow: hidden;
}

.relative {
/*   position: relative; */
}

#map-wrapper div {
/*   max-width: 900px; */
  margin: 0 auto;
  padding: 4px 30px;
  
  
}

#map-wrapper div:nth-child(even) button {
  float: right;
  background: red;
  visibility: hidden;

}

.start button {
/*   text-align: left;
  position: absolute; */
}

.horizontal {
/*  height: 100vh; */
/*  max-width: 2px; */
 min-width: 100vw;
 list-style: none;
 background-color: black;
 display: -webkit-box;
 display: -moz-box;
 display: -ms-flexbox;
 display: -webkit-flex;
 display: flex;
 justify-content: space-around;
 flex-direction: row;
}

.point {
  width: 15%;
 height: 30px;
  -moz-flex: 1 0 auto;
  -webkit-flex: 1 0 auto;
  flex: 1 0 auto;
  visibility: hidden;
}

.end {
/*   position: relative; */
}
            
          
!
            
              var trail = $('#solid-line');
// var animated = $('#animated-line');

// beginning coordinates for the solid line
var startx = $( ".start button" ).position().left;
var starty = $( ".start button" ).position().top;
var path = 'M ' + startx  + ',' + starty;
var bezcurve = 150;
// for each button, find the coordinates and add them to the SVG
$( "button" ).each(function( index ) {
  var currentX = $(this).position().left;
  var currentY = $(this).position().top;
  
  if( 0 === index ) {
  // C needs two sets of coordinates to make a quadratic Bezier curve
    path += ' C' + ((startx)+150) + ',-20 '+((startx)+20)+',80 ';

  } else {
    // write the end point of the line now we know it
   path+= currentX +','+currentY+' ';
   
  if (index % 2 === 0) {
      // even, map marker on left
      path += 'M'+ currentX+','+currentY;
     // curve
      path += ' C' + (currentX+80) + ',-30 ' + (currentX+80) + ',90 ';
    } else {
      // odd, map marker on right 
      path += 'M'+ currentX+','+currentY;
     // curve
      path += ' C' + (currentX+130) + ',-30 ' + (currentX+10) + ',180 ';
    }
  }

});

trail.attr('d', path);

// $("svg").clone().appendTo("body");
// $("svg").clone().appendTo("body");
// $("svg").clone().appendTo("body");

$(".horizontal").clone().appendTo("body");
$(".horizontal").clone().appendTo("body");




            
          
!
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