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.

<div class="info">
		<span class="offset_top">0</span>
		<span class="scroll_top">0</span>
<nav id="nav">
		<li><a href="#section1">menu1</a></li>
		<li><a href="#section2">menu2</a></li>
		<li><a href="#section3">menu3</a></li>
		<li><a href="#section4">menu4</a></li>
		<li><a href="#section5">menu5</a></li>
		<li><a href="#section6">menu6</a></li>

<div id="contents">
	<div id="section1">We love What You do.</div>
	<div id="section2">Make hay while the sun shines</div>
	<div id="section3">All in my dream</div>
	<div id="section4">Be Strict With Myself</div>
	<div id="section5">Can't Stop to Dream</div>
	<div id="section6">No Pains No Gain</div>
              @import url('https://fonts.googleapis.com/css?family=Kreon');
/* font-family: 'Kreon', serif; */

.info {position: fixed; left: 10px; bottom: 50px;}
.info span {position: relative; background: rgba(0,0,0,0.6); padding: 10px; border-radius: 50%; color: #fff; display: inline-block; width: 50px; height: 50px; margin: 3px; text-align: center; line-height: 50px;}
.info .offset_top:before {content:'offset'; position: absolute; left: 50%; top: -40px; transform: translateX(-50%);}
.info .scroll_top:before {content:'scroll'; position: absolute; left: 50%; top: -40px; transform: translateX(-50%);}

#nav {overflow:hidden; position:fixed; left:0; top:0; width: 100%; background-color: rgba(255,255,255,0.6);}
#nav h1 {float:left; color: #fff; font-size:40px; padding:12px 5px 5px 20px; font-weight:900;	}
#nav ul {float:right;}
#nav ul li {display: inline;}
#nav ul li a {padding: 20px 10px; text-decoration: none; color: #fff; display:inline-block;}
#nav ul li.active a {color: #c51162; border-bottom: 3px solid #c51162;}

#contents {text-align: center; font-size: 50px; color:#fff; font-family: 'Kreon', serif;}
#contents > div {height: 100vh; line-height: 100vh;}
#section1 {background-color: #42a5f5;}
#section2 {background-color: #4db6ac;}
#section3 {background-color: #4dd0e1;}
#section4 {background-color: #4fc3f7;}
#section5 {background-color: #c0ca33;}
#section6 {background-color: #7cb342;}
              var nav = $("#nav ul li");
var contents = $("#contents > div");

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

	var wScroll = $(this).scrollTop();
	if(wScroll >= contents.eq(0).offset().top){
	if(wScroll >= contents.eq(1).offset().top){
	if(wScroll >= contents.eq(2).offset().top){
	if(wScroll >= contents.eq(3).offset().top){
	if(wScroll >= contents.eq(4).offset().top){
	if(wScroll >= contents.eq(5).offset().top){
🕑 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 ..................