Pen Settings

HTML

CSS

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

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

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.

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

              
                <!-- Generator: Adobe Illustrator 18.1.0, SVG Export Plug-In  -->
<div id="container">
 <!-- Generator: Adobe Illustrator 18.1.0, SVG Export Plug-In  -->
<svg id="line-svg-node" version="1.1"
	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
	 x="0px" y="0px" width="100%" height="100%"  enable-background="new 0 0 400 400"
	 xml:space="preserve">
<defs>
</defs>
<path id="l0" fill="none" stroke="#FCE4EC" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
	M400,200 Q500,200 600,200 "/>
  <circle id="p0" cx="0" cy="0" r="14" fill="rgba(0,0,0,0)" stroke-linecap="round" stroke-width="6" stroke="#FCE4EC"></circle>
  <circle id="p1" cx="0" cy="0" r="14" fill="rgba(0,0,0,0)" stroke-linecap="round" stroke-width="6" stroke="#FCE4EC"></circle>
</svg>

</div>

<div id="null-object"></div>
<div id="p0-null-object"></div>
<div id="p1-null-object"></div>
              
            
!

CSS

              
                body{
  background-color:#E91E63;
  overflow:hidden;
}
body, html, #container {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

#null-object, #p0-null-object, #p1-null-object{
  position:absolute;
  width:8px;
  height:8px;
  background-color:rgba(136,14,79,0);
  border-radius:50%;
}

              
            
!

JS

              
                var container = document.getElementById('container');
var nullObject = document.getElementById('null-object');
var p0NullObject = document.getElementById('p0-null-object');
var p1NullObject = document.getElementById('p1-null-object');
var lineSVGNode = document.getElementById('line-svg-node');
var l0 = document.getElementById('l0');
var p0 = document.getElementById('p0');
var p1 = document.getElementById('p1');

TweenMax.set(container, {
  position:'absolute',
  top:'50%',
  left:'50%',
  xPercent:-50,
  yPercent:-50
})

TweenMax.set([p0,p1], {
  drawSVG:'40 90',
  transformOrigin:'50% 50%'
})

TweenMax.set(lineSVGNode, {
  position:'absolute'
})
TweenMax.set([p0, p1], {
  position:'absolute',
  scale:1
})

TweenMax.set(nullObject, {
  position:'absolute',
  x:0,
  y:0
})
TweenMax.set(p0NullObject, {
  position:'absolute',
  x:0,
  y:400
})
TweenMax.set(p1NullObject, {
  position:'absolute',
  x:0,
  y:400
})

function point0Update(e){
  
    //move point0
    TweenMax.set(p0, {
      attr:{cx:p0NullObject._gsTransform.x,
            cy:p0NullObject._gsTransform.y
           }
    })
    
	p0cX = p0NullObject._gsTransform.x;   
  p0cY = p0NullObject._gsTransform.y;     
  p1cX = p1NullObject._gsTransform.x;   
  p1cY = p1NullObject._gsTransform.y;     

  updateLine();

}

function point1Update(e){
  
    //move point1
    TweenMax.set(p1, {
      attr:{cx:p1NullObject._gsTransform.x,
            cy:p1NullObject._gsTransform.y
           }
    })
    
	p0cX = p0NullObject._gsTransform.x;   
  p0cY = p0NullObject._gsTransform.y;     
  p1cX = p1NullObject._gsTransform.x;   
  p1cY = p1NullObject._gsTransform.y;     
    
  updateLine();
  
}

function updateLine(){
  nullX = nullObject._gsTransform.x;
  nullY = nullObject._gsTransform.y;
  
  TweenMax.set(l0, {
    attr:{d:"M" + p0cX + "," +p0cY +" Q" + nullX + "," + nullY + " " + p1cX + ","+ p1cY  }
  })  
  
  
}

function initPoints(){
    TweenMax.set(p0, {
      attr:{cx:p0NullObject._gsTransform.x,
            cy:p0NullObject._gsTransform.y
           }
    })  
      TweenMax.set(p1, {
      attr:{cx:p1NullObject._gsTransform.x,
            cy:p1NullObject._gsTransform.y
           }
    })  
  point0Update();
  point1Update();
  updateLine();
}


var tl = new TimelineMax({repeat:-1, repeatDelay:2, yoyo:true});
tl.timeScale(3)

.to(p1NullObject, 2, {
  bezier:{type:'thru', values:[
    {x:0, y:400}, {x:300, y:400}]},
  ease:Power3.easeInOut,
  onUpdate:point1Update
})
.to(nullObject, 2, {
  x:0,
  y:0,
  ease:Back.easeOut,
  onUpdate:updateLine
}, '-=2')

tl.to(p0NullObject, 2, {
  bezier:{type:'cubic', values:[
    {x:0, y:400}, {x:200, y:0},
  {x:400, y:0}, {x:600, y:400}]},
  ease:Power4.easeInOut,
  onUpdate:point0Update
})
.to(nullObject, 2, {
  x:450,
  y:0,
  ease:Back.easeIn.config(0.6),
  onUpdate:updateLine
}, '-=2')

.to(p1NullObject, 2, {
  bezier:{type:'cubic', values:[
    {x:300, y:400}, {x:500, y:0},
  {x:700, y:0}, {x:900, y:400}]},
  ease:Power4.easeInOut,
  onUpdate:point1Update
})
.to(nullObject, 2, {
  x:750,
  y:0,
  ease:Back.easeOut,
  onUpdate:updateLine
}, '-=2')

.to(p0NullObject, 2, {
  bezier:{type:'cubic', values:[
    {x:600, y:400}, {x:800, y:0},
  {x:1000, y:0}, {x:1200, y:400}]},
  ease:Power4.easeInOut,
  onUpdate:point0Update
})
.to(nullObject, 2, {
  x:1050,
  y:0,
  ease:Back.easeIn.config(0.3),
  onUpdate:updateLine
}, '-=2')

.to(p1NullObject, 2, {
  bezier:{type:'cubic', values:[
    {x:900, y:400}, {x:1100, y:0},
  {x:1300, y:0}, {x:1500, y:400}]},
  onUpdate:point1Update
})
.to(nullObject, 2, {
  x:1350,
  y:0,
  ease:Power1.easeOut,
  onUpdate:updateLine
}, '-=2')

.to(p0NullObject, 2, {
  bezier:{type:'thru', values:[
    {x:1200, y:0}, {x:1500, y:0}
  ]},
  ease:Power2.easeOut,
  onUpdate:point0Update
})
.to(nullObject, 2, {
  x:1500,
  y:0,
  ease:Back.easeOut.config(2),
  onUpdate:updateLine
}, '-=2')


initPoints();
              
            
!
999px

Console