Pen Settings



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


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


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.


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.


                <svg id="mainSVG" xmlns="" viewBox="0 0 800 600" preserveAspectRatio="xMidYMin meet">
	<title>Click me!</title>
 <filter id="Bevel" filterUnits="objectBoundingBox" x="-100%" y="-100%" width="250%" height="250%">
    <feGaussianBlur in="SourceAlpha" stdDeviation="3" result="blur"/>
    <feSpecularLighting in="blur" surfaceScale="5" specularConstant="0.5" specularExponent="10" result="specOut" lighting-color="white">
      <fePointLight x="-5000" y="-10000" z="20000"/>
    <feComposite in="specOut" in2="SourceAlpha" operator="in" result="specOut2"/>
    <feComposite in="SourceGraphic" in2="specOut2" operator="arithmetic" k1="0" k2="1" k3="1" k4="0" result="litPaint" />
  <filter id="Bevel2" filterUnits="objectBoundingBox" x="-250%" y="-250%" width="450%" height="450%" color-interpolation-filters="sRGB">
    <feGaussianBlur in="SourceAlpha" stdDeviation="1.2" result="blur"/>
    <feSpecularLighting in="blur" surfaceScale="10" specularConstant="0.275" specularExponent="10" result="specOut" lighting-color="white">
      <fePointLight x="500" y="-500" z="0"/>
    <feComposite in="specOut" in2="SourceAlpha" operator="in" result="specOut2"/>
    <feComposite in="SourceGraphic" in2="specOut2" operator="arithmetic" k1="0" k2="1" k3="1" k4="0" result="litPaint" />
    <radialGradient id="standShadowGrad" cx="400.5" cy="511" r="325.92" gradientTransform="translate(0 446.99) scale(1 0.13)" gradientUnits="userSpaceOnUse">
      <stop offset="0" stop-opacity="0.3"/>
      <stop offset="1" stop-color="#ede2f2" stop-opacity="0"/>

    <radialGradient id="eyeGradL" cx="538.43" cy="124.43" r="27" gradientUnits="userSpaceOnUse">
      <stop offset="0" stop-color="#fff"/>
      <stop offset="0.01" stop-color="#fefdfe"/>
      <stop offset="0.14" stop-color="#f1e9f5"/>
      <stop offset="0.23" stop-color="#ede2f2"/>
      <stop offset="0.58" stop-color="#ebe0f0"/>
      <stop offset="0.7" stop-color="#e4daeb"/>
      <stop offset="0.79" stop-color="#d8cfe0"/>
      <stop offset="0.86" stop-color="#c8bfd2"/>
      <stop offset="0.92" stop-color="#b2abbf"/>
      <stop offset="0.98" stop-color="#9792a8"/>
      <stop offset="1" stop-color="#89859c"/>
    <radialGradient id="eyeGradR" cx="483.41" cy="124.02" r="27" xlink:href="#eyeGradL"/>	
    <linearGradient id="boggleGrad" x1="400" y1="84.16" x2="400" y2="498.05" gradientUnits="userSpaceOnUse">
      <stop offset="0" stop-color="#89859c"/>
      <stop offset="1" stop-color="#ede2f2"/>
      <rect width="2000%" x="-1000%" height="100%" fill="url(#boggleGrad)"/>
<ellipse id="standShadow" cx="400.5" cy="511" rx="307.5" ry="46.25" fill="url(#standShadowGrad)"/>	
<path id="backBowl_1_" d="M173.4,251c9.9,114.8,107.6,205,226.6,205s216.8-90.2,226.6-205"  fill="none" stroke="#436974" stroke-linecap="round" stroke-linejoin="round" stroke-width="27"/>
<path id="stand2" d="M548,511H252c-3.4,0-5.7-3.5-4.3-6.6l6.1-14.3c6.5-15.2,21.4-25.1,37.9-25.1h216.6
	c16.5,0,31.5,9.9,37.9,25.1l6.1,14.3C553.7,507.5,551.4,511,548,511z" fill="#436974"/>
      <g id="eyeR">
        <circle cx="540" cy="126" r="27" fill="url(#eyeGradL)"/>
        <circle cx="536" cy="125" r="10" fill="#3c4858"/>
      <g id="eyeL">
        <circle cx="485" cy="126" r="27" fill="url(#eyeGradR)"/>
        <circle cx="486" cy="127" r="10" fill="#3c4858"/>
      <g filter="url(#Bevel2)" >
      <g id="face" >
        <circle  cx="509" cy="255" r="110" fill="#295c70"/>
 <g filter="url(#Bevel2)">
 <g id="mouth" >
          <path d="M436.56,243.5a73.51,73.51,0,0,1,144.88,0" fill="none" stroke="#e74b54" stroke-linecap="round" stroke-linejoin="round" stroke-width="36"/>
          <path id="lips" d="M436.56,243.5a73.51,73.51,0,0,1,144.88,0" fill="none" stroke="#632128" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/>

	     <g filter="url(#Bevel2)" >
    <path id="bowl" d="M166.84,247C177,366.87,277.5,461,400,461s223-94.13,233.16-214" fill="none" stroke="#7aa7ad" stroke-linecap="round" stroke-linejoin="round" stroke-width="29"/>

      <path id="stand" d="M551.2,515.5H248.8a4.82,4.82,0,0,1-4.44-6.72l6.23-14.64a42.14,42.14,0,0,1,38.77-25.64H510.64a42.14,42.14,0,0,1,38.77,25.64l6.23,14.64A4.82,4.82,0,0,1,551.2,515.5Z" fill="#7aa7ad"/>
	<path id="path"  d="M509,255c-4.7,61.14-51.26,90-108,90s-103.3-28.86-108-90"  fill="none" stroke="red" stroke-width="0"/>



                body {
 background-color: #ada8be;
 overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center; 

html {
 height: 100%;
 width: 100%;
 margin: 0;
 padding: 0;

svg {
 width: 100%;
 height: 100%;
 visibility: hidden;
 cursor: pointer;
	-webkit-tap-highlight-color: rgba(0,0,0,0)


                let select = s => document.querySelector(s),
  selectAll = s =>  document.querySelectorAll(s),
		mainSVG = select('#mainSVG'),
		face = select('#face'),
		rToL = true 

gsap.set('svg', {
	visibility: 'visible'
gsap.set(face, {
	//svgOrigin: '512.5 255.5',
	transformOrigin: '50% 50%'

let line1 = '', 
    line2 = 'back(1.2)',
    line3= 'power3';
let ease1 = blendEases(line1, line2);
let ease2 = blendEases(line1, line3);

function blendEases(startEase, endEase, blender) {
    var s = gsap.parseEase(startEase),
        e = gsap.parseEase(endEase),
        blender = gsap.parseEase(blender || "power3.inOut");
    return function(v) {
      var b = blender(v);
      return s(v) * (1 - b) + e(v) * b;

function onUpdate() {
	gsap.set('#eyeL', {
		rotation: -gsap.getProperty(face, 'rotation')*2.4,
		x: gsap.getProperty(face, 'x'),
		y: gsap.getProperty(face, 'y'),
		transformOrigin: '50% 50%'
	gsap.set('#eyeR', {
		rotation: gsap.getProperty(face, 'rotation')*1.4,
		x: gsap.getProperty(face, 'x'),
		y: gsap.getProperty(face, 'y'),
		transformOrigin: '50% 50%'
	gsap.set('#mouth', {
		rotation: gsap.getProperty(face, 'rotation'),
		x: gsap.getProperty(face, 'x'),
		y: gsap.getProperty(face, 'y'),
		transformOrigin: '50% 120%'
let tl = gsap.timeline({onUpdate: onUpdate, paused: true});, {
	duration: 2,
	motionPath: {
		path: "#path",
		align: "#path",
		start: 0,
		end: 1,
		offsetX: -110,
		offsetY: -110
	ease: ease2,
	yoyoEase: ease2
.to(face, {
	duration: 2,
	rotation: -180,
	ease: ease2,
	yoyoEase: ease2
}, 0)

document.body.onclick = (e) => {
	rToL = !rToL;
	if(rToL) {
	} else {