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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div class="demo">
  <svg class="container" fill="#f0c0c0" style="background: linear-gradient(to top, #ddfdff, #6dd5fa, #2980b9);
;" xmlns="http://www.w3.org/2000/svg" width="200" height="300" viewBox="0 0 200 300">
    <g id="green-balloon">
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M0.194645 27.3897C1.58711 45.7292 10.9085 54.8234 20.6298
      55.1428C20.4731 55.2394 20.3908 55.3514 20.4288 55.4617C20.4731 55.59
      20.5847 55.6829 20.7359 55.744C20.5493 55.8572 20.3907 55.9447 20.2977
      55.9624C19.7612 56.0644 19.3924 56.2844 19.4317 56.5778C19.5879 57.746
      22.6816 57.9384 23.1463 56.859C23.2827 56.5422 22.8986 56.2631 22.325
      56.0885C22.198 56.0498 22.1905 55.8604 22.1935 55.6571C22.4366 55.5504
      22.6191 55.3994 22.6645 55.2144C22.6765 55.1658 22.6687 55.1223 22.6446
      55.0838C32.2523 54.2071 41.7436 44.8251 43.8938 27.3897C45.8753 11.3216
      34.1114 0.959961 22.0442 0.959961C9.97705 0.959961 -0.939838 12.4479
      0.194645 27.3897Z"
      fill="#00c51e" />
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M0.194645 27.3897C1.58711 45.7292 10.9085 54.8234 20.6298
      55.1428C20.4731 55.2394 20.3908 55.3514 20.4288 55.4617C20.4731 55.59
      20.5847 55.6829 20.7359 55.744C20.5493 55.8572 20.3907 55.9447 20.2977
      55.9624C19.7612 56.0644 19.3924 56.2844 19.4317 56.5778C19.5879 57.746
      22.6816 57.9384 23.1463 56.859C23.2827 56.5422 22.8986 56.2631 22.325
      56.0885C22.198 56.0498 22.1905 55.8604 22.1935 55.6571C22.4366 55.5504
      22.6191 55.3994 22.6645 55.2144C22.6765 55.1658 22.6687 55.1223 22.6446
      55.0838C32.2523 54.2071 41.7436 44.8251 43.8938 27.3897C45.8753 11.3216
      34.1114 0.959961 22.0442 0.959961C9.97705 0.959961 -0.939838 12.4479
      0.194645 27.3897Z"
      fill="url(#paint1_radial)"
      fill-opacity="0.5" />
    <text x="7" y="37" font-size="2rem">🕊</text>
  </g>
        <g id="red-balloon">
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M0.194645 27.3897C1.58711 45.7292 10.9085 54.8234 20.6298
      55.1428C20.4731 55.2394 20.3908 55.3514 20.4288 55.4617C20.4731 55.59
      20.5847 55.6829 20.7359 55.744C20.5493 55.8572 20.3907 55.9447 20.2977
      55.9624C19.7612 56.0644 19.3924 56.2844 19.4317 56.5778C19.5879 57.746
      22.6816 57.9384 23.1463 56.859C23.2827 56.5422 22.8986 56.2631 22.325
      56.0885C22.198 56.0498 22.1905 55.8604 22.1935 55.6571C22.4366 55.5504
      22.6191 55.3994 22.6645 55.2144C22.6765 55.1658 22.6687 55.1223 22.6446
      55.0838C32.2523 54.2071 41.7436 44.8251 43.8938 27.3897C45.8753 11.3216
      34.1114 0.959961 22.0442 0.959961C9.97705 0.959961 -0.939838 12.4479
      0.194645 27.3897Z"
      fill="#C50C00" />
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M0.194645 27.3897C1.58711 45.7292 10.9085 54.8234 20.6298
      55.1428C20.4731 55.2394 20.3908 55.3514 20.4288 55.4617C20.4731 55.59
      20.5847 55.6829 20.7359 55.744C20.5493 55.8572 20.3907 55.9447 20.2977
      55.9624C19.7612 56.0644 19.3924 56.2844 19.4317 56.5778C19.5879 57.746
      22.6816 57.9384 23.1463 56.859C23.2827 56.5422 22.8986 56.2631 22.325
      56.0885C22.198 56.0498 22.1905 55.8604 22.1935 55.6571C22.4366 55.5504
      22.6191 55.3994 22.6645 55.2144C22.6765 55.1658 22.6687 55.1223 22.6446
      55.0838C32.2523 54.2071 41.7436 44.8251 43.8938 27.3897C45.8753 11.3216
      34.1114 0.959961 22.0442 0.959961C9.97705 0.959961 -0.939838 12.4479
      0.194645 27.3897Z"
      fill="url(#paint0_radial)"
      fill-opacity="0.5" />
    <text x="7" y="37" font-size="2rem">⚡️</text>
    <rect width="44" height="58" fill="#ffffff20" />
  </g>
  <line x1="0" y1="100" x2="200" y2="100" stroke="white" stroke-width=".5px"/>
  <line x1="0" y1="200" x2="200" y2="200" stroke="white" stroke-width=".5px"/>
  <line x1="100" y1="0" x2="100" y2="300" stroke="white" stroke-width=".5px" />
  <defs>
    <radialGradient
      id="paint0_radial"
      cx="0"
      cy="0"
      r="1"
      gradientUnits="userSpaceOnUse"
      gradientTransform="translate(32.2215 7.47018) rotate(101.407)
      scale(51.1099 39.5885)">
      <stop offset="0.190965" stop-color="#FFF0F0" />
      <stop offset="1" stop-color="white" stop-opacity="0" />
    </radialGradient>
    <radialGradient
      id="paint1_radial"
      cx="0"
      cy="0"
      r="1"
      gradientUnits="userSpaceOnUse"
      gradientTransform="translate(32.2215 7.47018) rotate(101.407)
      scale(51.1099 39.5885)">
      <stop offset="0.190965" stop-color="#f0fff3" />
      <stop offset="1" stop-color="white" stop-opacity="0" />
    </radialGradient>
  </defs>
</svg>

</div>
<div id="nav">
  <div id="slider" style="width:465px; float:left"></div>
  <button id="play" class="dark-grey-button club-demo-button">play</button>
</div>
              
            
!

CSS

              
                .demo {
  display: table;
}

button#play {
  float: right;
  margin-top: -8px;
}

#nav {
  width: 560px;
  margin: 20px auto;
}

.demo {
  margin: 0px auto;
}

              
            
!

JS

              
                var redBalloon = $("#red-balloon");
var greenBalloon = $("#green-balloon");

var tl = new TimelineLite({onUpdate:updateSlider});

tl.set(greenBalloon, {x:100, y:200})
  .set(redBalloon, {svgOrigin:"50% 50%", x:100,y:200})
  .to(greenBalloon, 1, {scale:2, y:100})
  .to(redBalloon, 1, {scale:2, y:100}, "-=1")
  .to(redBalloon, 1, {scale:3, rotation:20, x:60, y:120})
  .to(redBalloon, 1, {scale:2, rotation:-20, x:100, y:120})
  .to(redBalloon, 1, {scale:2, rotation:0, x:100, y:200})
  .to(greenBalloon, 3, {scale:5, x:300, y:-100}, "-=3")

	$("#slider").slider({
            range: false,
            min: 0,
            max: 1,
			      step:0.001,
            slide: function ( event, ui ) {
                tl.progress( ui.value ).pause();
            }
     });	
			
	function updateSlider() {
		$("#slider").slider("value", tl.progress());
	}

$("#play").click(function(){
  if(tl.progress() === 1){
    tl.restart()
  } else {
    tl.play();
  }
})

tl.pause();

              
            
!
999px

Console