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

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

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <span id=terminal>/* Welcome! This is a pseudo-hacking terminal for fun!
  It was inspired by hackertyper.net so check out the original!
  Feel free to fork and heart!
  Click here and start typing to get hacking! */</span><div id=caret></div>

<style>#profile-hook{display:block;position:fixed;bottom:0;right:0;padding:.5em 1em;margin:1%;opacity:.5;transition:opacity 500ms;font-size:16px;color:inherit;text-decoration:none}#profile-hook span{vertical-align:middle}#profile-hook img{width:35px;border-radius:100%;border:1px solid #fff;vertical-align:middle;margin-left:3px}#profile-hook:hover{opacity:1}</style><a id="profile-hook" href="https://codepen.io/johnchinjew"> <span>Made by </span> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/256705/profile/profile-80_73.jpg"></a>
              body {
  font-family: courier new, monospace;
  color: #0f8;
  margin: 30px;
  background: #111 radial-gradient(#000, #111) no-repeat center center;
  font-size: 13px;
  height: 100vh

a {
  color: inherit;
  text-decoration: underline;

#terminal {
  white-space: pre-wrap;
  line-height: 1.4;

#caret {
  display: inline-block;
  height: 1.35em;
  width: 0.7em;
  vertical-align: middle;
  background-color: #fff;

.transparent {
  opacity: 0;
              // vars
var src, trmnl, caret, pos, speed;
trmnl = $('#terminal');
caret = $('#caret');
pos = 0;
speed = 3;

// main
$('html').on('keydown', function(e) {
  pos += speed;
  if (pos > src.length + speed - src.length % speed) {
    pos = 0;
  trmnl.html(trmnl.html() + src.slice(pos - speed, pos));
    'top': caret.offset().top
  window.scrollTo(0, document.body.scrollHeight);

// caret animation
setInterval(function() {
}, 600);

// filler code
src = "\n\n/**\n\tA class for executing binary searches through an array.\n*/\npublic class BinarySearcher\n{\n\tprivate int[] a;\n\n\t/**\n\t\tConstructs a BinarySearcher.\n\t\t@param anArray a sorted array of integers\n\t*/\n\tpublic BinarySearcher(int[] anArray)\n\t{\n\t\ta = anArray;\n\t}\n\n\t/**\n\t\tFinds a value in a sorted array, using the binary\n\t\tsearch algorithm.\n\t\t@param v the value to search\n\t\t@return the index at which the value occurs, or -1\n\t\tif it does not occur in the array\n\t*/\n\tpublic int search(int v)\n\t{\n\t\tint low = 0;\n\t\tint high = a.length - 1;\n\t\twhile (low <= high)\n\t\t{\n\t\t\tint mid = (low + high) / 2;\n\t\t\tint diff = a[mid] - v;\n\n\t\t\tif (diff == 0) // a[mid] == v\n\t\t\t\treturn mid;\n\t\t\telse if (diff < 0) // a[mid] < v\n\t\t\t\tlow = mid + 1;\n\t\t\telse\n\t\t\t\thigh = mid - 1;\n\t\t}\n\t\treturn -1;\n\t}\n}\n\n";
🕑 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.