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="container">
<div class="fab" id="fab">
  
  
<svg class="plane" width="24px" height="24px" viewBox="9556 3723 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <g id="sendplane" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(9556.000000, 3723.000000)">
        <g id="Group">
            <polygon id="Shape" fill="#FFFFFF" points="2.01 21 23 12 2.01 3 2 10 17 12 2 14"></polygon>
            <polygon id="Shape" points="0 0 24 0 24 24 0 24"></polygon>
        </g>
    </g>
</svg>

  
<svg class="check" width="29px" height="21px" viewBox="9558 3864 29 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <path class="checkmark" d="M9559.5,3874 L9568.01469,3882.51469 L9584.76635,3865.76304" id="Path-2" stroke="#FFFFFF" stroke-width="2.8" fill="none"></path>
</svg>


</div>
</div>
              
            
!

CSS

              
                body{
  background-color: #eeeeee;
}

.vbox{
  display: flex;
  flex-direction: column;
}

.hbox{
  display: flex;
  flex-direction: row;
}
.align-center{
  justify-content: center;
}
.container{
  margin-top: 50vh;
  display: flex;
  position: relative;
  align-items:center;
  height: 100%;
  left: 500px;
  width: 100%;
}
.fab{
  border-radius: 50%;
  background-color: #6EC8F2;
  width: 60px;
  height: 60px;
  box-shadow: 0px 2px 4px rgba(0,0,0,0.15);
  cursor: pointer;
  .plane{
    position: absolute;
    left: 20px;
    top: 18px;
  }
  .check{
    position: absolute;
    top: 20px;
    left: 16px;
  }
}
              
            
!

JS

              
                var tl = new TimelineMax({paused: true});  

tl
.to('#sendplane', 1.2, {rotation: -40, opacity: 0, x: '+=100', ease: Elastic.easeIn.config(1, .9), onComplete: resetPlane})
.to('.fab', .25, {scale: 1.2, boxShadow: '0px 10px 22px rgba(0,0,0,0.1)'}, '-=1.2')
.to('.fab', 1.6, {rotationY: -360, backgroundColor: '#4c96bb', ease: Elastic.easeIn.config(1, .9)}, '-=1.4')  
.fromTo('.checkmark', .5, {drawSVG: '0%'}, {drawSVG: '100%'})
.to('.fab', 1.6, {rotationY: 0, backgroundColor:'#6EC8F2', ease: Elastic.easeIn.config(1, .9)}) 
.to('.checkmark', .3, {opacity: 0}, '-=.9')
.to('#sendplane', .8, {x: '+=100',opacity: 1}, '-=.4')
.to('.fab', .25, {scale: 1,boxShadow: '0px 2px 4px rgba(0,0,0,0.15)'})

function resetPlane(){
  TweenMax.set('#sendplane', {x:'-=200', rotation: 0, opacity: 1})
}

document.getElementById('fab').addEventListener('click', function(){
  if(!tl.isActive()){
    tl.restart()
  }
})

//Hover State
var tlhover = new TimelineMax({paused: true})
.to('.fab', .25, {scale: 1.03, transformOrigin: '50% 50%',boxShadow: '0px 3px 6px rgba(0,0,0,0.15)'})

document.getElementById('fab').addEventListener('mouseover', function(){
  if(!tl.isActive()){
    tlhover.restart()
  } 
})

document.getElementById('fab').addEventListener('mouseout', function(){
  if(!tl.isActive()){
    tlhover.reverse()
  }
})

//TweenMax.set('.fab', {perspective: 200})

              
            
!
999px

Console