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

              
                <h2>Material Circle Button</h2>
<div class="wrapper">
  <button class="circle">
     <img src="https://ssl.gstatic.com/bt/C3341AA7A1A076756462EE2E5CD71C11/2x/btw_ic_speeddial_white_24dp_2x.png" alt="" />
  </button>
  
</div>
              
            
!

CSS

              
                //colors
$bg: #EEEEEE
$circle: #3F51B5
$sub-circle: #F50057

//reset
button
  border: none
  outline: none

//demo  
body
  font-family: 'PT Sans', sans-serif
  background-color: $bg
h2
  margin: 100px auto
  font-weight: 400
  text-align: center
footer
  .demo
    position: absolute
    bottom: 10px
    width: 500px
    margin: 0 auto
    a
      text-align: center
      color: #000
      text-decoration: none
      font-weight: 100
      border-bottom: 1px solid #000
      
.wrapper
  position: absolute
  top: 50%
  left: 50%
  transform: translate(-50%, -50%)
  width: 60px
  height: 60px
  
  
//Big circle
.circle
  position: relative
  padding: 0
  z-index: 98
  margin: 0 auto
  -webkit-box-shadow: 0 6px 10px 0 rgba(0,0,0,0.3)
  box-shadow: 0 6px 10px 0 rgba(0,0,0,0.3)
  border-radius: 50%
  height: 60px
  width: 60px
  background-color: $circle
  display: flex
  transition: 0.2s
  text-align: center
  
  // Rotate add icon 
  img
    margin: auto
    width: 30px
    height: 30px
    // line-height: 65px
    transition: 0.5s
    transform: rotate(180deg)
  
  &:focus img
    transform: rotate(405deg)
    
  &:hover, &:focus
    cursor: pointer
    background-color: lighten($circle, 10%)
    -webkit-box-shadow: 0 8px 15px 0 rgba(0,0,0,0.3)
    box-shadow: 0 8px 15px 0 rgba(0,0,0,0.3)
   
  $transalteValue: 100 //Distance between small and big circle 
  $translate75: $transalteValue*0.75 
  $transition: 0.1 //Coefficient time 
  
  &:focus ~ .subs button:nth-of-type(1)
    transform: translate(0px, -$transalteValue + px) scale(1)
    opacity: 1
    transition: $transition + s
  &:focus ~ .subs button:nth-of-type(2)
    transform: translate($translate75 + px, -$translate75 + px) scale(1)
    opacity: 1
    transition: $transition * 2 + s
  &:focus ~ .subs button:nth-of-type(3)
    transform: translate($transalteValue + px, 0px) scale(1)
    opacity: 1
    transition: $transition * 3 + s
  &:focus ~ .subs button:nth-of-type(4)
    transform: translate($translate75 + px, $translate75 + px) scale(1)
    opacity: 1
    transition: $transition * 4 + s
  &:focus ~ .subs button:nth-of-type(5)
    transform: translate(0px, $transalteValue + px) scale(1)
    opacity: 1
    transition: $transition * 5 + s
  &:focus ~ .subs button:nth-of-type(6)
    transform: translate(-$translate75 + px, $translate75 + px) scale(1)
    opacity: 1
    transition: $transition * 6 + s
  &:focus ~ .subs button:nth-of-type(7)
    transform: translate(-$transalteValue + px, 0px) scale(1)
    opacity: 1
    transition: $transition * 7 + s
  &:focus ~ .subs button:nth-of-type(8)
    transform: translate(-$translate75 + px, -$translate75 + px) scale(1)
    opacity: 1
    transition: $transition * 8 + s
   
.sub-circle
  z-index: 0
  position: absolute
  background-color: $sub-circle
  height: 40px
  width: 40px
  border-radius: 50%
  transition: 0.3s
  transform: scale(0.5) 
  opacity: 0
  -webkit-box-shadow: 0 6px 10px 0 rgba(0,0,0,0.3)
  box-shadow: 0 6px 10px 0 rgba(0,0,0,0.3)
  
  &:hover
    cursor: pointer
    background-color: lighten($circle, 10%)
    -webkit-box-shadow: 0 8px 15px 0 rgba(0,0,0,0.3)
    box-shadow: 0 8px 15px 0 rgba(0,0,0,0.3)

.subs
  left: -20px
  top: -50px
  width: 40px
  height: 40px
  text-align: center
  z-index: 0
  margin: 0 auto
  position: relative
  
  

              
            
!

JS

              
                
              
            
!
999px

Console