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. 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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <svg version="1.1"
	 xmlns="http://www.w3.org/2000/svg" 
	 viewBox="0 0 600 600" >
<defs>

<filter id="dropShadow" x="-100%" y="-200%" width="400%" height="500%" >
    <feGaussianBlur id="blur" in="SourceAlpha"  stdDeviation="12"/>
    <feOffset id="offset" dx="0" dy="3" />
      <feComponentTransfer>
    <feFuncA id="alpha" type="linear" slope="0.2"/>
  </feComponentTransfer>
    <feMerge>
      <feMergeNode/>
      <feMergeNode in="SourceGraphic"/>
    </feMerge>
  </filter>   
<filter id="trunkShadow" x="-100%" y="-200%" width="400%" height="500%" >
    <feGaussianBlur id="blur" in="SourceAlpha"  stdDeviation="7"/>
    <feOffset id="offset" dx="0" dy="0" />
      <feComponentTransfer>
    <feFuncA id="alpha" type="linear" slope="0.8"/>
  </feComponentTransfer>
    <feMerge>
      <feMergeNode/>
      <feMergeNode in="SourceGraphic"/>
    </feMerge>
  </filter>    
<filter id="platformShadow" x="-100%" y="-200%" width="400%" height="500%" >
    <feGaussianBlur id="blur" in="SourceAlpha"  stdDeviation="12"/>
    <feOffset id="offset" dx="0" dy="3" />
      <feComponentTransfer>
    <feFuncA id="platformShadowAlpha" type="linear" slope="0"/>
  </feComponentTransfer>
    <feMerge>
      <feMergeNode/>
      <feMergeNode in="SourceGraphic"/>
    </feMerge>
  </filter>   
  
<filter id="treeBlur" x="-100%" y="-100%" width="400%" height="500%">
<feGaussianBlur id="blur" in="SourceGraphic"  stdDeviation="7"/>  
  </filter>
	<linearGradient id="platformGrad" gradientUnits="userSpaceOnUse" x1="212.0816" y1="205.2852" x2="347.5501" y2="342.0884">
		<stop  offset="0" style="stop-color:#5C7880"/>
		<stop  offset="1" style="stop-color:#41626C"/>
	</linearGradient>

	<clipPath id="platformMask">
<path class="platformMask" fill="#1A3AC4" d="M300,375.3c73.2,0,133.3-27.8,139.5-63.2c0.3-2,0.5-126,0.5-126H300H160
	c0,0,0.2,124.1,0.5,126C166.7,347.4,226.8,375.3,300,375.3z"/>
	</clipPath>
	<clipPath id="dropMask">
<path class="dropMask" fill="#1A3AC4" d="M300,375.3c73.2,0,133.3-27.8,139.5-63.2c0.3-2,0.5-4,0.5-6c0-38.2-62.7-69.2-140-69.2s-140,31-140,69.2c0,2,0.2,4,0.5,6C166.7,347.5,226.8,375.3,300,375.3z"/>
	</clipPath> 
<linearGradient id="treeGrad" gradientUnits="userSpaceOnUse" x1="252" y1="200.814" x2="290" y2="223">
	<stop  offset="0" style="stop-color:#A1B491"/>
	<stop  offset="0.2432" style="stop-color:#6C9879"/>
</linearGradient>
<path id="treeBit" fill="url(#treeGrad)" d="M303.1,137.1l-76.9,85c0,0-31.1,36,15.8,55.6c46.9,19.6,99.2,18,125.9-6.5
	c26.7-24.5,17.2-33.9,0-59.7C347.8,181.2,303.1,137.1,303.1,137.1z"/>    
</defs>
  
<path class="holeWall"  fill="#241611" stroke="none" stroke-miterlimit="10" d="M300,375.3c73.2,0,133.3-27.8,139.5-63.2c0.3-2,0.5-4,0.5-6c0-38.2-62.7-69.2-140-69.2s-140,31-140,69.2c0,2,0.2,4,0.5,6C166.7,347.5,226.8,375.3,300,375.3z"/>   
<g class="dropGroup" clip-path="url(#dropMask)" >
<g class="dropAndBaseGroup" >  
<path class="dropBase" fill="#666666" d="M300,395.3c73.2,0,133.3-27.8,139.5-63.2c0.3-2,0.5-4,0.5-6c0-38.2-62.7-69.2-140-69.2
	s-140,31-140,69.2c0,2,0.2,4,0.5,6C166.7,367.5,226.8,395.3,300,395.3z"/>
<path class="drop" stroke-width="2" fill="#FAF5C8" stroke="none" stroke-miterlimit="10" d="M300,375.3c73.2,0,133.3-27.8,139.5-63.2c0.3-2,0.5-4,0.5-6c0-38.2-62.7-69.2-140-69.2s-140,31-140,69.2c0,2,0.2,4,0.5,6C166.7,347.5,226.8,375.3,300,375.3z"/>  
  </g>
  </g>
<path class="innerShadow" opacity="0" fill="#452B21" d="M440,306.1c0,2-0.2,4-0.5,6c-1.9,10.7-8.7,20.8-19.3,29.5c4.9-6.1,8.1-12.7,9.3-19.5
	c0.3-2,0.5-4,0.5-6c0-38.2-62.7-69.2-140-69.2c-51,0-95.7,13.5-120.2,33.7c20.5-25.6,71.1-43.7,130.2-43.7
	C377.3,236.9,440,267.9,440,306.1z"/>  
<path class="platformOutline"  stroke-width="2" fill="none" stroke="#F5EBB6" stroke-miterlimit="10" d="M300,375.3c73.2,0,133.3-27.8,139.5-63.2c0.3-2,0.5-4,0.5-6c0-38.2-62.7-69.2-140-69.2s-140,31-140,69.2c0,2,0.2,4,0.5,6C166.7,347.5,226.8,375.3,300,375.3z"/>  
  
<g class="filteredPlatform" filter="url(#platformShadow)">
<g class="platformGroup" clip-path="url(#platformMask)" >
	<g class="platform" >
			<path fill="#2B4B54" d="M440,294L440,294h-5v0.1l-275,0V306l0,23.3c0.3,38,63,65.8,140,65.8c77.2,0,140-27.6,140-65.8
		C440,327.2,440,294,440,294L440,294z"/>

	<path fill="url(#platformGrad)" d="M300,363.3c73.2,0,133.3-27.8,139.5-63.2c0.3-2,0.5-4,0.5-6c0-38.2-62.7-69.2-140-69.2
		s-140,31-140,69.2c0,2,0.2,4,0.5,6C166.7,335.5,226.8,363.3,300,363.3z"/>

  </g>
</g>
  </g>
  
<ellipse class="treeShadow" filter="url(#treeBlur)"  fill="#2A4B55" cx="309" cy="298" rx="95" ry="50"/>	
  
<g class="rippleGroup"  fill="none" stroke="#476871" stroke-width="2" clip-path="url(#platformMask)">
<ellipse class="ripple" stroke-width="2" fill="none" stroke="#729576" cx="330" cy="260" rx="30" ry="15"/>  
<ellipse class="ripple" cx="260" cy="290" rx="30" ry="15"/>  
 <ellipse class="ripple" cx="360" cy="290" rx="30" ry="15"/>   
  </g>
  
<path class="trunk"  fill="#866542" d="M303.8,307.5h-7c-11,0-20-9-20-20v-32c0-11,9-20,20-20h7c11,0,20,9,20,20v32
	C323.8,298.5,314.8,307.5,303.8,307.5z"/>
<use xlink:href="#treeBit" class="treeBot" />
<use xlink:href="#treeBit" y="-60"  class="treeMid" filter="url(#dropShadow)"/> 
<use xlink:href="#treeBit" class="treeTop" filter="url(#dropShadow)" y="-120"/>

<g class="rippleGroup" fill="none" stroke="#476871" stroke-width="2" clip-path="url(#platformMask)">
  <ellipse class="ripple"  cx="200" cy="300" rx="30" ry="15"/>    
  <ellipse class="ripple" cx="230" cy="300" rx="30" ry="15"/>  
  
  <ellipse class="ripple" cx="340" cy="330" rx="30" ry="15"/>    
  </g>    
</svg>



            
          
!
            
              body{
  background-color:#FAF5C8;
  overflow:hidden;
  display: flex;
  align-items: center;
  justify-content: center;   
}
body, html {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
  text-align:center;
}

svg{
  width:100%;
  height:100%;
}


            
          
!
            
              var xmlns="http://www.w3.org/2000/svg", select = function(s) {
      return document.querySelector(s);
    }, selectAll = function(s) {
      return document.querySelectorAll(s);
    },  platform = select('.platform'), platformOutline = select('.platformOutline'), drop = select('.drop'), platformGroup = select('.platformGroup'), dropAndBaseGroup = select('.dropAndBaseGroup'), dropGroup = select('.dropGroup'), holeWall = select('.holeWall'), treeBot = select('.treeBot'), treeMid = select('.treeMid'), treeTop = select('.treeTop'), trunk = select('.trunk'), innerShadow = select('.innerShadow'), treeShadow = select('.treeShadow'), allRipples = selectAll('.ripple')
//center the container cos it's pretty an' that

var isDevice = (/android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.userAgent.toLowerCase()));

var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;

TweenMax.set(platformOutline, {
  drawSVG:'0% 0%'
})

TweenMax.set([treeBot, treeMid, treeTop], {
  transformOrigin:'50% 80%'
})
TweenMax.set(treeTop, {
  scale:0.5,
  //transformOrigin:'50% 160%',
  attr:{
   // y:-220
  }
})


//optimisation for mobile devices - remove the shadow on the platform on mobile
if(isDevice){
  
  TweenMax.set('.filteredPlatform', {
    attr:{
      filter:""
    }
  })
}

TweenMax.set([trunk], {
  transformOrigin:'50% 100%'
})
TweenMax.set(allRipples, {
  transformOrigin:'50% 50%'
})

TweenMax.set(treeMid, {
  scale:0.75
})



var tl = new TimelineMax({repeat:-1});
tl.timeScale(2)
tl.to(platformOutline, 2, {
  drawSVG:'100% 0%',
  ease:Sine.easeInOut
})
.from([dropGroup, holeWall], 0.001, {
  alpha:0
})
.to(dropAndBaseGroup, 1, {
  y:60
})
.to(drop, 1, {
  fill:'#564A34'
}, '-=1')
.to(innerShadow, 0.5, {
  alpha:1,
  ease:Power1.easeIn
},'-=1')
.to(dropAndBaseGroup, 1, {
  x:280,
  ease:Back.easeIn.config(2)
})

.from(platform, 1, {
  y:180,
  ease:Back.easeOut.config(0.5)
})
.to('#platformShadowAlpha', 0.4,{
  attr:{
    slope:0.38
  }
},'-=0.5')

.from(trunk, 1, {
  scaleY:0,
  ease:Back.easeOut
})
.from(treeShadow, 1, {
  attr:{
    rx:0,
    ry:0
  } ,
  ease:Elastic.easeOut.config(1, 1.2)
},'-=1')
.staggerFrom([treeBot, treeMid, treeTop], 3, {
  scaleX:0,
  //alpha:0,
  ease:Elastic.easeOut.config(1, 1.2)
},0.1, '-=1')
.staggerFrom([treeBot, treeMid, treeTop], 3, {
  scaleY:0,
  //alpha:0,
  ease:Elastic.easeOut.config(1, 0.4)
},0.1, '-=3')
.to(treeTop, 1, {

},'-=3')
.set(innerShadow, {
  alpha:0
})
.staggerFromTo(allRipples, 4,{
  attr:{
    rx:0,
    ry:0
  }
  
}, {
  attr:{
    rx:30,
    ry:15
  },
  alpha:0
},0.2,'-=3')
.staggerTo([[platformGroup, holeWall, platformOutline], trunk,treeShadow, treeBot, treeMid, treeTop], 2, {
  x:600,
  //rotation:-53,
  ease:Back.easeIn
}, 0.02);


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

//TweenMax.globalTimeScale(0.5)
//ScrubGSAPTimeline(tl)
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console