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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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 id="loading">
    <ul class="stones">
        <li class="jones"></li>
        <li class="jagger"></li>
        <li class="richards"></li>
        <li class="watts"></li>
        <li class="parks"></li>
    </ul>
    <div id="matter">
        <div class="inner"></div>
    </div>
    <div id="player"></div>
</div>
              
            
!

CSS

              
                @import "compass/css3";

html, body {
    width: 100%; height: 100%;
}

#loading {
    position: relative;
    width: 100%; height: 100%;
    background: #fefefe;
    z-index: 9999;
    overflow: hidden;

    .stones {
        position: absolute;
        top: 50%; left: 50%;
        margin: -50px;
        border-radius: 50%;
        width: 100px; height: 100px;
        list-style: none;
        -webkit-animation-name: load;
        -webkit-animation-duration: 1.2s;
        -webkit-animation-timing-function: ease;
        -webkit-animation-iteration-count: infinite;
           -moz-animation-name: load;
           -moz-animation-duration: 1.2s;
           -moz-animation-timing-function: ease;
           -moz-animation-iteration-count: infinite;
            -ms-animation-name: load;
            -ms-animation-duration: 1.2s;
            -ms-animation-timing-function: ease;
            -ms-animation-iteration-count: infinite;
             -o-animation-name: load;
             -o-animation-duration: 1.2s;
             -o-animation-timing-function: ease;
             -o-animation-iteration-count: infinite;
                animation-name: load;
                animation-duration: 1.2s;
                animation-timing-function: ease;
                animation-iteration-count: infinite;
        
        li {
            position: absolute;
            margin: -5px;
            top: 50%; left: 50%;
            border-radius: 50%;
            width: 10px; height: 10px;
            background: #ccc;
            -webkit-animation-name: attack;
            -webkit-animation-duration: .6s;
            -webkit-animation-timing-function: ease;
            -webkit-animation-direction: alternate;
            -webkit-animation-iteration-count: infinite;
               -moz-animation-name: attack;
               -moz-animation-duration: .6s;
               -moz-animation-timing-function: ease;
               -moz-animation-direction: alternate;
               -moz-animation-iteration-count: infinite;
                -ms-animation-name: attack;
                -ms-animation-duration: .6s;
                -ms-animation-timing-function: ease;
                -ms-animation-direction: alternate;
                -ms-animation-iteration-count: infinite;
                 -o-animation-name: attack;
                 -o-animation-duration: .6s;
                 -o-animation-timing-function: ease;
                 -o-animation-direction: alternate;
                 -o-animation-iteration-count: infinite;
                    animation-name: attack;
                    animation-duration: .6s;
                    animation-timing-function: ease;
                    animation-direction: alternate;
                    animation-iteration-count: infinite;
        }
        
        .jones {
            margin-top: -30 - 5px;
        }
        
        .jagger {
            margin-top: -9.27 - 5px;
            margin-left: 28.53 - 5px;
        }
        
        .richards {
            margin-top: -9.27 - 5px;
            margin-left: -28.53 - 5px;
        }
        
        .watts {
            margin-top: 24.27 - 5px;
            margin-left: 17.63 - 5px;
        }
        
        .parks {
            margin-top: 24.27 - 5px;
            margin-left: -17.63 - 5px;
        }
    }
}

#matter {
    margin-top: 80px;
    position: absolute;
    top: 50%;
    left: 20%; right: 20%;
    border: solid #ccc 2px;
    border-radius: 6px;
    height: 8px;
    
    .inner {
        width: 0; height: 100%;
        background: #ccc;
        -webkit-transition: width .1s linear;
        -moz-transition: width .1s linear;
        -ms-transition: width .1s linear;
        -o-transition: width .1s linear;
        transition: width .1s linear;
    }
}

#player {
    display: none;
}

@-webkit-keyframes load {
    0% {
        -webkit-transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(360deg);
    }
}
@-moz-keyframes load {
    0% {
        -moz-transform: rotate(0deg);
    }
    100% {
        -moz-transform: rotate(360deg);
    }
}
@-ms-keyframes load {
    0% {
        -ms-transform: rotate(0deg);
    }
    100% {
        -ms-transform: rotate(360deg);
    }
}
@-o-keyframes load {
    0% {
        -o-transform: rotate(0deg);
    }
    100% {
        -o-transform: rotate(360deg);
    }
}
@keyframes load {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@-webkit-keyframes attack {
    0% {
        -webkit-transform: scale(1, 1);
    }
    100% {
        -webkit-transform: scale(1.4, 1.4);
    }
}

@-moz-keyframes attack {
    0% {
        -moz-transform: scale(1, 1);
    }
    100% {
        -moz-transform: scale(1.4, 1.4);
    }
}

@-ms-keyframes attack {
    0% {
        -ms-transform: scale(1, 1);
    }
    100% {
        -ms-transform: scale(1.4, 1.4);
    }
}

@-o-keyframes attack {
    0% {
        -o-transform: scale(1, 1);
    }
    100% {
        -o-transform: scale(1.4, 1.4);
    }
}

@keyframes attack {
    0% {
        transform: scale(1, 1);
    }
    100% {
        transform: scale(1.4, 1.4);
    }
}
              
            
!

JS

              
                (function (win, doc) {

    var tag            = doc.createElement("script"),
        firstScriptTag = doc.getElementsByTagName("script")[0];
    
    var $loading = $("#loading"), 
        $inner   = $("#matter > .inner").eq(0);
    
    tag.src = "https://www.youtube.com/iframe_api";
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
    
    function onYouTubeIframeAPIReady() {
        new YT.Player("player", {
            width   : 0, // 動画幅
            height  : 0, // 動画高さ
            videoId : "a6lJ071MeKA", // 動画ID
            events  : {
                onReady       : onPlayerReady,
                onStateChange : onPlayerStateChange
            },
            playerVars: {
                rel      : 0, // 関連動画非表示
                showinfo : 0, // 動画情報表示
                controls : 0  // コントローラー表示
            }
        });
    }
    
    function onPlayerReady(evt) { // 動画再生準備完了時イベント
        evt.target.playVideo(); // 動画再生
        evt.target.seekTo(4); // 4秒送る(目合わせ)
        setInterval(function() {
            var percent = evt.target.getCurrentTime() / 2.22; // 時間決め打ち
            
            $inner.css({width: percent + "%"});
            if ((percent | 0) >= 100) {
                $loading.animate({opacity: 0}, function() {
                    $loading.css({display: "none"});
                });
            }
        }, 1000);
    }
    
    function onPlayerStateChange(evt) { // 動画再生状態変更時イベント
        if (evt.data === 0) { // 動画停止時
//            evt.target.playVideo(); // 動画再生
        }
    }
    
    // export
    win.onYouTubeIframeAPIReady = onYouTubeIframeAPIReady;
    
})(this, document);
              
            
!
999px

Console