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.

              <html >

  <div ng-app="recipeBoxApp" ng-controller="recipeBoxCtrl">

    <h4 class="pull-right"><a href="https://youtu.be/8JqS72z9h0w" target="_blank">Watch tutorial</a></h4>
 <div class="container">
  <!-- Row is devided in the list of recipes and add a new one -->
  <div class="row">
   <!-- Left - list with edit/delete-->
   <div class="col-xs-8">
    <ul class="collapsible" data-collapsible="accordion">
     <li ng-repeat="recipe in recipeList | filter track by $index">
      <div class="collapsible-header">{{recipe.title}}</div>
      <div class="collapsible-body">
       <div class="recipeBtn">
        <button ng-click="editRecipe($index)">Edit</button>
        <button ng-click="deleteRecipe($index)">Delete</button>

   <!-- Right - add recipe -->
   <div class="col-xs-4">
    <div class="card">
     <div class="card-content">
      New recipe
      <form ng-submit="addRecipe()">
       <div class="input-field">
        <input type="text" ng-model="newRecipe" placeholder="Name">
       <div class="input-field">
        <input type="text" ng-model="newIngredients" placeholder="Ingredients (Seperate by commas)">
       <button type="submit">Add</button>
   </div> <!-- column -->
  </div> <!-- row -->
    <!-- Footer-->
		<div class="row">
			<div class="col-xs-12">
				<div class="tableFooter">
				  <!-- for footer -->
      <div class="col-xs-6">
      <h5><a href="http://www.eleftheriabatsou.com" target="_blank">Eleftheria</a> | <a href="https://codepen.io/EleftheriaBatsou" target="_blank">Projects</a> | <a href="https://www.youtube.com/channel/UCC-WwYv3DEW7Nkm_IP6VeQQ" target="_blank"> Coding videos </a></h5>
      <!-- social media -->
      <div class="col-xs-6 text-primary">
        <a href="https://twitter.com/BatsouElef" target="_blank">
     <img class="footerSvg"src="https://image.flaticon.com/icons/svg/60/60580.svg" 
      style="text-align:center" alt="twitter"> 
         <a href="https://github.com/EleftheriaBatsou" target="_blank">
     <img class="footerSvg" src="https://image.flaticon.com/icons/svg/25/25657.svg" 
      style="text-align:center" alt="github"> 
        <a href="https://www.youtube.com/channel/UCC-WwYv3DEW7Nkm_IP6VeQQ" target="_blank">
     <img class="footerSvg" src="https://image.flaticon.com/icons/svg/25/25312.svg" 
       style="text-align:center" alt="youtube"> 
    <!-- end footer -->
    <!-- end of Footer -->
 </div> <!--container -->
</div> <!-- app -->

  box-sizing: border-box;
  background: url(https://kaboompics.com/cache/7/2/3/6/9/72369f841aa0c5afd94c619bc35e6b08d9fd738e.jpeg?version=v23) center no-repeat;
  background-size: cover;
  min-height: 100vh; //vertical height
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: Arial;
*, *:before, *:after {box-sizing: inherit;}

  background-color: rgba(130,138,117,0.7);
  color: black;

.recipeBtn {
 padding-top: 20px;

  background: black;
  border-radius: 50%;
  color: white;
  font-size: 1.2em;
  button{color: black}

h5, h4{background-color: lightblue}

  margin-top: 150px;
  width: 32px;
              var app = angular.module('recipeBoxApp', [])
 .controller('recipeBoxCtrl', function($scope) {
  // Create the initial recipe list from local storage. 
 $scope.saved = localStorage.getItem('_msecrist_recipebox');
  // If localstorage has a value for my key, grab that. If not, create a new local storage item.
	$scope.recipeList = (localStorage.getItem('_msecrist_recipebox')!==null) ? JSON.parse($scope.saved) : [{
   title: "Pizza",
   ingredients: "Cheese, Ham, Tomato"
  }, {
   title: "Ice-cream",
   ingredients: "Milk, Chocolate, Sugar"
  }, {
   title: "Cheesecake",
   ingredients: "Milk, cream, buscuits, sugar"
  }, {
   title: "Cake",
   ingredients: "Milk, eggs, vanilla, chocolate"
  // This could probably be in a function on its own, with how many times its called. But its just one line so I didn't bother.
	localStorage.setItem('_msecrist_recipebox', JSON.stringify($scope.recipeList));

  //Allow a user to add a recipe.
  $scope.addRecipe = function() {
   if ($scope.newRecipe != null && $scope.newIngredients != null) {
    //Push the recipe to the array of recipes, and then save that to localstorage.
     title: $scope.newRecipe,
     ingredients: $scope.newIngredients
    localStorage.setItem('_msecrist_recipebox', JSON.stringify($scope.recipeList));
    $scope.newRecipe = null;
    $scope.newIngredients = null;

  //Allow a user to delete a recipe.
  $scope.deleteRecipe = function(index) {
   //Show confirm alert box, and when user confirms, it cuts the recipe out of the array and then updates localstorage.
   if (confirm("This recipe is going to be deleted")) {
    $scope.recipeList.splice(index, 1)
    localStorage.setItem('_msecrist_recipebox', JSON.stringify($scope.recipeList));
  //Edit a recipe
  $scope.editRecipe = function(index) {
   //Grab the recipe by the index of the array and then display the recipe's ingredients in a prompt.
   //That allows the user to change ingredients. If they hit cancel, it returns a null response, so check for that.
   var ingredients = $scope.recipeList[index].ingredients
   var result = prompt("Edit the ingredients: ", ingredients)
   if(result != null){
    $scope.recipeList[index].ingredients = result;
    localStorage.setItem('_msecrist_recipebox', JSON.stringify($scope.recipeList));


//jQuery for Collapsible area 
🕑 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 ..................