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

              
                <div class='bg-img '></div>
<div id='text'>GSAP</div>
<div id='roof'></div>
<svg  xmlns="http://www.w3.org/2000/svg" width="300" height="301" viewBox="0 0 300 301">
  <defs>
  <filter id="glow" x="-150%" y="-150%" height="500%" width="500%">
  <feGaussianBlur stdDeviation="15" result="coloredBlur"/>
  <feMerge>
  <feMergeNode in="coloredBlur"/>
  <feMergeNode in="SourceGraphic"/>
  </feMerge>
  </filter>
  </defs>
  <text id="T" x="170" y="70" fill="white" font-family="arial" font-size="1em" > ▼ Drag this :)</text>
  <path fill="#00665a" d="M177.142 6.195c0 3.953-2.8 7.157-6.25 7.157H129.11c-3.453 0-6.25-3.204-6.25-7.157V2.658S122.5 0 149.404 0s27.738 2.658 27.738 2.658v3.537z"/>
  <ellipse fill="#8DC63F" cx="150" cy="12" rx="23.685" ry="2.938"/>
  <g id='lamp'>
  <ellipse id='LI' filter="url(#glow)" fill="#D1D3D4" cx="149.706" cy="113.756" rx="70.653" ry="15.92"/>
  <path id='LWM' fill="none" stroke="none" d="M150 13.315v241.018"/>
  <path id='LW' fill="none" stroke="#111" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M151.422 12.315c0 1.623-10.422 1.623-10.422 3.247 0 1.624 18 1.624 18 3.247 0 1.62-18 1.62-18 3.24s18 1.62 18 3.25-18 1.62-18 3.242 18 1.624 18 3.25c0 1.62-18 1.62-18 3.24 0 1.625 18 1.625 18 3.248 0 1.62-18 1.62-18 3.244 0 1.623 18 1.623 18 3.25s-18 1.62-18 3.245c0 1.622 18 1.622 18 3.246s-18 1.624-18 3.25 18 1.624 18 3.25-18 1.624-18 3.25c0 1.623 18 1.623 18 3.25 0 1.623-18 1.623-18 3.247 0 1.627 18 1.627 18 3.253 0 1.628-18 1.628-18 3.255s10.422 1.628 10.422 3.255"/>
  <path id='L3' fill="#414042" d="M141.733 79.335c0-1.052.853-1.904 1.904-1.904h12.726c1.052 0 1.904.86 1.904 1.91v1.38h-16.534v-1.38z"/>
  <path id='L2' fill="#00665a" d="M150.028 79.796c-19.026 0-30.81 4.118-30.81 7.35v4.5h61.693v-4.5c.01-3.232-11.85-7.35-30.88-7.35z"/>
  <circle id='LB' filter="url(#glow)" fill="#FFF" cx="150" cy="109" r="13.333"/>
  <path id='L1' fill="#8DC63F" d="M149.647 84.837c-48.23 0-70.567 14.723-70.567 22.126v7.016s6.415-15.91 70.652-15.91 70.652 15.91 70.652 15.91v-7.02c0-7.4-27.632-22.13-70.737-22.13v.006z"/>
  <path id='L2M' fill="none" stroke="none" d="M149.963 250.38c-19.026 0-30.81 5.118-30.81 8.35v4.5h61.693v-4.5c.01-3.232-11.85-8.35-30.88-8.35h-.003z"/>
  <path id='L1M' fill="none" stroke="none" d="M149.915 261.504c-9.97 0-20.726-.02-30.762 1.556-21.563 3.386-39.805 9.518-39.805 14.57v6.728s3.632-.622 70.652-.622 70.652.622 70.652.622v-6.728c0-5.042-18.248-11.16-39.806-14.55-10.096-1.587-20.917-1.576-30.93-1.576z"/>
  </g>
</svg>



              
            
!

CSS

              
                html,body,.bg-img{width: 100%;height: 100%;}
body{
  background-color:gray;
  margin:0px; padding:0px;
  -webkit-user-select: none;  
  -moz-user-select: none;    
  -ms-user-select: none;      
  user-select: none;
  background-image:url('https://s-media-cache-ak0.pinimg.com/736x/89/ed/e5/89ede56bcc8243787e55676ab28f287f.jpg');
  background-size:350px 250px;
}

.bg-img{
  position: absolute;
  top:0; right:0; bottom:0; left:0;
  background: -moz-linear-gradient(top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.9)), color-stop(100%,rgba(0,0,0,0)));
  background: -webkit-linear-gradient(top, rgba(0,0,0,0.9) 0%,rgba(0,0,0,0) 100%);
  background: -o-linear-gradient(top, rgba(0,0,0,0.9) 0%,rgba(0,0,0,0) 100%);
  background: -ms-linear-gradient(top, rgba(0,0,0,0.9) 0%,rgba(0,0,0,0) 100%);
  background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%,rgba(0,0,0,0) 100%);
}


svg{
  overflow:visible;
  position:absolute;
  left:50%; top:15px;
  transform: translate(-50% , 0%);
}
#roof{
  position:absolute;
  left:0px; top:0px;
  width:100%; height:45px;
  background-color:#444;
}
#roof::before{
  content:'';
  position: absolute;
  top:0; right:0; bottom:0; left:0;
  background: -moz-linear-gradient(top, rgba(0,0,0,0) 50%, rgba(0,0,0,0.2) 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(50%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,0.2)));
  background: -webkit-linear-gradient(top, rgba(0,0,0,0) 50%,rgba(0,0,0,0.2) 100%);
  background: -o-linear-gradient(top, rgba(0,0,0,0) 50%,rgba(0,0,0,0.2) 100%);
  background: -ms-linear-gradient(top, rgba(0,0,0,0) 50%,rgba(0,0,0,0.2) 100%);
  background: linear-gradient(to bottom, rgba(0,0,0,0) 50%,rgba(0,0,0,0.2) 100%);
}

#text{
  position:absolute;
  left:50%; top:240px;
  transform:translate(-50%,0%);
  font-size:110px;
  white-space: nowrap;
  font-family:'Oswald', tahoma;
  color:rgba(0,0,0,0.7);
  mix-blend-mode: overlay;
}


              
            
!

JS

              
                /* a Pen by Diaco m.lotfollahi  : https://diacodesign.com */
var D=document.createElement('div') ,
    E=Linear.easeNone,F=1,
    tl=new TimelineMax({paused:true})
    .to("#L1",2,{morphSVG:"#L1M",ease:E},0)
    .to("#L2",2,{morphSVG:"#L2M",ease:E},0)
    .to("#LW",2,{morphSVG:"#LWM",ease:E},0)
    .to("#L3",2,{y:170,ease:E},0)
    .to("#LB",2,{y:170,ease:E},0)
    .to("#LI",2,{y:183,scaleY:0.12,ease:E},0);
var W=TweenMax.from("#LB,#LI",0.15,{fill:'#222',repeat:1,paused:true,immediateRender:false});
var V=new TimelineLite({paused:true})
  .to('#lamp',1,{transformOrigin:'center top',rotation:1.7,ease:Sine.easeInOut})
  .to('#lamp',2,{rotation:-1.7,ease:Sine.easeInOut})
  .to('#lamp',12,{rotation:0,ease:Elastic.easeOut})
Draggable.create(D,{
  type:'y',throwProps:true,bounds:{minY:0,maxY:150},
  trigger:"#lamp",edgeResistance:1,minDuration:1,
  onDrag:Update,onThrowUpdate:Update,
  onPress:function(){
    if(F){TweenLite.to('#T',0.5,{opacity:0}); F=0;}
    W.play(0);  V.pause();
  },
  onRelease:function(){V.play(0); W.play(0);},
  ease:Bounce.easeOut,snap:[0,150]
})
function Update(){tl.progress(Math.abs(this.y/150))};
/* a Pen by Diaco m.lotfollahi  : https://diacodesign.com */
              
            
!
999px

Console