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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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="container">
  <form>
    <div class="input-group">
      <input type="text" id="search" placeholder="Search..." autocomplete="off">
      <label for="search"><i class="fas fa-search"></i></label>
    </div>
    
    <div class="suggestion-list hidden">
    </div>
  </form>
  
  <div id="apps">
    <div class="app">
      <i class="fab fa-adobe"></i>
      <p>Adobe</p>
    </div>
    
    <div class="app">
      <i class="fab fa-android"></i>
      <p>Android</p>
    </div>
    
    <div class="app">
      <i class="fab fa-apple"></i>
      <p>Apple</p>
    </div>
    
    <div class="app">
      <i class="fab fa-aws"></i>
      <p>AWS</p>
    </div>
    
    <div class="app">
      <i class="fab fa-behance"></i>
      <p>Behance</p>
    </div>
    
    <div class="app">
      <i class="fab fa-bitcoin"></i>
      <p>Bitcoin</p>
    </div>
    
    <div class="app">
      <i class="fab fa-chrome"></i>
      <p>Chrome</p>
    </div>
    
    <div class="app">
      <i class="fab fa-codepen"></i>
      <p>Codepen</p>
    </div>
    
    <div class="app">
      <i class="fab fa-dribbble"></i>
      <p>Dribbble</p>
    </div>
    
    <div class="app">
      <i class="fab fa-docker"></i>
      <p>Docker</p>
    </div>
    
    <div class="app">
      <i class="fab fa-dropbox"></i>
      <p>Dropbox</p>
    </div>
    
    <div class="app">
      <i class="fab fa-drupal"></i>
      <p>Drupal</p>
    </div>
    
    <div class="app">
      <i class="fab fa-edge"></i>
      <p>Edge</p>
    </div>
    
    <div class="app">
      <i class="fab fa-firefox"></i>
      <p>Firefox</p>
    </div>
    
    <div class="app">
      <i class="fab fa-font-awesome"></i>
      <p>Font Awesome</p>
    </div>
    
    <div class="app">
      <i class="fab fa-github"></i>
      <p>Github</p>
    </div>
    
    <div class="app">
      <i class="fab fa-google"></i>
      <p>Google</p>
    </div>
    
    <div class="app">
      <i class="fab fa-google-drive"></i>
      <p>Google Drive</p>
    </div>
    
    <div class="app">
      <i class="fab fa-google-play"></i>
      <p>Google Play</p>
    </div>
    
    <div class="app">
      <i class="fab fa-google-plus"></i>
      <p>Google Plus</p>
    </div>
  </div>
</div>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Nunito', sans-serif;
}

body {
  background-color: #110e17;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 60px 15px;
}

form {
  max-width: 80%;
  margin: 0 auto;
  position: relative;
}

.input-group {
  position: relative;
}

label {
  position: absolute;
  right: 2%;
  top: 50%;
  transform: translatey(-50%);
  color: rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

input {
  width: 100%;
  padding: 8px 30px 8px 12px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  outline: none;
  font-size: 16px;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.06);
  color: #F27121;
  font-weight: bold;
  letter-spacing: 1px;
  border-radius: 1px;
  transition: all 0.2s ease;
}

input:focus {
  border-color: #F27121;
}

input:focus + label {
  transform: scale(1.05) translatey(-50%);
  color: #F27121;
}

#apps {
  margin-top: 42px;
}

.app {
  display: inline-block;
  width: 20%;
  margin: 0 2.2% 24px;
  padding: 12px 6px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  transition: all 0.2s ease;
}

.app:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.app i {
  font-size: 2.4em;
  color: #fff;
}

.app p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  margin-top: 6px;
  transition: 0.2s all ease;
}

.app:hover p {
  color: rgba(255, 255, 255, 0.8);
}

.suggestion-list {
  background-color: #fff;
  padding: 18px 24px 6px 12px;
  border-radius: 0 0 6px 6px;
  position: absolute;
  width: 100%;
  margin-top: 0px;
  border: 2px solid #F27121;
  border-top: none;
}

.suggestion-list.hidden {
  display: none;
}

.suggestion-list p {
  margin-bottom: 12px;
}

.suggestion-list i {
  margin-right: 12px;
  color: #F27121;
}
              
            
!

JS

              
                var all_apps = document.querySelectorAll('.app');
var search = document.querySelector('#search');
var listContainer = document.querySelector('.suggestion-list');

var app_list = [];

for (let i = 0; i < all_apps.length; i++) {
  let app_title = all_apps[i].querySelector('p').innerText.toLowerCase();
  let app_icon = all_apps[i].querySelector('i').classList.value;

  let obj = {};
  obj.app_title = app_title;
  obj.app_icon = app_icon;

  app_list.push(obj);
}

search.addEventListener('keyup', generateAppList);
search.addEventListener('blur', hideAppList);

function generateAppList(event) {
  var fragment = document.createDocumentFragment();

  var userInput = event.target.value.toLowerCase();

  if (userInput.length === 0) {
    listContainer.classList.add('hidden');
    return false;
  }

  listContainer.innerHTML = '';
  listContainer.classList.remove('hidden');

  var filteredList = app_list.filter(function (arr) {
    return arr.app_title.includes(userInput);
  });

  if (filteredList.length === 0) {
    let paragraph = document.createElement('p');
    paragraph.innerText = 'No app found';
    fragment.appendChild(paragraph);
  }

  else {
    for (let i = 0; i < filteredList.length; i++) {
      let paragraph = document.createElement('p');
      let icon = document.createElement('i');
      let span = document.createElement('span');

      icon.classList.value = filteredList[i].app_icon;
      span.innerText = filteredList[i].app_title;
      paragraph.appendChild(icon);
      paragraph.appendChild(span);
      fragment.appendChild(paragraph);
    }
  }

  listContainer.appendChild(fragment);
}

function hideAppList() {
  listContainer.classList.add('hidden');
}
              
            
!
999px

Console