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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
      <div class="background_img"></div>
        <div class="container">
            <div class="header__panel">
                <div class="header__text">
                 <h1>Wikipedia</h1>
                </div>
                <div class="searchbox">
                  <input type="text" id="searchfield">
                </div>
                <div class="buttons">
                  <button id="search" title="Search">Wiki Search</button>
                  <a href="https://en.wikipedia.org/wiki/Special:Random"><button id="lucky" title="Random article">I'm Feeling Lucky</button></a>
                </div>
            </div>
          
      </div>
      <ul id="results">
            
      </ul>
</body>
</html>
              
            
!

CSS

              
                body {
  margin: unset;
  /*   background: black; */
  height: 100%;
  text-align: center;
  font-size: 30px;
}

h1 {
  color: white;
  font-weight: 500;
  -webkit-user-select: none;
}

.background_img {
  background-image: url("https://images.unsplash.com/photo-1519987302173-cd3a8de0d903?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=62c788b779a281a3071251a87e3bf933&auto=format&fit=crop&w=1502&q=80");
  background-size: cover;
  display: block;
  filter: blur(2px);
  -webkit-filter: blur(2px);
  height: 100%;
  left: 0;
  position: fixed;
  right: 0;
  z-index: 1;
}

.container {
  /*   padding-top: 40px; */
  background: linear-gradient(to bottom, black, transparent);
  border-radius: 3px;
  left: 0;
  position: relative;
  right: 0;
  z-index: 2;
  padding: 20px;
}

input {
  margin: 20px;
  height: 36px;
  width: 360px;
  font-size: 14pt;
  padding: 0 14px 0 14px;
  background: transparent;
  color: white;
  border: 2px solid white;
  border-radius: 6px;
  outline: 0;
}

input:active {
  transform: translateY(1px);
}

button {
  color: white;
  border: 2px solid white;
  height: 30px;
  margin: 0px;
  background: transparent;
  border-radius: 6px;
  font-weight: 900;
  outline: 0;
  -webkit-user-select: none;
}

button:hover {
  cursor: pointer;
  background-color: #000;
}

button:active {
  box-shadow: 0.5px 0.5px #fff;
  transform: translateY(1px);
}

p {
  font-size: 20px;
}

ul {
  margin: 20px;
  z-index: 2;
  background: transparent;
  list-style-type: none;
  /*   text-align: left; */
  position: relative;
  display: inline-block;
  padding: 0 14px 0 14px;
}

ul li {
  border: 1px solid white;
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  margin: 10px 0 10px 0;
  width: 360px;
  padding: 10px;
  border-left: 8px solid white;
  text-align: left;
  border: 2px solid white;
  border-radius: 6px;
}

ul li:hover {
  background-color: black;
}

li a {
  text-decoration: none;
  color: white;
  font-weight: 900;
}

li a:hover {
  background-color: white;
  color: black;
}

              
            
!

JS

              
                // when document is ready
$(document).ready(function() {
  // when button is clicked..
  $("#search").click(function() {
    // it gets string from search field
    var searchTerm = $("#searchfield").val();

    // and paste it to the api link
    var url =
      "https://en.wikipedia.org/w/api.php?action=opensearch&search=" +
      searchTerm +
      "&format=json&callback=?";

    // form GET query
    // Wikimedia API requires this form
    $.ajax({
      type: "GET",
      url: url,
      async: false,
      dataType: "json",

      // if the call is successful we perform
      // this function and give it data
      success: function(data) {
        // results append in html as ul with 10 li
        $("#results").html("");
        for (i = 0; i < data[1].length; i++) {
          $("#results").append(
            "<li><a href=" +
              data[3][i] +
              " target='_blank' title='Open on Wikipedia'>" +
              data[1][i] +
              "</a><p>" +
              data[2][i] +
              "</p></li>"
          );
        }
      }
    });
  });

  // user can hit enter (keyCode == 13)
  // instead of Search button
  $("#searchfield").keyup(function(event) {
    if (event.keyCode == 13) {
      $("#search").click();
    }
  });
});

              
            
!
999px

Console