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

              
                <!-- Swiper -->
<div class="swiper mySwiper">
  <div class="swiper-wrapper">
    <div class="swiper-slide">
      <div class="slide-img" style="background-image: url('https://picsum.photos/1920/1080');"></div>
    </div>
    <div class="swiper-slide">
      <div class="slide-img" style="background-image: url('https://picsum.photos/1920/1081');"></div>
    </div>
    <div class="swiper-slide">
      <div class="slide-img" style="background-image: url('https://picsum.photos/1920/1082');"></div>
    </div>
  </div>
</div>
<!-- Swiper -->
              
            
!

CSS

              
                body {
  margin: 0;
  padding: 0;
}
/* Swiper */
.swiper-slide {
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.swiper-slide-active .slide-img,
.swiper-slide-duplicate-active .slide-img,
.swiper-slide-prev .slide-img {
  -webkit-animation: zoomUp 10s linear 0s;
  animation: zoomUp 10s linear 0s; /* 10秒かけて拡大 */
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}
.slide-img {
  background-size: cover; 
  background-position: center center;
  height: 100vh; /* 画像の高さ100vh */
}
/* Swiper-zoom */
@-webkit-keyframes zoomUp {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
  100% {
    -webkit-transform: scale(1.15);
    transform: scale(1.15);
  }
}
@keyframes zoomUp {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
  100% {
    -webkit-transform: scale(1.15);
    transform: scale(1.15);
  }
}
              
            
!

JS

              
                window.addEventListener('load', function(){
  let mySwiper = new Swiper(".mySwiper", {
    loop: true, // ループ指定
    effect: "fade", //フェード指定
    autoplay: {
      delay: 5000, //5秒後に次のスライドへ
      disableOnInteraction: false //スライドを止めない
    },
    speed: 3000, //3秒かけてフェードで切り替わる
    allowTouchMove: false, //マウスでのスワイプ禁止
  });
});
              
            
!
999px

Console