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

              
                <html>
<head>
  <meta charset="utf-8">
  <title>Slide Gallery</title>
  <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500&display=swap" rel="stylesheet">
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!-- ID Gallery -->
  <!-- Container -->
  <div class="container cont-gall" id="gallery">
    <!-- Topic for Gallery -->
    <div class="topic">
      <h2>Gallery</h2>
      <div class="gallery-arrows">
        <h1>Gallery Set</h1>
        <!-- Arrow -->
        <div>
          <a href="#">
            <img class="arrow-left" src="https://img.icons8.com/ios/452/long-arrow-left.png" height="70" alt="l"/>
            <img class="arrow-right" src="https://img.icons8.com/ios/452/long-arrow-left.png" height="70" alt="r"/>
          </a>
        </div>
        <!-- End of Arrow -->
      </div>
      <!-- End of Gallery-Arrows -->
    </div>
    <!-- End of Topic for Gallery -->
    <div class="gallery-run js-slidein">
      <!-- Gallery-Set -->
      <div class="gallery-set">
        <a class="mySlides" href="#">
          <img class="pict" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTg3n2qw3toPWUkH_fWsecwKnJriqG2FtbA6Q&usqp=CAU" height="370" alt="1">
        </a>
        <a class="mySlides" href="#">
          <img class="pict" src="https://i.pinimg.com/474x/9b/a1/ed/9ba1edefc64fc338cc34697feba4363c.jpg" height="370" alt="2">
        </a>
        <a class="mySlides" href="#">
          <img class="pict" src="https://www.advancedsciencenews.com/wp-content/uploads/2020/06/graham-holtshausen-fUnfEz3VLv4-unsplash.jpg" height="370" alt="3">
        </a>
        <a class="mySlides" href="#">
          <img class="pict" src="https://images.pexels.com/photos/262622/pexels-photo-262622.jpeg" height="370" alt="4">
        </a>
        <a class="mySlides" href="#">
          <img class="pict" src="https://i.pinimg.com/originals/71/11/a5/7111a58e35673a1f5f32ad30affc1290.png" height="370" alt="5">
        </a>
      </div>
      <!-- End of Gallery-Set -->
    </div>
    <!-- End of Gallery-Run -->
  </div>
  <!-- End of Container -->
  <!-- End ID Gallery-->
</body>
</html>
              
            
!

CSS

              
                //
// VARIABLES
// ------------------------------------------------------

$color-bg-page: #fff;
$color-light: #f9e8eb;
$color-dark: #476667;
$color-mid: #c28283;
$color-web: #f9e8eb;

$font-size-basic: 100%;
$font-family-1: "DM Sans", sans-serif;

//
//	MIXINS
// ------------------------------------------------------

//  Calculate size EM from PX size for responsive design!!!
@function em($size, $context: 16) {
  @return ($size / $context) + em;
}

@mixin font-size($size, $context: 16) {
  font-size: em($size, $context);
}

//  @include box-sizing
@mixin box-sizing($value) {
  box-sizing: $value;
}

//
//  MAIN CODE
//  --------------------------------------------------
//

//  DRAW OUTLINE FOR ALL ELEMENTS
//*{outline: em(1) solid blue;}

//
//  BOX-SIZING
//
html {
  @include box-sizing(border-box);
}
*,
*:before,
*:after {
  box-sizing: inherit;
}

//
//  CODE
//
html {
  position: relative;
  overflow-x: hidden;
}

body {
  margin: 0 auto;
  max-width: em(1920);
  height: auto;
  font: {
    family: $font-family-1;
    size: $font-size-basic;
    weight: 400;
  }
  line-height: em(26);
  text-align: center;
  background-color: $color-bg-page;
  color: $color-dark;

  -webkit-font-smoothing: antialiased;

  text-decoration: none;
  overflow-x: hidden;
  position: relative;
}

.container {
  margin: 0 em(250);
  padding: em(50) 0 em(70);
  position: relative;
  display: block;
}

//
//  SETTINGS OF GALLERY
//
.cont-gall {
  text-align: left;
}

.gallery-run {
  height: em(1000);
  position: relative;
}

.gallery-set {
  z-index: 100;
  position: absolute;

  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-flow: row nowrap;
  margin-top: em(30);
  .pict {
    margin-right: em(1);
    transform: scale(0.98);
    transition: all 0.3s linear;
    &:hover {
      transform: scale(1);
    }
  }
}

.gallery-arrows {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-flow: row nowrap;
  position: relative;
  line-height: em(43);
  img {
    margin-left: em(30);
  }
}

.arrow-left {
  transform: rotate(180deg);
}

.arrow-right {
  display: none;
}

//
//  MOVE GALLERY FROM SIDE
//
.js-slidein {
  opacity: 0;
  left: em(1200);
  transition: all 2.5s ease-in-out;
}

.js-slidein-visible {
  opacity: 1 !important;
  left: 0 !important;
}

//
//  RESPONSIVE SETTINGS
//
@media only screen and (max-width: em(1370)) {
  .container {
    margin: 0 em(100);
  }
}

@media only screen and (max-width: em(1230)) {
  #gallery {
    height: em(555);
  }

  .gallery-set {
    .pict {
      height: em(300);
    }
  }
}

@media only screen and (max-width: em(1100)) {
  .container {
    margin: 0 em(30);
  }
}

@media only screen and (max-width: em(960)) {
  #gallery {
    height: em(530);
  }

  .gallery-set {
    .pict {
      height: em(270);
    }
  }
}

@media only screen and (max-width: em(770)) {
  #gallery {
    height: em(500);
  }

  .gallery-set {
    .pict {
      height: em(230);
    }
  }
}

@media only screen and (max-width: em(725)) {
  #gallery {
    height: em(475);
  }

  .gallery-set {
    .pict {
      height: em(200);
    }
  }
}

@media only screen and (max-width: em(650)) {
  #gallery {
    height: em(435);
  }

  .gallery-set {
    .pict {
      height: em(150);
    }
  }
}

@media only screen and (max-width: em(520)) {
  #gallery {
    height: em(475);
  }
}

              
            
!

JS

              
                (function($) {
  /**
     * 
     * Shift Gallery Set
     * 
     */
  var arrowLeft = $('.arrow-left'),
      arrowRight = $('.arrow-right');

  arrowRight.hide();

  arrowLeft.on('click', function(event){
    event.preventDefault();
    $('.gallery-set').css({'right':''});

    // Check Default Margin-Left
    var galleryLeftAfter = $('.gallery-set').offset().left;
    //console.log( galleryLeftAfter );

    $('.gallery-set').animate( { 'right' : 0 }, 3000);
    arrowLeft.delay(2700).fadeOut(800);
    arrowRight.delay(3500).fadeIn(800);

    arrowRight.on('click', function(event){
      event.preventDefault();

      // Check Value Margin-Left After Shift Gallery onto - Right: 0
      var galleryLeft = $('.gallery-set').offset().left;
      //console.log( galleryLeft );

      $('.gallery-set').animate( { 'right' : (galleryLeft - galleryLeftAfter) }, 3000);
      arrowRight.delay(2700).fadeOut(800);
      arrowLeft.delay(3500).fadeIn(800);

    });
  });


  // Run Gallery From Side
  setTimeout( function(){
    $('.js-slidein').addClass("js-slidein-visible")
  }, 300);



})(jQuery);
              
            
!
999px

Console