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

              
                <body>
  <div class="container jumbotron">
    <h1 class="text-center"><i class="fa fa-paper-plane float shadow"></i> Flyaway<a href="">.css</a></h1>
    <p class="lead text-right">~ created by <small><a href="http://takentech.com/about"><i class="glyphicon glyphicon-fire"></i> @shenlu89</a></small> ~</p>
    <p><i class="fa fa-quote-left fa-pull-left"></i>Flyaway<a href="">.css</a> is a pure CSS3 animation tool, which can help you create an vivid paper-plane animation.</p>


    <br>
    <section class="center-block">
      <button class="download" onClick="window.location='https://github.com/lushen/flyaway/archive/v0.0.2.zip'; return false;">
                <span>Download</span>
                <i class="fa fa-paper-plane"></i>
            </button>
      <small class="center-block text-center">Currently v0.0.2</small>
    </section>
    <br>
    <br>
    <section class="text-center block">
      <ul class="social list-inline">
        <li>
          <i id="demo" class="fa fa-paper-plane fa-3x float shadow"></i>
        </li>
      </ul>
    </section>
    <section class="text-center block">
      <select class="select">
                <optgroup label="Flyout">
                    <option value="pushOut">pushOut</option>
                    <option value="popUp">popUp</option>
                </optgroup>
                <optgroup label="Shake">
                    <option value="linearShake">linearShake</option>
                    <option value="rotateShake">rotateShake</option>
                </optgroup>
            </select>
      <button class="animate">Animate</button>
    </section>


  </div>
  <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  <script src="https://apps.bdimg.com/libs/jquery/2.0.0/jquery.min.js"></script>
  <!-- Include all compiled plugins (below), or include individual files as needed -->
  <script src="https://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="js/back-to-top.js"></script>
  <script type="text/javascript" src="js/flyaway.js"></script>
</body>
              
            
!

CSS

              
                * {
    transition: all .2s ease-in-out;
    outline: none;
}

@keyframes text-fade {
    0% {
        opacity: 0;
    }
}

body {
    background-color: #2d7586;
    font-family: Galdeano, "Hiragino Sans GB", "Microsoft YaHei", Trebuchet, "Trebuchet MS", Tahoma, "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif;
    color: #fff;
    animation: text-fade 2s ease-in-out;
}

@media (min-width: 768px) {
    .container {
        max-width: 750px;
        animation: text-fade 1s;
    }
}

.jumbotron {
    background-color: transparent;
}

a {
    color: #CCD1D9;
}

a:hover {
    color: rgba(170, 178, 189, 0.3);
    text-decoration: none;
}

@keyframes bounce-in {
    0% {
        padding-right: 30px;
    }
    40% {
        padding-right: 6px;
    }
    50% {
        padding-left: 30px;
    }
    100% {
        padding-left: 6px;
    }
}

.download {
    font-size: 20px;
    font-family: 'Pacifico';
    overflow: visible;
    border-radius: 3px;
    position: relative;
    padding-right: 30px;
    border: none;
    background-color: #fff;
    color: #2d7586;
    display: block;
    margin: 5px auto;
    height: 50px;
    width: 150px;
}

.download:hover {
    background-color: #fff;
}

.download:hover i {
    transform: rotate(10deg);
}

.download i {
    position: absolute;
    top: 15px;
    right: 15px;
}

.download.bounce-in {
    background-color: rgb(50, 130, 149);
    border: none;
    color: #fff;
    padding-right: 6px;
    animation: bounce-in 0.4s;
}

.block {
    height: 80px;
}

.animate {
    font-size: 20px;
    overflow: visible;
    border-radius: 4px;
    background-color: transparent;
    position: relative;
    border: 1.5px solid white;
    margin-top: 15px;
    margin-bottom: 15px;
    height: 40px;
}

.select {
    border: none;
    border-radius: 4px;
    padding: .75rem;
    margin: 15px;
    background-color: white;
    color: #2d7586;
    font-size: 20px;
}

.float {
    animation: float 4s infinite ease-in-out alternate;
}

@keyframes zoom {
    from,
    to {
        background-color: rgba(170, 178, 189, 0.3);
        transform: scale(.6) rotate(0.01deg);
    }
    50% {
        background-color: rgba(170, 178, 189, 0.6);
        transform: scale(.8) rotate(0.01deg);
    }
}

.shadow:after {
    position: relative;
    display: block;
    width: 1em;
    height: .5em;
    border-radius: 100%;
    content: "";
    animation: zoom 4s ease-in-out infinite alternate;
}

@keyframes rotateShake {
    from {
        transform: rotate(-10deg);
    }
    to {
        transform: rotate(10deg);
    }
}

@keyframes float {
    from,
    to {
        transform: transofrmY(0);
    }
    50% {
        transform: translateY(4px);
    }
}
@charset "UTF-8";

/*!
 * Flyaway.css (http://takentech.com/flyaway)
 * Version: 0.0.2
 * Author: 進擊的燊 
 * Author URL: http://takentech.com/
 * Github: https://github.com/lushen/flyaway
 * Made available under a MIT License:
 * https://www.opensource.org/licenses/mit-license.php
 */

.flyaway {
    -webkit-animation-duration: 1s;
    animation-duration: 1s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both
}

@-webkit-keyframes pushOut {
    0% {
        -webkit-transform: translate(0, 0) rotate(0) scale(1);
        transform: translate(0, 0) rotate(0) scale(1)
    }
    5% {
        -webkit-transform: translate(15px, -2px) rotate(10deg) scale(1.2);
        transform: translate(15px, -2px) rotate(10deg) scale(1.2)
    }
    20% {
        -webkit-transform: translate(130px, -2px) rotate(-20deg) scale(1.5);
        transform: translate(130px, -2px) rotate(-20deg) scale(1.5)
    }
    40% {
        -webkit-transform: translate(280px, -40px) rotate(10deg) scale(.8);
        transform: translate(280px, -40px) rotate(10deg) scale(.8);
        opacity: .8
    }
    100% {
        -webkit-transform: translate(1000px, -200px) rotate(60deg) scale(0);
        transform: translate(1000px, -200px) rotate(60deg) scale(0);
        opacity: 0
    }
}

@keyframes pushOut {
    0% {
        -webkit-transform: translate(0, 0) rotate(0) scale(1);
        transform: translate(0, 0) rotate(0) scale(1)
    }
    5% {
        -webkit-transform: translate(15px, -2px) rotate(10deg) scale(1.2);
        transform: translate(15px, -2px) rotate(10deg) scale(1.2)
    }
    20% {
        -webkit-transform: translate(130px, -2px) rotate(-20deg) scale(1.5);
        transform: translate(130px, -2px) rotate(-20deg) scale(1.5)
    }
    40% {
        -webkit-transform: translate(280px, -40px) rotate(10deg) scale(.8);
        transform: translate(280px, -40px) rotate(10deg) scale(.8);
        opacity: .8
    }
    100% {
        -webkit-transform: translate(1000px, -200px) rotate(60deg) scale(0);
        transform: translate(1000px, -200px) rotate(60deg) scale(0);
        opacity: 0
    }
}

@-webkit-keyframes popUp {
    0% {
        -webkit-transform: translate(0, 0) scale(1);
        transform: translate(0, 0) scale(1)
    }
    10% {
        -webkit-transform: translate(-10px, 10px) scale(1);
        transform: translate(-10px, 10px) scale(1)
    }
    50% {
        -webkit-transform: translate(-15px, 15px) scale(1);
        transform: translate(-15px, 15px) scale(1);
        opacity: 1
    }
    100% {
        -webkit-transform: translate(500px, -500px) scale(0);
        transform: translate(500px, -500px) scale(0);
        opacity: 0
    }
}

@keyframes popUp {
    0% {
        -webkit-transform: translate(0, 0) scale(1);
        transform: translate(0, 0) scale(1)
    }
    10% {
        -webkit-transform: translate(-10px, 10px) scale(1);
        transform: translate(-10px, 10px) scale(1)
    }
    50% {
        -webkit-transform: translate(-15px, 15px) scale(1);
        transform: translate(-15px, 15px) scale(1);
        opacity: 1
    }
    100% {
        -webkit-transform: translate(500px, -500px) scale(0);
        transform: translate(500px, -500px) scale(0);
        opacity: 0
    }
}

.flyaway.pushOut {
    -webkit-animation-name: pushOut;
    animation-name: pushOut;
    -webkit-animation-timing-function: linear;
    animation-timing-function: lienar
}

.flyaway.popUp {
    -webkit-animation-name: popUp;
    animation-name: popUp
}

.flyaway.rotateShake {
    -webkit-animation-name: rotateShake;
    animation-name: rotateShake
}

.flyaway.linearShake {
    -webkit-animation-name: linearShake;
    animation-name: linearShake
}

@-webkit-keyframes linearShake {
    10%,
    20%,
    30%,
    40%,
    50%,
    60%,
    70%,
    80%,
    90%,
    from,
    to {
        -webkit-transform: translateX(-4px);
        transform: translateX(-4px)
    }
    15%,
    25%,
    35%,
    45%,
    5%,
    55%,
    65%,
    75%,
    85%,
    95% {
        -webkit-transform: translateX(4px);
        transform: translateX(4px)
    }
}

@keyframes linearShake {
    10%,
    20%,
    30%,
    40%,
    50%,
    60%,
    70%,
    80%,
    90%,
    from,
    to {
        -webkit-transform: translateX(-4px);
        transform: translateX(-4px)
    }
    15%,
    25%,
    35%,
    45%,
    5%,
    55%,
    65%,
    75%,
    85%,
    95% {
        -webkit-transform: translateX(4px);
        transform: translateX(4px)
    }
}

@-webkit-keyframes rotateShake {
    10%,
    20%,
    30%,
    40%,
    50%,
    60%,
    70%,
    80%,
    90%,
    from,
    to {
        -webkit-transform: rotate(-10deg);
        transform: rotate(-10deg)
    }
    15%,
    25%,
    35%,
    45%,
    5%,
    55%,
    65%,
    75%,
    85%,
    95% {
        -webkit-transform: rotate(10deg);
        transform: rotate(10deg)
    }
}

@keyframes rotateShake {
    10%,
    20%,
    30%,
    40%,
    50%,
    60%,
    70%,
    80%,
    90%,
    from,
    to {
        -webkit-transform: rotate(-10deg);
        transform: rotate(-10deg)
    }
    15%,
    25%,
    35%,
    45%,
    5%,
    55%,
    65%,
    75%,
    85%,
    95% {
        -webkit-transform: rotate(10deg);
        transform: rotate(10deg)
    }
}

              
            
!

JS

              
                function animate(x) {
    $('#demo').removeClass('float shadow').addClass('flyaway ' + x).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
        $('#demo').addClass('shadow float').removeClass('flyaway ' + x);
    });
};

$(document).ready(function() {
    $('.download').click(function() {
        $(this).addClass('bounce-in').find('span').text(function(span, text) {
            return "Success!";
        });
        $(this).find('i').addClass('flyaway pushOut').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
            $('.download').find('i').removeClass('flyaway pushOut');
            $('.download').removeClass('bounce-in').find('span').text(function(span, text) {
                return "Download";
            });
        });
    });
    $('.animate').click(function(e) {
        e.preventDefault();
        var anim = $('.select').val();
        animate(anim);
    });
});

              
            
!
999px

Console