Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!-- fluid container, modified with a no gutter class so it go allll the way to the edge -->
<div class="slideways container-fluid no-gutter">
  <!-- the viewport for the slideshow (width of the screen / single slide) positioned absolute with hidden overflow -->
  <div id="contentContainer">
    <!--  wrapper for all of the slides -->
    <div id="wrapper">
      <!-- slides, yay! -->
      <div class="content">
        SIGN UP
      </div>

      <div class="content">
        <div class="left col-md-8 col-sm-12" style="background-image:url('http://garrett.is/wp-content/uploads/2016/06/070512_0602.jpg');"></div>
        <div class="right col-md-4 hidden-sm-down">
          <h2 class="featured-title"><a href="#">IT'S A MIRACLE!</a></h2>
          <p class="info-tag">No, it is just a pretty decent slider, do not get too excited.</p>
        </div>
      </div>


      <div class="content">
        <div class="left col-md-8 col-sm-12" style="background-image:url('http://garrett.is/wp-content/uploads/2016/05/IMG_7589.jpg');"></div>
        <div class="right col-md-4 hidden-sm-down">
          <h2 class="featured-title"><a href="#">MORE FUN</a></h2>
          <p class="info-tag">Than going to the dentist.</p>
        </div>
      </div>


      <div class="content">
        <div class="left col-md-8 col-sm-12" style="background-image:url('http://storylens.org/wp-content/uploads/2016/07/Screen-Shot-2016-07-08-at-11.19.10-PM.png');"></div>
        <div class="right col-md-4 hidden-sm-down">
          <h2 class="featured-title"><a href="#">MORE EXCITING</a></h2>
          <p class="info-tag">Than your grandmothers book group.</p>
        </div>
      </div>
    </div>
  </div>
  
  <!--  Our handy dandy wine and brandy navigadoodles.  -->
  <div id="navLinks">
    <ul>
      <li class="itemLinks">1</li>
      <li class="itemLinks">2</li>
      <li class="itemLinks">3</li>
      <li class="itemLinks">4</li>
    </ul>
  </div>
  <!--  -->
</div>
            
          
!
            
              .slideways #wrapper {
  width: 400%;
  transform: translate3d(0, 0, 0);
  transition: transform .5s ease-in-out;
}
.slideways .content {
  float: left;
  width: 100vw;
  height: 100vh;
  white-space: normal;
  background-repeat: no-repeat;
  background-size:cover;
  font-family:sans-serif;
  display:flex;
}

.slideways body{
  margin:0;
}

.slideways .left{
  height:inherit;
  background-size:cover;
  float:left;
}
.slideways .right{
  height:inherit;
  background:#222;
  padding:15px;
  color:white;
}

.slideways #contentContainer {
  width: 100%;
  height: 100vh;
  border:none;
  overflow: hidden;
  text-align:left;
  margin:0 auto;
}

.slideways #navLinks {
  text-align: center;
  width: 100%;
  margin:0 auto;
  transform:translateY(-60px);
}
.slideways #navLinks ul {
  margin: 0px;
  padding: 0px;
  display: inline-block;
  margin-top: 6px;
}
.slideways #navLinks ul li {
  float: left;
  text-align: center;
  margin: 10px 5px;
  list-style: none;
  cursor: pointer;
  background-color: #CCCCCC;
  padding: 10px;
  font-family:sans-serif;
}
.slideways #navLinks ul li:hover {
    background-color: cornflowerblue;
  color:white;
}
.slideways #navLinks ul li.active {
    background-color: #333333;
    color: #FFFFFF;
    outline-width: 7px;
}
.slideways #navLinks ul li.active:hover {
    background-color: #484848;
    color: #FFFFFF;
}

.no-gutter{
  padding-right:0;
  padding-left:0;
}

.slideways .featured-title a{
  font-size:2rem;
  color:white;
}

.slideways p{
  font-size:1.5rem;
  text-transform:lowercase;
  font-variant:small-caps;
  text-align:justify;
  padding-right:15px;
}



            
          
!
            
                // just querying the DOM...like a boss!
var links = document.querySelectorAll(".itemLinks");
var wrapper = document.querySelector("#wrapper");
 
// the activeLink provides a pointer to the currently displayed item
var activeLink = 0;
 
// setup the event listeners
for (var i = 0; i < links.length; i++) {
    var link = links[i];
    link.addEventListener('click', setClickedItem, false);
 
    // identify the item for the activeLink
    link.itemID = i;
}
 
// set first item as active
links[activeLink].classList.add("active");
 
function setClickedItem(e) {
    removeActiveLinks();
 
    var clickedLink = e.target;
    activeLink = clickedLink.itemID;
 
    changePosition(clickedLink);
}
 
function removeActiveLinks() {
    for (var i = 0; i < links.length; i++) {
        links[i].classList.remove("active");
    }
}
 
// Handle changing the slider position as well as ensure
// the correct link is highlighted as being active
function changePosition(link) {

    var position = link.getAttribute("data-pos");
    var newPos = '-'+(100/links.length)*(link.itemID)+ '%';
 
    var translateValue = "translate3d(" + newPos + ", 0px, 0)";
    wrapper.style[transformProperty] = translateValue;
 
    link.classList.add("active");
}
 
//
// Dealing with Transforms
//
var transforms = ["transform",
            "msTransform",
            "webkitTransform",
            "mozTransform",
            "oTransform"];
 
var transformProperty = getSupportedPropertyName(transforms);
 
// vendor prefix management
function getSupportedPropertyName(properties) {
    for (var i = 0; i < properties.length; i++) {
        if (typeof document.body.style[properties[i]] != "undefined") {
            return properties[i];
        }
    }
    return null;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console