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

              
                <html>
<body>
  <div class="about">
    <p>a zipline project for <a href="https://www.freecodecamp.com" target="_blank" tabindex="-1">free code camp</a> by mike</p>
  </div>
  <div class="container">
    <div class="row">
      <div id="search" class="search">
        <h1>wikipedia knows <span class="subScript">[almost]</span> all: give it a shot</h1>
        <div id="searchContainer" class="searchCont">
          <div id="searchBox" class="search-box">
            <i id="glass" class="ion-ios-search-strong"></i>

            <input type="text" id="searchInput" tabindex="1">
            <div id="resetBtn">
              <i id="close" class="ion-ios-close-outline" tabindex="2"></i>
            </div>
          </div>
          <div class="closeIt" id="closeBtn" tabindex="3">close</div>
        </div>
      </div>
    </div>
    <div class="row " id="resultRow">
    </div>
  </div>
</body>
<script id="searchResult" type="text/x-handlebars-template">
  <a target="_blank" href="{{address}}" class="pageLink"> 
      
    <div class="col-lg-12 col-md-12 col-sm-12 result"><div class="linkOut">
      <i class="ion-android-open"></i>
    </div>
      <p class="result-name">{{name}}</p>
      <p class="result-description">{{description}}</p>
    </div>
  </a>
</script>
</html>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Josefin+Sans:400,600,700,300);

@import url(https://fonts.googleapis.com/css?family=Lato:400,700);
html {
  height: 100%;
}

body {
  background-color: #e9e7e8;
  height: 100%;
  font-family: 'Josefin Sans';
  font-size: 20px;
  text-align: center;
  
  a {
    text-decoration: none;
    
    &:focus {
      text-decoration: none;
    } 
  }
   
  h1 {
    text-transform: uppercase;
    font-size: 23px;
    letter-spacing: 0.5px;
    color: #444745;
    
    .subScript {
      font-size: 14px;      
    }
  }
  
  .active {
    display: inline-block;
  }
  
  #searchInput {
    width: 400px;
    display: none;
    outline: none;
    border: none;
    background-color: inherit;
    height: 40px;
    margin-top: 12px;
    margin-left: -30px;
    padding-left: 0px;
    font-size: 27px;
    color: purple;
    
  }
  
  .closeBox {
     border: 1px dotted red;
    // display: block;
     height: 100px;
    
     width: 100px;
    position: absolute;
    right: 90px;
    
    
  }
  
  .ion-ios-search-strong {
    font-size: 30px;
    vertical-align: middle;
    line-height: 30px;
    position: relative;
    right: 0px;
    top: 14px;
    color: #664482;
    
    &:hover {
      color: purple;
    }
    
   
   
  }    
   .ion-ios-close-outline {
     font-size: 30px;
      text-align: right;
      line-height: 20px;
      display: none;
     position: absolute;
     right: 14px;
     top: 12px;
     color: #664482;
     
     &:hover {
       color: red;
     }
    }
  }

 .icon-position {
      position: absolute;
      right: 0px;
       display: inline;
    }

  .search {
   margin: 0 auto;
   position: relative;
  }
  .search-box { 
    margin: 0 auto;
    position: relative;
    border: 2px solid #664482;
    border-radius: 32px;
    height: 66px;
    width: 66px;
    background-color: #D3B8DA;
  }
.contract {
   height: 66px;
    width: 66px;
}

#closeBtn {
  border: 3px dotted blue;
  &:hover {
      cursor: pointer;
    }
}

.closeIt {
  text-transform: uppercase;
  font-size: 15px;
  position: absolute;
  right: 60px;
  top: 20px;
  border: 1px dotted pink;
  display: none;
  
  
  
}

#searchContainer {
   //margin-top: 300px;
   position: relative;
  
  //height: 100%;
   // border: 1px dotted green;
  
}

.searchCont {
  //transform: translateY(80%);
  //margin-top: 400px;
  height: 100%;
}

.searchAdjust {
  margin-top: 0px;
  transition: all ease-in 0.3s;
}

  .expand {
    border-radius: 32px;
    width: 500px;
    height: 66px;
    background-color: #F2DBF8;
    transition: all 0.15s ease;
  }

.result {
  position: relative;
  text-align-last: auto;
  background-color: #Fff;
  padding: 12px;
  border-left: 4px solid purple;
  font-family: 'Lato';
 // box-shadow: 1px 1px 4px rgba(0,0,0, 0.2);
  margin: 8px;
  font-size: 14px;
  color: #444745;
  
  
}




a.pageLink {
  position: relative;
}

.linkOut {
  display: none;
}

a.pageLink:hover .linkOut {
  display: block;
  position: absolute;
  right: 7px;
  top: 0px;
  font-size: 24px;
  //transform: rotate(-45deg);
  color: purple;
  
  
}



.result-name {
  text-align: left;
  font-weight: 700;
  margin-bottom: 0px;
}

.result-description {
  text-align: left;
  padding-bottom: 0;
  margin-bottom: 0;
}

.searchFlash {
  background-color: #EBBEF8;
  transition: all ease-in-out 0.3s;

}

button {
  background-color: purple;
  color: #fff;
  border: none;
  border-radius: 3px;
  text-transform: uppercase;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 1px;
  padding: 14px 24px;
  margin: 20px;
  font-family: 'Lato';
  font-weight: 400;
  
}

.about {
  
  width: 100%;
  height: 30px;
  background-color: #292D44;
  color: #e1e1e1;
  font-family: 'Lato';
  
  p {
    font-size: 13px;
    line-height: 28px;
    color: #6870A3;
    font-style: normal;
    text-shadow: none;
  }
}
              
            
!

JS

              
                $(document).ready(function() {

  var search = $('#search');
  var searchForm = $('#searchInput');
  var resetBtn = $('#resetBtn');
  var searchResult = $('#resultRow');
  var closeBtn = $('#closeBtn');
  var searchBox = $('#searchBox');
  var searchGlass = $('#glass');

  search.keypress(function(e) {
    if (e.which === 13) {

      // variable for user input to place a query with
      var userInput = searchForm.val();
      $('#searchContainer').addClass('searchAdjust');
      // flash style to indicate upon enter
      // addclass
      searchBox.addClass('searchFlash');
      // timeout
      setTimeout(function() {
        // remove class
        searchBox.removeClass('searchFlash');
      }, 200);

      // query the wikipedia api
      $.getJSON('https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=' + userInput + '&callback=?', function(data) {

        // $('#searchContainer').css('margin-top', '0');
        return buildPage(data);
      });
    }

  });

  // build the results using the query results
  var buildPage = function(data) {

    // clears out any previous search results
    $(".pageLink").remove();

    for (var i = 1; i < data.length; i++) {
      var inside = data[i];
      for (var j = 0; j < inside.length; j++) {
        var tabInd = j + 3;
        var second = i + 1;
        var third = i + 2;

        // handlebars templating
        var source = $('#searchResult').html();
        var template = Handlebars.compile(source);

        var context = {
          name: inside[j],
          description: data[second][j],
          address: data[third][j]
        };

        var el_html = template(context);

        $('#resultRow').append(el_html).hide().fadeIn(400);
      }
    }

  }

  // opens and expands the search box 
  search.click(function() {
    searchBox.addClass('expand');
    closeBtn.css('display', 'inline');
    $('.ion-ios-search-strong').css('display', 'none');
    searchForm.css('display', 'inline-block');
    $('.ion-ios-close-outline').css('display', 'inline');
    searchForm.val('').focus();
    resetBtn.show();
  });

  // resets the search
  resetBtn.on('keypress click', function() {
    searchForm.val('').focus();

    clearResults();
  });

  // close the search field
  closeBtn.on('keypress click', function() {
    searchForm.hide();
    resetBtn.hide();
    searchBox.toggleClass('expand');
    searchGlass.show();
    closeBtn.hide();
    clearResults()

    event.stopPropagation();

  });

  var clearResults = function() {
    searchResult.fadeOut(500, function() {
      $(this).empty();
    });
  }

  // $(document).on("mouseenter mouseleave", '.pageLink', function() {
  //   $(this).find('.linkOut').toggle();
  // });
  

});
              
            
!
999px

Console