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

              
                <!-- Content Source: https://www.farmflavor.com/at-home/cooking/10-fun-facts-about-apples/  -->
<div class="slider__wrapper">
 
  <div class="slider">
    <div class="slider__content">
      <div class="slider__text">
        <span>1</span>
        <h3>The Producers</h3>
        <p>The top apple producers around the world are China, United States, Turkey, Poland and Italy.</p>
      </div>
      <figure class="slider__image">

        <img src="https://images.unsplash.com/photo-1458011170811-0c83ce240f99?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=8b4e45d40741267302ef75900c03b756&auto=format&fit=crop&w=800&q=90">

      </figure>

    </div>
    <div class="slider__content">
      <div class="slider__text">
        <span>2</span>
        <h3>The Size</h3>
        <p>Apple varieties range in size from a little larger than a cherry to as large as a grapefruit.</p>
      </div>
      <figure class="slider__image">
        <img src="https://images.unsplash.com/photo-1506277548624-5d9498cde122?ixlib=rb-0.3.5&s=9a53092137398e7219bbfc3acb936073&auto=format&fit=crop&w=800&q=90">

      </figure>

    </div>
    <div class="slider__content">
      <div class="slider__text">
        <span>3</span>
        <h3>The Time</h3>
        <p>Apple trees take four to five years to produce their first fruit.</p>
      </div>
      <figure class="slider__image">

        <img src="https://images.unsplash.com/photo-1503327655231-9a047d4772b6?ixlib=rb-0.3.5&s=4164f11f73a7f46defa0da9db7e76443&auto=format&fit=crop&w=800&q=90">

      </figure>

    </div>
    <div class="slider__content">
      <div class="slider__text">
        <span>4</span>
        <h3>The advantages</h3>
        <p>Apples contain no fat, sodium or cholesterol and are a good source of fiber.</p>
      </div>
      <figure class="slider__image">

        <img src="https://images.unsplash.com/photo-1513677785800-9df79ae4b10b?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=3bc74c728882a8c3d2ee704fc06e55f3&auto=format&fit=crop&w=800&q=90">

      </figure>

    </div>
    <div class="slider__content">
      <div class="slider__text">
        <span>5</span>
        <h3>The Surprise</h3>
        <p>Apples ripen six to 10 times faster at room temperature than if they are refrigerated.</p>
      </div>
      <figure class="slider__image">

        <img src="https://images.unsplash.com/photo-1506808541308-577f3be75bb7?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=5c86cf46bfb1e521d127021cf52d6187&auto=format&fit=crop&w=800&q=90">

      </figure>

    </div>
  </div>

</div>
              
            
!

CSS

              
                body {
  font-family: Montserrat, sans-serif;
  margin: 0;
}

$bg-gradient: linear-gradient(151deg, rgba(131,58,180,1) 0%, rgba(253,29,29,1) 50%, rgba(252,176,69,1) 100%);


.slider__wrapper {
  margin: 0 auto;
  .slick-track {
    overflow: hidden;
  }

}
.slider__content {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  position: relative;
  max-height: 90%;



  .slider__text {
    opacity: 0;
    transition: all 1s ease;
    background: rgba(white, .75);
    padding: 2.5em 4em;
    position: absolute;
    left: 0;
    width: 40%;
    z-index: 1;
    opacity: 0;
    transition: all 1s linear;
    span {
      font-weight: 600;
      font-size: 1.5em;
      background: $bg-gradient;
      border-radius: 50%;
      line-height: 35px;
      width: 35px;
      display: block;
      text-align: center;
      color: white;

    }
    h3 {
      font-weight: 600;
      font-size: 2em;
      display: inline-block;
      margin-bottom: 0;
      &:after {
        content: "";
        width: 100%;
        height: 3px;
        display: block;
        background: $bg-gradient;
      }
    }
    p {
      line-height: 2;
    }

  }

  .slider__image {
    width: 70%;
    margin: 0;
    position: relative;
    &:before {
      content: "";
      padding-top: 56.25%;
      display: block;
    }
    img {
      position: absolute;
      top: 0;
      left: 0;
      width: 0;
      height: 100%;
      object-fit: cover;
      transition: all .75s ease;
    }
  }
}



//arrows 

.slick-arrow {
  position: absolute;
  bottom: 2em;
  right: 2em;
  z-index: 2;
  background: $bg-gradient;
  background-size: 100%;
  border: 0;
  width: 30px;
  height: 25px;
  text-indent: -9999px;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  cursor: pointer;
  transition: all .5s ease;

  &:hover {
    background-size: 190%;
  }

  &.slick-prev {
    right: 5em;
    transform: rotate(-90deg);
  }

  &.slick-next {
    transform: rotate(90deg);

  }
}

//animation 

.slick-active {
  .slider__text {
    opacity: 1;
  }

  .slider__image img {
    width: 100%;
  }
}
              
            
!

JS

              
                
$('.slider').slick({
  slidesToShow: 1,
  slidesToScroll: 1,
  arrows: true,
  fade: true,
});

              
            
!
999px

Console