cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              
// Inputs
input(type="radio" name="item" checked)#section1
input(type="radio" name="item")#section2
input(type="radio" name="item")#section3
input(type="radio" name="item")#section4

// Navigation
nav.nav
  - for(var i = 1; i < 5; i++)
    label(for="section" + i).nav__item

// Sections

each val in ['One Page', 'Pure CSS', 'Smooth transition', '@Ver_Qn']
  section
    h1= val
    
// Fix the white space when scrolling two sections at the same time
.cover
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Carter+One);

$colors: #eb9385, #99c0bc, #937782, #2d4249;

// Inputs
input[type='radio'] {
  display: none;
}

@for $i from 1 through 4 {
  input[type='radio']#section#{$i}:checked ~ nav > label[for='section#{$i}'] {
    background-color: white;
  }
  
  input[type='radio']#section#{$i}:checked ~ section:nth-of-type(#{$i}) { 
    z-index: 1;
    top: 0;
    transition: top 0.5s ease-in-out;
    transition-delay: 0s;
  }
  
  input[type='radio']#section#{$i}:checked ~ .cover { 
   background-color: nth($colors, $i);
  }
}


// Navigation
.nav {
  position: fixed;
  z-index: 2;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  
  &__item {
    width: 12px;
    height: 12px;
    display: block;
    margin: 12px auto;
    border: solid 2px white;
    border-radius: 50%;
    cursor: pointer;
    
    &:hover {
      background-color: white;
    }
  }
}


// Sections
section {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  transition-delay: 0.5s;
}

@for $i from 1 through 4 {
  section:nth-of-type(#{$i}) {
    background: nth($colors, $i);
  }
}


// Fix the white-space
.cover {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
}



// Base
html,
body {
  height: 100%;
}

body {
  overflow: hidden;
  color: white;
  font: 100% 'Carter One', cursive;
}

h1 {
  font-size: 6em;
}
            
          
!
            
              // Not a single line of Javascript !

/* TODO
 * 1 - Fix z-index bug on edge/IE.
 */
            
          
!
999px
Loading ..................

Console