Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <div class="searchContainer">
	<div class="closecontainer">
		<div class="close"></div>
	</div>
	<div class="search">
		<svg class="searchIcon" viewBox="0 0 612.01 612.01">
			<path fill="#6DC38F" d="M606.209,578.714L448.198,423.228C489.576,378.272,515,318.817,515,253.393C514.98,113.439,399.704,0,257.493,0
						S0.006,113.439,0.006,253.393c0,139.954,115.276,253.393,257.487,253.393c61.445,0,117.801-21.253,162.067-56.586
						l158.624,156.099c7.729,7.614,20.277,7.614,28.007,0C613.938,598.686,613.938,586.328,606.209,578.714z M257.493,467.8
						c-120.326,0-217.869-95.992-217.869-214.407c0-118.414,97.543-214.407,217.869-214.407c120.327,0,217.869,95.993,217.869,214.407
						C475.362,371.808,377.82,467.8,257.493,467.8z"/>
		</svg>

		<input class="searchInput" type="text">
		<div class="result">
			<p>The results for<span class="word"></span></p>
			<div class="results">Hey im a result</div>
			<div class="results">Hey look at me im also a result</div>
			<div class="results">Im definitely the best result </div>
			<div class="results">whatev</div>
		</div>
	</div>
</div>

              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Poppins:400,300,700); 

body{
	background: #1d2124;
	font-family: 'Poppins', sans-serif;
}

.searchContainer{
	height: 100%;
	width:100%;
	position: relative;
	overflow:hidden;
}

.search{
	height: 0px;
	width: 0px;
	background: #6DC38F;
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	border-radius: 1000px;
	transition: .6s all cubic-bezier(.77,0,.175,1);
	z-index: 99;
	
	&.expand{
		height: 4000px;
		width: 4000px;
		
		.searchIcon{
			display: none;
		}
	}
	
	.searchInput{
		position:absolute;
		display: none;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		width: 300px;
		height:40px;
		background: transparent;
		border: none;
		border-bottom: 3px solid white;
		outline: none;
		color: #333;
		font-size: 26px;
		z-index:10;
	}
	
	.result{
		position: fixed;
		display: none;
		max-width:1200px;
		height: 400px;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		color: #fff;
		p{
			font-weight: 100;
			font-size: 38px;
		}
		span{
			font-weight: 700;
		}
		.results{
			display: none;
			margin-top: 30px;
			font-size: 16px;
			border-bottom: 1px solid white;
		}
	}
}

.searchIcon{
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width:40px;
	height:auto;
	stroke: #06fea6;
	cursor: pointer;
}

.closecontainer{
	position: fixed;
	z-index:999;
	height:50px;
	width:50px;
	top:30px;
	right:70px;
	cursor: pointer;
	display: none;

	.close::before, .close::after {
		content: "";
		position:absolute;
		border: solid #fff 2px;
		height: 20px;  
		width: 20px;
		transform: rotate(45deg); 
	}
	.close::before {
	  border-width: 0px 2px 2px 0px;
	  top: -5px;
	}
	.close::after {
	  border-width: 2px 0px 0px 2px;
	  top: 24px;
	}
	
}
              
            
!

JS

              
                $(window).load(function() {
	var icon = $('.searchIcon');
	var search = $('.search');
	var close = $('.closecontainer');
	var input = $('input.searchInput');
	var result = $('.result');
	var results = $('.results');
	var word = $('.word');
	var self = $(this);
	var setFocus;
	
	close.on('click', function() {
		toggleExpand();
	});

	icon.on('click', function() {
		toggleExpand();
	});

	function toggleExpand() {
		if (search.hasClass('expand')) {
			search.removeClass('expand');
			close.fadeOut();
			result.fadeOut();
			results.fadeOut();
			input.fadeOut('fast');
			input.val("");
		} else{
			clearTimeout(setFocus);
			search.addClass('expand');
			close.delay(400).fadeIn();
			input.delay(700).fadeIn('slow');
			setFocus = setTimeout(function(){
			input.focus();	
			input.on('keydown', function(e) {
				if (e.which == 13) {
					var searchWord = " " + input.val();
					input.fadeOut();
					word.text(searchWord);
					result.fadeIn();
					setFocus = setTimeout(function(){
						results.each(function(index) {
							$(this).delay(80*index).fadeIn(500)
						});
					}, 500);
					e.preventDefault();
				 }
			});
			}, 1000);
		}
	}
});
              
            
!
999px

Console