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="wrapper">
  <div class="splide" role="group" aria-label="中央のスライドだけ大きくする">
    <div class="splide__track">
      <div class="splide__list">
        <div class="splide__slide">
          <img
            src="https://junpei-sugiyama.com/wp-content/uploads/2021/01/dog01.jpg"
            alt=""
          />
        </div>
        <div class="splide__slide">
          <img
            src="https://junpei-sugiyama.com/wp-content/uploads/2021/01/dog02.jpg"
            alt=""
          />
        </div>
        <div class="splide__slide">
          <img
            src="https://junpei-sugiyama.com/wp-content/uploads/2021/01/dog03.jpg"
            alt=""
          />
        </div>
        <div class="splide__slide">
          <img
            src="https://junpei-sugiyama.com/wp-content/uploads/2021/08/dog04.jpg"
            alt=""
          />
        </div>
        <div class="splide__slide">
          <img
            src="https://junpei-sugiyama.com/wp-content/uploads/2021/08/dog05.jpg"
            alt=""
          />
        </div>
        <div class="splide__slide">
          <img
            src="https://junpei-sugiyama.com/wp-content/uploads/2021/08/dog06.jpg"
            alt=""
          />
        </div>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                /* スライド共通のスタイル */
.splide__slide img {
  opacity: .3; /* 左右のスライドを薄くする */
  transform: scale(.8); /* 左右のスライドを小さくする */
  transition: .7s; /* ゆっくり小さくさせる */
}
/* アクティブなスライドのスタイル */
.splide__slide.is-active img {
  opacity: 1; /* 中央のスライドは薄くしない */
  transform: scale(1); /* 中央のスライドは小さくしない */
  z-index: 1; /* 中央のスライドを一番上にする */
}
/* スライドのサイズ調整 */
.splide__slide img {
  height: auto;
  width: 100%;
}
/* レイアウトの為のスタイル */
.wrapper {
  margin-inline: auto;
  margin-top: 10px;
  max-width: 600px;
  width: 100%;
}

              
            
!

JS

              
                const splide = new Splide(".splide", {
  autoplay: true, // 自動再生
  type: "loop", // ループ
  rewind: true, // スライダーの終わりまで行ったら先頭に巻き戻す
  pauseOnHover: false, // カーソルが乗ってもスクロールを停止させない
  interval: 2000, // 自動再生の間隔
  speed: 1000, // スライダーの移動時間
  perPage: 3, // 表示するスライドの枚数
  focus  : "center", // アクティブなスライドを中央にする
  updateOnMove: true, // is-activeクラスを移動前に更新する
}).mount();

              
            
!
999px

Console