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

              
                <link href="https://fonts.googleapis.com/css?family=Jura:100,300,400,700,900" rel="stylesheet">

<div id="dot1">
  <ul>
    <li class="on"><a href="#section1">Intro</a></li>
    <li><a href="#section2">Skill</a></li>
    <li><a href="#section3">Website</a></li>
    <li><a href="#section4">Work</a></li>
    <li><a href="#section5">About</a></li>
    <li><a href="#section6">Contact</a></li>
  </ul>
</div>

<div id="dot2">
  <ul>
    <li class="on"><a href="#section1"><span>Intro</span></a></li>
    <li><a href="#section2"><span>Skill</span></a></li>
    <li><a href="#section3"><span>Website</span></a></li>
    <li><a href="#section4"><span>Work</span></a></li>
    <li><a href="#section5"><span>About</span></a></li>
    <li><a href="#section6"><span>Contact</span></a></li>
  </ul>
</div>                                                                                                       
<div id="contents">
  <div id="section1">
    <div class="container">
      <div class="sec1">
        <h2>I`m hurting baby, I`m broken down</h2>
      </div>
    </div>
  </div>
  <div id="section2">
    <div class="container">
      <div class="sec2">
        <h2>I need your loving, loving</h2>
      </div>
    </div>
  </div>
  <div id="section3">
    <div class="container">
      <div class="sec3">
        <h2>I need it now</h2>
      </div>
    </div>
  </div>
  <div id="section4">
    <div class="container">
      <div class="sec4">
        <h2>When I`m without you</h2>
      </div>
    </div>
  </div>
  <div id="section5">
    <div class="container">
      <div class="sec5">
        <h2>I`m something weak</h2>
      </div>
    </div>
  </div>
  <div id="section6">
    <div class="container">
      <div class="sec6">
        <h2>You got me begging, begging</h2>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                /* contents */

#contents {font-family: 'Jura', sans-serif; text-align: center; font-size: 50px; color:#fff;}
#contents > div {height: 100vh; line-height: 100vh;}

#section1 {background: linear-gradient(0deg, #fad0c4, #ffd1ff)}
#section2 {background: linear-gradient(0deg, #ff9a9e, #fecfef)}
#section3 {background: linear-gradient(0deg, #ff9a9e, #fad0c4)}
#section4 {background: linear-gradient(0deg, #ffecd2, #fcb69f)}
#section5 {background: linear-gradient(0deg, #f6d365, #fda085)}
#section6 {background: linear-gradient(0deg, #fccb90, #d57eeb)}

/* dot1 */

#dot1 {position: fixed; left: 40px; top: 50%; 
transform: translatey(-50%); }
#dot1 li {margin: 14px 7px; }
#dot1 li a {color: #fff; text-decoration: none; padding: 5px 15px; }
#dot1 li.on a {background-color: rgba(0,0,0,0.5); border-radius: 10px 0; }

/* dot2 */
#dot2 {position: fixed; right: 40px; top: 50%; transform:translatey(-50%);}
#dot2 li {width:17px; height: 17px; background-color: rgba(255,255,255,0.5); border-radius:50%; margin: 16px 7px;}
#dot2 li a {color: #fff; text-decoration: none; padding: 8px 15px 5px 15px; position:relative;  }
#dot2 li a span {opacity:0; position: absolute; right:35px; top:3px; background-color: rgba(0,0,0,0.51); padding: 8px 10px; transition: all 0.3s ease;}
#dot2 li a span:after {content:''; position:absolute; right:-7px; top:8px; 
	border-left: 7px solid rgba(0,0,0,0.51);
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
}
#dot2 li.on {background-color: rgba(255,255,255,1);}
#dot2 li.on a span {opacity: 1; right:25px; }




              
            
!

JS

              
                var dot1 = $("#dot1 > ul > li");
var dot2 = $("#dot2 > ul > li");
var contents = $("#contents > div");

dot1.on("click",function(e){
  e.preventDefault();
  
  var target = $(this);
  var index = target.index();
  
  var section = contents.eq(index);
  var offset = section.offset().top;
  
  $("body, html").animate({scrollTop:offset},400);
  
   
});

$(window).on("scroll",function(){
     var wScroll = $(this).scrollTop();
   
     if(wScroll >= contents.eq(0).offset().top){
        dot1.removeClass("on");
        dot1.eq(0).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(1).offset().top){
        dot1.removeClass("on");
        dot1.eq(1).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(2).offset().top){
        dot1.removeClass("on");
        dot1.eq(2).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(3).offset().top){
        dot1.removeClass("on");
        dot1.eq(3).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(4).offset().top){
        dot1.removeClass("on");
        dot1.eq(4).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(5).offset().top){
        dot1.removeClass("on");
        dot1.eq(5).addClass("on");
     }
  });

dot2.on("click",function(e){
  e.preventDefault();
  
  var target = $(this);
  var index = target.index();
  
  var section = contents.eq(index);
  var offset = section.offset().top;
  
  $("body, html").animate({scrollTop:offset},400);
  
   
});

$(window).on("scroll",function(){
     var wScroll = $(this).scrollTop();
   
     if(wScroll >= contents.eq(0).offset().top){
        dot2.removeClass("on");
        dot2.eq(0).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(1).offset().top){
        dot2.removeClass("on");
        dot2.eq(1).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(2).offset().top){
        dot2.removeClass("on");
        dot2.eq(2).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(3).offset().top){
        dot2.removeClass("on");
        dot2.eq(3).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(4).offset().top){
        dot2.removeClass("on");
        dot2.eq(4).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(5).offset().top){
        dot2.removeClass("on");
        dot2.eq(5).addClass("on");
     }
  });

$(window).on("scroll",function(){
     var wScroll = $(this).scrollTop();
   
     if(wScroll >= contents.eq(0).offset().top){
        dot2.removeClass("on");
        dot2.eq(0).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(1).offset().top){
        dot2.removeClass("on");
        dot2.eq(1).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(2).offset().top){
        dot2.removeClass("on");
        dot2.eq(2).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(3).offset().top){
        dot2.removeClass("on");
        dot2.eq(3).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(4).offset().top){
        dot2.removeClass("on");
        dot2.eq(4).addClass("on");
     }
    var wScroll = $(this).scrollTop();
     if(wScroll >= contents.eq(5).offset().top){
        dot2.removeClass("on");
        dot2.eq(5).addClass("on");
     }
  });
              
            
!
999px

Console