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="CurtainObject"></div>
<a class="Curtainlink" href="https://anke-to.net/">
  リンク
</a>
              
            
!

CSS

              
                /* bodyにScreenCurtainクラスが追加したら */
body.ScreenCurtain .CurtainObject{
  /* 画面を覆うカーテンオブジェクトを生成 */
  display: block;  /* 横幅いっぱいのブロック */
  position:fixed;  /* スクロールしても固定 */
  z-index: 999;    /* 最前面に表示 */
  width: 100vw;    /* 横幅は画面最大 */
  height: 100vh;   /* 縦幅は画面最大 */
  top: 0;          /* 表示開始位置縦 */
  left: 0;         /* 表示開始位置横 */
  background-color: #f9ca9e; /* オブジェクトの色 */
  
  /* カーテンアニメーション設定 */
  animation-name:CurtainAnime; /* アニメーション名 */
  animation-duration:0.5s;  /* アニメ時間 */
  animation-timing-function:ease-in-out; /* 遅い>早い>遅い */
  animation-fill-mode:forwards; /* 最後状態を最後まで保持 */
}

@keyframes CurtainAnime{
  0% {
    /* 左端を原点に */
    transform-origin:left;
    /* 最小スケールに縮めておく */
    transform:scaleX(0);
  }
  100% {
    /* 左端を原点に */
    transform-origin:left;
    /* 最大スケールにもどす */
    transform:scaleX(1);
  }
}
              
            
!

JS

              
                //画面ロード時に画面のカーテンを解除
$(function() {
  $('body').removeClass('ScreenCurtain');
});

//クリック時にカーテンを表示
$(".Curtainlink").on('click',function(event){
  event.preventDefault();
  let hrefurl = $(this).attr('href');
  
  $('body').addClass('ScreenCurtain');
  setTimeout(function(){
    window.location = hrefurl;  // 0.5秒待機(アニメ時間)
  }, 500);
  
 });

// ブラウザバックで戻ったとき画面のカーテンを解除
window.onpageshow = function(event) {
  // キャッシュから画面をロードした場合
  if (event.persisted) {
    $('body').removeClass('ScreenCurtain');
  }
};
              
            
!
999px

Console