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

              
                <head>
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <!--==============レイアウトを制御する独自のCSSを読み込み===============-->
  <link rel="stylesheet" type="text/css" href="https://dl.dropbox.com/s/0z920nydj51coo7/reset3.css?dl=0">
  <!--==============スライダープラグイン「Vegas Background SlideShow」のCSSを読み込み===============-->
  <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/vegas/2.4.4/vegas.min.css">
</head>

<body>
  <div class="wrapper">
    <div id="slider">
      <h1>Slide show</h1>
      <!--/slider-->
    </div>
    <!--/wrapper-->
  </div>
  <div class="container">
    <p>使用したライブラリ:<a href="https://vegas.jaysalvat.com/" target="_blank">https://vegas.jaysalvat.com/</a></p>
    <!--/container-->
  </div>

  <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/vegas/2.4.4/vegas.min.js"></script>
</body>
              
            
!

CSS

              
                @charset "utf-8";

/*==================================================
スライダーのためのcss
===================================*/
#slider {
  width: 100%;
  height: 100vh; /*スライダー全体の縦幅を画面の高さいっぱい(100vh)にする*/
}

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

a {
  color: #fff;
}

a:hover,
a:active {
  text-decoration: none;
}

h1 {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 6vw;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}

.wrapper {
  position: relative;
}

.container {
  background: #555;
}

.container p {
  padding: 300px 0;
  text-align: center;
  color: #fff;
}

              
            
!

JS

              
                //画像の設定

var windowwidth =
  window.innerWidth || document.documentElement.clientWidth || 0;
if (windowwidth > 768) {
  var responsiveImage = [
    //PC用の画像
    { src: "https://assets.codepen.io/6329135/img_01.jpg" },
    { src: "https://assets.codepen.io/6329135/img_02.jpg" },
    { src: "https://assets.codepen.io/6329135/img_03.jpg" }
  ];
} else {
  var responsiveImage = [
    //タブレットサイズ(768px)以下用の画像
    {
      src:
        "https://assets.codepen.io/6329135/img_01.jpg?width=768&height=477&format=auto"
    },
    {
      src:
        "https://assets.codepen.io/6329135/img_02.jpg?width=768&height=477&format=auto"
    },
    {
      src:
        "https://assets.codepen.io/6329135/img_03.jpg?width=768&height=477&format=auto"
    }
  ];
}

//Vegas全体の設定

$("#slider").vegas({
  overlay: true, //画像の上に網線やドットのオーバーレイパターン画像を指定。
  transition: "blur2", //切り替わりのアニメーション。http://vegas.jaysalvat.com/documentation/transitions/参照。fade、fade2、slideLeft、slideLeft2、slideRight、slideRight2、slideUp、slideUp2、slideDown、slideDown2、zoomIn、zoomIn2、zoomOut、zoomOut2、swirlLeft、swirlLeft2、swirlRight、swirlRight2、burnburn2、blurblur2、flash、flash2が設定可能。
  transitionDuration: 1500, //切り替わりのアニメーション時間をミリ秒単位で設定
  delay: 10000, //スライド間の遅延をミリ秒単位で。
  animationDuration: 20000, //スライドアニメーション時間をミリ秒単位で設定
  animation: "kenburns", //スライドアニメーションの種類。http://vegas.jaysalvat.com/documentation/transitions/参照。kenburns、kenburnsUp、kenburnsDown、kenburnsRight、kenburnsLeft、kenburnsUpLeft、kenburnsUpRight、kenburnsDownLeft、kenburnsDownRight、randomが設定可能。
  slides: responsiveImage //画像設定を読む
});

              
            
!
999px

Console