Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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 id='container'>
  <div id="www">www</div>
 
  <svg id='svgBack' xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">
   <g class='Capsule CG'>
      <ellipse fill="#222" cx="147.806" cy="107.935" rx="6.944" ry="46.726"/>
  <path fill="#00A072" d="M224.964 61.184h-77.16c4.434 6.882 5.518 22.14 5.518 39.87v13.738c0 17.73-1.085 32.987-5.517 39.87h77.16c25.812 0 46.738-20.927 46.738-46.74 0-25.813-20.925-46.738-46.74-46.738z"/>
  </g>
  </svg>
  
  
<svg id='mySVG' xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">

  <g class='Capsule CG'>
  <ellipse fill="none" cx="147.806" cy="107.935" rx="6.944" ry="46.726"/>
  <path fill="#00A072" d="M224.964 61.184h-77.16c4.434 6.882 5.518 22.14 5.518 39.87v13.738c0 17.73-1.085 32.987-5.517 39.87h77.16c25.812 0 46.738-20.927 46.738-46.74 0-25.813-20.925-46.738-46.74-46.738z"/>
  <path opacity=".3" fill="#F1F2F2" d="M227.272 154.603c22.127-1.08 40.925-18.23 43.98-40.242-8.65 9.954-21.245 11.063-33.442 11.063-12.537 0-83.952-.717-84.875 0-.697 9.54.198 20.968-5.13 29.24 25.742-.002 53.758 1.19 79.467-.06.258-.013-.764.037 0 0z"/>
  <path opacity=".7" fill="#FFF" d="M222.35 66.955h-70.817c.717 1.97.89 4.195 1.468 6.64h74.644c10.58 0 20.386 3.295 28.466 8.902-8.492-9.568-20.472-15.542-33.76-15.542z"/>
    <text x="183" y="110" font-size="16px"  font-family="Oswald,sans-serif" opacity='0.9' fill='#fff'>GSAP</text>
  </g>
      <g class='Capsule CW'>
      <path fill="#D1D3D4" d="M27.36 107.922c0 25.813 20.927 46.74 46.74 46.74h75.706c4.433-6.883 7.517-22.14 7.517-39.87v-13.74c0-17.73-3.085-32.986-7.517-39.868H74.1c-25.814 0-46.74 20.925-46.74 46.738z"/>
      <path opacity=".3" fill="#F1F2F2" d="M53.925 125.422c-10.014 0-19.788-2.82-26.113-11.062 2.93 14.647 10.574 27.31 23.896 34.595 9.728 5.322 19.933 5.706 30.696 5.706h66.646c5.683 0 7.607-25.44 7.884-29.238H53.924z"/>
      <path opacity=".7" fill="#FFF" d="M152.532 66.955h-75.82c-13.287 0-25.266 5.974-33.757 15.542 8.08-5.607 17.886-8.902 28.466-8.902h83.06c-.578-2.445-1.23-4.67-1.948-6.64z"/>
      <text x="66" y="110" font-size="16px" font-family="Oswald,sans-serif" opacity='0.6'>Cool Ideas</text>
  </g>
</svg>

</div>


              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Oswald);

body{background-color:#444; overflow:hidden;}

svg{ position:absolute; }

#container{
  width:300px; height:300px;
  position:absolute;
  left:50%; top:40%;
  transform:translate(-50% , -50%);
}
.dot{
  border-radius:50%;
  position:absolute;
  height:12px; width:12px;
  
}

#www{
  font-family:'Oswald',tahoma;
  font-size:80px;
  color:#fff;
  position:absolute;
  left:50%; bottom:-40px;
  transform:translate(-50% , 0%);
}


#www::before{
  content:'';
  width:160px; height:12px;
  border-radius:50%;
  position:absolute;
  left:50%; top:89px;
  transform:translate(-50% , 0%);
  background-color:#333;
  z-index:-1;
}



#DiacoDesignLink,#pens{
  color: #fff;
}
              
            
!

JS

              
                /* a Pen by Diaco m.lotfollahi  : https://diacodesign.com */

var S = document.getElementById('mySVG') , container = document.getElementById('container') ;

for (i=0; i<80; i++){ 
  var I=i&1 , C = I?'#fff':'hsl('+R(130,170)+',100%,65%)';
  var Div=document.createElement('div');
  TweenLite.set(Div,{attr:{class:'dot'},x:I?90:210,y:130,scale:R(0.1,1),opacity:R(0.5,1),backgroundColor:C});
  container.insertBefore(Div,S);
};

var Dots = container.querySelectorAll(".dot");
function particles(){
  for (i=0; i<Dots.length; i++){var I=i&1 , Div=Dots[i]; anim(Div,I);};
}

function anim(E,X){
  TweenMax.to(E,R(2,4),{y:R(250,350),x:X?R(100,200):R(100,200),scale:0.5,opacity:0,ease:Linear.easeNone,repeat:-1,delay:R(0,4)});
  TweenMax.to(E,2,{xPercent:X?400:-400,repeat:-1,yoyo:true,ease:Sine.easeInOut,delay:R(1,5)});
};

var tl = new TimelineMax()
  .staggerTo(['.CW','.CG'],1,{cycle:{rotation:[45,-45],x:[-20,15],y:[-5,10]},transformOrigin:'center',ease:Back.easeOut},0,1.5)
  .addCallback(particles,'-=0.5')
  .to('.Capsule',1,{y:'+=15',repeat:-1,yoyo:true,ease:Sine.easeInOut})

function R(min,max){return min+(Math.random()*(max-min))};

/* a Pen by Diaco m.lotfollahi  : https://diacodesign.com */
              
            
!
999px

Console