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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <svg class="beeSVG" version="1.1" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 600" width="100%" height="100%">
  <defs>
    <clipPath id="lineMask">
      <rect width="310" height="260" x="0" y="120" />
    </clipPath>    
    <clipPath id="bulletMask">
		      <polygon class="bulletMask"  stroke-width="7" stroke="#53504C" fill="#FBD353" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="		61.8,21.4 61.8,54.2 33.4,70.6 5,54.2 5,21.4 33.4,5 	"/>    </clipPath>
    <path id="maskedBeeStripe" d="M113,72.7c0,19.5-19.4,35.3-43.2,35.3S19.8,94.8,17.4,75.7C21,57.5,45.8,37.4,69.7,37.4S113,53.2,113,72.7				z" />
  </defs>
  <g clip-path="url(#lineMask)">
    <path id="waveyLine" fill="none" stroke="none" stroke-miterlimit="10" d="M300,238
	c100,0,100,36,199.99,36c100,0,100-36,200-36c100,0,100,36,200,36c100,0,100-36,200-36c100,0,100,36,200.01,36s100-36,200.01-36" />

    <path id="movingPath" fill="none" stroke="#D9D9D9" stroke-miterlimit="10" d="M-100,238
	c100,0,100,36,199.99,36c100,0,100-36,200-36c100,0,100,36,200,36c100,0,100-36,200-36c100,0,100,36,200.01,36s100-36,200.01-36
	c100,0,100,36,199.99,36c100,0,100-36,200-36c100,0,100,36,200,36c100,0,100-36,200-36c100,0,100,36,200.01,36
	c100,0,100-36,200.01-36" stroke-dasharray="12,24" stroke-width="3" stroke-linecap="round" />
    <path fill="none" stroke="#311BB2" stroke-miterlimit="10" d="M2194,460.5c2,0,4,0,6,0" />
  </g>
  
    <g id="beeGroup">
      <g id="bee">
<g id="speedLinesGroup" stroke="#53504C" stroke-width="4" stroke-linecap="round" stroke-linejoin="round">
	
			<line fill="none" stroke-miterlimit="10" x1="89.2" y1="104" x2="9.8" y2="104"/>
		
			<line fill="none" stroke-miterlimit="10" x1="83.7" y1="52" x2="24.3" y2="52"/>
		
			<line fill="none" stroke-miterlimit="10" x1="78.8" y1="33.6" x2="59.5" y2="33.6"/>
		
			<line fill="none" stroke-miterlimit="10" x1="61.3" y1="96" x2="2" y2="96"/>

</g>        
        <path id="antennaR" fill="none" stroke="#53504C" stroke-width="5.6" stroke-linecap="round" stroke-miterlimit="10" d="
		M79,56c6,0,21.7-8,24.3-22.3" />
        <path id="wingR" fill-opacity="0.8" fill="#EAE8E4" stroke="#53504C" stroke-width="5.4643" stroke-miterlimit="10" d="M73,3.8
	c10.7,4,15.3,17.9,10.4,31c-4.9,13.1-15.7,21.4-28.5,22c-8.8-10.6-15.1-23.5-10.1-36.6S62.3-0.2,73,3.8z" />
        <g>
          <path id="antennaL" fill="none" stroke="#53504C" stroke-width="5.6" stroke-linecap="round" stroke-miterlimit="10" d="
		M98,56c0,0,13.7-7.3,16.3-19.3" />
          <path id="stinger" fill="#53504C" d="M0,81c-0.3-3.1,19.6-9.8,23.2-7.7c3.6,2,3.6,9.4,1,11.5S0.4,85.1,0,81z" />
          <path fill="#FBD353" stroke="#53504C" stroke-width="7" stroke-miterlimit="10" d="M114,72.7c0,19.5-19.4,35.3-43.2,35.3
		S20.8,94.8,18.4,75.7C22,57.5,46.8,37.4,70.7,37.4S114,53.2,114,72.7z" />
          <path fill="none" stroke="#53504C" stroke-width="10" stroke-miterlimit="10" d="M96.9,100.8c-10.4-11.3-16.6-43-9.7-58.2" />
          <path fill="none" stroke="#53504C" stroke-width="10" stroke-miterlimit="10" d="M74.1,107.9c-9.4-16.5-19.5-39.9-8-70.2" />

          <clipPath id="beeStripeMask">
            <use xlink:href="#maskedBeeStripe" overflow="visible" />
          </clipPath>
          <path clip-path="url(#beeStripeMask)" fill="none" stroke="#53504C" stroke-width="10" stroke-miterlimit="10" d="M66,116.6			C38.3,116,25.6,51.6,53.6,35" />
        </g>
        <path id="wingL" fill-opacity="0.8" fill="#EAE8E4" stroke="#53504C" stroke-width="5.4643" stroke-miterlimit="10" d="M27.1,11.1
	C36,4,50.3,7.2,59,18.2s10.3,24.4,4.2,35.8C49.6,56,35.3,54.8,26.6,43.8S18.2,18.2,27.1,11.1z" />
        <path id="mouth" fill="none" stroke="#53504C" stroke-width="5.464" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
		M113.9,71.1c0.9,3.8-9.1,8.1-15,3.6c0,0,0.5,2.3,6.8,3.2C112,78.6,113.9,71.1,113.9,71.1z"/>
<path id="smile" fill="none" stroke="none" stroke-width="5.464" stroke-linecap="round" stroke-miterlimit="10" d="
		M113.9,71.1c0.9,3.8-9.1,8.1-15,3.6c0,0,1.2,12.2,7.5,13C112.8,88.5,113.9,71.1,113.9,71.1z"/>        
        <g id="eyeGroup">
          <circle id="eyeBg" fill="#53504C" cx="98.7" cy="62.2" r="7" />
          <circle id="eyeShine" fill="#EAE8E4" cx="103" cy="62.2" r="2" />
        </g>
<polygon id="ting" fill="#EFEAEA" points="112,68.7 114,76.4 122,76 115.3,80.3 118.2,87.8 112,82.8 105.7,87.8 108.6,80.3 
		101.9,76 109.9,76.4 	"/>        
      </g>
    </g>
  
<g id="bulletTimeGroup"  >
  <title>Bullet time</title>
  <g id="maskedBulletGroup" clip-path="url(#bulletMask)">
		<polygon id="bulletTimeBg" stroke="#53504C" fill="#FBD353" stroke-width="0" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
		61.8,21.4 61.8,54.2 33.4,70.6 5,54.2 5,21.4 33.4,5 	"/>
	<g id="bullet">
		<path fill="#53504C" d="M26.5,32.8h10.4c5.2,0,9.6,2.2,9.6,5.2v-0.3c0,3-4.3,5.1-9.6,5.1H26.5V32.8z"/>
		<rect x="22" y="32.8" fill="#53504C" width="3" height="10"/>
  </g>
<text id="b" x="32" y="52">B</text>
  </g>
		<polygon id="bulletTimeOutline" stroke="#53504C" fill="none" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="		61.8,21.4 61.8,54.2 33.4,70.6 5,54.2 5,21.4 33.4,5 	"/>    
</g>  

  <text id="mainText" x="50%" y="500"><tspan style="fill:#FBD353;">B</tspan> is for bullet time</text>  
</svg>
              
            
!

CSS

              
                body {
  background-color:#8FB5D8;
  overflow: hidden;
}

body,
html {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}


svg{

  visibility:hidden;
   
}


#bulletTimeGroup{
  cursor:pointer;
}
text{
  
  font-family: 'Krona One', sans-serif;
  text-anchor:middle;
  
}
#mainText{
  font-size:52px;
  fill:#53504C;
  letter-spacing:-4px;
}
#b{
  font-family: 'Bangers', cursive;
  font-size:40px;
  fill:#53504C;
}
              
            
!

JS

              
                //TweenLite.ticker.fps(24)
var xmlns = "http://www.w3.org/2000/svg",
  xlinkns = "http://www.w3.org/1999/xlink",
  select = function(s) {
    return document.querySelector(s);
  },
  selectAll = function(s) {
    return document.querySelectorAll(s);
  },
  beeSVG = select('.beeSVG'),
  bee = select('#bee'),
  beeGroup = select('#beeGroup'),
  movingPath = select('#movingPath'),
  waveyLine = select('#waveyLine'),
  wingL = select('#wingL'),
  wingR = select('#wingR'),
  bulletTimeGroup = select('#bulletTimeGroup'),
  speedLinesGroup = select('#speedLinesGroup'),
  allSpeedLines = selectAll('#speedLinesGroup line'),
  mouth = select('#mouth'),
  mouthPath = mouth.getAttribute('d')



TweenMax.set(bee, {
  transformOrigin: '50% 50%'

})
TweenMax.set(bulletTimeGroup, {
  transformOrigin: '50% 50%',
  x: 500,
  y: 20

})
TweenMax.set(speedLinesGroup, {
  transformOrigin: '50% 50%',
  x: -80,
  y: 0
})
TweenMax.set(allSpeedLines, {
  drawSVG: '0% 0%'
})

TweenMax.set(wingL, {
  transformOrigin: '100% 100%'
})
TweenMax.set(wingR, {
  transformOrigin: '0% 100%'
})

var beeSmileTl = new TimelineMax({
  paused: true
});
beeSmileTl
  .to('#mouth', 0.4, {
    morphSVG: {
      shape: '#smile'
    },
    fill: '#FFF'
  })
  .to('#eyeShine', 0.6, {
    attr: {
      cx: 99
    },
    ease: Back.easeOut

  }, '-=0.4')

  .fromTo('#ting', 2, {
    scale: 0,
    rotation: -360,
    transformOrigin: '50% 50%'
  }, {
    scale: 1,
    rotation: 0
  }, '-=1')
  .to('#ting', 0.5, {
    alpha: 0,
    ease: Linear.easeNone
  }, '-=0.5')
  .to('#stinger', 0.12, {
    rotation: -13,
    transformOrigin: '100% 50%',
    repeat: 7,
    yoyo: true
  }, '-=2.3')
  .addPause()

  .to('#eyeShine', 0.6, {
    attr: {
      cx: 103
    },
    ease: Back.easeOut

  })
  .to('#mouth', 0.4, {
    morphSVG: {
      shape: mouthPath
    },
    fill: 'none'
  }, '-=0.4')

beeSmileTl.timeScale(1.5);

var beePathBezier = MorphSVGPlugin.pathDataToBezier(waveyLine.getAttribute('d'), {
  offsetX: 50, // -(bee.getBBox().width),
  offsetY: -80 // -(bee.getBBox().height)
})

var tl = new TimelineMax({
  repeat: -1,
  paused: false
});
tl.to(bee, 6, {
    bezier: {
      type: "cubic",
      values: beePathBezier,
      autoRotate: false
    },
    ease: Linear.easeNone
  })
  .to([movingPath, beeGroup], 6, {
    x: -1200,
    ease: Linear.easeNone
  }, '-=6')

function flapWings() {

  var flapTl = new TimelineMax();

  var wl = TweenMax.to(wingL, 0.09, {
    scaleY: 0.25,
    delay: 0.01,
    repeat: -1,
    skewX: 40,
    yoyo: true,
    ease: Sine.easeInOut
  })
  var wr = TweenMax.to(wingR, 0.09, {
    scaleY: 0.25,
    skewX: -40,
    repeat: -1,
    yoyo: true,
    ease: Sine.easeInOut
  })

  flapTl.add(wl, 0);
  flapTl.add(wr, 0);

  return flapTl;

}

function doSpeedLines() {

  var tl = new TimelineMax({
    repeat: -1
  });
  tl.staggerTo(allSpeedLines, 1, {
      drawSVG: '30% 0%',
      ease: Linear.easeNone
    }, 1)
    .staggerTo(allSpeedLines, 2, {
      drawSVG: '100% 70%',
      ease: Linear.easeNone
    }, 1, '-=3')
    .staggerTo(allSpeedLines, 1, {
      drawSVG: '100% 100%',
      ease: Linear.easeNone
    }, 1, '-=3')

  tl.timeScale(6)
  return tl;
}


var bulletTl = new TimelineMax({paused:true});
bulletTl.from('#bullet', 1, {
    x:-40,
  ease:Back.easeOut
  })
  .to('#b', 1, {
    attr:{
      x:72
    },
  ease:Back.easeOut
  },'-=1')
  .set('#b', {
    attr:{
      x:-10
    },
  ease:Back.easeOut
  })
  .addPause()
  .to('#bullet', 1, {
    x:40,
  ease:Back.easeOut
  })
  .to('#b', 1, {
    attr:{
      x:32
    },
  ease:Back.easeOut
  },'-=1')  



function blink(){
  
  TweenMax.to('#eyeGroup', 0.1, {
    scaleY: 0.2,
    yoyo: true,
    repeat: 1,
    transformOrigin: '50% 50%',
    delay: Math.random() * 5,
    onComplete:blink
  })
}

blink();

var mainTl = new TimelineMax();
mainTl.add(tl, 0);
mainTl.add(doSpeedLines(), 0);

mainTl.add(flapWings(), 0)

mainTl.timeScale(3);
bulletTl.timeScale(3);

bulletTimeGroup.addEventListener('click', function(e) {

  if (mainTl.timeScale() < 1) {
    //mainTl.timeScale(3)
    TweenMax.to(mainTl, 1, {
      timeScale: 3,
      ease: Linear.easeNone
    })
    beeSmileTl.resume();
    bulletTl.resume();

  } else {
    //mainTl.timeScale(0.3);
    TweenMax.to(mainTl, 1, {
      timeScale: 0.3,
      ease: Linear.easeNone
    })

    bulletTl.play(0);
    
    TweenMax.delayedCall(1.6, function() {
      beeSmileTl.play(0);
    })

  }

})

TweenMax.set('svg', {
  visibility: 'visible'
})
              
            
!
999px

Console