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

              
                  <!-- ローディング画面 -->
  <div class="my-custom-loader-wrapper" id="my-custom-loader-wrapper">
    <video autoplay muted playsinline loop width="400px">
      <source type="video/mp4" src="https://prograshi.com/wp-content/uploads/2024/07/e02c92e4f1021c56ee8c3af2999642bb.mp4" />
    </video>
  </div>

  <!-- ファーストビュー -->
  <div class="my-first-view">
    <a href="javascript:location.reload()" class="my-reload-btn">リロード</a>
    <a href="javascript:sessionStorage.clear()" class="my-reload-btn my-session-clear-btn">セッションクリア</a>
  </div>
              
            
!

CSS

              
                  /* ローディング画面終了後のファーストビューのCSS */
  .my-first-view{
    height: 100vh;
    background-image: url(https://prograshi.com/wp-content/uploads/2024/06/image-125.jpg);
    background-size: cover;
    background-repeat: no-repeat;
  }

  /* リロードボタン */
  .my-reload-btn {
    position: absolute;
    bottom: 20px;
    left: 30%;
    transform: translate(-50%, -50%);
    padding: 10px;
    font-size: 14px;
    color: #fff;
    background-color: #E00022;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
  }

  .my-reload-btn:hover {
    background-color: #e000228e;
  }

  .my-session-clear-btn{
    left: 60%;
    color: black;
    background-color: yellow;
  }

  .my-session-clear-btn:hover{
    background-color: rgba(255, 255, 0, 0.7);
  }
  
  /* ローディング画面のCSS */
  .my-custom-loader-wrapper{
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index: 100;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    ali
              
            
!

JS

              
                ////////////初回セッションのみ/////////
document.addEventListener('DOMContentLoaded', () => {
  // ローディング画面を非表示にする関数
  const end_loader = () => {
    const loader = document.getElementById('my-custom-loader-wrapper');
    loader.style.transition = 'opacity 0.4s';
    loader.style.opacity = '0';
    setTimeout(() => {
      loader.style.display = 'none';
    }, 400);
  }

  // 初回セッションかどうかを確認する関数
  const isFirstSession = () => {
    return !sessionStorage.getItem('hasVisited');
  }

  // 初回セッションの場合にローディング画面の終了処理を実行
  if (isFirstSession()) {
    window.addEventListener('load', () => {
      setTimeout(() => {
        end_loader();
        // 初回セッションが終了したことを記録
        sessionStorage.setItem('hasVisited', 'true');
      }, 3000);
    });
  } else {
    // 初回セッションではない場合、ローディング画面を非表示にする
    end_loader();
  }
});
              
            
!
999px

Console