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

              
                .logo 
	h3 StuFF
.intro
	h3 I like...
.panel.some-stuff
	h2 some stuff
.panel.other-stuff
	h2 other stuff
.panel.more-stuff
	h2 more stuff
.panel.rare-stuff
	h2 rare stuff
nav
	a.button.button-1 
		h1 01
		span some stuff
	a.button.button-2 
		h1 02
		span other stuff
	a.button.button-3
		h1 03
		span more stuff
	a.button.button-4
		h1 04
		span rare stuff
		

              
            
!

CSS

              
                $base-duration: 250ms;

// Colors
$primary: slategray;
$accent: tomato;
$white: whitesmoke;
$black: #444;

// Breakpoints
$sm: 20rem;
$med: 48rem;
$lg: 64rem;

*, *:before, *:after {
	box-sizing: border-box;
	outline: none;
}

html {
	font-family: 'Source Sans Pro', sans-serif;
	font-size: 16px;
	font-smooth: auto;
	font-weight: 300;
	line-height: 1.5;
	color: #444;
}

body {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	width: 100vw;
	height: 100vh;
	background: linear-gradient(45deg, rgba(216,255,222,1) 10%, rgba(211,227,255,1) 90%);
	transition: all 0.5s linear;
	overflow: hidden;
	z-index: 0;
	&:before {
		position: absolute;
		content: '';
		top: -5%;
		left: -5%;
		width: 60vw;
		height: 120vh;
		background: repeating-linear-gradient(
			45deg,
			rgba(white,0.1),
			rgba(white,0.1) 1px,
			rgba(black,0.0) 1px,
			rgba(black,0.0) 20px
		);
		transform: rotate(45deg);
		z-index: 0;
	}
}

a {
	cursor: pointer;
}

.logo {
	position: absolute;
	top: 30px;
	left: 30px;
	height: 40px;
	padding-left: 30px;
	z-index: 98;
	&:before,
	&:after {
		position: absolute;
		content: '';
		top: 0;
		width: 10px;
		height: 20px;
		transition: 0.15s linear;
	}
	&:before {
		left: 0;
		background-color: $black;
		border-radius: 99px 0 0 99px;
	}
	&:after {
		left: 10px;
		background: transparent;
		border: 1px solid $black;
		border-radius: 0 99px 99px 0;
	}
	&.white {
		&:before {
			background: transparent;
			border: 1px solid $white;
		}
		&:after {
			background: $white;
			border: none;
		}
	}
	h3 {
		margin: 0;
		padding: 0;
		font-family: 'VT323', monospace;
		font-size: 26px;
		font-weight: 300;
		letter-spacing: 1px;
		line-height: 0.75;
		transition: 0.15s linear;
	}
}

.intro {
	position: absolute;
	bottom: 10vh;
	left: 0vw;
	transform: rotate(-90deg);
	h3 {
		color: $black;
		font-size: 32px;
	}
}

nav {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: center;
	width: 20vw;
	height: 100vh;
	padding: 0 20px;
	//background: red;
	z-index: 99;
}

.button {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: flex-end;
	width: 100%;
	height: 25vh;
	margin: 0;
	padding: 20px;
	background: transparent;
	border-bottom: 1px solid rgba(#666,0.0);
	&:last-child {
		border-bottom: none;
	}
	&:hover {
		h1, span {
			color: white;
			transition: 0.25s linear;
			opacity: 1;
		}
	}
	h1 {
		margin: 0;
		padding: 0;
		color: #999;
		font-size: 72px;
		font-weight: 200;
		line-height: 1;
		opacity: 0.5;
	}
	span {
		color: #999;
		font-size: 18px;
		font-weight: 700;
		opacity: 0.5;
	}
}

.panel {
	position: absolute;
	display: none;
	bottom: 0vh;
	left: 10vw;
	transition: bottom 0.25s ease;
	//background: rgba(black,0.2);
	&.show {
		display: block;
		bottom: 10vh;
		animation: moveUp 0.5s ease;
	}
	h2 {
		margin: 0;
		padding: 0;
		color: white;
		font-size: 10vw;
		font-weight: 700;
		line-height: 1;
	}
	p {
		margin: 0;
		padding: 0;
		color: white;
		
		font-size: 22px;
		line-height: 1;
	}
}

@keyframes moveUp {
	0% { bottom: 0vh; }
	100% { bottom: 10vh; }
}
              
            
!

JS

              
                var body_bg = 'linear-gradient(45deg, rgba(216,255,222,1) 10%, rgba(211,227,255,1) 90%)';
var button1_bg = 'linear-gradient(90deg, #3F2B96 0%, #A8C0FF 100%)';
var button2_bg = 'linear-gradient(-45deg, #1CB5E0 0%, #000851 100%)';
var button3_bg = 'linear-gradient(90deg, #9ebd13 0%, #008552 100%)';
var button4_bg = 'linear-gradient(-45deg, #d53369 0%, #daae51 100%)';

$('a.button').on('mouseover', function() {
	$('.logo').addClass('white');
	$('.logo h3').css('color','white');
	$('.intro h3').css('color','white');
	if($(this).hasClass('button-1')) {
		$('body').css('background', button1_bg);
		$('.some-stuff').addClass('show');
	} 
	if($(this).hasClass('button-2')) {
		$('body').css('background', button2_bg);
		$('.other-stuff').addClass('show');
	}
	if($(this).hasClass('button-3')) {
		$('body').css('background', button3_bg);
		$('.more-stuff').addClass('show');
	}
	if($(this).hasClass('button-4')) {
		$('body').css('background', button4_bg);
		$('.rare-stuff').addClass('show');
	}
});

$('.button').on('mouseout', function() {
	$('body').css('background',body_bg);
	$('.logo').removeClass('white');
	$('.logo h3').css('color','#444');
	$('.intro h3').css('color','#444');
	$('.some-stuff').removeClass('show');
	$('.other-stuff').removeClass('show');
	$('.more-stuff').removeClass('show');
	$('.rare-stuff').removeClass('show');
});
              
            
!
999px

Console