Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">

<div id="mainContainer">
  <p>Hover over key to see shortcut and synonymous keys. Simply set the title of a button to have a shortcut displayed and the key enabled.</p>
  <div class="keyboard">
    <div class="functionRow">
      <div class="functionColumn">
        <button id="key_esc" type="button" title="Menu"><span>Esc</span></button>
      </div>
      <div class="functionColumn">
        <button id="key_f1" type="button"><span>F1</span></button>
        <button id="key_f2" type="button"><span>F2</span></button>
        <button id="key_f3" type="button"><span>F3</span></button>
        <button id="key_f4" type="button"><span>F4</span></button>
      </div>
      <div class="functionColumn">
        <button id="key_f5" type="button"><span>F5</span></button>
        <button id="key_f6" type="button"><span>F6</span></button>
        <button id="key_f7" type="button"><span>F7</span></button>
        <button id="key_f8" type="button"><span>F8</span></button>
      </div>
      <div class="functionColumn">
        <button id="key_f9" type="button"><span>F9</span></button>
        <button id="key_f10" type="button"><span>F10</span></button>
        <button id="key_f11" type="button"><span>F11</span></button>
        <button id="key_f12" type="button"><span>F12</span></button>
      </div>
      <div class="functionColumn">
        <button id="key_scroll" type="button"><span class="smallFunctionText">Scroll</span></button>
        <button id="key_pause" type="button"><span class="smallFunctionText">Pause</span></button>
        <button id="key_insert" type="button"><span class="smallFunctionText">Insert</span></button>
        <button id="key_delete" type="button"><span class="smallFunctionText">Delete</span></button>
      </div>
    </div>
    <div class="normalRow">
      <button id="key_tick" type="button"><span class="dualFunction">~`</span></button>
      <button id="key_1" type="button" title="Switch to primary weapon"><span class="dualFunction">!1</span></button>
      <button id="key_2" type="button" title="Switch to secondary weapon"><span class="dualFunction">@2</span></button>
      <button id="key_3" type="button"><span class="dualFunction">#3</span></button>
      <button id="key_4" type="button"><span class="dualFunction">$4</span></button>
      <button id="key_5" type="button"><span class="dualFunction">%5</span></button>
      <button id="key_6" type="button"><span class="dualFunction">^6</span></button>
      <button id="key_7" type="button"><span class="dualFunction">&7</span></button>
      <button id="key_8" type="button"><span class="dualFunction">*8</span></button>
      <button id="key_9" type="button"><span class="dualFunction">(9</span></button>
      <button id="key_0" type="button"><span class="dualFunction">)0</span></button>
      <button id="key_minus" type="button"><span class="dualFunction">_-</span></button>
      <button id="key_plus" type="button"><span class="dualFunction">+=</span></button>
      <button id="key_backspace" type="button"><span class="smallerText">Backspace</span></button>
      <button id="key_home" type="button"><span class="smallerText">Home</span></button>
    </div>
    <div class="normalRow">
      <button id="key_tab" type="button"><span class="smallerText">Tab</span></button>
      <button id="key_q" type="button"><span>Q</span></button>
      <button id="key_w" type="button" title="Move Up"><span>W</span></button>
      <button id="key_e" type="button"><span>E</span></button>
      <button id="key_r" type="button" title="Reload"><span>R</span></button>
      <button id="key_t" type="button"><span>T</span></button>
      <button id="key_y" type="button"><span>Y</span></button>
      <button id="key_u" type="button"><span>U</span></button>
      <button id="key_i" type="button" title="Inventory"><span>I</span></button>
      <button id="key_o" type="button"><span>O</span></button>
      <button id="key_p" type="button"><span>P</span></button>
      <button id="key_openbracket" type="button"><span class="dualFunction">{[</span></button>
      <button id="key_closebracket" type="button"><span class="dualFunction">}]</span></button>
      <button id="key_backslash" type="button"><span class="dualFunction">|\</span></button>
      <button id="key_pageup" type="button"><span class="smallerText">Page Up</span></button>
    </div>
    <div class="normalRow">
      <button id="key_capslock" type="button"><span class="smallerText">Caps Lock</span></button>
      <button id="key_a" type="button" title="Move Left"><span>A</span></button>
      <button id="key_s" type="button" title="Move Down"><span>S</span></button>
      <button id="key_d" type="button" title="Move Right"><span>D</span></button>
      <button id="key_f" type="button" title="Interact"><span>F</span></button>
      <button id="key_g" type="button"><span>G</span></button>
      <button id="key_h" type="button"><span>H</span></button>
      <button id="key_j" type="button"><span>J</span></button>
      <button id="key_k" type="button"><span>K</span></button>
      <button id="key_l" type="button"><span>L</span></button>
      <button id="key_semicolon" type="button"><span class="dualFunction">:;</span></button>
      <button id="key_quote" type="button"><span class="dualFunction">"'</span></button>
      <button id="key_enter" type="button"><span class="smallerText">Enter</span></button>
      <button id="key_pagedown" type="button"><span class="smallerText">Page Down</span></button>
    </div>
    <div class="normalRow">
      <button id="key_leftshift" type="button" title="Run"><span class="smallerText">Shift</span></button>
      <button id="key_z" type="button">Z</span></button>
    <button id="key_x" type="button">X</span></button>
  <button id="key_c" type="button" title="Toggle Crouch">C</span></button>
<button id="key_v" type="button">V</span></button>
<button id="key_b" type="button">B</span></button>
<button id="key_n" type="button">N</span></button>
<button id="key_m" type="button">M</span></button>
<button id="key_comma" type="button"><span class="dualFunction"><,</span></button>
  <button id="key_period" type="button"><span class="dualFunction">>.</span></button>
  <button id="key_forwardslash" type="button"><span class="dualFunction">?/</span></button>
  <button id="key_rightshift" type="button" title="Run"><span class="smallerText">Shift</span></button>
  <button id="key_up" type="button" class="arrowKey" title="Move Up"><span>🠕</span></button>
  <button id="key_end" type="button"><span class="smallerText">End</span></button>
  </div>
<div class="normalRow">
  <button id="key_leftcontrol" type="button"><span class="smallerText">Ctrl</span></button>
  <button id="key_function" type="button"><span class="smallerText">Fn</span></button>
  <button id="key_leftalt" type="button"><span class="smallerText">Alt</span></button>
  <button id="key_space" type="button" title="Jump"><span class="smallerText"></span></button>
  <button id="key_rightalt" type="button"><span class="smallerText">Alt</span></button>
  <button id="key_menu" type="button"><span class="smallerText">Menu</span></button>
  <button id="key_rightcontrol" type="button"><span class="smallerText">Ctrl</span></button>
  <button id="key_left" type="button" class="arrowKey" title="Move Left"><span>🠔</span></button>
  <button id="key_down" type="button" class="arrowKey" title="Move Down"><span>🠗</span></button>
  <button id="key_right" type="button" class="arrowKey" title="Move Right"><span>🠖</span></button>
</div>
</div>
</div>
              
            
!

CSS

              
                html, body {
    height: 100%;
    width: 100%;
    font-family: 'Roboto', sans-serif;
}

#mainContainer {
    min-width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.keyboard {
    width: 575px;
    border: none;
    border-radius: 5px;
    background-color: gainsboro;
    box-shadow: 0 4px 5px 0px rgba(0, 0, 0, 0.4);
    padding: 5px;
}

button {
    padding: 0;
    padding-left: 2px;
    margin: 2px;
    flex: 1;
    min-width: 30px;
    height: 30px;
    white-space: normal;
    padding-bottom: 10px;
    text-align: left;
    border-radius: 5px;
    outline: none;
    user-select: none;
    font-size: 10px;
    border: none;
    box-shadow: 0 1px 0px 1px rgba(0, 0, 0, 0.3);
    color: rgb(60, 60, 60);
    background-color: rgba(255, 255, 255, 0.6);
}

button:not([title]) {
    opacity: 0.4;
}

.hoverButton {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 0px 1px rgba(0, 0, 0, 0.3), 0 0 6px 2px aquamarine;
    color: #5bb597;
}

button[title]:active {
    transform: translateY(1px);
    box-shadow: 0 0 0px 0.5px rgba(0, 0, 0, 0.3);
}

.dualFunction {
    writing-mode: vertical-lr;
    text-orientation: upright;
    padding-top: 3px;
}

.smallFunctionText {
    line-height: 6px;
    display: block;
    font-size: 8px;
    margin: -2px;
    padding-left: 1px;
}

.smallerText {
    font-size: 9px;
}

.arrowKey {
    font-size: 14px;
    padding-bottom: 0;
    padding-top: 10px;
    max-width: 32px;
}

.functionRow button {
    min-width: 27px;
    max-width: 27px;
    max-height: 27px;
    min-height: 27px;
    font-size: 9px;
}

#key_tab {
    flex: 1.5;
}

#key_backslash {
    flex: 1.7;
}

#key_capslock {
    flex: 1.7;
}

#key_leftcontrol,
#key_rightcontrol,
#key_function,
#key_leftalt,
#key_rightalt,
#key_menu {
    flex: 1.3;
}

#key_backspace,
#key_leftshift,
#key_rightshift {
    flex: 2;
}

#key_enter {
    flex: 2.5;
}

#key_space {
    flex: 5.2;
}

.normalRow {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.functionRow {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
}

.functionColumn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin: 5px;
}
              
            
!

JS

              
                $('button').on('click mouseover', (e) => {
  var title = $(e.currentTarget).attr('title');
  $('button').removeClass('hoverButton');
  if (title !== undefined) {
    $(`button[title='${title}']`).addClass('hoverButton');
  }
});
              
            
!
999px

Console