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

              
                <div class="container">
  <svg class="glassSVG" viewBox="0 0 600 600">
    <defs>
      <clipPath id="liquidMask">
        <polygon class="liquidMask" fill="#FFFFFF" points="218,225 381,225 345,441 255,441 " />
      </clipPath>
      <symbol id="fizz">
        <rect x="0" y="0" fill="#FF74CB" width="8" height="8" />
      </symbol>
    </defs>

    <path class="lemon" fill="#FFFF3F" stroke="#343434" stroke-width="16" stroke-miterlimit="10" d="M439,225c0,32-26,58-58,58
	c-3.3,0-6.4-0.3-9.5-0.8L381,225h-58c0-32,26-58,58-58S439,193,439,225z" />
    <polygon class="drinkLiquid" clip-path="url(#liquidMask)" fill="#FF74CB" points="218,225 381,225 345,441 255,441 " />


    <line class="pour" fill="none" stroke="#FF74CB" stroke-width="16" stroke-linecap="none" stroke-miterlimit="10" x1="313" y1="433" x2="313" y2="113" />

    <use xlink:href="#fizz" class="fizzUp" x="220" y="190" />
    <use xlink:href="#fizz" class="fizzDown" x="240" y="200" />
    <use xlink:href="#fizz" class="fizzUp" x="260" y="190" />
    <use xlink:href="#fizz" class="fizzDown" x="280" y="200" />
    <use xlink:href="#fizz" class="fizzUp" x="300" y="190" />
    <use xlink:href="#fizz" class="fizzDown" x="320" y="200" />
    <use xlink:href="#fizz" class="fizzUp" x="340" y="190" />
    <use xlink:href="#fizz" class="fizzDown" x="360" y="200" />

    <polyline class="emptyStraw" fill="none" stroke="#343434" stroke-width="16" stroke-miterlimit="10" points="273,225 255,154 
	218,154 " />
    <polyline class="fullStraw" fill="none" stroke="#FF74CB" stroke-width="16" stroke-miterlimit="10" points="273,225 255,154 
	218,154 " />
    <polygon class="glass" fill="none" stroke="#343434" stroke-width="16" stroke-miterlimit="10" points="218,225 381,225 345,441 
	255,441 " />
  </svg>


  <svg class="pitcherSVG" width="600" height="600" viewBox="0 0 600 600">
    <defs>
      <clipPath id="pitcherLiquidMask">
        <polygon class="pitcherLiquidMask" fill="#FFFFFF" points="175.7,146 392,146 392,427 211,427 211,194.7 " />
      </clipPath>
    </defs>
    <rect class="pitcherLiquid" clip-path="url(#pitcherLiquidMask)" x="0" y="180" fill="#FF74CB" width="600" height="600" />

    <g class="pitcherGroup">
      <polygon class="pitcher" fill="none" stroke="#343434" stroke-width="16" stroke-linecap="round" stroke-miterlimit="10" points="
		175.7,146 392,146 392,427 211,427 211,194.7 	" />
      <path class="pitcherHandle" fill="none" stroke="#343434" stroke-width="16" stroke-miterlimit="10" d="M391.6,146.1
		c37,0,67,30,67,67s-30,67-67,67" />
    </g>


  </svg>


</div>
              
            
!

CSS

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

.container{
  width:600px;
  height:600px;
}

svg{
  position:absolute;
}

              
            
!

JS

              
                var select = function(s) {
      return document.querySelector(s);
    }, container = select('.container'), liquidMask = select('.liquidMask'), emptyStraw = select('.emptyStraw'), fullStraw = select('.fullStraw'), lemon = select('.lemon'), glassSVG = select('.glassSVG'), pitcherSVG = select('.pitcherSVG'), pitcherGroup = select('.pitcherGroup'), pitcherLiquidMask = select('.pitcherLiquidMask'), pitcherLiquid = select('.pitcherLiquid'), pour = select('.pour')


TweenMax.set(fullStraw, {
  drawSVG:'0% 0%'
})
TweenMax.set(emptyStraw, {
  drawSVG:'100% 0%'
})
TweenMax.set(pour, {
  drawSVG:'100% 100%'
})

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

TweenMax.set([pitcherGroup, pitcherLiquidMask], {
  rotation:0,
  x:450,
  y:50,
  transformOrigin:'0% 0%'
})

TweenMax.set(glassSVG, {
  x:-150,
  y:100
})

var mainTimeline = new TimelineMax({repeat:-1, repeatDelay:1, delay:1});
mainTimeline.to(fullStraw, 0.6, {
  drawSVG:'100% 0%'
})
.to(emptyStraw, 0.6, {
  drawSVG:'100% 100%'
}, '-=0.6')
.to(liquidMask, 3, {
  y:210
})
.to(fullStraw, 0.6, {
  drawSVG:'100% 100%'
}, '-=1')
.to(emptyStraw, 0.6, {
  drawSVG:'100% 0%'
}, '-=1.6')

.to([pitcherGroup, pitcherLiquidMask], 1, {
  rotation:0,
  x:100,
  transformOrigin:'0% 0%'
})

.to([pitcherGroup, pitcherLiquidMask], 1, {
  rotation:-50,
  x:'-=40',
  y:'-=20',
  transformOrigin:'0% 30%'
})

.to(pitcherLiquid, 6, {
  attr:{
    y:380
  }
})
.to(pour, 1, {
  drawSVG:'100% 0%'
}, '-=6')
.to(liquidMask, 3, {
  y:0
}, '-=5')
.to(pour, 1, {
  drawSVG:'0% 0%'
}, '-=3')
.staggerFrom('.fizzUp', 0.2, {
  alpha:0,
  y:'+=20',
  repeat:7,
  yoyo:true
}, 0.061, '-=2.5')
.staggerFrom('.fizzDown', 0.2, {
  alpha:0,
  y:'-=20',
  repeat:7,
  yoyo:true
}, 0.061, '-=2.5')
.to([pitcherGroup, pitcherLiquidMask], 1, {
  rotation:0,
  x:450,
  y:50,  
  transformOrigin:'0% 30%'
})
.set(pitcherLiquid, {
  attr:{
    y:500
  }
},'-=1')
.to(lemon, 0.6, {
  y:0,
  ease:Back.easeOut.config(0.5)
},'-=1')
              
            
!
999px

Console