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

              
                [[[https://codepen.io/shaunrfox/pen/QwrRqM]]]

<!-- <div class="window-width"></div> -->

<header class="site-header"></header>
<div class="create-search">
	<div class="search-criteria">
		<div class="keywords">
			<div class="label">Keywords</div>
			<div class="keyword-input-wrapper"> 
				<div class="helper-icon">
					<svg viewBox="0 0 30 30" class="ico-search">
						<use xlink:href="#ico-search"></use>
					</svg>
				</div>
				<input id="keyword-input" type="text" placeholder="Search by Keyword"/>
				<button class="advanced-button">View Advanced</button>
				<div class="keyword-helper">
					<button class="button icon-button">
						<svg viewBox="0 0 30 30" class="ico-close">
							<use xlink:href="#ico-close"></use>
						</svg>
					</button>
				</div>
			</div> <!-- /.keyword-input-wrapper -->
		</div>

		<div class="date-range">
			<div class="label">Date Range</div>
			<div class="select-placeholder"></div>
		</div>
		<div class="sources">
			<button class="button button-with-icon sources-toggle all-selected">
				All
				<svg viewBox="0 0 30 30" class="ico-checked">
					<use xlink:href="#ico-checked"></use>
				</svg>
				<svg viewBox="0 0 30 30" class="ico-checkbox">
					<use xlink:href="#ico-checkbox"></use>
				</svg>				
			</button>
			<div class="label">Sources</div>
			<div class="source-list">
				<div class="source active">
					<img src="https://dl.dropboxusercontent.com/u/128045/social-icons-to-link/twitter-icon-sm.jpg" alt="Twitter" />
					<div class="source-off">
						<svg viewBox="0 0 30 30" class="ico-close">
							<use xlink:href="#ico-close"></use>
						</svg>
					</div>
				</div>
				<div class="source active">
					<img src="https://dl.dropboxusercontent.com/u/128045/social-icons-to-link/instagram-icon-sm.jpg" alt="Instagram" />
					<div class="source-off">
						<svg viewBox="0 0 30 30" class="ico-close">
							<use xlink:href="#ico-close"></use>
						</svg>
					</div>
				</div>
				<div class="source active">
					<img src="https://dl.dropboxusercontent.com/u/128045/social-icons-to-link/facebook-icon-sm.jpg" alt="Facebook" />
					<div class="source-off">
						<svg viewBox="0 0 30 30" class="ico-close">
							<use xlink:href="#ico-close"></use>
						</svg>
					</div>
				</div>
				<div class="source active">
					<img src="https://dl.dropboxusercontent.com/u/128045/social-icons-to-link/youtube-icon-sm.jpg" alt="YouTube" />
					<div class="source-off">
						<svg viewBox="0 0 30 30" class="ico-close">
							<use xlink:href="#ico-close"></use>
						</svg>
					</div>
				</div>
				<div class="source active">
					<img src="https://dl.dropboxusercontent.com/u/128045/social-icons-to-link/vk-icon-sm.jpg" alt="VK" />
					<div class="source-off">
						<svg viewBox="0 0 30 30" class="ico-close">
							<use xlink:href="#ico-close"></use>
						</svg>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="search-button">
		<button class="button-action large-button">Search</button>
		<div class="button search-warning">
			<svg viewBox="0 0 30 30" class="ico-warning-color">
				<use xlink:href="#ico-warning-color"></use>
			</svg>
		</div> 
	</div>
</div> <!-- /.create-search -->

<div class="results">
	<header class="results-header">
		Showing 204 Results
	</header>
	<div class="results-list">
		<div>post</div>
		<div>post</div>
		<div>post</div>
		<div>post</div>
		<div>post</div>
		<div>post</div>
		<div>post</div>
		<div>post</div>
		<div>post</div>
		<div>post</div>
	</div>
	<footer class="results-footer"></footer>
</div>

<div class="map">
	<div class="location-bar">
		<div class="location-input-wrapper">
			<div class="helper-icon">
				<svg viewBox="0 0 30 30" class="ico-location">
					<use xlink:href="#ico-location"></use>
				</svg>
			</div>
			<input type="text" placeholder="Find a Location"/>
			<div class="dropdown-icon">
				<svg viewBox="0 0 30 30" class="ico-arrow-down">
					<use xlink:href="#ico-arrow-down"></use>
				</svg>
			</div>
		</div>
		<button class="button button-with-icon map-button">
			Tools
			<svg viewBox="0 0 30 30" class="ico-arrow-down">
				<use xlink:href="#ico-arrow-down"></use>
			</svg>
		</button>
		<button class="button button-with-icon map-button">
			Layers
			<svg viewBox="0 0 30 30" class="ico-arrow-down">
				<use xlink:href="#ico-arrow-down"></use>
			</svg>
		</button>
		<button class="button button-with-icon map-button">
			Lenses
			<svg viewBox="0 0 30 30" class="ico-eye">
				<use xlink:href="#ico-eye"></use>
			</svg>
		</button>
	</div>
</div>

<div class="modal-dialog">
	<div class="modal-content">
		<div class="modal-header">
			<h4 class="modal-title">Profile Summary</h4>
			<button type="button" class="icon-button close">
				<svg viewBox="0 0 30 30" class="ico-close">
					<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico-close"></use>
				</svg>
			</button>
		</div>
		<div class="modal-body">
			Modal content
		</div>
	</div>
</div>
              
            
!

CSS

              
                body {
	width: 100%;
	height: 100%;
	display: block;
}

.window-width {
	position: fixed;
	top: 0;
	right: 0;
	width: auto;
	height: auto;
	padding: 10px 20px;
	background: $orange;
	color: $white;
	font-size: 20px;
	z-index: 10000;
}

.site-header {
	position: relative;
	width: 100%;
	height: 50px;
	background: $midnight;
	box-shadow: 0 2px 3px rgba($off-black, .2);
	z-index: 1000;
}

.create-search {
	float: left;
	width: percentage(2/3);
	height: 80px;
	background: $off-white;
	border-bottom: 1px solid $mid-grey; 
	box-shadow: 0 2px 3px rgba($off-black, .2);
	z-index: 100;
	
	@media (max-width: 1530px) {
		width: 100%;
	}
}

.search-criteria {
	position: relative;
	float: left;
	width: auto;
	@include clearfix();
	white-space: nowrap;
	padding: 10px 20px;
	z-index: 10;
	
	.keywords,
	.date-range,
	.sources {
		position: relative;
		float: left;
		margin-bottom: 10px;
		
		.label {
			@include font-size(1.4);
			@include uppercase();
			margin-bottom: 5px;
		}
		
		input {
			width: 100%;
			height: 30px;
			border: 1px solid $light-grey;
			padding: 0 30px;
			@include font-size(1.6);
			border-radius: 4px;
			
			&:focus {
				outline: none;
				border-color: $blue;
			}
		}
	}
	
	.keywords {
		width: 300px;
		margin-right: 20px;
		
		&:focus {
			outline: none;
			border-color: $blue;
		}
	}
	
	.date-range {
		float: left;
		margin-right: 20px;
		
		.select-placeholder {
			width: 225px;
			height: 30px;
			background: $light-grey;
		}
	}
}

.keyword-input-wrapper {
	position: relative;
	width: auto;
	height: auto;
	@include clearfix();
	
	> .dropdown-icon {
		background: $light-grey;
		border-radius: 4px;
		width: 20px;
		height: 20px;
		top: 5px;
		right: 5px;
		overflow: hidden;

		svg { 
			position: relative;
			fill: $off-black; 
			width: 30px;
			height: 30px;
			top: -5px;
			left: -5px;
		}

		&:hover {
			cursor: pointer;
			background: tint($light-grey, 75);
		}
		
		&:active,
		&.keyword-helper-open {
			background: shade($light-grey, 85);
		}
	}
}

.advanced-button {
	display: none;
	@include unstyled-button ();
	position: relative;
	top: 0;
	left: 0;
	right: 0; 
	margin: 0 auto; 
	border-radius: 0;
	width: auto;
	height: 20px;
	background: $blue;
	padding: 0 10px;
	@include uppercase();
	color: $white;
	@include font-size(1.2);
	
	&:focus { outline: 0; }
	
	&:hover { background: tint($blue, 80); }
}

.keyword-helper {
	display: none;
	position: relative;
	top: 3px;
	left: 0;
	width: 350px;
	height: 200px;
	background: $white;
	border: 1px solid $light-grey;
	border-radius: 4px;
	box-shadow: 2px 2px 3px rgba($off-black, .2);
	
	.button {
		position: absolute;
		top: 5px;
		right: 5px;
		border-radius: 30px;
	}
}

.keyword-input-wrapper {
	&.typing {
		.advanced-button { display: block; }
	}
	
	&.advanced-open {
		.advanced-button { display: none; }
		
		.keyword-helper {
			display: block;
		}
	}
}

.helper-icon {
	position: absolute;
	top: 0;
	left: 0;
	width: 30px;
	height: 30px;

	svg { fill: $light-grey; }
}

.dropdown-icon {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 30px;
	height: 30px;

	svg { fill: $light-grey; }
}

.search-button {
	float: left;
	height: 100%;
	
	button,
	.search-warning {
		float: left;
		@include vertical-align();
	}
	
	button { margin-right: 5px; }
	
	.search-warning { 
		width: 30px;
		height: 30px;
		padding: 0;
		
		svg { 

		}
	}
}

.map {
	position: relative;
	float: left;
	width: percentage(2/3);
	height: calc(100% - 80px - 50px);
	background-image: url('https://dl.dropboxusercontent.com/u/128045/generic-map-satelite.jpg');
	background-position: center center;
	background-size: cover;
	z-index: 1;
}

.location-bar {
	position: relative;
	width: calc(100% - 40px);
	margin: 20px;
	height: 30px;
	border-bottom: 1px solid $mid-grey;
	border-radius: 4px;
	
	.location-input-wrapper {
		position: relative;
		float: left;
		height: calc(100% + 1px);
		width: calc(100% - 300px);
	}
	
	input {
		width: 100%;
		height: 100%;
		border: 1px solid transparent;
		border-bottom: 1px solid $mid-grey;
		@include font-size(1.6);
		padding: 0 30px;
		border-radius: 4px 0 0 4px;
		
		&:focus {
			outline: none;
			border-color: $blue;
		}
	}
	
	.map-button {
		height: 100%;
		width: 100px;
		border-radius: 0;
		border-left: 1px solid $mid-grey;
		border-bottom: none;
			
		&:last-of-type {
			border-radius: 0 4px 4px 0;
		}
	}
}

.results {
	position: relative;
	float: right;
	width: percentage(1/3);
	height: calc(100% - 50px);
	background: $mid-grey;
	border-left: 1px solid $mid-grey;
	
	@media (max-width: 1530px) {
		height: calc(100% - 50px - 80px);
	}
}

$results-header-height: 40px;
$results-footer-height: 60px;

.results-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: $results-header-height;
	padding: 0 10px;
	line-height: $results-header-height;
	font-size: 16px;
	@include uppercase();
	background: tint($blue, 30);
	box-shadow: 0 2px 3px rgba($off-black, .2);
}

.results-list {
	position: absolute;
	top: $results-header-height;
	left: 0;
	right: 0;
	bottom: $results-footer-height;
	overflow: auto;
	
	> div {
		width: calc(100% - 20px);
		height: 150px;
		background: $white;
		border: 1px solid $light-grey;
		margin: 10px 10px 0 10px;
		padding: 20px;
		border-radius: 4px;
		box-shadow: 2px 2px 3px rgba($off-black, .2);
		font-size: 20px;
		
		&:hover {
			cursor: pointer;
			background: tint($blue, 30);
		}
		
		&:last-child {
			margin-bottom: 10px;
		}
	}
}

.results-footer {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: $results-footer-height;
	background: $light-grey;
	box-shadow: 0 -2px 3px rgba($off-black, .2);
}

.button.button-with-icon.sources-toggle {
	position: absolute;
	top: 0;
	right: -7px;
	float: none;
	padding: 0 30px 0 0;
	background: none;
	border: none;
	color: $dark-grey;
	text-transform: none;
	letter-spacing: 0; 
	
	svg { fill: $dark-grey; }
	
	.ico-checked { display: none; }
	
	&.all-selected {
		.ico-checked {
			display: block;
		}
	}
}

.sources {
	position: relative;
	width: auto;
	
	.source-list {
		width: auto;
		height: 100%;
		float: left;
	}
	
	.source {
		position: relative;
		float: left;
		margin-right: 5px;
		width: 30px;
		height: 30px;
		transition: 200ms ease all;
		overflow: hidden;
		
		img { opacity: .2; }
		
		&:last-of-type { margin-right: 0; }
		
		&:hover {
			cursor: pointer;
			
			img { opacity: .5; }
			
			.source-off { opacity: 0; }
		}
		
		&.active {
			img { opacity: 1; }
			
			.source-off { opacity: 0; }
		}
		
		img {
			width: 100%;
			height: 100%;
		}
		
		.source-off {
			opacity: 1;
			position: absolute;
			top: -5px;
			left: -5px;
			width: 40px;
			height: 40px;
			/*background: repeating-linear-gradient(
				45deg,
				rgba($mid-grey, 0.2),
				rgba($mid-grey, 0.2) 5px,
				rgba($dark-grey, 0.3) 5px,
				rgba($dark-grey, 0.3) 7px
			);*/
			
			svg { 
				display: none;
				fill: $off-black; 
			}
		}
	}
}

.modal-dialog {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: $white;
	z-index: -10000;
	opacity: 0;
	transition: 400ms ease all;
	
	&.modal-open { 
		z-index: 10000;
		opacity: 1;
	}
}

.modal-header {
	width: 100%;
	height: 50px;
	border-bottom: 1px solid $light-grey;
	
	.modal-title {
		@include font-size(2.4);
		margin: 0;
		line-height: 50px;
		padding-left: 20px;
	}
	
	button.close {
		position: absolute;
		top: 0;
		right: 0;
		width: 50px;
		height: 50px;
	}
}

.modal-body {
	position: absolute;
	top: 60px;
	right: 10px;
	bottom: 10px;
	left: 10px;
	background: $off-white;
	padding: 20px;
}
              
            
!

JS

              
                $(document).ready(function() {
	
	var thisWindow = $(window);
	var thisWindowWidth = thisWindow.width();
	var windowWidthDiv = $(".window-width");

	function displayWindowWidth() {
		thisWindowWidth = thisWindow.width();
		windowWidthDiv.html(thisWindowWidth + "px");
	}
	
	displayWindowWidth();
	
	$(window).resize(function() {
		displayWindowWidth();
		console.log("resizing");
	});
	
	$("#keyword-input").focus(function() {
		$(".keyword-input-wrapper").addClass("typing");
	});
	
	$("#keyword-input").blur(function() {
		setTimeout(function(){
			$(".keyword-input-wrapper").removeClass("typing");
		}, 180);
	});
	
	$(".advanced-button, .keyword-helper > .button").on("click", function() {
		
		if ( $(".keyword-input-wrapper").hasClass("advanced-open") ) {
			$(".keyword-input-wrapper").removeClass("advanced-open");
		} else {
			$(".keyword-input-wrapper").addClass("advanced-open");
		}
	});
		
	var sourceCount =	$(".source").length;
	var activeSourceCount = $(".source.active").length;
	
	$(".sources-toggle").on("click", function(){
		
		if ( sourceCount !== activeSourceCount ) {
			$(this).addClass("all-selected");
			$(".source").addClass("active");
			$(".search-button .button-action").prop("disabled", false);
		} else {
			$(this).removeClass("all-selected");
			$(".source").removeClass("active");
			$(".search-button .button-action").prop("disabled", true);
		}
		
		activeSourceCount = $(".source.active").length;
	});
	
	$(".source").on("click", function() {
		$(this).toggleClass("active");
		
		activeSourceCount = $(".source.active").length;
		
		if ( sourceCount !== activeSourceCount ) {
			$(".sources-toggle").removeClass("all-selected");
		} else {
			$(".sources-toggle").addClass("all-selected");
		}
		
		if ( activeSourceCount === 0 ) {
			$(".search-button .button-action").prop("disabled", true); 
		}
		
		if ( activeSourceCount > 0 ) {
			$(".search-button .button-action").prop("disabled", false);
		}
	});
	
	$(".results-list > div").on("click", function() {
		$(".modal-dialog").toggleClass("modal-open");
	});
	
	$("button.close").on("click", function() {
		$(".modal-dialog").toggleClass("modal-open");
	});
});
              
            
!
999px

Console