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="splash">
  <div id="splash_text"></div>
</div>

<main>
  <div id="container">
    <p>ローディング後、この画面が見えます。<br><br>ローディングで使用したライブラリ:<a href="https://kimmobrunfeldt.github.io/progressbar.js/" target="_blank">https://kimmobrunfeldt.github.io/progressbar.js/</a></p>
    <!--/container-->
  </div>
</main>
<!--==============JQuery読み込み===============-->
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<!--プログレスバーライブラリ-->
<script src="https://rawgit.com/kimmobrunfeldt/progressbar.js/master/dist/progressbar.min.js"></script>
<!--IE11用-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js"></script>

              
            
!

CSS

              
                @charset "utf-8";

/*========= LoadingのためのCSS ===============*/

/* Loading背景画面設定 */

#splash {
  /*fixedで全面に固定*/
  position: fixed;
  z-index: 999;
  width: 100%;
  height: 100%;
  background: #222;
  text-align: center;
  color: #fff;
}

/*========= レイアウトのためのCSS ===============*/

#container {
  width: 100%;
  height: 100vh;
  background: #777;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

a {
  color: #222;
}

a:hover {
  text-decoration: none;
}

              
            
!

JS

              
                //テキストのカウントアップの設定
var bar = new ProgressBar.Line(splash_text, {//id名を指定
  strokeWidth: 0,//進捗ゲージの太さ
  duration: 1000,//時間指定(1000=1秒)
  trailWidth: 0,//線の太さ
  text: {//テキストの形状を直接指定 
    style: {//天地中央に配置
      position:'absolute',
      left:'50%',
      top:'50%',
      padding:'0',
      margin:'0',
      transform:'translate(-50%,-50%)',
      'font-size':'2rem',
      color:'#fff',
    },
    autoStyleContainer: false //自動付与のスタイルを切る
  },
  step: function(state, bar) {
    bar.setText(Math.round(bar.value() * 100) + ' %'); //テキストの数値
  }
  
});

//アニメーションスタート
bar.animate(1.0, function () {//バーを描画する割合を指定します 1.0 なら100%まで描画します
  $("#splash").delay(1000).fadeOut(1000);//アニメーションが終わったら#splashエリアをフェードアウト 
  
});  
              
            
!
999px

Console