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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 class="Slate-itemsWrapper">

      <section class="Slate-item" data-title="Title 1" data-producer="Producer One" data-country="England">
		  
		  <div class="Slate-itemInner">
              <div class="Slate-mediaWrapper">
                  <div class="Slate-imageWrapper">
                      <img alt="image alt text" src="https://picsum.photos/600/800?random=1"/>
                  </div>
              </div>
          </div>
        
      </section>

      <section class="Slate-item" data-title="Title 2" data-producer="Producer Two" data-country="Hungry">
  
          <div class="Slate-itemInner">
              <div class="Slate-mediaWrapper">
                  <div class="Slate-imageWrapper">
                      <img alt="image alt text" src="https://picsum.photos/600/800?random=2"/>
                  </div>
                  
              </div>
          </div>
  
      </section>

      <section class="Slate-item" data-title="Title 3" data-producer="Producer Three" data-country="Bulgaria">
  
          <div class="Slate-itemInner">
              <div class="Slate-mediaWrapper">
                  <div class="Slate-imageWrapper">
                      <img alt="image alt text" src="https://picsum.photos/600/800?random=3"/>
                  </div>
                  
              </div>
          </div>
  
      </section>

      <section class="Slate-item" data-title="Title 4" data-producer="Producer Four" data-country="Brazil">
  
          <div class="Slate-itemInner">
              <div class="Slate-mediaWrapper">
                  <div class="Slate-imageWrapper">
                      <img alt="image alt text" src="https://picsum.photos/600/800?random=4"/>
                  </div>
                 
              </div>
          </div>
  
      </section>
  
      <section class="Slate-item" data-title="Title 5" data-producer="Producer Five" data-country="Finland">
  
          <div class="Slate-itemInner">
              <div class="Slate-mediaWrapper">
                  <div class="Slate-imageWrapper">
                      <img alt="image alt text" src="https://picsum.photos/600/800?random=5"/>
                  </div>
                  
              </div>
          </div>
  
      </section>

      <section class="Slate-item" data-title="Title 6" data-producer="Producer Six" data-country="Portugal">
  
          <div class="Slate-itemInner">
              <div class="Slate-mediaWrapper">
                  <div class="Slate-imageWrapper">
                      <img alt="image alt text" src="https://picsum.photos/600/800?random=6"/>
                  </div>
                  
              </div>
          </div>
  
      </section>

      <section class="Slate-item" data-title="Title 7" data-producer="Producer Seven" data-country="France">
  
        <div class="Slate-itemInner">
              <div class="Slate-mediaWrapper">
                  <div class="Slate-imageWrapper">
                      <img alt="image alt text" src="https://picsum.photos/600/800?random=7"/>
                  </div>
                  
              </div>
          </div>

      </section>

      <section class="Slate-item" data-title="Title 8" data-producer="Producer Eight" data-country="Argentina">
  
          <div class="Slate-itemInner">
              <div class="Slate-mediaWrapper">
                  <div class="Slate-imageWrapper">
                      <img alt="image alt text" src="https://picsum.photos/600/800?random=8"/>
                  </div>
                  
              </div>
          </div>
  
      </section>
  
      <section class="Slate-item" data-title="Title 9" data-producer="Producer Nine" data-country="Spain">
  
          <div class="Slate-itemInner">
              <div class="Slate-mediaWrapper">
                  <div class="Slate-imageWrapper">
                      <img alt="image alt text" src="https://picsum.photos/600/800?random=9"/>
                  </div>
                  
              </div>
          </div>
  
      </section>

      <section class="Slate-item" data-title="Title 10" data-producer="Producer Ten" data-country="Netherlands">
  
       <div class="Slate-itemInner">
              <div class="Slate-mediaWrapper">
                  <div class="Slate-imageWrapper">
                      <img alt="image alt text" src="https://picsum.photos/600/800?random=10"/>
                  </div>
                  
              </div>
          </div>

    </section>
  
  </div>

  <div class="market--information">
    <h2 class="markets--title">Titles go here</h2>
    <p class="markets--producer">Producers go here</p>
    <p class="markets--country">Countries go here</p>
  </div>
              
            
!

CSS

              
                ::-webkit-scrollbar {
  display: none;
}
.Slate-itemsWrapper {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-flow: row;
    flex-flow: row;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}
.Slate-itemsWrapper {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    min-width: 100%;
    padding-top: 100px;
    padding-bottom: 130px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 0;
}
@media (min-width: 768px) {
    .Slate-itemsWrapper {
        padding-right: 0;
        padding-left: 0;
        padding-bottom: calc(0.14667 * 1vh * 100 + 160px);
    }
}
@media (min-height: 900px) {
    .Slate-itemsWrapper {
        padding-bottom: 292px;
    }
}
.Slate-item {
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    margin-right: 2px;
    margin-left: 2px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    width: calc(1vh * 12);
    display: block;
    position: relative;
    -webkit-transform-origin: center center;
    transform-origin: center center;
  max-height:60vh;
}

.Slate-item:before {
    content: "";
    display: block;
    padding-top: 449.23077%;
    height: 0;
    pointer-events: none;
}
@media (min-width: 375px) {
    .Slate-item {
        margin-right: 4px;
        margin-left: 4px;
    }
}
@media (min-width: 576px) {
    .Slate-item {
        margin-right: 5px;
        margin-left: 5px;
    }
}
@media (min-width: 992px) {
    .Slate-item {
        margin-right: 10px;
        margin-left: 10px;
    }
}
.Slate-item .Slate-itemInner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    background: #cfcdc2;
}
.Slate-item:first-child {
    padding-left: 0;
}
.Slate-item:last-child {
    padding-right: 0;
}
.Slate-item .Slate-mediaWrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(1vh * 24);
    height: calc(100% + 2px);
    z-index: 0;
}
.Slate-item .Slate-imageWrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e7e5df;
}
.Slate-item .Slate-imageWrapper img.imageColor {
    opacity: 0;
}
.Slate-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.Slate-item video {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: 0;
    -o-object-fit: cover;
    object-fit: cover;
/*     display: none; */
    pointer-events: none;
}

.market--information {
    position: absolute;
    bottom: 0%;
		left:50%;
    transform: translateX(-50%);
    text-align: center;
    padding-bottom: 50px;
}
.markets--title {color:#000;font-size: 48px;}
h2 > div div:first-child {text-transform:capitalize;}
.markets--producer {font-size: 32px;line-height:1;margin-bottom:16px;font-style:italic;color:#000;}
.markets--country {font-size: 24px;line-height:1;color:#000;}
              
            
!

JS

              
                gsap.registerPlugin(SplitText);

document.addEventListener("DOMContentLoaded", function() {
  
  var text_title_tl,
     text_producer_tl,
     text_country_tl,
     text_title,
     text_title_split,
     text_title_chars,
     text_producer,
     text_country;

  var slates = document.querySelectorAll(".Slate-item");
  
  slates.forEach(function(slate) {
    
    slate.addEventListener("mouseenter", function() {
      
      // create the timelines
      slate.text_title_tl = gsap.timeline({ paused: true });
      slate.text_producer_tl = gsap.timeline({ paused: true });
      slate.text_country_tl = gsap.timeline({ paused: true });

      // get the specific text from this hovered section attributes
      slate.text_title =  $(this).attr("data-title");
      slate.text_producer = $(this).attr("data-producer");
      slate.text_country = $(this).attr("data-country");

      // write title text to div for SplitText
      $('.markets--title').text(slate.text_title);
      // setup splitText
      slate.text_title_split = new SplitText('.markets--title', {
        type:"words,chars"
      });
      slate.text_title_chars = slate.text_title_split.chars; 
      slate.text_title_tl.from(slate.text_title_chars, {
        delay: 0.5,
        opacity:0,
        scale:0.5,
        y:50,ease:"back(4)",
        stagger:{
          from:"start",
          each:0.01
        }});

      // write producer / country text to div 
      $('.markets--producer').text(slate.text_producer);
      $('.markets--country').text(slate.text_country);
      
      // setup timelines for producer/country 
      slate.text_producer_tl.from(".markets--producer",{
        delay: 1,
        opacity:0,
        duration:1,
        clearProps:"opacity"
      });
      slate.text_country_tl.from(".markets--country",{
        delay: 1.25,
        opacity:0,
        duration:1,
        clearProps:"opacity"
      });

      // play!
      slate.text_title_tl.play(0);
      slate.text_producer_tl.play(0);
      slate.text_country_tl.play(0);

    });

    slate.addEventListener("mouseleave", function() {

      // clear div so all text is removed
      $('.market--information .markets--title').text("");
      $('.market--information .markets--producer').text("");
      $('.market--information .markets--country').text("");
      // kill. kill. kill.
      slate.text_title_tl.kill();
      slate.text_producer_tl.kill();
      slate.text_country_tl.kill();

    });
    
  });
  
});


		

		
		
              
            
!
999px

Console