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

              
                <button style="width:200px; height:20px;" onclick="playAnim1();">Play Animation</button><span id="spnInfo"></span>
<svg version="1.1" id="svgArcs" x="0px" y="0px" width="204.658px" height="408.256px" viewBox="0 0 204.658 408.256" preserveAspectRatio="xMinYMin meet">
    <path id="pathLeftArc" fill="none" stroke="#000000" d="M102.329,1c56.231,0,101.815,45.584,101.815,101.815s-45.584,101.815-101.815,101.815"/>
    <path id="pathRightArc" fill="none" stroke="#000000" d="M102.329,408.256c-56.23,0-101.815-45.584-101.815-101.814s45.585-101.814,101.815-101.814"/>        
    <img id="imgLogoSoft" src="http://softlinksys.com/images/LogoSoft.png" />
    <img id="imgLogoLink" src="http://softlinksys.com/images/LogoLink.png" /> 
</svg>
<img id="imgLogoBig" src="http://softlinksys.com/images/LogoBig.png" />
              
            
!

CSS

              
                *{box-sizing: border-box;}
body
{
	overflow:hidden;
}
#svgArcs
{
	/*width="204px" height="407px"* @ 1280 X 630 screen res.*/
	position:absolute;	
	width:16%;
	z-index:10;
}
#imgLogoSoft
{
  position:absolute;
	top:40%;
	left: -20%;
	width:19.45%;
	height:auto;
	z-index:1;
}
#imgLogoLink
{
	position:absolute;
	top:40%;
	left: 120%;
	width:32.03%;
	height:auto;
	z-index:1;
}
#imgLogoBig
{
	position:absolute;	
	left:30%;
	top:40%;
	width:54.7%;
	height:auto;	
	z-index:4;
}
              
            
!

JS

              
                var Arcs = null;
var LogoSoft = null;
var LogoLink = null;
var LogoBig = null;
var nScreenWidth = 0;
var nScreenHeight = 0;
var nScreenWidthCenter = 0;
var nArcsLeft = 0;
var nArcsTop = 0;

$(function()
 {
  nScreenWidth = $(window).width();
	nScreenHeight = $(window).height();
	nScreenWidthCenter = nScreenWidth/2;
  spnInfo = $("#spnInfo");
  Arcs = $("#svgArcs");	
  LogoSoft = $("#imgLogoSoft");
	LogoLink = $("#imgLogoLink");
  LogoBig = $("#imgLogoBig");  
  nLeft = nScreenWidthCenter - (LogoBig.width()/2);
	LogoBig.css("left", nLeft + "px");
  nLogoBigTop = LogoBig.offset().top;
  
  dimArcs = Arcs.get(0).getBoundingClientRect();
  nArcsLeft = nLeft - (dimArcs.width/2);
  nArcsTop = LogoBig.offset().top - (dimArcs.height/2);
  spnInfo.html("width:" + Math.round(dimArcs.width) + "&nbsp;&nbsp;&nbsp;&nbsp;height:" + Math.round(dimArcs.height));
  Arcs.css({"left":nArcsLeft + "px"});
  playAnim1();
});

$( window ).resize(function() {
  dimArcs = Arcs.get(0).getBoundingClientRect();  
  spnInfo.html("width:" + Math.round(dimArcs.width) + "&nbsp;&nbsp;&nbsp;&nbsp;height:" + Math.round(dimArcs.height));
});

function playAnim1()
{	
	
  var pathLeftArc = MorphSVGPlugin.pathDataToBezier("#pathLeftArc");
	var pathRightArc =  MorphSVGPlugin.pathDataToBezier("#pathRightArc");
	
	var tl = new TimelineMax();
	tl.to(LogoSoft, 1, {"left":0})
	tl.to(LogoSoft, 2.5, {bezier:{values:pathLeftArc, type:"cubic"}}, .3);	
	tl.to(LogoLink, 1, {"left":0, delay:0}, 0)
	tl.to(LogoLink, 2.5, {bezier:{values:pathRightArc, type:"cubic"}}, .3);	
}
              
            
!
999px

Console