123

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.

            
              <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700' rel='stylesheet' type='text/css'>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<article class="recipe">

<h1>
Chris' Four-Bean Chili 
</h1>

<div class="stars">
	<p class="rate">Rate my recipe :</p>
	<i class="fa fa-star"></i>
	<i class="fa fa-star"></i>
	<i class="fa fa-star"></i>
	<i class="fa fa-star"></i>
	<i class="fa fa-star-half-o"></i>
</div>

<div class="time">
	<p><i class="fa fa-clock-o"></i> Prep Time : 30mins</p>
	<p><i class="fa fa-clock-o"></i> Cooking Time : 1hour 30mins</p>
</div>

<div class="recipe-image">
	<div class="ingredient-image">
	</div>
	<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/chili.jpg">
	<p class="quote" >My grandpappy used to make this chili over the campfire under the Texas stars. The secret ingredient was a little squeeze of scorpion venom in the pot.<span class="cite">-Chris</span></p>
</div>

<div class="recipe-text">
	<h2>Ingredients <i class="slidetoggle fa fa-arrow-up right"></i></h2>
	<div class="inner-text">
		<h3></h3>
		<ul class="need">
			<li data-image="http://www.lowellprovisionco.com/files/Ground_buffalo.jpg">
				<i class="fa fa-square-o"></i>
				<strong>1lb</strong>
				ground bison
			</li>
			<li data-image="http://www.markon.com/sites/default/files/styles/product_banner/public/prdimg/RSS_Onions_Ylw_Diced_0.jpg">
				<i class="fa fa-square-o"></i>
				<strong>1 cup</strong>
				diced onion
			</li>
			<li data-image="http://www.mredepot.com/catalog/jalapenos%20diced%20(2).jpg">
				<i class="fa fa-square-o"></i>
				<strong>4</strong>
				diced jalepeños
			</li>
			<li data-image="http://anniegreenjeans.com/wp-content/uploads/2009/08/black-beans.jpg">
				<i class="fa fa-square-o"></i>
				<strong>1 cup</strong>
				black beans
			</li>
			<li data-image="http://www.zarina.ca/uploads/temp/img8902356.jpg">
				<i class="fa fa-square-o"></i>
				<strong>1 cup</strong>
				great northern beans
			</li>
			<li data-image="http://www.iknowlegumes.com/images/beans/original/kidney-beans.jpg">
				<i class="fa fa-square-o"></i>
				<strong>1 cup</strong>
				kidney beans
			</li>
			<li data-image="http://www.canningbasics.com/images/pintobeans.jpg">
				<i class="fa fa-square-o"></i>
				<strong>1 cup</strong>
				pinto beans
			</li>
			<li data-image="http://lukehoney.typepad.com/photos/uncategorized/2008/03/20/garlic1.jpg">
				<i class="fa fa-square-o"></i>
				<strong>4 cloves</strong>
				garlic
			</li>
			<li data-image="http://img.21food.com/20110609/descript/1307124583020.JPG">
				<i class="fa fa-square-o"></i>
				<strong>2 tbsp</strong>
				mexican chili powder
			</li>
			<li data-image="http://www.ericcressey.com/wp-content/uploads/2012/01/DenSalt.jpg">
				<i class="fa fa-square-o"></i>
				<strong>2 tsp</strong>
				salt
			</li>
			<li data-image="http://www.bigoven.com/uploads/groundpepper.jpg">
				<i class="fa fa-square-o"></i>
				<strong>2 tsp</strong>
				ground pepper
			</li>
			<li data-image="http://www.infiniteunknown.net/wp-content/uploads/2011/03/cayenne-pepper-the-king-of-herbs.jpg">
				<i class="fa fa-square-o"></i>
				<strong>1 tsp</strong>
				cayenne
			</li>
			<li data-image="http://www.freeenterprise.com/sites/default/files/styles/large/public/media/00_GOVT_shutterstock_83682121_Budget_800px.jpg?itok=tYArc6g3">
				<i class="fa fa-square-o"></i>
				<strong >28oz</strong>
				smushed tomatoes
			</li>
			<li data-image="http://www.bonappetit.com/wp-content/uploads/2008/08/ttar_beefbroth_h.jpg">
				<i class="fa fa-square-o"></i>
				<strong >3 cups</strong>
				beef broth
			</li>
		</ul>
		<div class="ingredients-have">
			<h2>You currently have in your basket</h2>
			<ul class="got">
			</ul>
		</div>
	</div>
</div>

<div class="recipe-directions">
	<h2>Directions <i class="slidetoggle fa fa-arrow-up right"></i></h2>
	<div class="inner-directions">
		<ol>
			<li>Get your filthiest campfire-scorched Dutch oven over the fire the best you can situate it.</li>
			<li>Brown the bison.</li>
			<li>Add the diced onion and spices, sautee until soft.</li>
			<li>Add tomatoes and broth and bring to a simmer for 40 minutes.</li>
			<li>Add beans and cook another 30 minutes.</li>
			<li>Serve with Tabasco and a giant spoon.</li>
		</ol>
	</div>
</div>

<div class="comments">
	<h2>How did your four-bean chili go? <i class="slidetoggle fa fa-arrow-up right"></i></h2>
	<div class="inner-comments">
		<form>
			<input type="text" placeholder="Nathan" />
			<textarea placeholder="It was gorgeous....."></textarea>
			<button>Add Comment</button>
		</form>
	</div>
</div>

</article>
            
          
!
            
              *, *:before, *:after {
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box;
position:relative;
}

body {
background-color: #2e3641; 
margin:0;
color:#fff; 
font-family: 'Open Sans', sans-serif;
}


.recipe {
width:100%;
display:block;

	.quote {
	text-align:center;
	width:100%;
	text-align: center;
	width: 100%;
	position: absolute;
	bottom: 0;
	background: rgba(0,0,0,0.5);
	margin: 0;
	padding: 2em 0;

		.cite {
		width:100%;
		float:left;
		font-style:italic;
		font-size:14px;
		text-align:center;
		}
	}
	
	li {
	list-style:none; 
	padding:0;
	margin:0;
	width:100%;
		i {
		margin:0;
		padding:0.5em;
		float:left;
		}
	}
	
	.ingredient-image {
	width:100%;
		img {
		width:100%;
		}
	}

	i {
	font-size:15px; 
	float:right;
	padding-top:0.5em;
	cursor:pointer;
	}


	.rate {
	float: left;
	padding: 0;
	margin: 0.2em 1em 0 0; 
	}
	
	ul {
	padding:0;  
		li {
		list-style:none; 
		padding:0;
		margin:0;
		width:100%;
		padding:0.5em;
		cursor:pointer;
			i {
			margin:0;
			padding:0.3em 0.5em 0 0;
			float:left;
			}
		}
	}

	h1 {
	width:100%;
	padding:1em 1em 0.5em;
	margin:0;
	display:block;
	font-weight:bold;
	background: #e9513a;
	text-transform:uppercase;  
	}

	.stars {
	float:left;
	width:100%;
	padding:0 1.5em 1.5em;
	background: #e9513a;
		.fa-star-half-o,.fa-star {
		float:left;
		}      
	}

	.time {
	float:left;
	width:auto;
	padding:0.5em 1.5em;
	background: #e9513a;
	position:absolute;
	top:0;
	right:0;
		.fa-clock-o {
		padding: 2px 10px 0 0;
		font-size:18px;
		float:left;
		}      
	}

	.recipe-image img{
	width:100%;
	height:auto;
	float:left;
	}

	.recipe-image {
	width:33.3%; 
	float:left;
	display:inline-block;
	}

	.recipe-text, .recipe-directions, .comments {  
	width:33.3%;
	padding:0 2em;
	float:left;
	display:inline-block;
		h2 {
		font-weight:600; 
		}
	}

	.got li {
	text-decoration:line-through;
	}

	ol  {
	padding:0 0 0 1.5em;
		li {
		list-style: inherit;
		cursor:pointer;
		padding: 0.5em 0;
		}
	}

	.linethrough {
	text-decoration:line-through; 
	}

	form {
	width:100%;
	padding:0;
	margin:0;
	float:left;

		input[type="text"], textarea {
		width: 100%;
		border: none;
		background-color: #fff;
		display: block;
		outline: none;
		margin: 20px 0;
		padding: 10px 10px;
		border: 1px solid #ccc;
		-webkit-border-radius: 2px;
		-ms-border-radius: 2px;
		-moz-border-radius: 2px;
		-o-border-radius: 2px;
		border-radius: 2px;
		font-family: 'Open Sans', sans-serif;
		}

		textarea {
		height:10em;
		}

		button {
		display: block;
		margin-top: 15px;
		margin-bottom: 15px;
		padding: 13px;
		width: auto;
		border: 0;
		margin-left: 0;
		-webkit-border-radius: 2px;
		-ms-border-radius: 2px;
		-moz-border-radius: 2px;
		-o-border-radius: 2px;
		border-radius: 2px;
		-webkit-box-sizing: border-box;
		-ms-box-sizing: border-box;
		-moz-box-sizing: border-box;
		-o-box-sizing: border-box;
		box-sizing: border-box;
		font-size: 16px;
		background: #e9513a;
		color: #fff;
		cursor: pointer;  
		}
	}
}

@media screen and (max-width:1000px) {
	.recipe {
		.recipe-image, .recipe-text {
		width:50%;
		}

		.comments, .recipe-directions {
		width:100%;
		}
	}
}

@media screen and (max-width:630px) {
	.recipe .time {
	float: left;
	width: 100%;
	position: relative;
	}
}


@media screen and (max-width:600px) {
	.recipe {
		.recipe-image, .recipe-text {
		width:100%;
		}
	}
}
            
          
!
            
              $(document).ready(function(){

$('li').on('mouseover',function(){
	$('.ingredient-image').append("<img src='" + $(this).attr('data-image') + "'>");
});

$('li').on('mouseout',function(){
	$('.ingredient-image').empty();
});

var count = $("ul").children().length;
	if(count == 0) {
		$('.recipe-text h3').text("You are ready to start cooking!");
	} else {
		$('.recipe-text h3').text("You have " + count + " items left to get!");    
	}

$('.recipe-text .slidetoggle').on('click', function(){
	$(this).toggleClass("fa-arrow-up fa-arrow-down");
	$(this).parent().siblings('.inner-text').slideToggle();
});

$('.recipe-directions .slidetoggle').on('click',function(){
	$(this).toggleClass("fa-arrow-up fa-arrow-down");
	$(this).parent().siblings('.inner-directions').slideToggle();
});

$('.comments .slidetoggle').on('click',function(){
	$(this).toggleClass("fa-arrow-up fa-arrow-down");
	$(this).parent().siblings('.inner-comments').slideToggle();
});

$('.recipe-text ul.need').on('click','li i',function(){
	$(this).parent().appendTo(".ingredients-have .got");
	$(this).removeClass("fa-square-o");
	$(this).addClass("fa-check-square-o");
	var count = $(".recipe-text .need").children().length;
	if(count == 0) {
		$('.recipe-text h3').text("You are ready to start cooking!");
	} else {
		$('.recipe-text h3').text("You have " + count + " items left to get!");  
	}
});

$('.ingredients-have ul.got').on('click','li i',function(){
	$(this).parent().appendTo(".recipe-text .need");
	$(this).removeClass("fa-check-square-o");
	$(this).addClass("fa-square-o");
	var count = $(".recipe-text .need").children().length;
	if(count == 0) {
		$('.recipe-text h3').text("You are ready to start cooking!");
	} else {
		$('.recipe-text h3').text("You have " + count + " items left to get!");  
	}
});

$('.inner-directions').on('click', 'ol li', function(){
	$(this).toggleClass('linethrough');
});

});
            
          
!
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.

Console