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

              
                <div class="wrapper">
<div class="input-group"><input type="text" id="quicksearch" class="form-control" placeholder="Search" /></div>
<div id="filter" class="btn-group" role="group"><button id="allbuttons" class="btn btn-default is-checked" data-value="*">Show All</button></div>
<div id="database"><br /></div>
</div>
              
            
!

CSS

              
                body {width: 100%;}
.wrapper {max-width:800px}
h2 {
  font-weight: 700;
}

a {
  color: #555;
  font-size: 15px;
  text-decoration: underline;
  margin: 0;
  padding: 0;
  
}

a:hover {
  color: #555;
}

a:active {
  text-decoration: none;
}

.form-control {float:right;height:30px;width:200px}

.btn {
  float:left;
  display: inline-block;
  padding: 0.5em 1.0em;
  background: #EEE;
  border: none;
  border-radius: 7px;
  background-image: linear-gradient( to bottom, hsla(0, 0%, 0%, 0), hsla(0, 0%, 0%, 0.2) );
  color: #222;
  font-family: sans-serif;
  font-size: 16px;
  text-shadow: 0 1px white;
  cursor: pointer;
}

.btn:hover {
  background-color: #8CF;
  text-shadow: 0 1px hsla(0, 0%, 100%, 0.5);
  color: #222;
}

.btn:active,
.button.is-checked {
  background-color: #ED204C;
}

.btn.is-checked {
  color: white;
  text-shadow: 0 -1px hsla(0, 0%, 0%, 0.8);
  background-color: #ED204C;
}

.btn:active {
  box-shadow: inset 0 1px 10px hsla(0, 0%, 0%, 0.8);
  background-color: #ED204C;
}

/* ---- button-group ---- */

.btn-group:after {
  content: '';
  display: block;
  clear: both;
}

.btn-group .btn {
  float: left;
  border-radius: 0;
  margin-left: 0;
  margin-right: 1px;
}

.btn-group .btn:first-child { border-radius: 0.5em 0 0 0.5em; }
.btn-group .btn:last-child { border-radius: 0 0.5em 0.5em 0; }

/* ---- isotope ---- */


/* clear fix */
.isotope:after {
  content: '';
  display: block;
  clear: both;
}

/* ---- #element-item ---- */

#element-item {
  position: relative;
  float: left;
  font-family: sans-serif;
  width: 100%! important;
  height: auto;
  margin: 2px;
  padding: 10px;
  border: 1px solid #ccc;
  background: rgba( 253, 253, 253, 0.9);
  color: #5C564B;
  box-shadow: 1px 1px 1px #999999;
}

#element-item img {
  width: 120px;
  height: 120px;
  object-fit: contain;
	float:left;
	margin-right: 20px;
}

#element-item .category { 
  font-size: 14px;
  background-color: #1a5ba39e;
  padding: 5px 10px;
  color: #fff;
  width: auto;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 10px;
	text-align: left;

}


#element-item img {
  border: 1px solid #ccc;
}


#element-item .readmore, #element-item .readmore a {
  font-weight: 700;
  color: #1A5BA3;
  font-size: 12px;
}

#element-item .description {
  padding-top: 10px;
  padding-bottom: 10px;
}


#element-item .boldsubhed {
font-size: 13px;
font-weight: 700;
color: #666;

}
#element-item .name {
  color: #333;
  font-size: 14px;
  font-weight: 700;
 /* text-transform: uppercase;*/
  padding-top: 5px;

}

.is-checked {
  background-color: #ebebeb;
}


#element-item .colorsubhed {
  font-weight: 700;
  color: #800000;

}

#element-item .location {
  font-weight: 700;
}

#element-item .date, #element-item .description  {
  font-size: 13px;

}

.page-header {
  padding: 0px;
  margin: 0px;
}


@media screen and (min-width: 1000px) {
  body {
    width: 100%;
  }
}

@media (max-width: 850px) {
   #element-item {
  width: 32%! important;
}

}

@media (max-width: 550px) {
   #element-item {
  width: 47%! important;
}

h2 {
  font-size: 1.6em
}
.btn-default  {
  font-size: 0.9em;
}

body {
  font-size: 1.0em;
}

	#quicksearch {float: right !important;
	position: relative;}	
#element-item .boldsubhed, #element-item .description {
font-size: 1.0em;

}
#element-item .category {
  font-size: 1.2em;
  padding: 5px 15px;
}
#element-item .name {

  font-size: 1.1em;

}
}

@media (max-width: 320px) {
   #element-item {
  width: 100%! important;
}


.btn-default {
  font-size: 0.7em;
}

body {
  font-size: 1.3em;
}

h2 {
  font-size: 1.4em;
}

#element-item img {
  height: 120px;


}

}
#database {
	padding-top: 30px;
}
              
            
!

JS

              
                // Get Google sheet data using Papa Parse example by Frank Bültge - www.frankbueltge.de
// Code published here: https://github.com/frrrrank/Google-Sheet-Stuff
// Instructions can be found here: https://frankbueltge.de/en/google-sheets-as-database-or-tiny-cms/

// Publish your sheet to the web and use the URL you get from the sharing option on the top/right of the sheet and add /pub?output=csv at the end of the URL      
	 var public_spreadsheet_url = 'https://docs.google.com/spreadsheets/d/13lP-96izM95kbpBlY9Wx1XfcyPNF9Lsc26ApQN-95Qo/pub?output=csv';

     var qsRegex;
     var buttonFilter;
     var $quicksearch = $('#quicksearch');
     var $container = $('#database')
     var timeout;

     function init() {
       Papa.parse(public_spreadsheet_url, {
         download: true,
         header: true,
         complete: showInfo
       })
     }
     window.addEventListener('DOMContentLoaded', init)

     function showInfo(results) {
       var data = results.data
       var result = [];
       var count = 1;
       // data comes through as a simple array since simpleSheet is turned on
       // alert("Successfully processed " + data.length + " rows!");
       // console.log(data);
		
	   // loop to get the data from JSON and write it to the div's with the id's database and quicksearch 
       $.each(data, function(i, v) {
         // Parses the resulting JSON into the individual squares for each row
         $container.append('<div id="element-item"><div class="category">' + v.Filter_category + '</div><img src="' + v.Pic_Link + '"><div class="name">' + v.Title + '</div><div class="boldsubhed">' + v.Location + '</div><div class="boldsubhed">' + v.City + '</div><div class="description">' + v.Date + '</div><div class="readmore"><a href="' + v.Website + ' " target="_blank">Website</a></div></div>');
         // Gets all unique filtercategory values and puts them into an array
         if ($.inArray(v.Filter_category, result) == -1) {
           result.push(v.Filter_category);
           // Creates the filter buttons
           $('#filter').append('<button id="' + v.Filter_category + '" class="btn btn-default" data-value="choice' + count++ + '">' + v.Filter_category + '</button>')
         }
       });
       // search function
       $quicksearch.keyup(debounce(function() {
         qsRegex = new RegExp($quicksearch.val(), 'gi');
         $container.isotope();
       }));
       //  wait until images are loaded 
       $container.imagesLoaded(function() {
         // Sorts them into responsive square layout using isotope.js
         $container.isotope({
           itemSelector: '#element-item',
           layoutMode: 'masonry',
           // so that isotope will filter both search and filter results
           filter: function() {
             var $this = $(this);
             var searchResult = qsRegex ? $this.text().match(qsRegex) : true;
             var buttonResult = buttonFilter ? $this.is(buttonFilter) : true;
             return searchResult && buttonResult;
           }
         });
       });
       // debounce so filtering doesn't happen every millisecond
       function debounce(fn, threshold) {
         return function debounced() {
           if (timeout) {
             clearTimeout(timeout);
           }

           function delayed() {
             fn();
             timeout = null;
           }
           timeout = setTimeout(delayed, threshold || 100);
         }
       }
       // Adds a click function to all buttons in the group
       $('.btn-group').each(function(i, buttonGroup) {
         var $buttonGroup = $(buttonGroup);
         var allbuttonids = $("button").attr('id');
         $buttonGroup.on('click', 'button', function() {
           // Changes to .is-checked class when clicked
           $buttonGroup.find('.is-checked').removeClass('is-checked');
           $(this).addClass('is-checked');
           // Gets all values that matches the clicked button's data value
           buttonFilter = $(this).attr('data-value');
           textFilter = $(this).text();

           function getitems() {
             var name = $(this).find('.category').text();
             if (textFilter != "Show All") {
               return name.match(textFilter);
             } else {
               return "*";
             }
           }
           buttonFilter = getitems || buttonFilter;
           $container.isotope();
         });
       });
     }

              
            
!
999px

Console