cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <div class='desc'>pls Click the Lamp ... :)</div>


<div id='text'>Power of GSAP</div>

<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 400 400">
  <defs>
  <filter id="glow" x="-50%" y="-50%" height="200%" width="200%">
  <feGaussianBlur stdDeviation="10" result="coloredBlur"/>
  <feMerge>
  <feMergeNode in="coloredBlur"/>
  <feMergeNode in="SourceGraphic"/>
  </feMerge>
  </filter>
  </defs>
  <linearGradient id="a" gradientUnits="userSpaceOnUse" x1="197.5" y1="32" x2="197.5" y2="160">
  <stop offset="0" stop-color="#FFF" stop-opacity=".15"/><stop offset="0.9" stop-color="#FFF" stop-opacity="0"/>
  </linearGradient>
  <g id='myLamp'>
  <path d="M177.93 374.025s10.096 5.076 12.288 6.02c2.19.947 3.926 1.902 6.75 1.902 2.8 0 6.74-1.635 6.74-1.635l14.25-6.5-40.028.213z"/>
  <path fill="#555" d="M147.36 297.813s-1.347 5.358 1.113 9.043c2.48 3.686 1.525 2.02 1.525 2.02s-.973 3.2 3.72 5.822c-2.484 1.54-4.83 4.51-4.83 6.415 0 1.91 3.848 4.52 3.848 4.52-1.088.83-3.71 3.687-3.71 6.305 0 2.623 3.58 4.878 3.58 4.878s-3.024 2.498-3.024 6.053c0 3.57 3.57 5.22 3.57 5.22s-2.875 2.85-1.504 6.43c1.378 3.56 4.684 4.87 8.542 8.2 3.837 3.32 13.198 9.28 17.74 11.3 4.132 1.29 28.502 5.11 41.018-.71 12.53-5.83 20.778-12.02 21.47-13.8.69-1.78.417-2.26.417-2.26s5.646-4.28 5.098-8.09c-.564-3.79-2.078-5.59-2.078-5.59s2.76-4.03 2.626-6.54c-.14-2.49-2.47-4.864-2.47-4.864s2.62-3.34 2.48-6.553c-.14-3.216-2.75-4.99-2.75-4.99s3.86-1.666 3.03-6.78c-.82-5.107-1.65-6.29-.82-8.31.826-2.025 1.096-6.226.55-8.237-1.53.825-10.87 9.54-49.4 9.54-41.03 0-49.72-9.044-49.72-9.044l-.02.02z"/>
  <path opacity=".1" fill="#FFF" d="M233.24 321.784s4.066-1.75 3.192-7.125c-.864-5.368-1.738-6.61-.864-8.734.87-2.128 1.153-3.39.58-5.503-.824.443-3.81 2.227-11.933 3.867-.146.503-.34 1.033-.586 1.637-.875 2.123 0 3.366.863 8.733.874 5.374-3.192 7.125-3.192 7.125s2.75 1.864 2.898 5.244c.147 3.375-2.612 6.885-2.612 6.885s2.454 2.496 2.602 5.112c.14 2.636-2.766 6.87-2.766 6.87s1.595 1.893 2.19 5.875c.576 4.004-5.37 8.5-5.37 8.5s.287.505-.44 2.376c-.7 1.8-3.656 7.917-16.017 13.83 1.86-.03 3.117-.187 5.698-.5 5.26-.636 5.202-.905 7.435-1.395 10.796-5.463 14.175-10.274 14.823-11.936.728-1.87.44-2.375.44-2.375s5.947-4.498 5.37-8.5c-.594-3.984-2.19-5.875-2.19-5.875s2.908-4.235 2.767-6.87c-.147-2.618-2.602-5.113-2.602-5.113s2.76-3.51 2.612-6.886c-.148-3.38-2.897-5.244-2.897-5.244z"/>
  <path fill="#333" d="M147.387 296.763s-1.85-8.527 47.863-8.527c49.716 0 51.157 5.81 51.43 8.527 0 1.76-1.333 12.328-49.588 12.328-45.237 0-50.63-9.89-49.716-12.32l.01-.007z"/>
  <path fill="none" opacity='.15' stroke="#fff" stroke-width="3" d="M206.024 305.667s-1.667-71 2.333-83 46-83.333 46-83.333.903-1.95-1.228-2.34c-1.278-.23-5.45 8.462-5.45 8.462m-100.137 0s-4.173-8.693-5.448-8.46c-2.13.386-1.228 2.338-1.228 2.338s42 71.333 46 83.333 2.332 83 2.332 83"/>
  <path opacity=".2" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M219.446 304.5v-31c0-6.65-2.977-8.602-7.667-12.606v-22.56c0-2.76-6.836-5-6.836-5v-28c0-.574 4.667-2.935 4.667-4.5S208.346 198 206.78 198h-18.333c-1.565 0-2.833 1.27-2.833 2.833s4.667 3.926 4.667 4.5v28s-6.83 2.24-6.83 5v22.56c-4.69 4.005-7.667 5.956-7.667 12.606v30.622"/>
  <path id='blob' filter="url(#glow)" stroke="rgba(255,255,255,0.2)" stroke-width="3" opacity=".5" fill="rgba(0,0,0,0.5)" d="M288.22 220.188c18.313-21.067 29.402-48.582 29.402-78.688 0-66.274-53.726-120-120-120s-120 53.726-120 120c0 30.106 11.088 57.62 29.402 78.688 7.48 10.855 14.42 18.23 17.413 21.938 12.053 14.933 10.043 39.487 10.043 39.487 0 8.916 3.65 13.387 10.605 17.206 5.976 3.28 27.387 8.03 52.507 8.03 25.12 0 46.588-4.755 52.567-8.03 6.97-3.82 10.604-8.29 10.604-17.207 0 0-2.01-24.554 10.043-39.487 2.993-3.71 9.934-11.083 17.413-21.938z"/>
  <ellipse fill="url(#a)" cx="197.5" cy="92" rx="88.5" ry="65"/>
  <path opacity=".2" d="M241.75 343.25s-14 7-41.5 8-45.5-3-45.5-3m83.833 6.833s-11 7-38.5 8-39.5-3-39.5-3M241.75 332.5s-14 7-41.5 8-45.5-3-45.5-3m87.5-16.75s-16 7-43.5 8-43.5-3-43.5-3m86.5-16s-16 7-43.5 8-43.5-3-43.5-3" fill="none" stroke="#000" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10"/>
  <g id="lightningG" opacity='0'>
  <path id="lightning" stroke="rgba(0,238,255,0.1)" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" fill="none" d="M0,0 L105,0"/>
  <path id="lightning1" stroke="rgba(0,238,255,0.3)" stroke-linecap="round" stroke-linejoin="round" stroke-width="5" fill="none" d="M0,0 L105,0"/>
  <path id="lightning2" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1" fill="none" d="M0,0 L105,0"/>
  </g>
  <path opacity=".07" fill="none" stroke="#FFF" stroke-width='2' stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M180.328 268.73s4.572 2.207 17.027 2.207 17.973-2.207 17.973-2.207m-28.508-30.043s2.877 1.388 10.71 1.388 11.306-1.388 11.306-1.388M191.32 202.75s1.7.762 6.333.762c4.632 0 6.683-.763 6.683-.763"/>
  <text x="197" y="284" fill="#fff" font-size="12px" text-anchor="middle" font-family="sans-serif" opacity='0.2'>GSAP</text> 
  </g>
</svg>

<div id='links'>
<a id='twitter' href="https://twitter.com/Diaco_ml" target="_blank"><span class='fa fa-twitter'></span></a>
<div id='pens'><a href="http://codepen.io/collection/DgYoEw/" target="_blank"><span class='fa fa-codepen'></span></a> my other Pens</div>
</div>

            
          
!
            
              body{
  background-color:#252525;
  -webkit-user-select: none;  
  -moz-user-select: none;    
  -ms-user-select: none;      
  user-select: none;
  overflow:hidden;
}
svg{
  position:absolute;
  left:50%; top:25px;
  transform:translate(-50% , 0%);
  overflow:visible;
}
#myLamp{
  cursor: pointer;
}

#text{
  position:absolute;
  left:50%; top:390px;
  transform:translate(-50%,0%);
  font-size:7vw;
  white-space: nowrap;
  font-family:'Oswald', tahoma;
  color:rgba(0,145,145,0.2);
  text-shadow:0px 0px 20px #000 , 0px 1px 20px #000 , -1px -3px 0 rgba(255,255,255,0.1);
}

.desc{
  position:absolute;
  top:10px;left:10px;
  color:#eee;
  font-size:17px;
  font-family:arial;
}

@media(max-width: 700px) {
  #text{ top:410px; font-size:10vw; }
}


#links{position:absolute;bottom:0px;left:0px;width:100%;height:50px;font-size:13px;font-family:tahoma;color:#fff;}
#links a{text-decoration:none;font-size:2.3em;color:#fff;}
#twitter{position:absolute;bottom:15px;right:20px;}
#pens{position:absolute;bottom:15px;left:20px;}
            
          
!
            
              /* Pen by DIACO : twitter.com/Diaco_ml || codepen.io/MAW
powered by GSAP : http://www.greensock.com/
*/

var DOC=document, F=0 , 
    l0=DOC.getElementById('lightning'),
    l1=DOC.getElementById('lightning1'),
    l2=DOC.getElementById('lightning2'),
    bl=DOC.getElementById('blob'),
    lNoise=DOC.createElement('audio'),
    TwL=TweenLite , M=Math ; 
lNoise.src = 'http://www.freesound.org/data/previews/170/170612_1015240-lq.mp3'; lNoise.volume=.4; 
DOC.getElementById('myLamp').addEventListener('click',POn);
function POn(){
  TwL.set('#lightningG',{opacity:1});
  F=1;  lNoise.currentTime=0.4; lNoise.play();  T();
  TwL.delayedCall(2.2*M.random(),POff);
};

function POff(){  
  F=0;  
  lNoise.pause(); 
  TwL.to('#lightningG',0.2,{opacity:0}); 
  TwL.to('#text',0.5,{color:'rgba(0,145,145,0.2)'});
  TwL.to(bl,0.3,{fill:"hsla(190,100%,0%,0.5)"});
};

function T(){
  if(!F){return false};
  var L=106,C=R(3,11),PC=L/C,A=[],D=4.5,NP='M',S=R(1,2)*0.01,B=R(-2,5),RF=0.4;
  for (var i=0;i<C;i++){if(i<(C/2)){A.push([i*PC,R(-D,D)*i])}else{ A.push( [i*PC,R(-D,D)*(C-i)])}};
  for(var i=0;i<C;i++){
    if(i!=0 && i!=C-1){
    var P=f(A[i-1],A[i],RF) , p=f(A[i],A[i+1],1-RF);
    NP+=' L'+P[0]+','+P[1];
    NP+=' Q'+A[i][0]+','+A[i][1];
    NP+=' '+p[0]+','+p[1];
    }else if(i==C-1){NP+=' T'+L+','+0}else{NP+=" "+A[i][0]+','+A[i][1]}
  };
  At(l0,"stroke-width",B+12);  At(l1,"stroke-width",B+6);  At(l2,"stroke-width",B); 
  TwL.to(bl,S,{fill:"hsla(190,100%,"+M.random()*12+"%,0.5)"});
  TwL.to('#text',S,{color:'rgba(0,145,145,'+M.random()+')'});
  TwL.to([l0,l1],S,{morphSVG:{d:NP}});
  TwL.to(l2,S,{morphSVG:{d:NP},delay:S,onComplete:T});
  function f(p,P,d){ return [(p[0]-P[0])*d+P[0],(p[1]-P[1])*d+P[1]]};
};
function At(el,a,v){el.setAttribute(a,v)};
function R(min,max){return M.round(min+M.random()*(max-min))};
TwL.set("#lightningG",{x:146,y:141});

// a Pen by DIACO : twitter.com/Diaco_ml || codepen.io/MAW 

            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console