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 id="wrap">
<div id="outer">
   
    <div class="container">
  <svg id="fullSVG" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="400px" width="800px" height="800px" viewBox="0 0 800 800" style="enable-background:new 0 0 800 800;" xml:space="preserve">

    <g id="arm-back"><g><path id="arm-back-arm" class="st13" d="M591.4,397.6l-72,27.1l-10.6-45.5l-9,9.3l11.3,48.4l72.8-17.4C583.9,419.4,599,412.8,591.4,397.6z"/>
  <polygon id="arm-back-hand" class="st13" points="509.1,393.2 508.3,386.9 512.1,377.4 510.8,366.7 508,366.9 508.4,374.7 505.9,375 503,358.7 498.6,359.5 500.9,374.5 498.7,374.4 496,361.6 492.6,363.6 495.3,375.3 490.6,366.7 488.4,368.2 497,390 502.1,396.4 "/></g></g>
    
    <g id="basketball"><g><ellipse class="st14" cx="479.8" cy="363.3" rx="30.8" ry="33.4"/><path class="st15" d="M459.3,376.3c0-18.4,13.8-33.4,30.8-33.4c6.4,0,12.4,2.1,17.3,5.8c-5-11.1-15.5-18.8-27.7-18.8c-17,0-30.8,14.9-30.8,33.4c0,11.5,5.4,21.6,13.5,27.6C460.4,386.5,459.3,381.6,459.3,376.3z"/></g></g>
    
    <g id="basketballFirst"><g><ellipse class="st14" cx="479.8" cy="363.3" rx="30.8" ry="33.4"/><path class="st15" d="M459.3,376.3c0-18.4,13.8-33.4,30.8-33.4c6.4,0,12.4,2.1,17.3,5.8c-5-11.1-15.5-18.8-27.7-18.8c-17,0-30.8,14.9-30.8,33.4c0,11.5,5.4,21.6,13.5,27.6C460.4,386.5,459.3,381.6,459.3,376.3z"/></g></g>
    
<g id="path-for-motion">
<path id="motionPath" class="st23" d="M483.9,295.5c-0.7-15.6-1.7-37.4-3.1-50.5c-10.5-95.6-40.2-125.9-80.8-136.6
		c-57.4-15.2-101.8,12.2-126.3,73.5c-21.1,55.5-26.8,109.8-26.8,204.2s0,321.5,0,321.5"/>
</g>

    
<g id="hoop_1_"><g id="hoop"><g><rect x="195.9" y="207.7" class="st0" width="62.3" height="5.1"/><rect x="211.3" y="208.1" class="st1" width="101.7" height="9"/><rect x="252.7" y="208.1" class="st2" width="19" height="9"/></g><g><path class="st3" d="M305.9,217.2c-0.4-0.4-1-0.5-1.7-0.1c-10.7,7-12.1,21.6-16,32.9c-4-5.5-8.9-10-14-14.5c-0.5-5.7-0.9-11.4-0.5-17.1c0.2-1.9-2.8-1.9-3,0c-0.5,5.3-0.1,10.6,0.3,15.9c-0.2,0.1-0.4,0.2-0.6,0.4c-3.7,4.4-6.1,9.6-9.3,14.3c-0.2-0.1-0.4-0.1-0.7-0.1c-2-5.2-4.9-10.1-6.2-15.6c-0.1-0.2-0.2-0.4-0.3-0.6c0.2-0.2,0.3-0.6,0.3-1V231c0-0.2-0.1-0.4-0.1-0.6c-0.5-4.1-0.7-8.3-1.2-12.4c-0.3-1.9-3.2-1.1-2.9,0.8c0.6,4.1,0.7,8.2,1.2,12.3c-1.5,5.8-3.9,11.1-7.4,16c-3.4-4-6.6-8.2-7.6-13.6c0.6-1.4,0.1-4.2,0.2-5.3c0.2-3.3,0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,0.7,0.8,1.4,1.1,2.1C230.5,274,229.4,276.8,228.5,279.5z M232.5,264.9c-2.6-5.9-5-11.9-8.2-17.5c2.8-4.3,5.9-8.2,9.7-11.6c1.4,5.3,4.8,9.6,8.3,13.7C238,254,235.3,259.5,232.5,264.9z M243.4,288.1c-2.7-6.7-6.1-13-9.6-19.4c3.3-6.1,6.1-12.6,11.1-17.5c2.4,5.6,5.1,11.1,5.9,17.2c0.1,1.1,1.6,2.2,2.6,1.1c0-0.1,0.1-0.1,0.1-0.2C250.3,275.6,247.7,282.3,243.4,288.1z M263.1,290.1c-1.6-7.2-4.1-14.2-5.3-21.5c-0.1-0.6-0.5-0.9-0.9-1c-0.4-0.6-1.3-0.9-1.9-0.6c2-3.7,2.7-8,4.6-11.8c0.2,0,0.4,0,0.7-0.1c4.4,5.1,7.7,11,11.8,16.3c0.4,0.5,1.2,0.6,1.7,0.3C272,278.5,267.3,284.4,263.1,290.1z M273,267.9c-3.7-5-6.8-10.4-10.9-15c3.5-4.7,5.9-10.1,9.5-14.7c0.4,0.8,1.4,1.1,2.1,0.8c4.3,3.9,8.5,7.8,12,12.5C280.8,256.4,277.3,262.5,273,267.9z M283.3,282c-2.1-4.6-4.1-9.2-6.3-13.8c-0.1-0.1-0.1-0.2-0.2-0.3c3.6-4.9,6.9-10.1,11.2-14.5c0.7,0.5,2,0.4,2.4-0.7c3.5-9.2,4.6-22.1,11.6-29.8C295.9,242.6,290.3,262.6,283.3,282z"/></g><g><polygon class="st4" points="86.2,253 78,247.2 166.5,120.6 193.1,120.6 193.1,130.6 171.7,130.6 "/></g><rect x="74.6" y="247.1" class="st4" width="123" height="9"/><rect x="74.6" y="247.1" class="st5" width="28.5" height="9"/><rect x="79.1" y="206.6" class="st4" width="12" height="369"/><rect x="73.1" y="289.1" class="st6" width="24" height="418.5"/><rect x="76.1" y="266.6" class="st6" width="18" height="57"/><rect x="74.6" y="289.1" class="st7" width="9" height="418.5"/><rect x="87.6" y="289.1" class="st8" width="9" height="418.5"/><rect x="188.6" y="103.1" class="st9" width="10.5" height="157.5"/><circle class="st4" cx="69" cy="255" r="11"/></g></g>

<g id="legs">

<g id="leg-front-group">
		<path id="leg-front" class="st10" d="M585.4,533.9L542.9,615l59.1,94h-39.4v-6.8l19.7-3l-57.6-85.7l40.9-89.5L585.4,533.9z"/>
		<path id="leg-front-boot" class="st11" d="M547.5,651.9l16.9-5.1l33.2,52.3l-15.2,0.1L547.5,651.9z"/>
		<path id="leg-front-sheen" class="st12" d="M532.5,614.8l57.2,88.4l-27-1v0l19.7-3l-34.8-47.3l2.5-0.8l-25.3-37.6l40.9-89.5
			l7.5,3.7L532.5,614.8z"/>
	</g>

<g id="leg-back"><polygon id="leg-part-back" class="st13" points="598.3,524.1 557.3,613.5 599,699.2 579.3,702.2 579.3,709.1 618.8,709.1 575.5,615 618,533.9 "/><polygon id="boot-2" class="st11" points="571.7,648.5 595.3,649.1 614.4,699.7 599,699.2 "/></g></g>




<g id="head"><path id="head-move" class="st10" d="M604.4,399.7c0.6-8.6-14.9-21.1-22.5-26.7l10.3-32.8c0,0,9.1-18.2-30.3-15.9l-3,24.6l-7.6,48.2c0,0,13.4,2,22-0.9c0,0.3,0,0.5,0,0.5c16.7,5.3,15.9,12.1,15.9,12.1L604.4,399.7z"/><path id="headPart1" class="st13" d="M586.9,324.8c-7.1-3.8-14.6-7.9-27,0.6c0,0,12.4,7.9,14.1,7.9c1.7,0,0,19.1,0,19.1h3.4l2.2-5.1l4.5,3.4l-6.2,19.6l5.1,0.1l13.5-35.4C596.4,334.9,594.2,328.7,586.9,324.8z"/><path id="headPart2" class="st10" d="M558,354.9c0,0-6,3-6.4,14.2h4.9L558,354.9z"/><path id="headPart3" class="st15" d="M568.6,327.3c-1-1.3-2-2.3-2.9-3.1c-1.2,0-2.4,0.1-3.7,0.2l-3,24.6l-1,6c-0.8,0.4-5.9,3.8-6.3,14.2h4l-4.4,27.9c0,0,3,0.4,7,0.6l4-20.7l-4.6-14.4L568.6,327.3z"/></g>

<g id="body"><g><path class="st11" d="M569.5,503.6c0,0-10.9,21.9-12.4,32.5l27,10.1l7.4-12.3l-0.8,6.8l27.3-2.3c0,0,13.6-34.1,10.6-37.1L569.5,503.6z"/><path class="st16" d="M631,503c0,0,5.9-100.2-26.7-116.9c0,0-16.7-0.8-27.3,22.7c0,0-3.7,79.5-17.2,98C559.9,506.9,618.1,512.1,631,503z"/></g><path class="st12" d="M559.7,537.1l7.9,2.4l13-36.4l-11.1,0.5l12.8-66c-2.5,0.5-5,0.9-7.5,1.3c-2.4,24.6-6.9,57-14.9,68c0,0,3,0.3,7.7,0.6c-3.2,6.8-9.4,20.8-10.6,28.7L559.7,537.1z"/></g>

<g id="arm-front"><path id="arm-front-arm" class="st10" d="M589.7,399.3L524,437.6l-34.1-50.8l-9.1-0.8l34.9,63.7l83.4-17.6C599,432.2,610.8,411.1,589.7,399.3z"/><polygon id="arm-front-hand" class="st10" points="494.3,393.1 493.3,386.4 497,375.9 495.3,364.5 492.3,364.8 492.9,373.2 490.3,373.6 486.5,356 481.8,357.1 484.9,373.2 482.5,373.2 479.1,359.4 475.4,361.8 478.8,374.2 473.4,365.1 471.1,366.8 481.2,390.1 486.9,396.8 "/></g>

</svg>
      
      
 <svg id="SHOTfullSVG" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="800px" height="800px" viewBox="0 0 800 800" style="enable-background:new 0 0 800 800;" xml:space="preserve">  
<g id="SHOTlegs">
<g id="SHOTleg-front-group">
		<path id="SHOTleg-front" class="st10" d="M585.4,523.9L571.9,597l30.1,112h-39.4v-6.8l19.7-3l-26.6-103.7l9.9-81.5L585.4,523.9z"/>
		<path id="SHOTleg-front-boot" class="st11" d="M563.5,651.9l18.9-5.1l17.2,52.3l-17.2,0.1L563.5,651.9z"/>
		<path id="SHOTleg-front-sheen" class="st12" d="M563.5,596.8l26.2,106.4l-27-1v0l19.7-3l-18.8-47.3l2.5-0.8l-10.3-55.6l9.9-81.5
			l7.5,3.7L563.5,596.8z"/>
	</g>

<g id="SHOTleg-back">
  <polygon id="SHOTleg-part-back" class="st13" points="598.3,515.1 588.3,595.5 599,699.2 579.3,702.2 579.3,709.1 618.8,709.1 604.5,597 618,524.9 "/><polygon id="SHOTboot-2" class="st11" points="587.7,648.5 610.3,649.1 617.1,699.7 599,699.2 "/></g></g>
   
   
   <g id="SHOThead">
	<path id="SHOThead-move" class="st10" d="M602.4,391.4c0.6-8.6-6-31.7-14.5-39.4l10.3-32.8c0,0,9.1-18.2-30.3-15.9l-3,24.6l-7.6,48.2
		c0,0,13.4,2,22-0.9c0,0.3,0,0.5,0,0.5c4.9,7.3,5.4,20.3,5.4,20.3L602.4,391.4z"/>
	<path id="SHOTheadPart1" class="st13" d="M592.9,303.8c-7.1-3.8-14.6-7.9-27,0.6c0,0,12.4,7.9,14.1,7.9c1.7,0,0,19.1,0,19.1h3.4l2.2-5.1l4.5,3.4
		l-6.2,19.6l5.1,0.1l13.5-35.4C602.4,313.9,600.2,307.7,592.9,303.8z"/>
	<path id="SHOTheadPart2" class="st10" d="M564,333.9c0,0-6,3-6.4,14.2h4.9L564,333.9z"/>
	<path id="SHOTheadPart3" class="st15" d="M574.6,306.3c-1-1.3-2-2.3-2.9-3.1c-1.2,0-2.4,0.1-3.7,0.2l-3,24.6l-1,6c-0.8,0.4-5.9,3.8-6.3,14.2h4
		l-4.4,27.9c0,0,3,0.4,7,0.6l4-20.7l-4.6-14.4L574.6,306.3z"/>
</g>
 
   <g id="SHOTarm-back">
	<g><path id="SHOTarm-back-arm" class="SHOTarm-back" d="M595.8,398.8l-61.3-56.2l-10.8-44.7l-7.3,4.3l8,44.5l48.7,56.4C573.1,403,586.4,412.9,595.8,398.8z"/>
		<polygon id="SHOTarm-back-hand" class="st13" points="524.6,301.4 523.4,295.2 526.4,285.4 524.3,274.9 521.5,275.3 522.5,283.1 520,283.5 515.9,267.5 
			511.5,268.6 515.1,283.4 512.9,283.5 509.2,270.9 505.8,273.3 509.5,284.6 504.1,276.5 502,278.1 512.4,299.1 518,305.1 		"/>
	</g></g>
   
   <g id="SHOTarm-front">
	<g><path id="SHOTarm-front-arm" class="st10" d="M598,391.6L534,372.7l-30-46.7l-7.8-4.7l24.9,58.6l70.5,45.3C591.7,425.1,611.6,411.5,598,391.6z"/>
		<polygon id="SHOTarm-front-hand" lass="st10" points="506.9,330.1 503.3,324.3 502.6,313.2 496.6,303.4 493.9,304.9 497.8,312.4 495.5,313.7 485.2,299.1 
			481.3,301.9 490.4,315.5 488.3,316.5 479.7,305.1 477.2,308.8 485.3,318.9 476.7,312.6 475.2,315.1 493.7,332.5 501.6,336.4 		"/>
	</g></g>
   
  
 </svg>
      

      
</div>
  </div>
  </div>
              
            
!

CSS

              
                .st17{fill:none;stroke:#231F20;stroke-miterlimit:10;}
.st0{fill:#75121E;}
.st1{fill:#BE1E2D;}
.st2{opacity:0.4;fill:#FFFFFF;}
.st3{fill:#F9EEE4;}
.st4{fill:#9BB8DA;}
.st5{opacity:0.7;fill:#231F20;}
.st6{fill:#E83E1C;}
.st7{opacity:0.2;fill:#231F20;}
.st8{opacity:0.2;fill:#FFFFFF;}
.st9{fill:#FAEDCD;}
.st10{fill:#601000;}
.st11{fill:#ED1C24;}
.st12{opacity:0.2;fill:#FFF200;}
.st13{fill:#2B0022;}
.st14{fill:#F16232;}
.st15{opacity:0.3;fill:#FFF200;}
.st16{fill:#F1F2F2;}

body{background:#b55a90;}
body,html {width:100% height:100%; margin: 0;padding: 0;}
.container{position: absolute; max-width:100%; top: 0px; left: 0px; width: 800px; height: 800px; }
#motionPath{
/*   visibility:hidden; */
  fill: none;
  stroke: black;
}
#basketballFirst * {
  fill: blue;
}


/* use for centering with js */
#wrap {position: relative;max-width:100%; width: 800px; height: 800px; margin:auto 0; text-align:center;}
#outer {position: relative; width: 800px; height: 800px; -webkit-transform-origin: top left;}
/* end centering elements*/
#SHOTfullSVG{display:none; visibility:hidden;}
/* so I can see the ball */
svg{overflow:visible;}
              
            
!

JS

              
                //center the container
TweenMax.set(".container, #wrap", {position: 'absolute',left: '50%',xPercent: -50})
// just fix scaling so I can see what's going on
TweenMax.set("#fullSVG", {scale:.5, y:-200, x:-130});

// TweenMax.set("#basketball", {visibility: "hidden"});

// SVG MOTION PATH
var values = MorphSVGPlugin.pathDataToBezier("#motionPath", {align: "#basketball"});

// center the ball on the path
TweenLite.set("#basketball", {
  
  x: values[0].x,
  y: values[0].y,
  
  xPercent: -50,
  yPercent: -50,
  transformOrigin: "50% 50%"
});

TweenLite.set("#basketballFirst", {  
  xPercent: -50,
  yPercent: -50,
  transformOrigin: "50% 50%"
});

// GSAP animate player and ball
var legs = new TimelineMax({yoyo:true, repeat:-1});
legs

  // .set("#basketball", {y:0})
  .set("#basketball", {y:67})

 .to("#leg-front", 1,  {morphSVG:"#SHOTleg-front", ease:Expo.easeIn}, "0")
.to("#leg-front-boot", 1,  {morphSVG:"#SHOTleg-front-boot", ease:Expo.easeIn}, "0")
.to("#leg-front-sheen", 1,  {morphSVG:"#SHOTleg-front-sheen", ease:Expo.easeIn}, "0")
.to("#leg-part-back", 1,  {morphSVG:"#SHOTleg-part-back", ease:Expo.easeIn}, "0")
.to("#boot-2", 1,  {morphSVG:"#SHOTboot-2", ease:Expo.easeIn}, "0")
.to("#head-move", 1,  {morphSVG:"#SHOThead-move", ease:Expo.easeIn}, "0")
.to("#headPart1", 1,  {morphSVG:"#SHOTheadPart1", ease:Expo.easeIn}, "0")
.to("#headPart2", 1,  {morphSVG:"#SHOTheadPart2", ease:Expo.easeIn}, "0")
.to("#headPart3", 1,  {morphSVG:"#SHOTheadPart3", ease:Expo.easeIn}, "0")

.to("#arm-front-arm", 1, {morphSVG:{shape:"#SHOTarm-front-arm", shapeIndex:0}, ease:Expo.easeIn}, "0")
.to("#arm-front-hand", 1,  {morphSVG:"#SHOTarm-front-hand", ease:Expo.easeIn}, "0")
.to("#arm-back-arm", 1,  {morphSVG:{shape:"#SHOTarm-back-arm", shapeIndex:0}, ease:Expo.easeIn}, "0")

.to("#arm-back-hand", 1,  {morphSVG:"#SHOTarm-back-hand", ease:Expo.easeIn}, "0")
.to("#head, #body, #arm-front, #arm-back", 1,  {y:-17, ease:Expo.easeIn}, "0")

  // .to("#basketballFirst", 1,  {y:-67,  ease:Expo.easeIn}, "0")
  .to("#basketball", 1,  {y:-67,  ease:Expo.easeIn}, "0")

// .set("#basketballFirst", {visibility: "hidden"})
// .set("#basketball", {visibility: "visible"})

.to("#basketball", .85, {bezier: {values: values, type: "cubic", autoRotate: false }, ease:Sine.easeIn})

// .to("#basketball", .85,  {y:87,  ease:Expo.easeOut})
// .to("#basketball", .6,  {y:350,  ease:Expo.easeIn})
// .to("#basketball", .4,  {y:167,  ease:Expo.easeOut})
// .to("#basketball", .65,  {y:350,  ease:Expo.easeIn});



/*
TweenMax.to("#basketball", 1.2, {
      bezier: { values, type: "cubic", autoRotate: true },
      ease:Sine.easeIn,
      delay:  1.2,
      repeat: -1,      
    });

*/
//comment out next line to disable findShapeIndex() UI
//findShapeIndex("#arm-front-arm", "#SHOTarm-front-arm");

// my Master Timeline runs here
//var masterTimeline = new TimelineMax({repeat:-1});
//  masterTimeline; 


              
            
!
999px

Console