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

              
                <div id="output">
</div>

<div class="divWrapper"><h1>BIG TEXT</h1></div>
<div class="divWrapper"><div class="sliderWrapper">
  <div class="sliderImage load">
   <div class="sliderImageWrapper">
    <div data-title="Dock" data-text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Hic ambiguo ludimur. Quae similitudo in genere etiam humano apparet. Hoc est non dividere, sed frangere. Neminem videbis ita laudatum, ut artifex callidus comparandarum voluptatum diceretur. Ex quo illud efficitur, qui bene cenent omnis libenter cenare, qui libenter, non continuo bene. Duo Reges: constructio interrete. Tu autem negas fortem esse quemquam posse, qui dolorem malum putet. Quamquam te quidem video minime esse deterritum. Quid, quod res alia tota est? Nam, ut sint illa vendibiliora, haec uberiora certe sunt." class="sliderImageItem">
      <img src="https://unsplash.it/800/500?image=230" />
    </div>
    <div data-title="Stump" data-text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Hic ambiguo ludimur. Quae similitudo in genere etiam humano apparet. Hoc est non dividere, sed frangere. Neminem videbis ita laudatum, ut artifex callidus comparandarum voluptatum diceretur. Ex quo illud efficitur, qui bene cenent omnis libenter cenare, qui libenter, non continuo bene." class="sliderImageItem">
      <img src="https://unsplash.it/800/500?image=330" />
    </div>
    <div data-title="Forest" data-text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Hic ambiguo ludimur. Quae similitudo in genere etiam humano apparet. Hoc est non dividere, sed frangere. Tu autem negas fortem esse quemquam posse, qui dolorem malum putet. Quamquam te quidem video minime esse deterritum. Quid, quod res alia tota est? Nam, ut sint illa vendibiliora, haec uberiora certe sunt." class="sliderImageItem">
      <img src="https://unsplash.it/800/500?image=560" />
    </div>
    <div data-title="Plant" data-text="Ex quo illud efficitur, qui bene cenent omnis libenter cenare, qui libenter, non continuo bene. Duo Reges: constructio interrete. Tu autem negas fortem esse quemquam posse, qui dolorem malum putet. Quamquam te quidem video minime esse deterritum. Quid, quod res alia tota est? Nam, ut sint illa vendibiliora, haec uberiora certe sunt." class="sliderImageItem">
      <img src="https://unsplash.it/800/500?image=530" />
    </div>
        <div data-title="Snow" data-text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Hic ambiguo ludimur. Quae similitudo in genere etiam humano apparet. Hoc est non dividere, sed frangere. Neminem videbis ita laudatum, ut artifex callidus comparandarum voluptatum diceretur. Ex quo illud efficitur, qui bene cenent omnis libenter cenare, qui libenter, non continuo bene. Duo Reges: constructio interrete. Quid, quod res alia tota est? Nam, ut sint illa vendibiliora, haec uberiora certe sunt." class="sliderImageItem">
      <img src="https://unsplash.it/800/500?image=730" />
    </div>
     <div data-title="Fog" data-text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Hic ambiguo ludimur. Quae similitudo in genere etiam humano apparet. Hoc est non dividere, sed frangere. Neminem videbis ita laudatum, ut artifex callidus comparandarum voluptatum diceretur. Ex quo illud efficitur, qui bene cenent omnis libenter cenare, qui libenter, non continuo bene.  Quamquam te quidem video minime esse deterritum. Quid, quod res alia tota est? Nam, ut sint illa vendibiliora, haec uberiora certe sunt." class="sliderImageItem">
      <img src="https://unsplash.it/800/500?image=932" />
    </div>
   </div>
  </div>
  <div class="sliderText">
    <div class="sliderTextFloat">
      <div class="sliderTextWrapper">
        <h3 class="sliderSubText">Most Important Category</h3>
    <h2 class="sliderTitleText">Super Important <span></span></h2>
    <p> data-text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Hic ambiguo ludimur. Quae similitudo in genere etiam humano apparet. Hoc est non dividere, sed frangere. Neminem videbis ita laudatum, ut artifex callidus comparandarum voluptatum diceretur. Ex quo illud efficitur, qui bene cenent omnis libenter cenare, qui libenter, non continuo bene. Duo Reges: constructio interrete. Tu autem negas fortem esse quemquam posse, qui dolorem malum putet. Quamquam te quidem video minime esse deterritum. Quid, quod res alia tota est? Nam, ut sint illa vendibiliora, haec uberiora certe sunt."</p>
    <a class="sliderLink">Read More</a>
      </div>
  </div>
  </div>
</div>
  </div>
  <div class="divWrapper"><h1>Filterable Categories</h1></div>
    <div class="sliderWrapperEnd"></div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Raleway:400,600);
body{
  background-color:#eeeeee;
/*   display:flex;
  justify-content:center;
  align-items:center;
  height:100vh; */
}
.divWrapper{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100vw;
  min-height: 75vh;
}
.sliderWrapper{
  position:relative;
  width:90vw;
  margin:0 auto;
  display:flex;
} 
.sliderImage{
  position:relative;
  flex-basis:60%;
}

.sliderText{
 flex-basis:40%;
  overflow:hidden;
}
.sliderTextFloat{
  padding:60px;
  position:fixed;
  height:100vh;
  display:flex;
  top:0;
  justify-content:center;
  align-items:center;
  transition:all .5s ease;
  opacity:0;
}
.visible.sliderTextFloat{
  opacity:1;
    transition:all .5s ease;
}

.sliderImageItem {
  transform: translatey(-0%);
  transition: all .4s ease;
  margin-bottom: 40px;
/*     box-shadow:0px 0px 30px 0px #8e8e8e; */
}
.active.sliderImageItem {
  transform: translatey(-0%);
  transition: all .4s ease;
  margin-bottom: 40px;
    box-shadow:0px 0px 30px 0px #8e8e8e;
}
.sliderImage img{
  width:100%;
}
h3.sliderSubText {
  font-family: 'Raleway', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    color: #c07a4c;
}
.sliderText h2 {
    font-family: 'Raleway', sans-serif;
    margin-bottom: 20px;
     margin-top:0;
    padding-bottom: 10px;
    border-bottom: 2px solid #c07a4c;
    display: inline-block;
}
.sliderText p{
  margin-bottom:20px;
} 

a.sliderLink {
  font-family: 'Raleway', sans-serif;
    padding: 9px 15px;
    background: #c07a4c;
    display: inline-block;
    color: #fff;
    text-transform: uppercase;
    font-size: 13px;
}
#output {
    position : fixed;
    font-size: 10px;
    top      : 0;
    right    : 0;
    height   : 200px;
    width    : 300px;
    border   : 1px solid yellow;
    overflow : hidden;
    display:none;
}
.sliderWrapperEnd{
  position:fixed;
  width:100vw;
  border:1px solid red;
  display:none;
}
              
            
!

JS

              
                $(function() {
  $('.sliderImage').removeClass('load');
});

function eventTextChange(currentItem, stage) {

  if (stage === 'active') {
    if (currentItem.hasClass('active')) {

    } else  {
      currentItem.addClass('active');
      $('.sliderTextFloat').addClass('visible');
      $('.sliderTitleText span').text(currentItem.attr('data-title'));
      $('.sliderTextFloat p').text(currentItem.attr('data-text'));
    }
  } else if (stage === 'above-active'){
    if(currentItem.index() == 0){
       $('.sliderTextFloat').removeClass('visible');
       currentItem.removeClass('active');       
    } else {
      currentItem.removeClass('active'); 
    }
  } else if (stage === 'below-active'){
    if(currentItem.index() == sliderLength){
       $('.sliderTextFloat').removeClass('visible');
       currentItem.removeClass('active');       
    } else {
      currentItem.removeClass('active'); 
    }
  }
}

var $output = $('#output'),
  sliderLength = $('.sliderImageWrapper').children().length - 1,
  currentIndex = $('.sliderImageItem.active').index(),
  windowHalfHeight = $(window).height() / 2;

$('.sliderWrapperEnd').css('top', windowHalfHeight);

$(window).on('scroll', function() {
  $('.sliderImageItem').each(function() {
    var scrollTop = $(window).scrollTop(),
      elementOffsetTop = $(this).offset().top,
      elementHeight = $(this).height(),
      elementOffsetBottom = elementOffsetTop + elementHeight,
      distanceTop = Math.round(elementOffsetTop - (scrollTop + windowHalfHeight)),
      distanceBottom = Math.round(elementOffsetBottom - scrollTop);
    
    $output.prepend('<p>distanceTop :' + distanceTop + ' - height : ' + (distanceTop < -elementHeight) + '</p>');
    if ((distanceTop < 0) && (distanceTop > -elementHeight)) {
      // If the Center of the viewport falls upon a element - Add active class
      eventTextChange($(this), 'active');
    } else if (distanceTop < -elementHeight) {
      //If the Center of the viewport drops below the element - Remove active class
      eventTextChange($(this), 'below-active');
    } else if (distanceTop > 0) {
      //If the Center of the viewport rises above the element - Remove active class
      eventTextChange($(this), 'above-active');
    }
    // $output.prepend('<p>Scroll-Down: ' + $(this).index() + ' : ' + distance + '</p>');
  });

});
              
            
!
999px

Console