cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - 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.

+ 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.

            
              <nav id="dot">
	<ul>
		<li class="active"><a href="#c"><em>Intro</em></a></li>
		<li><a href="#c"><em>Skill</em></a></li>
		<li><a href="#c"><em>Website</em></a></li>
		<li><a href="#c"><em>Work</em></a></li>
		<li><a href="#c"><em>About</em></a></li>
		<li><a href="#c"><em>Contact</em></a></li>
	</ul>
</nav>

<section id="contents">
	<div id="section1">
		<div class="container">
			<div class="sec1">
				<h2>Think Different</h2>
			</div>
		</div>
	</div>
	<div id="section2">
		<div class="container">
			<div class="sec2">
				<h2>Way to Go</h2>
			</div>
		</div>
	</div>
	<div id="section3">
		<div class="container">
			<div class="sec3">
				<h2>Have a Dream</h2>
			</div>
		</div>
	</div>
	<div id="section4">
		<div class="container">
			<div class="sec4">
				<h2>Ti Amo</h2>
			</div>
		</div>
	</div>
	<div id="section5">
		<div class="container">
			<div class="sec5">
				<h2>Que Sera Sera</h2>
			</div>
		</div>
	</div>
	<div id="section6">
		<div class="container">
			<div class="sec6">
				<h2>Spero Spera</h2>
			</div>
		</div>
	</div>
</section>
            
          
!
            
              @import url('https://fonts.googleapis.com/css?family=Quicksand');
/* font-family: 'Quicksand', sans-serif; */

/* nav */
#dot {position: fixed; right: 20px; top: 50%; transform: translateY(-50%);}
#dot li {}
#dot li a {position: relative; width: 15px; height: 15px; background-color: rgba(255,255,255,0.5); border-radius: 15px; margin: 8px; display: block;}
#dot li a em {position: absolute; top:-7px; right: 37px; background: rgba(0,0,0,0.55); color: #fff; padding: 8px 14px 8px 14px; display: block; opacity: 0; transition: all 0.3s ease;}
#dot li a em:after {content:''; position: absolute; top: 11px; right: -5px; border-left: 5px solid rgba(0,0,0,0.55);
 border-top: 5px solid transparent;
 border-bottom: 5px solid transparent;}
#dot li.active a {position: relative; background-color: rgba(255,255,255,1);}
#dot li.active a em {opacity: 1; right: 27px;}



/* container */
.container {}

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

/* section */
#section1 {background-image: linear-gradient(60deg, #64b3f4 0%, #c2e59c 100%);}
#section2 {background-image: linear-gradient(to top, #fbc2eb 0%, #a6c1ee 100%);}
#section3 {background-image: linear-gradient(120deg, #f6d365 0%, #fda085 100%);}
#section4 {background-image: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);}
#section5 {background-image: linear-gradient(to top, #5ee7df 0%, #b490ca 100%);}
#section6 {background-image: linear-gradient(to right, #eea2a2 0%, #bbc1bf 19%, #57c6e1 42%, #b49fda 79%, #7ac5d8 100%);}
            
          
!
            
              var nav = $("#dot ul li");
var contents = $("#contents > div");

nav.click(function(e){
	e.preventDefault();
	var target = $(this);
	var index = target.index();
	// alert(index);
	var section = contents.eq(index);
	var offset = section.offset().top;
	// alert(offset);
	$(".offset_top").text(offset);
	
	$("html,body").animate({scrollTop:offset},600, "easeInOutExpo");
});

$(".offset_top").text($("#section2").offset().top);
$(window).scroll(function(){
	var wScroll = $(this).scrollTop();
	
	$(".scroll_top").text(wScroll);
	if(wScroll >= contents.eq(0).offset().top){
		nav.removeClass("active");
		nav.eq(0).addClass("active");
	}
	if(wScroll >= contents.eq(1).offset().top){
		nav.removeClass("active");
		nav.eq(1).addClass("active");
	}
	if(wScroll >= contents.eq(2).offset().top){
		nav.removeClass("active");
		nav.eq(2).addClass("active");
	}
	if(wScroll >= contents.eq(3).offset().top){
		nav.removeClass("active");
		nav.eq(3).addClass("active");
	}
	if(wScroll >= contents.eq(4).offset().top){
		nav.removeClass("active");
		nav.eq(4).addClass("active");
	}
	if(wScroll >= contents.eq(5).offset().top){
		nav.removeClass("active");
		nav.eq(5).addClass("active");
	}
});
            
          
!
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.
Loading ..................

Console