css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

            
              mixin labels(n)
	label(for="slide"+[n+1] id="slide"+[n+1] class="slide")
		.content 
			h1!= content[n]
.container
	form#nav
		- var pages = ['Home', 'Features', 'Adding pages', 'More', 'About', 'A title', 'Another title']
		- var content = ['<strong>Not really a Pure CSS</strong> one page vertical navigation', 'Amazing', 'content', 'here', ':)', '', '', '']
		- for(var n = 0; n < pages.length; n++)
			if n == 0
				input(type="radio" id="slide1" name="slider" title=""+pages[0] data-scroll="0" autofocus checked)
			else
				input(type="radio" id="slide"+[n+1] name="slider" title=""+pages[n] data-scroll=""+n)
		.labels
			- for(var n = 0; n < pages.length; n++)
				+labels(n)
					
            
          
!
            
              pages = 7
bg = #2b2b38
bg-odd = #f5004f

.container
	width 100vw
	height 100vh
	background black
	position relative
	display flex
	align-items center
	form
		box-sizing border-box
		text-align center
		padding 22px
		display inline-flex
		flex-direction column
		position fixed
		height 100vh
		justify-content center
		input
			height 0
			margin 12px 0
			z-index 1
			&:checked
				outline 0
				border 0
			&:before
				content ""
				position absolute
				display inline-block
				width 8px
				height 8px
				border 1px solid rgba(255, 255, 255, 0.81)
				border-radius 11px
				cursor pointer
				transition all .25s linear
			&:checked:before 
				background-color white			
			&:after
				content ""attr(title)""
				position relative
				left 30px
				opacity 0
				color white
				font-size 9px
				display block
				min-width 80px
				transition all .25s linear
			&:checked:after
				opacity 1
				left 20px
			&:hover:after:not(label)
				opacity 1	
			for i in 1..pages
				&:nth-of-type({i}):checked ~ .labels label
					transform translateY(-(i - 1) * 100%)
					
		.labels 
			position absolute
			top 0
			left 0
			width 100vw
			height 100vh
			display flex
			flex-direction column
			label
				min-width 100vw
				min-height 100vh
				display flex
				flex-direction column
				justify-content center
				align-items center
				background-color bg
				z-index 0
				transition all .75s cubic-bezier(0.75, 0.25, 0, 1.05)
				&:nth-child(odd)
					background-color bg-odd
					color white !important
					
body
	font-family 'Open sans', sans-serif
	font-size 16px
	font-weight 100
	color white
	margin 0
	padding 0

.content 
	width 100%
	box-sizing border-box
	padding 0 110px
	.block 
		width inherit
		font-size 11px
		font-weight 400
		line-height 1.5
		margin 42px 0
		display flex
		justify-content center
		span
			margin 0 42px
			i
				margin-bottom 22px
				margin 0 42px // @extend span // not working for some reason i dont know yet :D
				&:before
					font-size 30px

.slide:nth-child(even) .content .block
	color #717171
.icon 
	position absolute
	bottom 30px
	left 0
	right 0
	font-size 11px
	text-align center
	line-height 1.5
	display flex
	flex-direction column
#slide5 .content .block
	flex-direction column
	i
		margin 0 12px
		vertical-align middle
strong
	font-weight 400
h1
	text-transform uppercase
ol
	text-align left
	list-style-type decimal
a
	text-decoration none
	color inherit
	transition all .25s linear
	&:hover
		color rebeccapurple
            
          
!
            
              /*
	This script's only use is so we can scroll with mousewheel
	otherwise u can scroll by clicking in navigation inputs or
	using the arrow keys on ur keyboard.
	
	Changes on the scroll loop won't affect arrow keys' navigation loops.
*/
$(document).ready(function(){ 
	var pages = (7 - 1) // 0..6 = 7 pages
	$(".container").bind('mousewheel', function(e){
		var datascroll = $('#nav input[name="slider"]:checked').data('scroll');
		if(e.originalEvent.wheelDelta /120 > 0) { // scrolled up
			datascroll != 0 ? datascroll -= 1 : datascroll = pages
			// change this last 'pages' to '0' to stop the loop back when scrolling up
		} else { // scrolled down
			datascroll < pages ? datascroll += 1 : datascroll = 0 
			// change this last '0' to 'pages' to stop the loop back when scrolling down
		}		
		$('input[name="slider"]').each(function(i, input) {
			if (i == datascroll) { // found the next page
				$("input#" + input.id).prop('checked', true).focus();
				exit; // breaks loop to not waste time 
			}
		});
    });
});
            
          
!
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