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.

            
              <nav class="nav nav--active">
  <ul class="nav__list">
    <li class="nav__item">
      <a href="" class="nav__link">
         <div class="nav__thumb color1" data-letter="a"></div>
        <div class="content">
        <p class="nav__label"></p>
      </a>
    </li>
      <li class="nav__item">
      <a href="" class="nav__link">
        <div class="nav__thumb color2" data-letter="e"></div>
        <p class="nav__label">Universitario</p>
      </a>
    <li class="nav__item">
      <a href="" class="nav__link">
        <div class="nav__thumb color3" data-letter="e"></div>
        <p class="nav__label">Técnico o tecnólogo</p>
      </a>
    </li>
    <li class="nav__item">
      <a href="" class="nav__link">
        <div class="nav__thumb color4" data-letter="c"></div>
        <p class="nav__label">Bachiller</p>
      </a>
    </li>
    <li class="nav__item">
      <a href="" class="nav__link">
        <div class="nav__thumb color5" data-letter="a"></div>
        <p class="nav__label">No estudia</p>
      </a>
    </li>
       </ul>
 </a>
</nav>

<div class="page">
  <section class="section section--active color1" data-letter="a">
   <img src="https://image.ibb.co/g4AVyR/new_piktochart_26293995.png" alt="new_piktochart_26293995" border="0">
      
  </section>
  <section class="section color2" data-letter="p">
   
      <div class="piktowrapper-embed" style="height: 300px; position: relative;" data-uid="26015726-new-piktochart-copy-copy"><div class="pikto-canvas-wrap"><div class="pikto-canvas"><div class="embed-loading-overlay" style="width: 100%; height: 100%; position: absolute; text-align: center;"><img width="60px" alt="Loading..." style="margin-top: 100px" src="https://create.piktochart.com/loading.gif"/><p style="margin: 0; padding: 0; font-family: Lato, Helvetica, Arial, sans-serif; font-weight: 600; font-size: 16px">Loading...</p></div></div></div></div><script>(function(d){var js, id="pikto-embed-js", ref=d.getElementsByTagName("script")[0];if (d.getElementById(id)) { return;}js=d.createElement("script"); js.id=id; js.async=true;js.src="https://create.piktochart.com/assets/embedding/embed.js";ref.parentNode.insertBefore(js, ref);}(document));</script>
     
    </article>
  </section>
  <section class="section color3" data-letter="q">
    
    <div class="piktowrapper-embed" style="height: 300px; position: relative;" data-uid="26015762-new-piktochart-copy-copy-copy"><div class="pikto-canvas-wrap"><div class="pikto-canvas"><div class="embed-loading-overlay" style="width: 100%; height: 100%; position: absolute; text-align: center;"><img width="60px" alt="Loading..." style="margin-top: 100px" src="https://create.piktochart.com/loading.gif"/><p style="margin: 0; padding: 0; font-family: Lato, Helvetica, Arial, sans-serif; font-weight: 600; font-size: 16px">Loading...</p></div></div></div></div><script>(function(d){var js, id="pikto-embed-js", ref=d.getElementsByTagName("script")[0];if (d.getElementById(id)) { return;}js=d.createElement("script"); js.id=id; js.async=true;js.src="https://create.piktochart.com/assets/embedding/embed.js";ref.parentNode.insertBefore(js, ref);}(document));</script>
    
   
    </article>
  </section>
  <section class="section color4" data-letter="m">
    
  <div class="piktowrapper-embed" style="height: 300px; position: relative;" data-uid="26275517-new-piktochart-copy-copy-copy-conflict-copy-copy"><div class="pikto-canvas-wrap"><div class="pikto-canvas"><div class="embed-loading-overlay" style="width: 100%; height: 100%; position: absolute; text-align: center;"><img width="60px" alt="Loading..." style="margin-top: 100px" src="https://create.piktochart.com/loading.gif"/><p style="margin: 0; padding: 0; font-family: Lato, Helvetica, Arial, sans-serif; font-weight: 600; font-size: 16px">Loading...</p></div></div></div></div><script>(function(d){var js, id="pikto-embed-js", ref=d.getElementsByTagName("script")[0];if (d.getElementById(id)) { return;}js=d.createElement("script"); js.id=id; js.async=true;js.src="https://create.piktochart.com/assets/embedding/embed.js";ref.parentNode.insertBefore(js, ref);}(document));</script>
  
    </article>
  </section>
  <section class="section color5" data-letter="h">
    <div class="piktowrapper-embed" style="height: 300px; position: relative;" data-uid="26275548-new-piktochart-copy-copy-copy-conflict-copy-copy-copy"><div class="pikto-canvas-wrap"><div class="pikto-canvas"><div class="embed-loading-overlay" style="width: 100%; height: 100%; position: absolute; text-align: center;"><img width="60px" alt="Loading..." style="margin-top: 100px" src="https://create.piktochart.com/loading.gif"/><p style="margin: 0; padding: 0; font-family: Lato, Helvetica, Arial, sans-serif; font-weight: 600; font-size: 16px">Loading...</p></div></div></div></div><script>(function(d){var js, id="pikto-embed-js", ref=d.getElementsByTagName("script")[0];if (d.getElementById(id)) { return;}js=d.createElement("script"); js.id=id; js.async=true;js.src="https://create.piktochart.com/assets/embedding/embed.js";ref.parentNode.insertBefore(js, ref);}(document));</script>
    
    
</article>
  </section>
 
   
</div>

            
          
!
            
              easeout(s=.45s)
  transition all s cubic-bezier(0.23, 1, 0.32, 1)
align()
  display flex
  align-items center
  justify-content center
color1 = #fff;
color2 = #000;
color3 = #000;
color4 = #000;
color5 = #000;
color6 = #DFB816;
  
*
  box-sizing 50px
  -webkit-tap-highlight-color:  rgba(white, 0); // remove tap highlight on android chrome

body
  line-height 1.5
  font-family "futura-pt", 'Century Gothic','Arial', sans-serif
  -webkit-font-smoothing antialiased
  text-rendering optimizeLegibility
  color white, 10
  background lighten(white, 10)
  
a
  text-decoration none
  color inherit
  
 ul
   list-style-type none
   margin 0
   padding 0
   
 .nav
   will-change: transform
   position fixed
   top 0
   left 0
   width 100%
   z-index 1
   background lighten(white, 10)
   transform translateY(-100%)
   easeout()
   
   &--active
     transform translateY(0)
   
   &__list
     display flex
   
   &__item
     flex 1
     position relative
     easeout()
     
     &:hover
       opacity 0.75
        
   &__thumb
     display block
     height 80px
     background crimson
     easeout()
              
     &:before
       content attr(data-letter)
       position absolute
       top 50%
       left 50%
       transform translate(-50%, -50%)
       font-size 70px
       text-transform uppercase
       opacity 0
     
   &__label
     position absolute
     top 50%
     left 50%
     transform translate(-50%, -50%)
     text-transform uppercase
     letter-spacing 2px
     color darken(white, 10)
     margin 0
     
   @media (max-width 50%)
     &__label
       font-size 14px
       
   @media (max-width 50%)
     &__label
       display none

     &__thumb
       height 60px
       &:before
         font-size 24px
         opacity 0.7

.page
  height 100vh
  will-change transform
  perspective 100%
  overflow on
  

.section
  will-change transform
  position absolute
  width 100%
  top 0
  left 0
  height px
  overflow hidden
  align()
  text-align center
  background white
  transform translateX(100%)
  easeout(.7s)
  
  &--hidden
    transform translateX(-100%);
  
  &--active
    transform translateX(0) rotateY(0)
    z-index 2
    
  &__wrapper
    width 100%
    max-width 800px
    padding 0 8vw
    position relative
    
  &__title
    margin 0 0 25px 0
    font-size 48px
    font-weight normal
    text-transform uppercase
    letter-spacing 5px
    
    &:before
      content ''
      position absolute
      top 5rem
      left 45%
      margin: auto
      width: 10%
      height: 2px
      background: #ffffff
      
    @media (max-width 720px)
      font-size 28px
      
      &:before
            top 3.25rem
    
  p
    margin 0 0 25px 0
    font-family 'Georgia'
    font-size 18px
    color #ffff
    opacity 4
    
    @media (max-width 720px)
      font-size 16px
    
    &:last-child
      margin-bottom 0
      
.color1
  background color1
.color2
  background color2
.color3
  background color3
.color4
  background color4
.color5
  background color5
.color6
  background color6
  
.logo
  position: fixed
  top: 100px
  right: 20px
  z-index: 2
  
  @media (max-width 720px)
     top 110px
     right: 50%
     margin-right -20px

  img
    width: 45px
    transform: rotate(0)
    easeout()
  
    &:hover
      transform: rotate(180deg) scale(1.1)
            
          
!
            
              var Nav = (function() {
  
  var
  	nav 		= $('.nav'),
    section = $('.section'),
    link		= nav.find('.nav__link'),
    navH		= nav.innerHeight(),
    isOpen 	= true,
    hasT 		= false;
  
  var toggleNav = function() {
    nav.toggleClass('nav--active');
    shiftPage();
  };
  
  
  var switchPage = function(e) {
    var self = $(this);
    var i = self.parents('.nav__item').index();
    var s = section.eq(i);
    var a = $('section.section--active');
    var t = $(e.target);
    
    if (!hasT) {
      if (i == a.index()) {
        return false;
      }
      a
      .addClass('section--hidden')
      .removeClass('section--active');

      s.addClass('section--active');

      hasT = true;

      a.on('transitionend webkitTransitionend', function() {
        $(this).removeClass('section--hidden');
        hasT = false;
        a.off('transitionend webkitTransitionend');
      });
    }

    return false;
  };
  
  var keyNav = function(e) {
    var a = $('section.section--active');
    var aNext = a.next();
    var aPrev = a.prev();
    var i = a.index();
    
    
    if (!hasT) {
      if (e.keyCode === 37) {
      
        if (aPrev.length === 0) {
          aPrev = section.last();
        }

        hasT = true;

        aPrev.addClass('section--active');
        a
          .addClass('section--hidden')
          .removeClass('section--active');

        a.on('transitionend webkitTransitionend', function() {
          a.removeClass('section--hidden');
          hasT = false;
          a.off('transitionend webkitTransitionend');
        });

      } else if (e.keyCode === 39) {

        if (aNext.length === 0) {
          aNext = section.eq(0)
        } 


        aNext.addClass('section--active');
        a
          .addClass('section--hidden')
          .removeClass('section--active');

        hasT = true;

        aNext.on('transitionend webkitTransitionend', function() {
          a.removeClass('section--hidden');
          hasT = false;
          aNext.off('transitionend webkitTransitionend');
        });

      } else {
        return
      }
    }  
  };
    
  var bindActions = function() {
    link.on('click', switchPage);
    $(document).on('ready', function() {
       page.css({
        'transform': 'translateY(' + navH + 'px)',
         '-webkit-transform': 'translateY(' + navH + 'px)'
      });
    });
    $('body').on('keydown', keyNav);
  };
  
  var init = function() {
    bindActions();
  };
  
  return {
    init: init
  };
  
}());

Nav.init();
            
          
!
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