skip to Main Content

enter image description here

My design this but I don’t know How to do this steps

I trying different config with swiper and slick slides
enter image description here
My code like this but

enter image description here
that is my result

2

Answers


  1. At the left and right of the container you can add opacity or blur or gradient with opacity using ::after and ::before pseudo selectors.

    Login or Signup to reply.
  2. This effect not related to Swiper API (It is some transparent edges of .swiper).

    The most simple way is to add css mask.

    .swiper {
      /* MASK */
      -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 1) 80%, transparent 100%)
    }
    

    **Better to disable on mobile by media query.

    Demo:

    var swiper = new Swiper(".mySwiper", {
      slidesPerView: 4,
      spaceBetween: 30,
      mousewheel: true,
      centeredSlides: true,
      loop: true,
      pagination: {
        el: ".swiper-pagination",
        clickable: true,
      },
    });
    html,
    body {
      position: relative;
      height: 100%;
    }
    
    body {
      background: lightblue;
      font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
      font-size: 14px;
      color: #000;
      margin: 0;
      padding: 0;
    }
    
    .swiper {
      width: 100%;
      height: 100%;
      max-width: 900px;
      margin: auto;
      /* MASK */
      -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 1) 80%, transparent 100%)
    }
    
    .swiper-slide {
      text-align: center;
      font-size: 18px;
      background: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/swiper-bundle.min.js"></script>
    
    <!-- Swiper -->
    <main class="swiper mySwiper">
      <div class="swiper-wrapper">
        <div class="swiper-slide">Slide 1</div>
        <div class="swiper-slide">Slide 2</div> 
        <div class="swiper-slide">Slide 3</div>
        <div class="swiper-slide">Slide 4</div>
        <div class="swiper-slide">Slide 5</div>
        <div class="swiper-slide">Slide 6</div>
        <div class="swiper-slide">Slide 7</div>
        <div class="swiper-slide">Slide 8</div>
        <div class="swiper-slide">Slide 9</div>
      </div>
      <div class="swiper-pagination"></div>
    </main>
    
    </script>
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/swiper-bundle.min.css" rel="stylesheet"/>
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search