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

              
                <!-- to clean svg files https://jakearchibal...thub.io/svgomg/ -->

<div class="animBox">
<svg xmlns="http://www.w3.org/2000/svg" id="svg2" viewBox="50 0 100 160" height="300" width="500">
  <g id="FishingCloud">
    
    <path id="ShirtBody" d="M76.4 86.91c-.197-.045-.97-9.197-.977-10.633.516-5.084 1.46-7.782 2.778-10.228.908-1.565 1.875-2.612 3.22-3.435.556-1.577 2.056-3.443 2.233-4.55 1.54.507 3.674 3.67 7.848 3.352-.912 2.385-.857 3.938.59 5.643 1.462 1.197 1.984 1.436 3.284 1.894 1.393 1.383 3.65 5.482 3.914 6.944.71 2.615 1.462 6.602 2.126 9.956-.356-.238-24.995 1.646-25.015 1.055z" fill="#f19c69" fill-rule="evenodd" stroke-linejoin="round"/>
    
    <path  id="Cloud"  d="M108.076 92.208c26-11 33 10 24.643 21.428 6.496 10.124-.294 20.94-8.93 20-4.753 23.866-29.252 13.98-34.285 5-24.582 4.268-28.43-6.428-32.143-18.928-10.286.5-20.286-17.5-4.643-24.643 2.356-11.857 22.356-15.857 30.356-8.482 9.06-2.116 22.17-2.68 25 5.625z"fill="#5ec4e6" fill-rule="evenodd" stroke="#5ec4e6"/>
    
    <path id="Head" d="M83.145 42.62c-.08.154-2.555 1.46-2.58 1.632.572 2.487-.004 4.754.035 7.15.3 1.77.323 4.41 2.652 6.693 3.498 2.405 5.282 3.516 7.97 3.595 3.782-.798 5.28-9.157 5.288-10.92.24-2.27.24-4.66.03-6.786-.79-1.484-3-1.65-3.913-1.54.145.16-1.877-.1-3.09-.358-2.787-.586-6.17.104-6.392.534z" fill="#58360a" fill-rule="evenodd" stroke="#512f05" stroke-width=".5" stroke-linejoin="round"/>
    
    <path id="Hair" d="M99.875 46.762c2.626-1.49 1.96-2.528 2.352-3.524.44-1.493.865-1.64-.647-3.964 1.242-1.48 2.17-4.774-1.238-6.1-1.592-.674-1.837 1.15-2.644 1.16-.948.166-1.948.166-2.533-1.664-.415-3.17-1.533-2.22-2.12-2.6-1.295.43-1.864 2.784-3.448 2.114.153-1.684-4.963-1.86-4.617-.343-3.346 1.483-4.346.483-5.112.01-2.113-2.41-4.552.79-4.552.833-.566.817-1.566.817-.852 2.88-1.714-.063-3.963-.088-2.4 3.156-2.314-.22-1.668 3.162-.7 3.18-1.224.8-1.588 2.07-1.385 3.284.77.316 1.767 1.105 1.99 1.105-1.63.892-1.304 1.52-1.307 2.846.594.982.087 1.364 1.818.997 2.27 1.367.944 1.428 3.89.815v.005c-.15.852-.768 1.83-.202 2.868 2.286 2.182 2.654.89 2.728 2.223 1.854-.543 1.48 1.113 2.728 1.116-.103-1.064-.047-1.847.2-1.77-.186-.595-.62-.838-.845-1.336-1.282-3.565-.428-4.597-.127-6.313-.504-1.813.04-2.46.43-2.954.435-.514 1.467-2.286 2.095-1.338.372 1.052 4.372-.948 5.543.347 1.154 1.717-.17 2.705.898 3.087.58.616 1.534 2.06 1.37 1.68.11-.56.17-1.496.02-1.83-1.155-1.244.07-2.037.756-3.158.805.534 3.826-1.403 4.47 1.736.493 2.412-.045 3.642.188 5.196 1.176-1.802 2.128-3.006 3.253-3.744z" fill-rule="evenodd" stroke="#000" stroke-width=".5" stroke-linejoin="round"/>
    
    <path id="MouthSmile" d="M91.844 56.5c-1.277 1.35-2.577.9-3.344-.156" fill="none" stroke="#000" stroke-width=".5" stroke-linecap="round" stroke-linejoin="round"/>
    
    <path id="Nose" d="M89.438 53.22c1.982-.055 1.7-.83 2.124-1.25" fill="none" stroke="#000" stroke-width=".25" stroke-linecap="round" stroke-linejoin="round"/>
    
    <path id="LeftEyeOpen" d="M92.057 49.524c0 1.07.602 1.937 1.344 1.937.743 0 1.17-1.01 1.25-1.914.018-.185.03-.355.003-.58-.162-1.35.636-1.254.427-1.3-.788-.166-1.13-.133-1.68-.08-.738.072-1.343.868-1.343 1.938z" stroke-width=".5" stroke-linejoin="round"/>
    
    <path id="RightEyeOpen" d="M88 49.656c0 1.07-.602 1.938-1.344 1.938-.742 0-1.168-1.01-1.25-1.916-.016-.184-.03-.354-.002-.58.162-1.35-.636-1.254-.427-1.298.79-.167 1.13-.135 1.68-.08.738.07 1.343.866 1.343 1.936z" stroke-width=".5" stroke-linejoin="round"/>
    <g id="HandGrp">
      <path id="LeftHand" d="M104.97 78.64c0 1.977-1.463 3.58-3.267 3.58-1.803 0-.16-1.667.86-3.36.5-.832-2.002-1.414-2.185-2.062-.182-.648 1.656-2.085 2.356-1.517 1.616 1.314 2.235 1.384 2.235 3.36z" fill="#58360a" stroke="#512f05" stroke-width=".5" stroke-linecap="round" stroke-linejoin="round"/>

      <path id="PoleLine" d="M159.998 30.997c1.238 43.664.442 44.9.442 44.9l-.707 3.095" fill="none" fill-rule="evenodd" stroke="#000" stroke-width=".5" stroke-linecap="round" stroke-linejoin="round"/>

      <path id="Pole" d="M99 81.125c5.31-8.28 9.395-14.227 12.405-18.867 5.258-7.196 10.027-12.402 17.095-17.633 15.165-9.306 19.208-9.682 31.856-14.197l.08.338c-5.442 1.74-26.87 9.966-34.988 18.355-6.18 5.47-12.103 13.27-16.698 19.63-2.257 3.353-5.073 8.015-8.125 13-.88-.03-.967-.278-1.625-.625z" fill="#783d0a" fill-rule="evenodd"/>

      <path id="RightHand" d="M102.97 80.885c0 3.038-1.948 3.6-4.295 3.6s-2.77-1.953-1.73-3.953c.775-1.493 1.95-3.153 2.69-3.918 1.496-1.552 1.16 1.51 1.16 1.51-.545 1.54-1.058 1.266-1.457 2.63 0 0 .94 1.26 1.286.443.655-1.546 2.345-1.07 2.345-.312z" fill="#58360a" stroke="#512f05" stroke-width=".5" stroke-linecap="round" stroke-linejoin="round"/>
      <!--text y was originally -158.493 x was 78.133 -->
      <g id="codeG"><text transform="rotate(90)" id="code" y="-158.493" x="170.133" style="line-height:125%" font-size="5" font-family="sans-serif" letter-spacing="0" word-spacing="0">     
      &lt;h1&gt;Hello World!&lt;/h1&gt; 
        </text></g>
      <!--3/28/16 Before y="-158.493" x="170.133" and after y="-160.493" x="185.133" -->
    </g>
    
    <path id="RightEyeClosed" d="M88 49.733c-.242-.13-.33-.187-1.313-.202-.36-.004-.863-.07-1.28.207-.032.02-.03-.066-.003-.108.162-.253-.62-.298-.41-.306.787-.03 1.113.037 1.662.047.74.015 1.344.163 1.344.363z" stroke-width=".5" stroke-linejoin="round"/>
    
    <path id="LeftEyeClosed" d="M92.057 49.733c.242-.13.33-.187 1.313-.202.36-.004.863-.07 1.28.207.033.02.03-.066.003-.108-.162-.253.62-.298.41-.306-.787-.03-1.113.037-1.662.047-.738.015-1.343.163-1.343.363z" stroke-width=".5" stroke-linejoin="round"/>
    
    <path id="HairStatic" d="M97.477 42.3C83.67 37.28 77.76 39.673 77.12 47.573c.064 2.617-.075 5.172 1.776 8.47 1.854-.543 1.48 1.113 2.728 1.116-.103-1.064-.047-1.847.2-1.77-.186-.595-.62-.838-.845-1.336-1.282-3.565-.428-4.597-.127-6.313-.504-1.813.04-2.46.43-2.954.435-.514 1.467-2.286 2.095-1.338.372 1.052 4.372-.948 5.543.347 1.154 1.717-.17 2.705.898 3.087.58.616 1.534 2.06 1.37 1.68.11-.56.17-1.496.02-1.83-1.155-1.244.07-2.037.756-3.158.805.534 3.826-1.403 4.47 1.736.493 2.412-.045 3.642.188 5.196 2.802-6.46.518-6.344.855-8.206z" fill-rule="evenodd" stroke="#000" stroke-width=".5" stroke-linejoin="round"/>
    
    <path id="MouthStrug" d="M91.844 56.5c-.777-1.524-1.764-.29-3.344-.156" fill="none" stroke="#000" stroke-width=".5" stroke-linecap="round" stroke-linejoin="round"/>
    
    <path id="MouthFlat" d="M91.844 56.5c-1.43-.086-1.86-.078-3.344-.156" fill="none" stroke="#000" stroke-width=".5" stroke-linecap="round" stroke-linejoin="round"/>
    
    
  </g>
</svg>


</div>
<div><button id="button">PLAY</button></div>
              
            
!

CSS

              
                
#FishingCloud {
  
}

.animBox {
  background: grey;
  width: 800px;
  float: left;
  height: 500px;
  
}

svg {
  width: 100%;
}
#button {
   
  width: 100px;
  
  text-align: center;
  float: right;
}

#Head {
  fill-opacity:1;
  fill-rule:evenodd;
  fill:#58360a;
  stroke-dasharray:none;
  stroke-linecap:butt;
  troke-linejoin:round;
  stroke-miterlimit:4;
  stroke-opacity:1;
  stroke-width:0.5;
  stroke:#512f05;
}

#ShirtBody {
  fill-opacity:1;
  fill-rule:evenodd;
  fill:#f19c69;
}

#Cloud {
  fill-opacity:1;
  fill-rule:evenodd;
  fill:#5ec4e6;
  opacity:1;
  stroke-linecap:butt;
  stroke-linejoin:miter;
  stroke-opacity:1;
  stroke-width:1;
  stroke:#5ec4e6;
}

#PoleLineLong {
  visibility: hidden;
}

#PoleLine {
  scaleY: 5;
}

#codeG {
  visibility: "hidden";
}

#RightEyeClosed {
  visibility: hidden;
}

#RightEyeOpen {
  
}

#LeftEyeClosed {
  visibility: hidden;
}

#LeftEyeOpen {
  
}

#MouthSmile {
  
}

#MouthFlat {
  visibility: hidden;
}
#MouthStrug {
  visibility: hidden;
}

#Pole {
  fill-opacity:1;
  fill-rule:evenodd;
  fill:#783d0a;
}

#HandGrp {
  visibility:"hidden";
}
              
            
!

JS

              
                // SVG elements to be animated
CSSPlugin.useSVGTransformAttr = true;
var replay = document.getElementById("button");
var line = document.getElementById("PoleLine");
var fishingPole = document.getElementById("HandGrp");
var text = document.getElementById("codeG");

// Timelines

Master = new TimelineMax();
pole = new TimelineMax();
codeCatch = new TimelineMax();


Master.add([
pole.to(fishingPole, .5, {y:-7, x: 5, rotation: 20,transformOrigin: "50% 50%"})
    .to(line,1, {scaleY:5})
    .to(fishingPole, 1, {y:10, x:-20})
 
    
])
//THIS SECTION OF CODE IS WHERE I'M HAVING TROUBLE
.add([
   codeCatch.fromTo(line,2,{rotation: -7}, {rotation: -15}, "1.7")
    .to(line,2.3, {scaleY:1}, "1")
    .fromTo(text,1.2, {x:0}, {x:11},"1")
    .to(text,2.3, {y: -95, visibility: "visible", rotation:-15},"1.2") 
    .to(text,2,{visibility: "hidden"},"6") //5
 
    
  
]); 

Master.repeat(-1).repeatDelay(1);
replay.onclick = function() {
  Master.restart();
}

              
            
!
999px

Console