cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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.

            
              link(href='https://fonts.googleapis.com/css?family=Roboto', rel='stylesheet', type='text/css')
link(rel="stylesheet",href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css")

h1 Search input + animated suggestions
h2 Animation in Sass, simple script in CoffeeScript

.search-container
  .search-box
    .search-icon
      i.fa.fa-search
    input.search-input#search(type="text", placeholder="Search people")
    ul.search-results#results
            
          
!
            
              // Importing bourbon to make things easy: http://bourbon.io/
@import "bourbon"

// Useful mixins
@mixin border-radius($radius: 4px)
  @include prefixer(border-radius, $radius, webkit moz spec)
    
@mixin box-sizing($box-model)
  @include prefixer(box-sizing, $box-model, webkit moz spec)
    
/* General styles */

body
  background-color: white
  font-family: 'Roboto', Arial, sans-serif
  text-align: center
  padding-top: 30px
  font-size: 14px
  
h1
  font-size: 1.5em
  color: #666666
  
h2, a
  font-size: 0.8em
  color: #9BC788
  
h3
  color: #999
  margin-top: 40px

/* ============================ */
/* VARIABLES                    */
/* ============================ */
  
$color-primary: #9BC788
$search-width: 400px
$search-icon-width: 32px
$search-height: 40px
$visible-results: 5
/* ============================ */
/* SEARCH BAR                   */
/* ============================ */
  
.search-container
  margin: 40px auto
  width: $search-width
  
.search-box
  @include border-radius(3px)
  background-color: #f2f2f2
  height: $search-height
  position: relative
  
.search-icon
  @include box-sizing(border-box)
  float: left
  width: $search-icon-width
  height: $search-height
  color: #999
  font-size: 1.3em
  padding: 7px 15px
  
.search-input
  @include box-sizing(border-box)
  width: $search-width - $search-icon-width
  height: $search-height
  float: right
  background-color: transparent
  border: 0px
  padding: 10px
  text-transform: uppercase
  font-family: 'Roboto', Arial, sans-serif
  font-size: 1em
  position: relative
  outline: 0px
  
//useful for animation
@include keyframes(fadeInTop)
  0%
    opacity: 0
    @include transform(translateY(-1.334em) translateZ(0))
  100%
    opacity: 1

@mixin fadeInTop($dur: 1s, $delay: 0s, $fill: forwards)
  @include prefixer(animation, fadeInTop $dur $delay $fill, webkit spec)

.search-results
  list-style: none
  margin: 0
  padding: 0
  position: absolute
  z-index: 999
  width: $search-width - $search-icon-width
  max-height: $search-height * $visible-results
  overflow: scroll
  top: $search-height
  left: $search-icon-width
  text-align: left
  li
    @include box-sizing(border-box)
    padding: 10px
    height: $search-height
    background-color: $color-primary
    color: white
    font-weight: bold
    &:hover
      background-color: darken($color-primary, 7%)
      cursor: pointer
    /* ANIMATION */
    /* remove this part if you dont like the animation */
    @for $i from 1 through $visible-results
      &:nth-child(#{$i})
        /* Animation */
        @include fadeInTop(0.4s, (($i - 1)/10) * 1s )
        opacity: 0
    /* END OF ANIMATION */
  
            
          
!
            
              names = [
  "Gentry",
  "Brandi",
  "Maryann",
  "Tina",
  "Harper",
  "Hayes",
  "Tamera",
  "Shauna",
  "Mcfarland",
  "Charles",
  "Ortiz",
  "Maynard",
  "Julie",
  "Gay",
  "Wiggins",
  "Navarro",
  "Hopkins",
  "Candace",
  "Tammi",
  "Horton",
  "Erna",
  "Mills",
  "Opal",
  "Wolfe",
  "Walter",
  "Bonita",
  "Eleanor",
  "Rojas",
  "Ochoa",
  "Kirk",
  "Rosario",
  "Ball",
  "Lucile",
  "Kayla",
  "Carmela",
  "Miranda",
  "Middleton",
  "Lillie",
  "Sherry",
  "Jacqueline",
  "Deirdre",
  "Mueller",
  "Debra",
  "Jodi",
  "Joyce",
  "Estrada",
  "Liz",
  "Justine",
  "Francis",
  "Benton",
  "Henrietta",
  "Elise",
  "Lang",
  "Morse",
  "Farrell",
  "Tamra",
  "Darla",
  "Amy",
  "Kristie",
  "Wyatt",
  "Mcbride",
  "Talley",
  "Fay",
  "Sweet",
  "Fern",
  "Mcintosh",
  "Clemons",
  "Travis",
  "Kirsten",
  "Rios",
  "Newman",
  "Cook",
  "Jocelyn",
  "Mcmillan",
  "Mona",
  "Bessie",
  "Francis",
  "Rosemary",
  "Beverly",
  "Chandra",
  "Luella",
  "Parrish",
  "Ronda",
  "Earlene",
  "Bright",
  "Guthrie",
  "Shana",
  "Theresa",
  "Wells",
  "Green",
  "Schroeder",
  "Russo",
  "Randolph",
  "Livingston",
  "Carroll",
  "Velasquez",
  "Dana",
  "Bridget",
  "Hines",
  "Martha",
  "Marci",
  "Fuentes",
  "Stuart",
  "Glass",
  "Alejandra",
  "Thornton",
  "Britt",
  "Jeri",
  "Leach",
  "Cleo",
  "Lela",
  "Mattie",
  "Bonnie",
  "Lucille",
  "Mamie",
  "Kelly",
  "Obrien",
  "Carol",
  "Murphy",
  "Isabella",
  "Lowery",
  "Odom",
  "Norris",
  "Mullins",
  "Florine",
  "Morales",
  "Frederick",
  "Reynolds",
  "Janine",
  "Joyce",
  "Dean",
  "Marcy",
  "Allison",
  "Rena",
  "Saundra",
  "Flossie",
  "Kristi",
  "Monica",
  "Molina",
  "Guzman",
  "Loretta",
  "Levine",
  "Oneill",
  "Mccray",
  "Mann",
  "Constance",
  "English",
  "Eula",
  "Butler",
  "Erika"
]

# Match words in a collection
findAll = (wordList, collection) =>
  collection.filter (word) ->
    word = word.toLowerCase()
    wordList.some (w) -> ~word.indexOf w

# Displays results in a list
displayResults = (resultsEl, wordList) ->
  resultsEl.innerHTML = (wordList.map (w) -> '<li>'+w+'</li>').join ''

# Handle keyboard events
searchInput = document.getElementById 'search'
resultsOutput = document.getElementById 'results'
maxResults = 7

searchInput.addEventListener 'keyup', (e) =>
    value = searchInput.value.toLowerCase().split ' '
    suggested = (if value[0].length then findAll value, names else [])
    displayResults resultsOutput, suggested
            
          
!
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.
Loading ..................

Console